/*
 * Fichier — gabarit de page (templates/element/site/shell.php).
 * ==========================================================================
 * Reprend la barre d'administration Hôtellerie : fond bleu, liseré or,
 * marque SJM, navigation Oswald en capitales soulignée d'or au survol,
 * boutons « nav-light » à droite. Le menu du Fichier comptant davantage
 * d'entrées, il occupe une seconde ligne de la même barre bleue.
 *
 * Point de bascule smartphone / tablette : 992 px (comme navbar-expand-lg).
 */

/* --------------------------------------------------------------------------
   LIEN D'ÉVITEMENT
   -------------------------------------------------------------------------- */

.skip-link {
    position: fixed;
    top: -100px;
    left: 20px;
    z-index: 2000;
    padding: .75rem 1.25rem;
    border-radius: .45rem;
    background: #fff;
    color: var(--hot-blue-deep);
    font-weight: 700;
}

.skip-link:focus {
    top: 10px;
}

/* --------------------------------------------------------------------------
   EN-TÊTE
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    color: #fff;
    background-color: var(--hot-blue);
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, .035), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(0, 0, 0, .04));
    border-bottom: 3px solid var(--hot-gold);
    box-shadow: 0 9px 26px rgba(44, 66, 96, .22);
}

.navbar-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    max-width: 1680px;
    min-height: 76px;
    margin: 0 auto;
    padding: .55rem var(--gutter);
}

/* Marque : logo SJM + intitulé du programme. */
.site-brand {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    min-width: 0;
    margin-right: .6rem;
    color: #fff;
    text-decoration: none;
}

.site-brand:hover,
.site-brand:focus {
    color: #fff;
}

.brand-logo {
    display: block;
    width: auto;
    height: 46px;
    max-width: 170px;
    margin-right: 1rem;
    object-fit: contain;
}

.brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.05;
}

.brand-copy strong {
    color: #fff;
    font-family: var(--font-title);
    font-size: clamp(1.15rem, 1.6vw, 1.42rem);
    font-weight: 400;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-copy small {
    margin-top: .4rem;
    color: rgba(255, 255, 255, .78);
    font-size: .66rem;
    font-weight: 400;
    letter-spacing: .09em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Fichier actif. */
.header-context {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
    padding-left: 1.2rem;
    border-left: 1px solid rgba(255, 255, 255, .28);
}

.context-label {
    color: rgba(255, 255, 255, .74);
    font-size: .64rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: 280px;
    padding: .2rem .75rem;
    border-radius: 999px;
    background: var(--file-accent-soft);
    color: var(--file-accent-ink);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.file-badge::before {
    content: "";
    flex-shrink: 0;
    width: .42rem;
    height: .42rem;
    border-radius: 50%;
    background: var(--file-accent);
}

a.file-badge:hover {
    background: #fff;
    color: var(--file-accent-ink);
}

/* Utilisateur connecté. */
.header-account {
    min-width: 0;
    margin-left: auto;
    padding-right: .4rem;
    text-align: right;
}

.account-name {
    display: block;
    color: #fff;
    font-size: .84rem;
    font-weight: 600;
}

.account-id {
    display: block;
    max-width: 300px;
    color: rgba(255, 255, 255, .74);
    font-size: .72rem;
    overflow-wrap: anywhere;
}

.guest-header-note {
    margin-left: auto;
    color: rgba(255, 255, 255, .78);
    font-family: var(--font-title);
    font-size: .9rem;
    font-weight: 300;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}

.navbar-inner form {
    margin: 0;
}

/* Boutons de la barre (équivalents btn-nav-light / btn-nav-outline). */
.button-header,
.menu-toggle {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    font-family: var(--font-title);
    font-size: .88rem;
    font-weight: 300;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.button-header {
    border: 1px solid #fff;
    background: #fff;
    color: var(--hot-blue-deep);
}

.button-header:hover,
.button-header:focus {
    border-color: var(--hot-gold);
    background: var(--hot-gold);
    color: #fff;
}

.menu-toggle {
    display: none;
    gap: .6rem;
    border: 1px solid rgba(255, 255, 255, .76);
    background: transparent;
    color: #fff;
}

.menu-toggle:hover,
.menu-toggle:focus {
    border-color: #fff;
    background: #fff;
    color: var(--hot-blue-deep);
}

.menu-toggle[hidden] {
    display: none;
}

/* --------------------------------------------------------------------------
   NAVIGATION PRINCIPALE
   -------------------------------------------------------------------------- */

.navigation-row {
    border-top: 1px solid rgba(255, 255, 255, .16);
    background: rgba(0, 0, 0, .045);
}

.site-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 calc(var(--gutter) - .55rem);
}

.site-navigation .nav-link,
.nav-dropdown > summary,
.nav-pending {
    position: relative;
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    padding: .7rem .55rem;
    color: #fff;
    font-family: var(--font-title);
    font-size: .98rem;
    font-weight: 300;
    letter-spacing: .05em;
    line-height: 1.3;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: .95;
}

.site-navigation .nav-link::after,
.nav-dropdown > summary::after {
    content: "";
    position: absolute;
    right: .55rem;
    bottom: .32rem;
    left: .55rem;
    height: 2px;
    background: var(--hot-gold);
    opacity: 0;
    transform: scaleX(.3);
    transform-origin: center;
    transition:
        opacity .18s ease, transform .18s ease;
}

.site-navigation .nav-link:hover,
.site-navigation .nav-link:focus,
.nav-dropdown > summary:hover,
.nav-dropdown > summary:focus {
    color: #fff;
    opacity: 1;
}

.site-navigation .nav-link:hover::after,
.site-navigation .nav-link:focus::after,
.nav-dropdown > summary:hover::after,
.nav-dropdown > summary:focus::after,
.site-navigation .nav-link.is-active::after,
.nav-dropdown.is-active > summary::after,
.nav-dropdown[open] > summary::after {
    opacity: 1;
    transform: scaleX(1);
}

.site-navigation .nav-link.is-active,
.nav-dropdown.is-active > summary {
    font-weight: 400;
    opacity: 1;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown > summary {
    list-style: none;
    cursor: pointer;
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.chevron {
    color: rgba(255, 255, 255, .78);
    font-family: var(--font-text);
    font-size: .8rem;
    line-height: 1;
    transform: translateY(-.3em);
    transition: transform .15s ease;
}

.nav-dropdown[open] .chevron {
    transform: translateY(.1em) rotate(180deg);
}

/* Menu déroulant : rendu des dropdowns Admin Hôtellerie. */
.dropdown-panel {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    z-index: 1040;
    min-width: 16.5rem;
    max-height: calc(100vh - 140px);
    padding: .35rem 0;
    overflow-y: auto;
    border: 1px solid rgba(49, 70, 95, .15);
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 14px 32px rgba(36, 52, 72, .17);
}

.nav-dropdown:last-child .dropdown-panel {
    right: 0;
    left: auto;
}

.dropdown-panel a {
    display: block;
    padding: .48rem .9rem;
    color: var(--hot-ink);
    font-family: var(--font-text);
    font-size: .88rem;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
}

.dropdown-panel a:hover,
.dropdown-panel a:focus,
.dropdown-panel .is-current {
    background: var(--hot-blue-soft);
    color: var(--hot-blue-deep);
}

.dropdown-panel .is-current {
    box-shadow: inset 3px 0 0 var(--hot-gold);
    font-weight: 600;
}

.nav-pending {
    color: rgba(255, 255, 255, .6);
    cursor: default;
}

.nav-pending small {
    padding: .05rem .3rem;
    border-radius: .25rem;
    background: rgba(255, 255, 255, .16);
    font-family: var(--font-text);
    font-size: .6rem;
    letter-spacing: .02em;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   FIL D'ARIANE ET CONTENU
   -------------------------------------------------------------------------- */

.workspace-trail {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 1.1rem var(--gutter) 0;
    color: var(--hot-muted);
    font-size: .74rem;
}

.workspace-trail > span:first-child {
    color: var(--hot-gold-dark);
    font-weight: 700;
    letter-spacing: .11em;
}

.workspace-trail strong {
    color: var(--hot-blue-deep);
    font-weight: 600;
}

.workspace-content {
    display: block;
    width: 100%;
    max-width: 1680px;
    min-height: calc(100vh - 260px);
    margin: 0 auto;
    padding: 1rem var(--gutter) 3rem;
}

/* Surface blanche des écrans de liste et de saisie (équivalent .page-card). */
.content-surface {
    min-width: 0;
    padding: clamp(1.1rem, 2.2vw, 2rem);
    border: 1px solid var(--hot-line);
    border-radius: var(--radius-lg);
    background: var(--hot-paper);
    box-shadow: var(--hot-shadow-soft);
}

/*
 * Les fiches en blocs posent directement leurs cartes sur le fond de page,
 * comme les fiches Hôtellerie : la surface blanche s'efface.
 */
.content-surface:has(> .view-page) {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.content-surface > h1:first-child {
    margin-top: 0;
}

.content-surface article {
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--hot-line);
    border-radius: .6rem;
    background: #fff;
}

.content-surface article p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   PIED DE PAGE
   -------------------------------------------------------------------------- */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .6rem 1rem;
    padding: 1.1rem var(--gutter);
    border-top: 1px solid var(--hot-line);
    background: #fff;
    color: #758194;
    font-size: .8rem;
}

.site-footer > span:first-child {
    color: var(--hot-blue-deep);
    font-family: var(--font-title);
    font-size: .95rem;
    letter-spacing: .035em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   ÉCRANS SANS SESSION (connexion, mot de passe oublié…)
   Référence : .auth-shell Hôtellerie.
   -------------------------------------------------------------------------- */

.guest-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: center;
    width: 100%;
    max-width: 1320px;
    min-height: calc(100vh - 170px);
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 4rem) var(--gutter);
}

.guest-intro .eyebrow {
    color: var(--hot-blue);
    font-family: var(--font-title);
    font-size: .88rem;
    font-weight: 400;
    letter-spacing: .12em;
}

.guest-intro h2 {
    max-width: 560px;
    margin: .6rem 0 1.2rem;
    color: var(--hot-blue-deep);
    font-size: clamp(2.2rem, 4.2vw, 3.6rem);
    font-weight: 300;
    line-height: 1.05;
    text-transform: uppercase;
}

.guest-intro p {
    max-width: 46ch;
    color: var(--hot-muted);
    font-size: 1.05rem;
    line-height: 1.72;
}

.guest-decoration {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 2.2rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(209, 151, 27, .45);
    color: var(--hot-muted);
    font-family: var(--font-title);
    font-size: .78rem;
    letter-spacing: .14em;
}

.content-surface.guest-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    justify-self: end;
    overflow: hidden;
    padding: clamp(1.6rem, 3.4vw, 3.2rem);
    border: 1px solid rgba(var(--hot-blue-rgb), .20);
    border-radius: 1.15rem;
    box-shadow: var(--hot-shadow);
}

.content-surface.guest-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--hot-gold), #edb62e 30%, var(--hot-blue) 72%);
}

.guest-card h1 {
    margin-bottom: .4rem;
    color: var(--hot-blue-deep);
    font-size: clamp(2rem, 3.4vw, 2.8rem);
    font-weight: 300;
    text-transform: uppercase;
}

.guest-card p {
    color: var(--hot-muted);
    font-size: .92rem;
}

.guest-card form {
    margin-top: 1.4rem;
}

.guest-card .input {
    margin-bottom: 1.1rem;
}

.guest-card button {
    width: 100%;
    min-height: 3rem;
    margin-top: .4rem;
    font-size: .95rem;
}

.guest-card a {
    color: var(--hot-blue);
    font-size: .87rem;
    font-weight: 700;
    text-decoration: none;
}

.guest-card a:hover {
    color: var(--hot-gold-dark);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */

/* Barre dépliée compacte (comme l'Admin Hôtellerie entre 992 et 1399 px). */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .navbar-inner {
        min-height: 64px;
        gap: .8rem;
    }

    .brand-logo {
        height: 38px;
        margin-right: .7rem;
    }

    .brand-copy strong {
        font-size: 1.05rem;
    }

    .brand-copy small {
        margin-top: .25rem;
        font-size: .56rem;
        letter-spacing: .05em;
    }

    .site-navigation .nav-link,
    .nav-dropdown > summary,
    .nav-pending {
        padding: .6rem clamp(.2rem, -.35rem + .8vw, .45rem);
        font-size: clamp(.76rem, .38rem + .6vw, .9rem);
        letter-spacing: .02em;
    }

    .site-navigation .nav-link::after,
    .nav-dropdown > summary::after {
        right: .3rem;
        bottom: .28rem;
        left: .3rem;
    }

    .button-header {
        min-height: 28px;
        padding: 0 8px;
        font-size: .72rem;
    }
}

/* Smartphone / tablette : menu replié derrière le bouton « Menu ». */
@media (max-width: 991.98px) {
    .navbar-inner {
        flex-wrap: wrap;
        gap: .6rem .9rem;
        min-height: 64px;
    }

    .brand-logo {
        height: 38px;
    }

    .brand-copy small {
        display: none;
    }

    .header-context {
        order: 4;
        flex-direction: row;
        align-items: center;
        flex-basis: 100%;
        padding: .45rem 0 0;
        border-top: 1px solid rgba(255, 255, 255, .19);
        border-left: 0;
    }

    .header-account {
        display: none;
    }

    .header-actions {
        margin-left: auto;
    }

    .js-ready .menu-toggle {
        display: inline-flex;
    }

    .js-ready .menu-toggle[hidden] {
        display: none;
    }

    .navigation-row {
        border-top: 0;
        background: transparent;
    }

    .js-ready .site-navigation:not(.is-open) {
        display: none;
    }

    .site-navigation {
        flex-direction: column;
        max-height: calc(100dvh - 120px);
        padding: .3rem var(--gutter) .9rem;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-top: 1px solid rgba(255, 255, 255, .19);
    }

    .site-navigation .nav-link,
    .nav-dropdown > summary,
    .nav-pending {
        padding: .7rem .25rem;
    }

    .site-navigation .nav-link::after,
    .nav-dropdown > summary::after {
        right: auto;
        left: .25rem;
        width: 2.2rem;
    }

    .dropdown-panel {
        position: static;
        min-width: 0;
        max-height: none;
        margin: 0 0 .4rem .6rem;
        border: 0;
        border-left: 2px solid var(--hot-gold);
        border-radius: 0;
        background: rgba(255, 255, 255, .08);
        box-shadow: none;
    }

    .dropdown-panel a {
        color: #fff;
    }

    .dropdown-panel a:hover,
    .dropdown-panel a:focus,
    .dropdown-panel .is-current {
        background: rgba(255, 255, 255, .14);
        color: #fff;
    }

    .guest-content {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .content-surface.guest-card {
        max-width: none;
        justify-self: stretch;
    }

    .guest-decoration {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .site-header {
        border-bottom-width: 2px;
    }

    .navbar-inner {
        gap: .5rem .6rem;
    }

    .brand-logo {
        height: 28px;
        margin-right: .5rem;
    }

    .site-brand {
        margin-right: 0;
    }

    .brand-copy strong {
        font-size: .98rem;
    }

    .header-actions {
        gap: 6px;
    }

    .button-header {
        padding: 0 8px;
        font-size: .74rem;
    }

    /* Bouton menu réduit à son icône : l'en-tête tient sur une ligne. */
    .menu-toggle {
        gap: 0;
        padding: 0 10px;
        font-size: 0;
    }

    .menu-toggle span {
        font-size: 1.1rem;
    }

    .guest-header-note,
    .guest-intro {
        display: none;
    }

    .content-surface {
        padding: 1.1rem .9rem;
        border-radius: .65rem;
    }

    .workspace-trail {
        padding-top: .8rem;
    }

    .site-footer {
        font-size: .74rem;
    }
}

@media print {
    .site-header,
    .site-footer,
    .workspace-trail,
    .skip-link,
    .menu-toggle,
    .guest-intro {
        display: none !important;
    }

    .workspace-content,
    .guest-content {
        display: block;
        min-height: 0;
        padding: 0;
    }

    .content-surface {
        padding: 0;
        border: 0;
        box-shadow: none;
    }
}
