/* ==========================================================
   SC PLATFORM — COMPOSANTS
   Tous les composants consomment les tokens du thème actif.
   ========================================================== */


/* ==========================================================
   SEGMENTED CONTROL
   ========================================================== */

.sc-day-switch {
    display: flex;
    justify-content: center;

    margin-bottom: 14px;
}

.sc-segmented {
    display: inline-flex;
    align-items: center;

    gap: 2px;

    padding: 4px;

    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-pill);

    background: var(--app-surface);

    box-shadow: var(--app-shadow-soft);
}

.sc-segmented__button {
    min-height: 38px;

    padding: 9px 17px;

    border-radius: var(--app-radius-pill);

    background: transparent;
    color: var(--app-primary);

    font-size: 13px;
    font-weight: var(--app-font-semibold);

    cursor: pointer;
}

.sc-segmented__button.is-active {
    background: var(--app-active);
    color: var(--app-active-text);
}

.sc-segmented__button:focus-visible {
    outline: 3px solid var(--app-focus-ring);
    outline-offset: 2px;
}


/* ==========================================================
   HERO
   ========================================================== */

.sc-hero {
    position: relative;

    isolation: isolate;
    overflow: hidden;

    min-height: 310px;

    border-radius: var(--app-radius-lg);

    /*
     * La photo sera injectée ultérieurement.
     * En son absence, le thème crée un fallback propre.
     */
    background:
        linear-gradient(
            180deg,
            color-mix(
                in srgb,
                var(--app-primary) 16%,
                var(--app-surface)
            ),
            var(--app-primary)
        );

    box-shadow: var(--app-shadow-card);
}

.sc-hero__overlay {
    position: absolute;

    inset: 0;
    z-index: 1;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.01) 20%,
            rgba(0, 0, 0, 0.05) 52%,
            rgba(0, 0, 0, 0.30) 100%
        );
}

.sc-hero__content {
    position: absolute;

    z-index: 2;

    left: 22px;
    right: 22px;
    bottom: 22px;

    color: #FFFFFF;
}

.sc-hero__eyebrow {
    margin-bottom: 8px;

    font-size: 11px;

    font-weight: var(--app-font-bold);

    letter-spacing: 0.15em;
}

.sc-hero__title {
    max-width: 590px;

    margin-bottom: 10px;

    font-size: clamp(28px, 7vw, 46px);
    line-height: 1.02;

    font-weight: var(--app-font-extrabold);
}

.sc-hero__location {
    margin-bottom: 0;

    font-size: 13px;
    line-height: 1.4;

    font-weight: var(--app-font-medium);
}


/* ==========================================================
   WEATHER
   ========================================================== */

.sc-weather-card {
    display: flex;
    align-items: center;

    gap: 16px;

    margin-top: 12px;

    padding: 18px;

    border-radius: var(--app-radius-lg);

    background: var(--app-surface);

    box-shadow: var(--app-shadow-card);
}

.sc-weather-card__icon {
    flex: 0 0 48px;

    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    background:
        color-mix(
            in srgb,
            var(--app-accent) 18%,
            var(--app-surface)
        );

    color: var(--app-primary);

    font-size: 31px;
}

.sc-weather-card__content {
    min-width: 0;
}

.sc-weather-card__date {
    margin-bottom: 4px;

    color: var(--app-text);

    font-size: 15px;

    font-weight: var(--app-font-semibold);
}

.sc-weather-card__summary {
    margin-bottom: 3px;

    color: var(--app-primary);

    font-size: 14px;

    font-weight: var(--app-font-semibold);
}

.sc-weather-card__tip {
    margin-bottom: 0;

    color: var(--app-text-soft);

    font-size: 12px;
    line-height: 1.4;
}


/* ==========================================================
   FEATURE CARD
   ========================================================== */

.sc-feature-card {
    position: relative;

    isolation: isolate;
    overflow: hidden;

    min-height: 175px;

    border-radius: var(--app-radius-lg);

    background:
        linear-gradient(
            110deg,
            var(--app-primary) 0%,
            color-mix(
                in srgb,
                var(--app-primary) 76%,
                var(--app-surface)
            ) 100%
        );

    box-shadow: var(--app-shadow-card);
}

.sc-feature-card__content {
    position: relative;

    z-index: 2;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    min-height: 175px;
    max-width: 78%;

    padding: 22px;

    color: #FFFFFF;
}

.sc-feature-card__label {
    margin-bottom: 6px;

    font-size: 10px;

    font-weight: var(--app-font-bold);

    letter-spacing: 0.14em;
}

.sc-feature-card__title {
    margin-bottom: 8px;

    font-size: clamp(21px, 5vw, 30px);
    line-height: 1.04;

    font-weight: var(--app-font-bold);
}

.sc-feature-card__meta {
    margin-bottom: 0;

    font-size: 12px;
    line-height: 1.4;

    opacity: 0.88;
}


/* ==========================================================
   EXPLORER
   ========================================================== */

.sc-explore-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.sc-explore-card {
    position: relative;

    isolation: isolate;
    overflow: hidden;

    display: flex;
    align-items: flex-end;

    aspect-ratio: 1 / 1;

    border-radius: var(--app-radius-md);

    background:
        linear-gradient(
            180deg,
            color-mix(
                in srgb,
                var(--app-primary) 22%,
                var(--app-surface)
            ),
            var(--app-primary)
        );

    color: #FFFFFF;

    transition: transform 0.16s ease;
}

.sc-explore-card::before {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 1;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.01) 25%,
            rgba(0, 0, 0, 0.05) 50%,
            rgba(0, 0, 0, 0.30) 100%
        );
}

.sc-explore-card:active {
    transform: scale(0.98);
}

.sc-explore-card__content {
    position: relative;

    z-index: 2;

    width: 100%;

    padding: 16px;
}

.sc-explore-card__label {
    margin-bottom: 4px;

    font-size: 10px;

    font-weight: var(--app-font-bold);

    letter-spacing: 0.12em;
}

.sc-explore-card__title {
    margin-bottom: 0;

    font-size: clamp(18px, 5vw, 26px);
    line-height: 1.05;

    font-weight: var(--app-font-bold);
}


/* ==========================================================
   MA SÉLECTION
   ========================================================== */

.sc-selection-card {
    display: grid;

    gap: 18px;

    padding: 22px;

    border-radius: var(--app-radius-lg);

    background: var(--app-surface);
    color: var(--app-text);

    box-shadow: var(--app-shadow-card);
}

.sc-selection-card .sc-section__eyebrow {
    color: var(--app-primary);
}

.sc-selection-card__title {
    margin-bottom: 8px;

    color: var(--app-text);

    font-size: clamp(23px, 5vw, 30px);
    line-height: 1.06;

    font-weight: var(--app-font-bold);
}

.sc-selection-card__text {
    margin-bottom: 0;

    color: var(--app-text-soft);

    font-size: 13px;
    line-height: 1.5;
}


/* ==========================================================
   PRIMARY ACTION
   ========================================================== */

.sc-primary-button {
    min-height: 46px;

    padding: 12px 18px;

    border-radius: var(--app-radius-pill);


    background: var(--app-action);
    color: var(--app-action-text);

    font-weight: var(--app-font-bold);

    cursor: pointer;
}

.sc-primary-button:focus-visible {
    outline: 3px solid var(--app-focus-ring);
    outline-offset: 3px;
}


/* ==========================================================
   BOTTOM NAV
   ========================================================== */

.sc-bottom-nav {
    position: fixed;

    z-index: 1000;

    left: 14px;
    right: 14px;

    bottom:
        calc(
            14px +
            env(safe-area-inset-bottom)
        );

    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    align-items: center;

    max-width: 470px;

    margin: 0 auto;

    padding: 6px;

    border: 1px solid var(--app-border);
    border-radius: 30px;

    background:
        rgba(255, 255, 255, 0.94);

    box-shadow:
        0 10px 30px
        rgba(46, 58, 63, 0.14);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.sc-bottom-nav__item {
    display: flex;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 3px;

    min-width: 0;
    min-height: 48px;

    padding: 5px 3px;

    border-radius: 22px;

    background: transparent;
    color: var(--app-text-soft);

    cursor: pointer;
}

.sc-bottom-nav__item.is-active {
    color: var(--app-primary);
}

.sc-bottom-nav__icon {
    font-size: 21px;
    line-height: 1;
}

.sc-bottom-nav__label {
    font-size: 9px;
    line-height: 1.2;

    font-weight: var(--app-font-semibold);
}


/* ==========================================================
   TABLETTE
   ========================================================== */

@media (min-width: 768px) {

    .sc-hero {
        min-height: 390px;
    }

    .sc-hero__content {
        left: 30px;
        right: 30px;
        bottom: 30px;
    }

    .sc-weather-card {
        padding: 22px;
    }

    .sc-explore-grid {
        gap: 16px;
    }

    .sc-explore-card {
        aspect-ratio: 1.2 / 1;
    }

    .sc-selection-card {
        grid-template-columns:
            1fr auto;

        align-items: center;

        padding: 28px;
    }
}


/* ==========================================================
   DESKTOP
   ========================================================== */

@media (min-width: 1200px) {

    .sc-home:not([hidden]) {
    	display: grid;

        grid-template-columns:
            minmax(0, 1.35fr)
            minmax(340px, 0.65fr);

        gap: 30px 34px;

        align-items: start;
    }

    .sc-day-switch {
        grid-column: 1 / -1;

        justify-content: flex-start;

        margin-bottom: -8px;
    }

    .sc-hero {
        grid-column: 1;

        grid-row: 2 / span 2;

        min-height: 510px;
    }

    .sc-weather-card {
        grid-column: 2;

        margin-top: 0;
    }

    .sc-home > .sc-section {
        margin-top: 0;
    }

    .sc-explore-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .sc-explore-card {
        aspect-ratio: 1.18 / 1;
    }
}

/* ==========================================================
   SC PLATFORM — BOTTOM SHEET GÉNÉRIQUE / MENU
   ========================================================== */

.sc-sheet-backdrop {
    position: fixed;
    inset: 0;

    z-index: 2000;

    background: rgba(24, 28, 22, 0.34);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    opacity: 0;

    transition:
        opacity 0.24s ease;

    cursor: pointer;
}

.sc-sheet-backdrop.is-open {
    opacity: 1;
}

.sc-sheet-backdrop[hidden] {
    display: none;
}


/* ==========================================================
   MENU SHEET
   ========================================================== */

.sc-menu-sheet {
    position: fixed;

    z-index: 2010;

    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;

    max-height: min(
        78vh,
        680px
    );

    padding:
        12px
        18px
        calc(
            24px +
            env(safe-area-inset-bottom)
        );

    overflow-y: auto;
    overscroll-behavior: contain;

    background: var(--app-surface);

    border-radius:
        28px
        28px
        0
        0;

    box-shadow:
        0 -12px 38px
        rgba(46, 58, 63, 0.16);

    transform: translateY(105%);

    transition:
        transform
        0.34s
        cubic-bezier(.22, 1, .36, 1);

    -webkit-overflow-scrolling: touch;
}

.sc-menu-sheet.is-open {
    transform: translateY(0);
}

.sc-menu-sheet[hidden] {
    display: none;
}


/* ==========================================================
   POIGNÉE
   ========================================================== */

.sc-menu-sheet__handle {
    width: 42px;
    height: 5px;

    margin:
        0
        auto
        18px;

    border-radius: 999px;

    background:
        color-mix(
            in srgb,
            var(--app-text) 18%,
            var(--app-surface)
        );
}


/* ==========================================================
   HEADER
   ========================================================== */

.sc-menu-sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 20px;
}

.sc-menu-sheet__eyebrow {
    margin:
        0
        0
        6px;

    color: var(--app-primary);

    font-size: 10px;
    line-height: 1.2;

    font-weight: var(--app-font-bold);

    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sc-menu-sheet__title {
    margin: 0;

    color: var(--app-text);

    font-size: clamp(
        22px,
        6vw,
        30px
    );

    line-height: 1.05;

    font-weight: var(--app-font-bold);
}


/* ==========================================================
   BOUTON FERMER
   ========================================================== */

.sc-menu-sheet__close {
    display: grid;
    place-items: center;

    flex: 0 0 auto;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 1px solid var(--app-border);
    border-radius: 50%;

    background: var(--app-surface);

    color: var(--app-text);

    font: inherit;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;
}

.sc-menu-sheet__close span {
    display: block;

    transform: translateY(-1px);
}

.sc-menu-sheet__close:active {
    transform: scale(.94);
}

.sc-menu-sheet__close:focus-visible {
    outline: 3px solid var(--app-focus-ring);
    outline-offset: 2px;
}


/* ==========================================================
   LISTE DU MENU
   ========================================================== */

.sc-menu-sheet__list {
    display: grid;

    gap: 8px;
}


/* ==========================================================
   LIGNE
   ========================================================== */

.sc-menu-sheet__item {
    display: grid;

    grid-template-columns:
        42px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 13px;

    min-height: 68px;

    padding:
        11px
        13px;

    border:
        1px solid
        var(--app-border);

    border-radius:
        var(--app-radius-md);

    background:
        var(--app-background);

    color:
        var(--app-text);

    text-decoration: none;

    transition:
        transform .16s ease,
        background-color .16s ease,
        border-color .16s ease;
}

.sc-menu-sheet__item:active {
    transform: scale(.985);
}

@media (hover: hover) {

    .sc-menu-sheet__item:hover {
        background:
            color-mix(
                in srgb,
                var(--app-primary) 7%,
                var(--app-surface)
            );

        border-color:
            color-mix(
                in srgb,
                var(--app-primary) 24%,
                var(--app-border)
            );
    }
}

.sc-menu-sheet__item:focus-visible {
    outline:
        3px solid
        var(--app-focus-ring);

    outline-offset: 2px;
}


/* ==========================================================
   ICÔNE
   ========================================================== */

.sc-menu-sheet__item-icon {
    display: grid;

    place-items: center;

    width: 42px;
    height: 42px;

    border-radius: 50%;

    background:
        color-mix(
            in srgb,
            var(--app-accent) 16%,
            var(--app-surface)
        );

    color:
        var(--app-primary);

    font-size: 20px;
    line-height: 1;
}


/* ==========================================================
   TEXTE
   ========================================================== */

.sc-menu-sheet__item-content {
    display: flex;

    flex-direction: column;

    min-width: 0;
}

.sc-menu-sheet__item-title {
    color:
        var(--app-text);

    font-size: 14px;
    line-height: 1.25;

    font-weight:
        var(--app-font-semibold);
}

.sc-menu-sheet__item-description {
    margin-top: 3px;

    color:
        var(--app-text-soft);

    font-size: 11px;
    line-height: 1.35;
}


/* ==========================================================
   FLÈCHE
   ========================================================== */

.sc-menu-sheet__item-arrow {
    color:
        var(--app-primary);

    font-size: 24px;
    line-height: 1;

    opacity: .65;
}


/* ==========================================================
   PAGE BLOQUÉE QUAND UNE SHEET EST OUVERTE
   ========================================================== */

body.sc-sheet-open {
    overflow: hidden;
}

/* ==========================================================
   APP SHEET — BASE
   ========================================================== */

.sc-app-sheet {
    position: fixed;

    z-index: 2020;

    left: 0;
    right: 0;
    bottom: 0;

    display: flex;
    flex-direction: column;

    width: 100%;
    height: 92vh;
    max-height: 92vh;

    overflow: hidden;

    border-radius:
        30px
        30px
        0
        0;

    background:
        var(--app-surface);

    box-shadow:
        0 -12px 42px
        rgba(46, 58, 63, .18);

    transform:
        translateY(105%);

    transition:
        transform
        .42s
        cubic-bezier(.22,1,.36,1);
}


.sc-app-sheet.is-open {
    transform:
        translateY(0);
}


.sc-app-sheet[hidden] {
    display: none;
}


/* ==========================================================
   HERO
   ========================================================== */

.sc-app-sheet__hero {
    position: relative;

    flex: 0 0 auto;

    height: 240px;

    overflow: hidden;

    background:
        color-mix(
            in srgb,
            var(--app-primary) 18%,
            var(--app-surface)
        );

    touch-action: pan-x;
}


.sc-app-sheet__image {
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;
}


.sc-app-sheet__image[hidden] {
    display: none;
}


.sc-app-sheet__image-fallback {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            145deg,
            color-mix(
                in srgb,
                var(--app-primary) 14%,
                var(--app-surface)
            ),
            color-mix(
                in srgb,
                var(--app-primary) 34%,
                var(--app-surface)
            )
        );
}


.sc-app-sheet__image-fallback[hidden] {
    display: none;
}


/* ==========================================================
   POIGNÉE
   ========================================================== */

.sc-app-sheet__handle {
    position: absolute;

    z-index: 4;

    top: 12px;
    left: 50%;

    width: 50px;
    height: 5px;

    transform:
        translateX(-50%);

    border-radius:
        var(--app-radius-pill);

    background:
        rgba(255,255,255,.88);

    box-shadow:
        0 1px 5px
        rgba(0,0,0,.10);

    cursor: grab;
}


/* ==========================================================
   FAVORI — COMPOSANT CANONIQUE
   ========================================================== */

.sc-favorite {
    appearance: none;
    -webkit-appearance: none;

    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background:
        var(
            --app-favorite-surface,
            rgba(255,255,255,.94)
        );

    color:
        var(
            --app-favorite,
            var(--app-primary)
        );

    box-shadow:
        0 4px 14px
        rgba(0,0,0,.10);

    cursor: pointer;

    backdrop-filter:
        blur(8px);

    -webkit-backdrop-filter:
        blur(8px);

    transition:
        transform .16s ease,
        background-color .16s ease;
}


/* ==========================================================
   ICÔNE
   ========================================================== */

.sc-favorite svg {
    display: block;

    width: 21px;
    height: 21px;

    fill: transparent;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition:
        fill .18s ease,
        stroke .18s ease,
        transform .18s ease;
}


/* ==========================================================
   ÉTAT ACTIF
   ========================================================== */

.sc-favorite.is-active svg,
.sc-favorite[aria-pressed="true"] svg {
    fill: currentColor;
    stroke: currentColor;
}


/* ==========================================================
   FAVORI — CARTE LISTE
   ========================================================== */

.sc-tourism-card__media {
    position: relative;
}

.sc-favorite--card {
    position: absolute;

    z-index: 10;

    top: 12px;
    right: 12px;

    width: 34px;
    height: 34px;
}


/* ==========================================================
   FAVORI — APP SHEET / FICHE OUVERTE
   ========================================================== */

.sc-favorite--media {
    position: absolute;

    z-index: 10;

    top: 16px;
    right: 16px;

    /*
     * Pas de width / height ici :
     * la fiche conserve la taille canonique
     * de 38 × 38 px.
     */
}


/* ==========================================================
   INTERACTIONS
   ========================================================== */

.sc-favorite:active {
    transform:
        scale(.92);
}

.sc-favorite:focus-visible {
    outline:
        3px solid
        var(--app-focus-ring);

    outline-offset: 2px;
}
/* ==========================================================
   CORPS SCROLLABLE
   ========================================================== */

.sc-app-sheet__scroll {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


.sc-app-sheet__content {
    padding:
        34px
        24px
        calc(
            34px +
            env(safe-area-inset-bottom)
        );
}


/* ==========================================================
   TYPOGRAPHIE
   ========================================================== */

.sc-app-sheet__eyebrow {
    margin:
        0
        0
        9px;

    color:
        var(--app-primary);

    font-size: 10px;
    line-height: 1.2;

    font-weight:
        var(--app-font-bold);

    letter-spacing: .14em;
    text-transform: uppercase;
}


.sc-app-sheet__title {
    margin:
        0
        0
        16px;

    color:
        var(--app-text);

    font-size:
        clamp(
            30px,
            8vw,
            44px
        );

    line-height: 1;

    font-weight:
        var(--app-font-bold);
}


.sc-app-sheet__meta {
    margin:
        0
        0
        16px;

    color:
        var(--app-primary);

    font-size: 12px;

    font-weight:
        var(--app-font-semibold);
}


.sc-app-sheet__description {
    margin: 0;

    color:
        var(--app-text-soft);

    font-size: 14px;
    line-height: 1.7;
}

/* ==========================================================
   TABLETTE
   ========================================================== */

@media (min-width: 768px) {

    .sc-menu-sheet {
        left: 50%;
        right: auto;

        width:
            min(
                560px,
                calc(100vw - 48px)
            );

        bottom: 24px;

        padding:
            16px
            22px
            24px;

        border-radius:
            28px;

        transform:
            translate(
                -50%,
                calc(100% + 48px)
            );
    }

    .sc-menu-sheet.is-open {
        transform:
            translate(
                -50%,
                0
            );
    }

    .sc-menu-sheet__handle {
        display: none;
    }
}

@media (min-width: 768px) {

    .sc-app-sheet {
        left: 50%;
        right: auto;

        width:
            min(
                680px,
                calc(100vw - 48px)
            );

        bottom: 24px;

        border-radius:
            30px;

        transform:
            translate(
                -50%,
                calc(100% + 48px)
            );
    }


    .sc-app-sheet.is-open {
        transform:
            translate(
                -50%,
                0
            );
    }
}

/* ==========================================================
   DESKTOP
   ========================================================== */

@media (min-width: 1200px) {

    .sc-menu-sheet {
        width: 600px;

        max-height: min(
            76vh,
            720px
        );
    }

    .sc-menu-sheet__list {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 10px;
    }

    .sc-menu-sheet__item {
        min-height: 82px;
    }
}
