/* ========================= RESET & BASE ==================================================================================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Causten", sans-serif;
    background-color: white;
}

/* Variantes de fond public (hors contenu) */
body.bg-variant-1 {
    background-image: none;
}
body.bg-variant-2 {
    background-image: none;
}

/* Activer l'effet fixed uniquement sur desktop pour de meilleures perfs mobile */
@media (min-width: 992px) {
    body.bg-variant-1,
    body.bg-variant-2 {
        background-attachment: scroll;
    }
}

/* Le contenu reste sur fond blanc */
main.main-public {
    background-color: #fff;
    width: 100%;
    margin: 0;
    border-radius: 0;
}
@media (min-width: 992px) {
    main.main-public {
        width: 100%;
        margin: 0;
        background-color: #fff;
        border-radius: 0;
    }
}

/* Causten - toutes variantes */
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Extra Light.ttf") format("truetype");
    font-weight: 200;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Extra Light Oblique.ttf") format("truetype");
    font-weight: 200;
    font-style: italic;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Light Oblique.ttf") format("truetype");
    font-weight: 300;
    font-style: italic;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Regular Oblique.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Medium Oblique.ttf") format("truetype");
    font-weight: 500;
    font-style: italic;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Bold Oblique.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Extra Bold.ttf") format("truetype");
    font-weight: 800;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Extra Bold Oblique.ttf") format("truetype");
    font-weight: 800;
    font-style: italic;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Black.ttf") format("truetype");
    font-weight: 900;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: "Causten";
    src: url("../fonts/Causten Black Oblique.ttf") format("truetype");
    font-weight: 900;
    font-style: italic;
    font-display: block;
}

/* More Sugar Regular - Local TTF */
@font-face {
    font-family: "More Sugar";
    src: url("../fonts/MoreSugar-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

/* Apply More Sugar to all subheadings */
h2, h3, h4, h5, h6 {
    font-family: 'More Sugar', cursive !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: -0.04em !important;
    text-align: center !important;
}

/* All H1 use More Sugar Regular (400) */
h1 {
    font-family: 'More Sugar', cursive !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: -0.04em !important;
    text-align: center !important;
}

/* (Mix overlay retiré) */

/* ========================= TITRE PUBLIC COMMUN ========================= */
/* Classe à appliquer sur tous les h1 des pages publiques */
.public-title {
    font-family: 'More Sugar', cursive !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: -0.04em !important;
    text-align: center !important;
    color: #000 !important;
    margin: 0 0 1.5rem 0 !important;
}

/* Fallback global: s'assurer que tous les h1 publics utilisent More Sugar regular */
/* Fallback déplacé dans global-theme.css pour charger après tous les CSS */

/* Lock background scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* ========================= HEADER ==================================================================================================================================== */
.navbar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    grid-column: 1;
    order: 1;
    justify-self: start;
}

.user-action-btn {
    color: #333;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.user-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 20px;
    grid-column: 2;
    order: 2;
    justify-content: center;
}

.logo img {
    height: 55px;
}

.logo {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 40px;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.nav-links > li {
    position: relative;
}

.nav-links > li > a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400; /* More Sugar Regular */
    font-family: 'More Sugar', cursive;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links > li > a:hover {
    transform: translateY(-2px);
}

.nav-links > li > a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #333;
    transition: width 0.3s ease;
}

.nav-links > li > a:hover::after,
.nav-links > li > a.active::after {
    width: 100%;
}

/* Uniformiser l'animation de survol sur toute la zone du bouton (y compris Activités avec flèche) */
.nav-links > li:hover > a {
    transform: translateY(-2px);
}
.nav-links > li:hover > a::after {
    width: 100%;
}

/* Bouton de la flèche pour ouvrir le menu déroulant */
.submenu-toggle {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    font-size: 11px;
    margin-left: 6px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.submenu-toggle:hover {
    transform: translateY(-2px);
}

.has-submenu.open .submenu-toggle i {
    transform: rotate(180deg);
}

.submenu-toggle i {
    transition: transform 0.3s ease;
}

/* Pour les items avec sous-menu */
.has-submenu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links > li.has-megamenu {
    position: static;
}

/* Recherche */
.search-box {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    height: 45px;
    overflow: hidden;
}

.search-box.active {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    padding: 0 15px;
    width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.search-input {
    border: none;
    outline: none;
    font-size: 15px;
    width: 0;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.search-box.active .search-input {
    width: 220px;
    opacity: 1;
    margin-right: 10px;
}

.search-btn {
    background: transparent;
    border: none;
    width: auto;
    height: auto;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.search-btn i {
    color: #333;
    font-size: 20px;
    transition: all 0.3s ease;
}

.search-btn:hover i {
    color: #666;
    transform: scale(1.1) rotate(15deg);
}

/* Mega Menu */
.megamenu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #f5f5f5;
    border-radius: 16px;
    padding: 35px 45px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    width: min(960px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    min-width: 0;
    box-sizing: border-box;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.4s,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.4s,
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
    pointer-events: none;
    display: flex;
    flex-direction: row;
    gap: 40px;
}

.has-megamenu.open .megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}

/* Ouverture au survol sur desktop uniquement (tactile/mobile garde le clic) */
@media (hover: hover) and (min-width: 993px) {
    .has-megamenu:hover .megamenu,
    .has-megamenu:focus-within .megamenu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
        pointer-events: auto;
        transition-delay: 0s;
    }

    .has-megamenu:hover .submenu-toggle i,
    .has-megamenu:focus-within .submenu-toggle i {
        transform: rotate(180deg);
    }

    /* Pont invisible toujours actif : combler le gap entre le <li> et le mégamenu
       pour que le survol reste continu pendant le déplacement de la souris. */
    .has-megamenu::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: min(960px, calc(100vw - 40px));
        height: 20px;
        pointer-events: auto;
        background: transparent;
    }
}

.megamenu-column {
    flex: 1;
}

.megamenu-column h3 {
    font-family: 'More Sugar', cursive !important;
    font-size: 17px;
    font-weight: 400 !important;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #2d2d2d;
    margin: 0 0 12px 0;
}

@keyframes megamenuFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Liens cliquables pour les groupes d'activités dans le megamenu */
.megamenu-group {
    display: inline-block;
    font-family: 'More Sugar', cursive !important;
    font-size: 17px;
    font-weight: 400 !important;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #000;
    margin: 0 0 12px 0;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    text-align: center;
    animation: megamenuFloat 6s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Couleurs pour chaque colonne du megamenu */
.megamenu-column:nth-child(1) .megamenu-group {
    background-color: #ffde59;
    animation-delay: 0.2s;
}

.megamenu-column:nth-child(2) .megamenu-group {
    background-color: #f68c10;
    animation-delay: 0.4s;
}

.megamenu-column:nth-child(3) .megamenu-group {
    background-color: #f04e4b;
    animation-delay: 0.6s;
}

.megamenu-column:nth-child(4) .megamenu-group {
    background-color: #ff4e4b;
    animation-delay: 0.8s;
}

.megamenu-column:nth-child(5) .megamenu-group {
    background-color: #6053a6;
    animation-delay: 1s;
}

.megamenu-group:hover {
    color: #000;
    text-decoration: none;
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    animation-play-state: paused;
}

.megamenu-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.megamenu-column ul li a {
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400 !important;
    font-family: 'Causten', sans-serif !important;
    line-height: 1.6;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.5rem 0.8rem;
    border-radius: 25px;
    position: relative;
    animation: megamenuFloat 6s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Couleurs claires pour chaque colonne */
.megamenu-column:nth-child(1) ul li a {
    background-color: #fff9c4;
}

.megamenu-column:nth-child(1) ul li a:nth-child(1) { animation-delay: 0.3s; }
.megamenu-column:nth-child(1) ul li a:nth-child(2) { animation-delay: 0.5s; }
.megamenu-column:nth-child(1) ul li a:nth-child(3) { animation-delay: 0.7s; }

.megamenu-column:nth-child(2) ul li a {
    background-color: #fce4b6;
}

.megamenu-column:nth-child(2) ul li a:nth-child(1) { animation-delay: 0.5s; }
.megamenu-column:nth-child(2) ul li a:nth-child(2) { animation-delay: 0.7s; }
.megamenu-column:nth-child(2) ul li a:nth-child(3) { animation-delay: 0.9s; }
.megamenu-column:nth-child(2) ul li a:nth-child(4) { animation-delay: 1.1s; }

.megamenu-column:nth-child(3) ul li a {
    background-color: #f7b8b5;
}

.megamenu-column:nth-child(3) ul li a:nth-child(1) { animation-delay: 0.7s; }
.megamenu-column:nth-child(3) ul li a:nth-child(2) { animation-delay: 0.9s; }
.megamenu-column:nth-child(3) ul li a:nth-child(3) { animation-delay: 1.1s; }
.megamenu-column:nth-child(3) ul li a:nth-child(4) { animation-delay: 1.3s; }

.megamenu-column:nth-child(4) ul li a {
    background-color: #ffc2ad;
}

.megamenu-column:nth-child(4) ul li a:nth-child(1) { animation-delay: 0.9s; }
.megamenu-column:nth-child(4) ul li a:nth-child(2) { animation-delay: 1.1s; }
.megamenu-column:nth-child(4) ul li a:nth-child(3) { animation-delay: 1.3s; }
.megamenu-column:nth-child(4) ul li a:nth-child(4) { animation-delay: 1.5s; }

.megamenu-column:nth-child(5) ul li a {
    background-color: #d4c8e8;
}

.megamenu-column:nth-child(5) ul li a:nth-child(1) { animation-delay: 1.1s; }

.megamenu-column ul li a:hover {
    color: #000;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    animation-play-state: paused;
}

.megamenu-column ul li a::before {
    display: none;
}

.hamburger {
    display: none !important;
}

.mobile-only {
    display: none !important;
}

@media (min-width: 769px) {
    .hamburger {
        display: none !important;
    }

    .mobile-only {
        display: none !important;
    }

    .user-actions {
        display: flex !important;
        grid-column: 1;
        order: 1;
    }

    .nav-center {
        display: flex !important;
        grid-column: 2;
        order: 2;
    }
}

/* Responsive - Smartphone uniquement */
@media (max-width: 768px) {
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        height: 60px;
    }

    .user-actions {
        display: none !important;
    }

    .mobile-only {
        display: list-item !important;
    }

    /* Masquer l'accès admin (connexion/configuration/déconnexion) sur mobile */
    .mobile-only-admin {
        display: none !important;
    }

    .nav-center {
        display: flex;
        order: 3;
        width: 100%;
    }

    .logo {
        order: 1;
        margin-left: 0;
        justify-self: auto;
        grid-column: unset;
    }

    .logo img {
        height: 45px;
    }

    .hamburger {
        display: block !important;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #000;
        margin: 0;
        order: 2;
        justify-self: auto;
        padding: 0;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hamburger:hover {
        background: rgba(0,0,0,0.05);
        border-radius: 8px;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 0;
        overflow-y: auto;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        margin: 0;
        order: 3;
        grid-column: unset;
        justify-content: flex-start;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links > li {
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-links > li:last-child {
        border-bottom: none;
    }

    .nav-links > li > a {
        font-size: 16px;
        line-height: 1.5;
        padding: 8px 0;
        display: block;
        color: #333;
        text-decoration: none;
    }

    .nav-links > li > a::after {
        display: none;
    }

    .nav-links > li:hover > a::after {
        display: none;
    }

    .nav-links > li > a:active {
        color: #000;
        font-weight: 700;
    }

    /* Backdrop behind mobile menu */
    .nav-backdrop {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(0,0,0,0.35);
        z-index: 998;
    }

    .nav-links.open + .nav-backdrop {
        display: block;
    }

    .megamenu {
        position: static;
        transform: none;
        display: none !important;
        flex-direction: column;
        box-shadow: none;
        padding: 0;
        margin: 0;
        min-width: auto;
        border-radius: 0;
        background: transparent;
        width: 100%;
        opacity: 1;
        visibility: visible;
    }

    .has-megamenu.open .megamenu {
        display: none !important;
    }

    .megamenu-column {
        margin-bottom: 0;
    }

    .megamenu-group {
        display: block !important;
        font-family: 'More Sugar', cursive !important;
        font-weight: 400 !important;
        font-size: 15px !important;
        padding: 8px 0 !important;
        background: transparent !important;
        animation: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        color: #2d2d2d !important;
        text-align: left !important;
        border-radius: 0 !important;
    }

    .megamenu-group:hover {
        background: transparent !important;
        color: #000 !important;
        transform: none !important;
        box-shadow: none !important;
    }

    .megamenu-column ul li a {
        display: block;
        font-size: 13px;
        font-family: 'Causten', sans-serif !important;
        font-weight: 400 !important;
        padding: 6px 0 6px 15px;
        background: transparent !important;
        animation: none !important;
        box-shadow: none !important;
        color: #555 !important;
    }

    .megamenu-column ul li a:active {
        color: #333 !important;
        font-weight: 400;
    }

    .megamenu-column h3,
    .megamenu-column ul {
        display: none;
    }

    /* Masquer la flèche d'ouverture en mobile */
    .submenu-toggle {
        display: none !important;
    }

    /* En mobile, ne pas utiliser le layout flex sur les items avec sous-menu */
    .has-submenu {
        display: block !important;
        gap: 0 !important;
    }

    .has-submenu > a {
        display: block !important;
        width: 100% !important;
    }

    .search-box {
        display: none;
    }

    .search-box.active {
        display: none;
    }
}
