:root {
    --font-primary: 'Montserrat', sans-serif;
    --color-primary: #003366; /* Dark Blue */
    --color-secondary: #BF4C00; /* Orange */
    --color-background: #FFE4CC; /* Pastel Orange */
    --color-surface: #f9f9f9;
    --color-surface-light: #ffffff;
    --color-text-primary: #333;
    --color-text-secondary: #666;
    --color-border: #ddd;
    --color-facebook: #1877F2;
    --color-helloasso: #00A15C;
}

/* Reset et styles de base */
html {
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    color: var(--color-text-primary);
}

/* Smooth scroll pour les ancres */
html {
    scroll-behavior: smooth;
}

/* Background */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    z-index: -1;
}

/* Container principal */
.main-container {
    width: 80%;
    margin: 0 auto;
    background-color: rgba(153, 204, 255, 0.4);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background-color: var(--color-surface-light);
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo-container:hover {
    opacity: 0.8;
}

.logo-img {
    height: 60px;
    width: 60px;
    margin-right: 15px;
    border-radius: 50%;
}

.logo-text {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--color-primary);
    transition: font-size 200ms ease;
}

.orange-letter {
    color: var(--color-secondary);
}

/* Navigation */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1em;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--color-secondary);
}

/* Menu burger */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 25px;
    position: relative;
}

.mobile-menu-toggle span {
    display: block;
    position: absolute;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: var(--color-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span:nth-child(1) {
    top: 0;
}

.mobile-menu-toggle span:nth-child(2) {
    top: 11px;
}

.mobile-menu-toggle span:nth-child(3) {
    top: 22px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    top: 11px;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    top: 11px;
    transform: rotate(-45deg);
}

body.menu-open {
    overflow-x: hidden;
}

/* Main et sections */
main {
    padding: 0;
}


.content-wrapper {
    background-color: transparent;
    padding: 0;
    margin-top: 5px;
    border-radius: 8px;
}

section {
    margin-bottom: 15px;
}

section:first-child {
    margin-top: 0;
}

h2 {
    font-size: 2em;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
}

p {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--color-text-primary);
}


/* Contact */
#contact a:not(.social-link) {
    color: var(--color-secondary);
    font-weight: bold;
}

/* Liens réseaux sociaux */
.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 10px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: var(--color-primary); /* Couleur icône via currentColor */
    background: var(--color-surface-light);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    background: #f7f9fc;
}

.social-link svg {
    width: 28px;
    height: 28px;
}

.social-link img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: block;
}

/* HelloAsso recolorable via mask */
.helloasso-mark {
    width: 28px;
    height: 28px;
    display: inline-block;
    background-color: currentColor; /* permet de teinter l’icône */
    -webkit-mask-image: url('helloasso.png');
    -webkit-mask-size: cover;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url('helloasso.png');
    mask-size: cover;
    mask-repeat: no-repeat;
    mask-position: center;
    border-radius: 50%;
}

/* Couleurs spécifiques au hover */
.social-link.facebook:hover { color: var(--color-facebook); }
.social-link.email:hover { color: var(--color-secondary); }
.social-link.helloasso:hover { color: var(--color-helloasso); }

/* Footer */
footer {
    text-align: center;
    padding: 15px 0;
    margin-top: 20px;
    border-top: 1px solid var(--color-border);
    font-size: 0.9em;
    color: var(--color-text-secondary);
}

/* Responsive Design */
@media (max-width: 1140px) {
    .main-container {
        width: 95%;
        padding: 10px;
    }
    
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }
    
    .logo-container {
        margin-bottom: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-primary);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        will-change: max-height, opacity;
    }

    /* Activer les transitions uniquement quand le JS est prêt pour éviter le flash au chargement */
    .js-ready .nav-menu {
        transition: max-height 250ms ease, opacity 180ms ease;
    }

    .nav-menu.active {
        max-height: 60vh;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 20px 0;
        margin: 0;
    }
    
    nav ul li {
        margin: 0;
        width: 100%;
        text-align: center;
    }
    
    nav ul li a {
        display: block;
        padding: 15px 20px;
        color: var(--color-surface-light);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1.1em;
    }
    
    nav ul li a:hover {
        background-color: var(--color-secondary);
        color: var(--color-surface-light);
    }
    
    .content-wrapper {
        padding: 0;
        margin-top: 5px;
    }
    
    #hero {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    #hero h1 {
        font-size: 2.2em;
    }
    
    h2 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }
    
    p {
        font-size: 1em;
        line-height: 1.6;
        margin-bottom: 12px;
    }
    
    .sponsor-logos {
        flex-direction: column;
        gap: 15px;
        padding: 0 10px;
    }
    
    .sponsor a {
        padding: 12px 20px;
        display: block;
        text-align: center;
        border: 1px solid var(--color-secondary);
        border-radius: 5px;
        background-color: var(--color-surface);
    }
}

@media (max-width: 480px) {
    .main-container {
        width: 98%;
        padding: 5px;
    }
    
    .content-wrapper {
        padding: 0;
        margin-top: 3px;
    }
    
    #hero {
        padding: 18px 10px;
        margin: 12px 0;
    }
    
    #hero h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    p {
        font-size: 0.95em;
        line-height: 1.5;
    }
    
    nav ul li a {
        padding: 8px 12px;
        font-size: 0.9em;
    }
}

/* Masquer le texte du logo sur très petits écrans */
@media (max-width: 600px) {
    .logo-text { font-size: 1.3em; }
}

@media (max-width: 480px) {
    .logo-text { display: none; }
    .logo-img { margin-right: 0; }
}

/* Respecte l’accessibilité: pas d’animation si l’utilisateur préfère réduire les mouvements */
@media (prefers-reduced-motion: reduce) {
    .logo-text { transition: none !important; }
}

/* Offset pour les sections lors du scroll */
#about, #sponsors, #photos, #contact {
    scroll-margin-top: 100px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    border-top: 1px solid var(--color-border);
    font-size: 0.9em;
    color: var(--color-text-secondary);
    background-color: #f8f8f8;
}

/* Sections avec styles visuels */
#hero, #about, #sponsors, #photos, #contact {
    margin: 20px 0;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#hero {
    background-color: var(--color-primary);
    text-align: center;
}

#hero h1 {
    font-size: 3em;
    color: var(--color-surface-light);
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#about, #sponsors, #photos, #contact {
    background-color: var(--color-surface);
}

#hero:hover, #about:hover, #sponsors:hover, #photos:hover, #contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

/* Header */
.header {
    background-color: var(--color-primary); /* Dark Blue */
    color: var(--color-surface-light);
}

/* ====== Carrousel Photos ====== */
.carousel {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.carousel-viewport {
    overflow: hidden;
    border-radius: 10px;
    background: var(--color-surface-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.carousel-track {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform 0.4s ease;
}

.carousel-slide {
    min-width: 100%;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
}

.carousel-slide a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#sponsors .carousel-slide {
    height: 200px;
}

.carousel-btn {
    border: none;
    background: var(--color-primary);
    color: var(--color-surface-light);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.15s ease, background 0.15s ease;
}

.carousel-btn:hover { transform: translateY(-2px); background: var(--color-secondary); }
.carousel-btn:active { transform: translateY(0); }

.carousel-dots {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    aspect-ratio: 1 / 1;
    display: inline-block;
    padding: 0;
    line-height: 0;
    border-radius: 50%;
    background: #c6d4e2;
    border: none;
    cursor: pointer;
}

.carousel-dot[aria-selected="true"] { background: var(--color-primary); }

.carousel-empty {
    text-align: center;
    color: var(--color-text-secondary);
    margin-top: 10px;
}

.hidden { display: none !important; }

@media (max-width: 768px) {
    .carousel-slide { height: 300px; }
}

@media (max-width: 480px) {
    .carousel-slide { height: 220px; }
}
