/* ======================================================
   RESET + BASE
====================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a5490;
    --primary-dark: #1a252f;
    --accent: #FFD700;
    --text: #333;
    --white: #fff;
    --container: 1200px;
    --radius: 15px;
    --transition: 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ======================================================
   NAVBAR
====================================================== */

.navbar {
    background-color: var(--primary);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color var(--transition);
}

.nav-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-img {
    height: 50px;
    width: 50px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--white);
}

.logo-text {
    display: inline-block;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    transition: color var(--transition);
    padding: 0.5rem;
}

.nav-link:hover {
    color: var(--accent);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    margin: 3px 0;
    transition: var(--transition);
}

/* ======================================================
   HERO
====================================================== */

.hero {
    background-image: url('../images/bandeau.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--white);
    padding: 150px 20px 100px;
    text-align: center;
    margin-top: 60px;
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    font-weight: 900;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: backwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* ======================================================
   BUTTONS
====================================================== */

.btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--accent);
    color: var(--primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
    animation: fadeInUp 1s ease 0.4s;
    animation-fill-mode: backwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    background-color: #FFC700;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background-color: #f0f0f0;
}

.btn.disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.btn.sending {
    background-color: #999;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.sending::after {
    content: " ⏳";
}

/* ======================================================
   POPUP
====================================================== */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.popup-overlay.show {
    display: flex;
}

.popup-container {
    background: var(--white);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInDown 0.4s ease;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background var(--transition), transform var(--transition);
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
}

.popup-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.popup-body {
    padding: 2rem;
    padding-bottom: 3rem;
}

.popup-body h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.popup-date {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.popup-description {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.popup-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.popup-btn {
    flex: 1;
    text-align: center;
    min-width: 150px;
    position: relative;
    z-index: 100;
}

#popup-link {
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

/* ======================================================
   ABOUT SECTION
====================================================== */

.about {
    padding: 80px 20px;
    background-color: #f8f9fa;
}

.about h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary);
}

.about h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: justify;
}

.values-list {
    list-style: none;
    margin-top: 1rem;
}

.values-list li {
    padding: 0.8rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid #e0e0e0;
}

.about-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Bureau interactif */
.photo-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1466 / 825;
    overflow: hidden;
    background: #000;
    margin: 2rem 0;
}

.photo-wrapper > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
    filter: grayscale(100%);
}

.photo-wrapper .columns {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.photo-wrapper .col {
    position: relative;
    overflow: hidden;
    border-left: 2px solid #fff;
    cursor: pointer;
}

.photo-wrapper .col:first-child {
    border-left: none;
}

.photo-wrapper .col::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../images/bureau.jpeg");
    background-repeat: no-repeat;
    background-size: 400% 100%;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1;
}

.photo-wrapper .col:nth-child(1)::before { background-position: 0% 0; }
.photo-wrapper .col:nth-child(2)::before { background-position: 33.333% 0; }
.photo-wrapper .col:nth-child(3)::before { background-position: 66.666% 0; }
.photo-wrapper .col:nth-child(4)::before { background-position: 100% 0; }

.photo-wrapper .col::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.12);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
    pointer-events: none;
}

.photo-wrapper .label {
    position: absolute;
    left: 50%;
    top: 75%;
    transform: translate(-50%, -50%);
    width: 100%;
    padding: 0 20px;
    text-align: center;
    color: #fff;
    font-weight: 700;
    font-size: clamp(14px, 1.2vw, 22px);
    line-height: 1.35;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 3;
    pointer-events: none;
}

@media (max-width: 600px) {
    .photo-wrapper .label {
        font-size: clamp(9px, 2.3vw, 13px);
        padding: 0 4px;
        top: 80%;
    }
}

.photo-wrapper .col:hover::before,
.photo-wrapper .col:hover::after,
.photo-wrapper .col:hover .label { opacity: 1; }

@media (hover: none), (pointer: coarse) {
    .photo-wrapper .col:hover::before,
    .photo-wrapper .col:hover::after,
    .photo-wrapper .col:hover .label { opacity: 0; }
    .photo-wrapper .col.is-active::before,
    .photo-wrapper .col.is-active::after,
    .photo-wrapper .col.is-active .label { opacity: 1; }
}

/* ======================================================
   SERVICES/DISCIPLINES
====================================================== */

.services {
    padding: 80px 20px;
    background: linear-gradient(to bottom, #fff, #f0f8ff);
}

.services h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(26, 84, 144, 0.3);
}

.icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.service-card p {
    color: #666;
}

/* ======================================================
   PORTFOLIO/EVENTS
====================================================== */

.portfolio {
    padding: 80px 20px;
    background-color: #f8f9fa;
}

.portfolio h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    height: 300px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 84, 144, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--white);
    padding: 20px;
    text-align: center;
    transition: opacity var(--transition);
}

.portfolio-overlay h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.portfolio-overlay p {
    font-size: 1rem;
    line-height: 1.6;
}

.portfolio-overlay .btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--accent);
    color: var(--primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.portfolio-overlay .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
    background-color: #FFC700;
}

/* Desktop : overlay apparaît au survol */
@media (hover: hover) and (pointer: fine) {
    .portfolio-overlay {
        opacity: 0;
    }
    
    .portfolio-item:hover .portfolio-overlay {
        opacity: 1;
    }
    
    .portfolio-item:hover img {
        transform: scale(1.1);
    }
}

/* Mobile/Tactile : overlay semi-transparent permanent */
@media (hover: none), (pointer: coarse) {
    .portfolio-overlay {
        background: linear-gradient(to bottom, rgba(26, 84, 144, 0.3) 0%, rgba(26, 84, 144, 0.95) 60%);
        opacity: 1;
        justify-content: flex-end;
        padding-bottom: 2rem;
    }
    
    .portfolio-overlay h3 {
        font-size: 1.5rem;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    }
    
    .portfolio-overlay p {
        font-size: 0.95rem;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    }
}

/* ======================================================
   ADHESION
====================================================== */

.adhesion {
    padding: 80px 20px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
}

.adhesion h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary);
}

.adhesion-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    align-items: center;
}

.adhesion-info h3 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.benefits-list {
    list-style: none;
    margin-bottom: 2rem;
}

.benefits-list li {
    padding: 0.8rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #d0e8f2;
}

.club-info {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.club-info h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.club-info p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.adhesion-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ======================================================
   CONTACT
====================================================== */

.contact {
    padding: 80px 20px;
    background-color: var(--white);
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.contact-intro {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: #666;
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.contact-form .btn {
    width: 100%;
    background-color: var(--primary);
    color: var(--white);
}

.contact-form .btn:hover {
    background-color: #00a8cc;
}

.form-message {
    max-width: 700px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
    font-size: 1.1rem;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    display: block;
}

/* ======================================================
   FOOTER
====================================================== */

.footer {
    background: linear-gradient(135deg, var(--primary) 0%, #00a8cc 100%);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    text-align: center;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-section a:hover {
    color: var(--accent);
}

.contact-info {
    margin-bottom: 1rem;
}

.contact-info p {
    margin: 0.5rem 0;
}

.contact-info a {
    color: var(--white);
    text-decoration: none;
    transition: color var(--transition);
}

.contact-info a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 1rem;
    font-size: 2rem;
    justify-content: center;
    align-items: center;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: transform var(--transition), box-shadow var(--transition);
}

.social-links a:hover {
    transform: scale(1.2);
}

.social-links a.whatsapp {
    background-color: #25D366;
    padding: 10px;
}

.social-links a.facebook {
    background-color: transparent;
    padding: 0;
}

.whatsapp-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.facebook-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-links a.whatsapp:hover {
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.5);
}

.social-links a.facebook:hover {
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.5);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.social-links a.instagram {
    background: radial-gradient(circle at 30% 110%,
        #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    padding: 10px;
}

.instagram-icon {
    width: 100%;
    height: 100%;
    color: #fff;
}

.social-links a.instagram:hover {
    box-shadow: 0 5px 15px rgba(214, 36, 159, 0.5);
}

.social-links a.whatsapp:hover,
.social-links a.facebook:hover,
.social-links a.instagram:hover {
    animation: pulse 0.6s ease-in-out;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    max-width: var(--container);
    margin: 0 auto;
}

/* ======================================================
   ANIMATIONS
====================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ======================================================
   FONDS GLOBAUX HARMONISÉS
====================================================== */

/* Fond global du site */
body {
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 30%, #f8f9fa 70%, #ffffff 100%);
    background-attachment: fixed;
}

/* Alterner les sections avec dégradés légers */

/* Sections paires : dégradé gris très clair */
section:nth-of-type(even) {
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0.5), rgba(255, 255, 255, 0.3));
}

/* Sections impaires : dégradé bleu très clair */
section:nth-of-type(odd) {
    background: linear-gradient(135deg, rgba(240, 248, 255, 0.4) 0%, rgba(230, 243, 255, 0.3) 100%);
}

/* Cartes et conteneurs : fond blanc léger avec ombre douce */
.service-card,
.portfolio-item,
.format-card,
.event-section,
.album-card,
.document-item,
.club-info {
    background: linear-gradient(135deg, #ffffff 0%, #f9fbfc 100%) !important;
    box-shadow: 0 2px 15px rgba(26, 84, 144, 0.08) !important;
}

/* Footer reste avec son dégradé fort */
.footer {
    background: linear-gradient(135deg, var(--primary) 0%, #00a8cc 100%) !important;
}

/* Hero garde son image de fond */
.hero {
    background-image: url("../images/bandeau.webp") !important;
    background-size: cover !important;
    background-position: center !important;
}

.event-hero {
    background-image: url('../images/affiche-swimrun-saintes-2026.webp') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .logo-img {
        height: 40px;
        width: 40px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--primary);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu li {
        padding: 1rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero {
        padding: 120px 20px 80px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .popup-container {
        width: 95%;
        max-height: 85vh;
    }

    .popup-image {
        height: 200px;
    }

    .popup-body {
        padding: 1.5rem;
        padding-bottom: 2.5rem;
    }

    .popup-body h2 {
        font-size: 1.5rem;
    }

    .popup-actions {
        flex-direction: column;
        margin-top: 1rem;
        gap: 0.8rem;
    }

    .popup-btn {
        width: 100%;
        padding: 0.8rem 1rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }
    
    .logo-img {
        height: 45px;
        width: 45px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}
/* ======================================================
   DROPDOWN "ÉVÉNEMENTS" — sous-menu navigation
   Ajouté le 17/05/2026
====================================================== */

.nav-menu {
  align-items: center;
}

.nav-item-dropdown {
  position: relative;
}

.nav-link-dropdown {
  cursor: pointer;
}

.nav-link-dropdown::after {
  content: ' \25BE';
  display: inline-block;
  font-size: 0.8em;
  margin-left: 0.25em;
  transition: transform 0.2s ease;
  transform-origin: center;
}

/* ----- Desktop ----- */
@media (min-width: 769px) {
  .nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 240px;
    background: var(--primary, #1a5490);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1100;
  }

  .nav-submenu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--primary, #1a5490);
  }

  .nav-item-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.6rem;
  }

  .nav-item-dropdown:hover .nav-submenu,
  .nav-item-dropdown:focus-within .nav-submenu,
  .nav-item-dropdown.open .nav-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .nav-item-dropdown:hover .nav-link-dropdown::after,
  .nav-item-dropdown.open .nav-link-dropdown::after {
    transform: rotate(180deg);
  }

  .nav-item-dropdown.dismissed .nav-submenu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(-6px) !important;
  }
  .nav-item-dropdown.dismissed .nav-link-dropdown::after {
    transform: none !important;
  }

  .nav-submenu li {
    padding: 0;
  }

  .nav-submenu a {
    display: block;
    padding: 0.55rem 1.1rem;
    color: var(--white, #fff);
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .nav-submenu a:hover,
  .nav-submenu a:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent, #FFD700);
  }

  .nav-submenu-heading {
    padding: 0.5rem 1.1rem 0.6rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--accent, #FFD700);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 0.3rem;
  }
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
  .nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.15);
  }

  .nav-item-dropdown.open .nav-submenu {
    max-height: 800px;
  }

  .nav-item-dropdown.open .nav-link-dropdown::after {
    transform: rotate(180deg);
  }

  .nav-submenu li {
    padding: 0;
  }

  .nav-submenu a {
    display: block;
    padding: 0.7rem 1rem;
    color: var(--white, #fff);
    text-decoration: none;
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-submenu a:hover,
  .nav-submenu a:focus {
    color: var(--accent, #FFD700);
  }

  .nav-submenu-heading {
    padding: 0.7rem 1rem 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--accent, #FFD700);
  }

  /* Nav mobile scrollable quand le sous-menu déployé dépasse le viewport */
  .nav-menu.active {
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 3rem;
  }
}

/* Ancres : décale la cible pour ne pas être masquée par la navbar fixe */
.event-section[id] {
  scroll-margin-top: 90px;
}

html {
  scroll-behavior: smooth;
}
