﻿
/* ---------- Variables ---------- */
:root {
    --mc-blue: #183375;
    --mc-link: #2b3a4a;
    --mc-link-active: #1a5bff;
    --mc-separator: #e9eef5;
}

/* Accessibilité */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

    .skip-to-content:focus {
        left: 16px;
        top: 12px;
        width: auto;
        height: auto;
        background: #fff;
        border: 2px solid var(--mc-link-active);
        padding: 6px 10px;
        border-radius: 6px;
        z-index: 10001;
    }

/* ---------- Topbar FIXE + TRANSPARENTE NEUTRE ---------- */
.mc-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    /* verre dépoli neutre (pas de saturation => pas de teinte bleue) */
    background: rgba(255,255,255,.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    isolation: isolate; /* empêche les mélanges avec le contenu interne */
    /* Ombre inférieure pour séparation nette */
    box-shadow: 0 8px 18px -12px rgba(0,0,0,.28), 0 1px 0 0 var(--mc-separator);
}

/* Grille */
.mc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
}

/* ---------- Marque / logo (mieux visible) ---------- */
.mc-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

    .mc-brand img {
        width: 200px;
        height: 200px;
    }

    .mc-brand span {
        font-weight: 700;
        font-size: 20px;
        color: #0e2336;
        white-space: nowrap;
    }

/* ---------- Navigation alignée à droite ---------- */
.mc-nav {
    display: flex;
    justify-content: flex-end;
}

.mc-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
}

.mc-link {
    font-size: 20px;
    position: relative;
    text-decoration: none;
    font-weight: 500;
    color: var(--mc-link);
    padding: 8px 2px;
    line-height: 1.2;
}

    .mc-link:hover {
        color: #0e2336;
    }

    .mc-link.active {
        color: var(--mc-link-active);
    }

    /* On retire le ::after individuel pour tous les liens */
    .mc-link::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -8px;
        height: 3px;
        width: 0;
        border-radius: 2px;
        background: var(--mc-link-active);
        transition: left 0.35s ease, width 0.35s ease;
    }

    /* Lien actif uniquement → définit la largeur et position initiale */
    .mc-link.active::after {
        width: 100%;
    }


/* ---------- CTA ---------- */
.mc-cta {
    margin-left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(90deg,#2a66ff,#8a34ff);
    box-shadow: 0 6px 14px rgba(71,97,255,.25);
    transition: transform .06s ease, box-shadow .15s ease;
}

    .mc-cta:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 18px rgba(71,97,255,.28);
    }

.mc-cta-icon {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .mc-container {
        grid-template-columns: 1fr auto;
        grid-template-areas: "brand cta" "nav nav";
        row-gap: 8px;
    }

    .mc-brand {
        grid-area: brand;
    }

    .mc-nav {
        grid-area: nav;
        justify-content: flex-start;
    }

    .mc-cta {
        grid-area: cta;
        justify-self: end;
        margin-left: 0;
    }

    .mc-menu {
        flex-wrap: wrap;
        gap: 16px;
    }
}

/* Optionnel: corriger l'ancrage d’ID sous nav fixe
   .anchor { scroll-margin-top: 80px; } */

/* --- Burger menu --- */
.mc-burger {
    display: none;
    width: 34px;
    height: 26px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 10001;
}

    .mc-burger span {
        display: block;
        height: 3px;
        width: 100%;
        background: #183375;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* --- Animation burger → croix --- */
    .mc-burger.open span:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
    }

    .mc-burger.open span:nth-child(2) {
        opacity: 0;
    }

    .mc-burger.open span:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
    }

/* --- Menu mobile --- */
@media (max-width: 900px) {
    .mc-burger {
        display: flex;
    }

    .mc-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 22px;
        transform: translateY(-100%);
        transition: transform 0.35s ease-in-out;
        z-index: 9999;
    }

        .mc-nav.open {
            transform: translateY(0);
        }

    .mc-menu {
        flex-direction: column;
        gap: 28px;
        text-align: center;
    }

    .mc-link {
        font-size: 22px;
        font-weight: 600;
        color: #1e2a3b;
    }

    /* Logo plus petit et header compact */
    .mc-topbar {
        padding: 8px 0;
    }

    .mc-brand img {
        width: 90px;
        height: auto;
    }

    /* Bouton CTA intégré dans le menu mobile */
    .mc-cta-mobile {
        margin-top: 28px;
    }

    .mc-cta {
        font-size: 18px;
        padding: 12px 26px;
        background: linear-gradient(90deg, #2a66ff, #8a34ff);
        box-shadow: 0 8px 18px rgba(71, 97, 255, .28);
        color: #fff;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        font-weight: 600;
    }

    .mc-cta-icon {
        width: 18px;
        height: 18px;
        fill: #fff;
    }
}
/* --- Corrige le dépassement du burger sur la page d'accueil --- */
@media (max-width: 900px) {
    .mc-container {
        padding-right: 20px !important; /* ajoute un peu d’air à droite */
    }

    .mc-burger {
        margin-right: 0 !important;
        right: 0 !important;
        position: relative;
    }

    /* Évite que le header se décale si la page a un overflow */
    body, html {
        overflow-x: hidden !important;
    }
}

/* --- Hauteur optimisée du header sur mobile --- */
@media (max-width: 900px) {
    /* Réduit la hauteur du header */
    .mc-topbar {
        padding: 4px 0 !important; /* au lieu de 8px */
    }

    /* Compense dans le conteneur interne */
    .mc-container {
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

    /* Logo légèrement plus petit pour équilibrer */
    .mc-brand img {
        width: 70px !important;
        height: auto !important;
    }

    /* Centrage vertical parfait du burger */
    .mc-burger {
        height: 22px !important;
        align-self: center;
    }

    /* Réduction du gap global */
    .mc-container {
        gap: 10px !important;
    }
}
