/* ==========================================================================
   Header — Les Toits de Bryan
   Sticky, fond crème transparent, ombre légère au scroll
   Mobile-first
   ========================================================================== */

/* Skip link accessibilité — visible uniquement au focus clavier */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: var(--color-copper);
    color: #fff;
    z-index: 9999;
    border-radius: 4px;
}

/* ==========================================================================
   Conteneur principal du header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 60px; /* mobile par défaut */
    background-color: rgba(251, 247, 239, 0.95); /* --color-cream + transparence */
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid transparent;
    z-index: 100;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, height 0.3s ease;
}

/* Au scroll (classe ajoutée par header.js) */
.site-header.is-scrolled {
    box-shadow: 0 2px 12px rgba(43, 37, 34, 0.08);
    border-bottom-color: var(--color-border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1rem;
}

/* ==========================================================================
   Logo
   ========================================================================== */
.site-logo {
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-decoration: none;
    color: var(--color-charcoal);
}

.site-logo--text .site-logo__line1 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-charcoal);
}

.site-logo--text .site-logo__line2 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--color-copper);
    margin-top: 2px;
}

.site-logo__img {
    display: block;
    max-height: 64px;
    width: auto;
    height: auto;
}

@media (min-width: 1024px) {
    .site-logo__img {
        max-height: 72px;
    }
}

/* ==========================================================================
   Navigation principale — masquée sur mobile
   ========================================================================== */
.site-nav {
    display: none;
}

.site-nav__list {
    display: flex;
    list-style: none;
    gap: 1.75rem;
    margin: 0;
    padding: 0;
}

.site-nav__list a {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-charcoal);
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.site-nav__list a:hover,
.site-nav__list a:focus,
.site-nav__list .current-menu-item > a {
    color: var(--color-copper);
}

/* Soulignement cuivre animé au hover */
.site-nav__list a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-copper);
    transition: width 0.3s ease;
}

.site-nav__list a:hover::after,
.site-nav__list a:focus::after,
.site-nav__list .current-menu-item > a::after {
    width: 100%;
}

/* ==========================================================================
   Zone CTA droite (téléphone + Devis gratuit)
   Masquée sur mobile (remplacée par le burger)
   ========================================================================== */
.site-header__cta {
    display: none;
    align-items: center;
    gap: 1rem;
}

.site-header__phone {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-charcoal);
    text-decoration: none;
}

.site-header__phone:hover,
.site-header__phone:focus {
    color: var(--color-copper);
}

.site-header__devis {
    /* hérite de .btn .btn-primary, on ajuste juste la taille pour le header */
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

/* ==========================================================================
   Bouton burger (mobile)
   ========================================================================== */
.site-header__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
}

.site-header__burger-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-charcoal);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animation : burger → croix quand le drawer est ouvert */
.site-header__burger[aria-expanded="true"] .site-header__burger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.site-header__burger[aria-expanded="true"] .site-header__burger-bar:nth-child(2) {
    opacity: 0;
}
.site-header__burger[aria-expanded="true"] .site-header__burger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Drawer mobile (panneau de navigation glissant depuis la droite)
   ========================================================================== */
.mobile-drawer {
    position: fixed;
    top: 60px; /* hauteur du header mobile */
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 360px;
    background-color: var(--color-cream);
    box-shadow: -8px 0 32px rgba(43, 37, 34, 0.12);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
    overflow-y: auto;
}

.mobile-drawer.is-open {
    transform: translateX(0);
}

.mobile-drawer__inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mobile-drawer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-drawer__list a {
    display: block;
    padding: 0.85rem 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-charcoal);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: color 0.3s ease;
}

.mobile-drawer__list a:hover,
.mobile-drawer__list a:focus {
    color: var(--color-copper);
}

.mobile-drawer__cta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ==========================================================================
   Tablette / desktop
   ========================================================================== */
@media (min-width: 1024px) {
    .site-header {
        height: 80px;
    }

    .site-nav {
        display: block;
        flex: 1;
        margin-left: 3rem;
    }

    .site-header__cta {
        display: flex;
    }

    .site-header__burger,
    .mobile-drawer {
        display: none;
    }
}
