/* ========================================
   HEADER - TOUTES LES PAGES
   ======================================== */

.topbar {
    position: relative;
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid var(--theme-border);
    background-color: var(--bs-primary);
    overflow: hidden;
}

/* ========================================
   HEADER HERO AVEC IMAGE DE FOND
   ======================================== */

.topbar.hero-header {
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 0;
    position: relative;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

/* Overlay sombre sur l'image */
.topbar.hero-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

/* Les blocs du header passent au-dessus de l'overlay */
.header-top-bar,
.container-fluid,
.header-bottom-zone {
    position: relative;
    z-index: 2;
}

/* ========================================
   ZONE HAUTE - HAMBURGER
   ======================================== */

.header-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    width: 100%;
    padding: 0 1.5rem;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1001;
    position: relative;
}

.menu-toggle span {
    display: block;
    width: 38px;
    height: 4px;
    background: #fff;
    border-radius: 2px;
}

/* ========================================
   ZONE BASSE - BLOC LOGO / TEXTE
   ======================================== */

.container-fluid {
    display: flex;
    align-items: flex-end;
    width: 100%;
    padding: 0 1.5rem;
}

.header-mini-block {
    display: flex;
    align-items: center;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.25rem;
}

.header-mini-image {
    width: 90px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.header-mini-image img {
    max-height: 70px;
    width: auto;
    display: block;
}

.header-mini-text {
    width: auto;
    line-height: 1.2;
}

.header-mini-text .site-name {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-primary);
    text-decoration: none;
}

.header-mini-text .site-description {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: var(--bs-primary);
}

/* Si jamais il reste des spans génériques */
.header-mini-text span {
    display: block;
}

/* ========================================
   TITRE DE SITE CLASSIQUE
   ======================================== */

.site-title {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: var(--theme-text) !important;
}

.site-title:hover {
    color: var(--theme-hover) !important;
    text-decoration: none;
}

/* ========================================
   MENU OFFCANVAS
   ======================================== */

.offcanvas-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: right 0.3s ease;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.offcanvas-menu.active {
    right: 0;
}

.menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    margin-bottom: 1rem;
    color: var(--bs-primary);
}

/* Overlay caché par défaut */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   NAVIGATION OFFCANVAS
   ======================================== */

.offcanvas-navigation {
    margin-top: 1rem;
}

.offcanvas-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.offcanvas-menu-list .menu-item {
    list-style: none;
}

.offcanvas-menu-list a {
    display: block;
    text-decoration: none;
}

.offcanvas-menu-list .sub-menu {
    list-style: none;
    margin: 0.5rem 0 0.5rem 1rem;
    padding: 0;
}

.offcanvas-menu-list .sub-menu a {
    font-size: 0.95rem;
}

/* ========================================
   RESPONSIVE - TABLETTE
   ======================================== */

@media (max-width: 992px) {
    .topbar.hero-header {
        min-height: 32vh;
    }

    .header-mini-block {
        max-width: 360px;
    }

    .header-mini-text .site-name {
        font-size: 1.5rem;
    }

    .header-mini-text .site-description {
        font-size: 0.95rem;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 768px) {
    .topbar.hero-header {
        min-height: 220px;
        padding: 1rem 0;
    }

    .header-top-bar {
        padding: 0 1rem;
    }

    .container-fluid {
        padding: 0 1rem;
    }

    .header-mini-block {
        max-width: 100%;
        padding: 0.75rem 1rem;
    }

    .header-mini-image {
        width: 60px;
        margin-right: 0.5rem;
    }

    .header-mini-image img {
        max-height: 50px;
    }

    .header-mini-text .site-name {
        font-size: 1.2rem;
    }

    .header-mini-text .site-description {
        font-size: 0.85rem;
    }

    .menu-toggle span {
        width: 32px;
        height: 3px;
    }

    .offcanvas-menu {
        width: 280px;
        right: -280px;
    }

    .offcanvas-menu.active {
        right: 0;
    }
}