/* =====================================================
   HEADER CNS V2
   Conserve les couleurs institutionnelles existantes
   Vert : #005b38 | Bordeaux : #8b1022
   ===================================================== */

:root {
    --cns-green: #005b38;
    --cns-green-dark: #00472c;
    --cns-green-soft: #eef7f3;
    --cns-burgundy: #8b1022;
    --cns-white: #ffffff;
    --cns-border: #d7e4dd;
    --cns-text: #17231d;
}

.site-header-v2 {
    position: relative;
    z-index: 1002;
    width: 100%;
    padding: 18px 7%;
    background: var(--cns-white);
    border-top: 3px solid var(--cns-burgundy);
    transition: padding 0.25s ease, box-shadow 0.25s ease;
}

.site-header-v2__inner {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.site-header-v2 .brand-link {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.site-header-v2 .brand-link img {
    width: 75px;
    height: 75px;
    object-fit: contain;
    flex: 0 0 auto;
}

.site-header-v2 .brand-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.site-header-v2 .brand-copy h1 {
    margin: 0 0 5px;
    color: var(--cns-burgundy);
    font-size: 42px;
    line-height: 1;
    font-weight: 800;
}

.site-header-v2 .brand-copy p {
    margin: 0;
    color: var(--cns-green);
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.visa-statistique-btn {
    min-height: 56px;
    padding: 13px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--cns-green);
    background: var(--cns-green-soft);
    border: 2px solid #cfe1d8;
    border-radius: 16px;
    text-decoration: none;
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.visa-statistique-btn svg,
.main-nav-v2__visa-mobile svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.visa-statistique-btn:hover {
    color: var(--cns-white);
    background: var(--cns-green);
    border-color: var(--cns-green);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 91, 56, 0.18);
}

.main-nav-v2 {
    position: relative;
    z-index: 1001;
    width: 100%;
    padding: 0 7%;
    background: var(--cns-green);
    box-shadow: 0 5px 14px rgba(0, 52, 32, 0.12);
}

.main-nav-v2__inner {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
}

.main-nav-v2 a {
    position: relative;
    min-height: 54px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cns-white);
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    transition: background 0.22s ease, color 0.22s ease;
}

.main-nav-v2 a::after {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 7px;
    height: 2px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.9);
    transform: scaleX(0);
    transition: transform 0.22s ease;
}

.main-nav-v2 a:hover,
.main-nav-v2 a.active {
    color: var(--cns-white);
    background: var(--cns-burgundy);
}

.main-nav-v2 a:hover::after,
.main-nav-v2 a.active::after {
    transform: scaleX(1);
}

.main-nav-v2__visa-mobile,
.mobile-menu-toggle {
    display: none;
}

.site-header-v2.is-compact {
    padding-top: 10px;
    padding-bottom: 10px;
    box-shadow: 0 8px 22px rgba(0, 45, 28, 0.10);
}

.site-header-v2.is-compact .brand-link img {
    width: 58px;
    height: 58px;
}

.site-header-v2.is-compact .brand-copy h1 {
    font-size: 34px;
}

/* Tablettes et smartphones */
@media (max-width: 900px) {
    .site-header-v2 {
        padding: 14px 5%;
    }

    .site-header-v2__inner {
        gap: 14px;
    }

    .site-header-v2 .brand-link img {
        width: 60px;
        height: 60px;
    }

    .site-header-v2 .brand-copy h1 {
        font-size: 32px;
    }

    .site-header-v2 .brand-copy p {
        max-width: 210px;
        font-size: 13px;
    }

    .visa-statistique-btn {
        display: none;
    }

    .mobile-menu-toggle {
        width: 54px;
        height: 54px;
        flex: 0 0 auto;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 0;
        color: var(--cns-green);
        background: var(--cns-white);
        border: 2px solid #dce5e0;
        border-radius: 16px;
        cursor: pointer;
        transition: background 0.22s ease, border-color 0.22s ease;
    }

    .mobile-menu-toggle span {
        width: 25px;
        height: 3px;
        border-radius: 99px;
        background: currentColor;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .main-nav-v2 {
        padding: 0;
        overflow: hidden;
        max-height: 0;
        visibility: hidden;
        opacity: 0;
        transition: max-height 0.32s ease, opacity 0.25s ease, visibility 0.25s ease;
    }

    .main-nav-v2.is-open {
        max-height: 520px;
        visibility: visible;
        opacity: 1;
    }

    .main-nav-v2__inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 8px 0 14px;
    }

    .main-nav-v2 a {
        width: 100%;
        min-height: 50px;
        padding: 13px 6%;
        justify-content: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    }

    .main-nav-v2 a::after {
        display: none;
    }

    .main-nav-v2 a.active {
        border-left: 5px solid var(--cns-white);
    }

    .main-nav-v2__visa-mobile {
        margin: 12px 5% 0;
        width: auto !important;
        min-height: 52px !important;
        gap: 10px;
        justify-content: center !important;
        color: var(--cns-green) !important;
        background: var(--cns-white) !important;
        border: 2px solid rgba(255, 255, 255, 0.75);
        border-radius: 14px;
    }
}

@media (max-width: 520px) {
    .site-header-v2 {
        padding-left: 4%;
        padding-right: 4%;
    }

    .site-header-v2 .brand-link {
        gap: 10px;
    }

    .site-header-v2 .brand-link img {
        width: 52px;
        height: 52px;
    }

    .site-header-v2 .brand-copy h1 {
        margin-bottom: 3px;
        font-size: 28px;
    }

    .site-header-v2 .brand-copy p {
        max-width: 165px;
        font-size: 11px;
    }

    .mobile-menu-toggle {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header-v2,
    .visa-statistique-btn,
    .main-nav-v2,
    .main-nav-v2 a,
    .mobile-menu-toggle span {
        transition: none;
    }
}
