:root {
    /* Couleurs vives "fun", pensées pour ressortir sur fond sombre */
    --pastel-blue: #12f4ff;    /* cyan vif */
    --pastel-pink: #fffc3b;    /* rose vif */
    --pastel-green: #6bcf7f;   /* vert vif */
    --pastel-yellow: #ffd23f;  /* jaune soleil */

    /* Texte à l'intérieur des cartes/formulaires blancs */
    --ink: #2e2e3d;
    --ink-light: #6f6f85;

    /* Texte directement posé sur le fond sombre de la page */
    --text-on-dark: #f4f3f8;
    --muted-on-dark: #b6b5c9;

    /* Fond principal sombre demandé */
    --bg-1: #33333f;
    --bg-2: #3a3a4a;
    --card-bg: #ffffff;

    --radius: 18px;
    --shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

h2 { font-family: Georgia, 'Times New Roman', serif; color: var(--ink); }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-on-dark);
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 111, 145, 0.16), transparent 42%),
        radial-gradient(circle at 88% 12%, rgba(46, 196, 182, 0.16), transparent 42%),
        radial-gradient(circle at 50% 95%, rgba(255, 210, 63, 0.12), transparent 48%),
        linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* --- Header --- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px;
    max-width: 1100px;
    margin: 0 auto;
    flex-wrap: wrap;
    row-gap: 10px;
}
.site-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: auto;
}
.site-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}
.site-nav a {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--ink);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform .15s ease;
}
.site-nav a:hover { transform: translateY(-2px); }
.site-nav a.active { background: #12ff9b; color: #0f2e29; font-weight: 700; }

/* Bouton burger : caché sur grand écran, visible seulement en dessous du seuil mobile. */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    cursor: pointer;
    padding: 0;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 0 auto;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.ouvert span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.ouvert span:nth-child(2) { opacity: 0; }
.nav-toggle.ouvert span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
    .site-header { flex-direction: column; align-items: stretch; text-align: left; gap: 0; }
    .site-header-top { width: 100%; }
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        flex-direction: column;
        gap: 6px;
        width: 100%;
        margin-top: 14px;
    }
    .site-nav.ouvert { display: flex; }
    .site-nav a { text-align: center; }
}

 h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.site-header h1 span { color: #12ff9b; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    background: #12ff9b;
    color: #0f2e29;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
    font-size: 0.95rem;
}
.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-hover); }
.btn-pink { background: #7c1a5a; color: #ffffff; }
.btn-green { background: var(--pastel-green); color: #143d1d; }
.btn-outline { background: rgba(255, 255, 255, 0.94); border: 2px solid var(--pastel-blue); color: #1f3a52; box-shadow: var(--shadow); }
.btn-danger { background: #5c5c70; color: #ffffff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.btn-small { padding: 6px 14px; font-size: 0.85rem; }

/* --- Section titles --- */
.section-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    font-style: italic;
    margin: 34px 0 16px;
    color: var(--text-on-dark);
    text-transform: none;
    letter-spacing: 0.3px;
    position: relative;
    padding-bottom: 8px;
}
.section-title::after {
    content: '';
    display: block;
    width: 54px;
    height: 4px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--pastel-blue), var(--pastel-pink), var(--pastel-yellow));
    margin-top: 8px;
}

/* --- Cards grid --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.card {
    background: var(--card-bg);
    color: var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
    border-top: 6px solid var(--pastel-blue);
}
.card:hover { transform: translateY(-4px) scale(1.015); box-shadow: var(--shadow-hover); }

.card img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
    background: #eee;
}

.card-body { padding: 14px 16px; }
.card-body h3 { margin: 0 0 4px; font-size: 1.02rem; color: #584c96; }
.card-body p { margin: 0; font-size: 0.85rem; color: var(--ink-light); }

/* Vignettes de structures, plus petites que les vignettes d'événements */
.cards-grid-lieux {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}
.cards-grid-lieux .card img { height: 80px; }
.cards-grid-lieux .card-body { padding: 8px 10px; }
.cards-grid-lieux .card-body h3 { font-size: 0.85rem; }
.cards-grid-lieux .card-body p { font-size: 0.72rem; }
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--pastel-yellow);
    color: #5c4200;
    margin-bottom: 6px;
}

/* --- Month navigation --- */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin: 34px auto 24px;
    max-width: 460px;
    background: #cb026a;
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
    padding: 12px 28px;
    border-radius: 999px;
    box-shadow: var(--shadow);
}
.month-nav h2 {
    margin: 0;
    font-size: 1.35rem;
    min-width: 200px;
    text-align: center;
    text-transform: capitalize;
    color: var(--text-on-dark);
}
.month-nav .nav-btn {
    background: none;
    border: none;
    color: var(--text-on-dark);
    width: auto; height: auto;
    padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: none;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, color .15s ease;
    flex-shrink: 0;
}
.month-nav .nav-btn:hover { transform: scale(1.2); color: var(--pastel-blue); }

.filters { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.filters select {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #dfe4ee;
    background: var(--card-bg);
    color: var(--ink);
    font-size: 0.9rem;
}

/* --- Day groups --- */
.day-group { margin-bottom: 26px; }
.day-group > h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--pastel-yellow);
    text-transform: capitalize;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.22);
    padding-bottom: 6px;
}

.editorial {
    max-width: 720px;
    margin: 50px auto 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.editorial p {
    color: var(--muted-on-dark);
    line-height: 1.7;
    margin: 0 0 14px;
}
.editorial-page {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}
.editorial-page h1.section-title {
    font-size: 1.7rem;
}
.editorial-legal h2 {
    color: var(--text-on-dark);
    font-size: 1.1rem;
    margin: 30px 0 10px;
}
.editorial-legal ul {
    color: var(--muted-on-dark);
    line-height: 1.7;
    margin: 0 0 14px;
    padding-left: 22px;
}
.editorial-legal a { color: var(--pastel-yellow); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.intro-text {
    max-width: 680px;
    margin: 0 auto 24px;
    text-align: center;
    color: var(--muted-on-dark);
    font-size: 0.95rem;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted-on-dark);
}

/* --- Modales --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 22, 0.65);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--card-bg);
    color: var(--ink);
    border-radius: var(--radius);
    max-width: 480px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    position: relative;
    animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-box img.modal-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.modal-content { padding: 22px 26px 26px; }
.modal-content h2 { margin: 0 0 6px; }
.modal-content .meta { color: var(--ink-light); font-size: 0.9rem; margin-bottom: 12px; }
.modal-content p.desc { line-height: 1.5; }

.modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 34px; height: 34px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 2;
}

.link-row { margin: 10px 0; font-size: 0.9rem; }
.link-row a { color: #1b8a7e; text-decoration: underline; font-weight: 600; }

/* --- Forms --- */
form.stack { display: flex; flex-direction: column; gap: 14px; }
label { font-size: 0.85rem; font-weight: 600; color: var(--ink-light); display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=color], input[type=file], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #dfe4ee;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--ink);
    background: #fbfcfe;
}
textarea { min-height: 90px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.form-card {
    background: var(--card-bg);
    color: var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    max-width: 560px;
    margin: 0 auto 30px;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 600;
}
.alert-error { background: #ffd6d6; color: #7a1c1c; }
.alert-success { background: #d1f5da; color: #155724; }

/* --- Admin dashboard --- */
.admin-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.admin-nav a {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--ink);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform .15s ease;
}
.admin-nav a:hover { transform: translateY(-2px); }
.admin-nav a.active { background: #12ff9b; color: #0f2e29; font-weight: 700; }

table.event-table { width: 100%; border-collapse: collapse; background: var(--card-bg); color: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.event-table th, table.event-table td { padding: 12px 14px; text-align: left; font-size: 0.88rem; border-bottom: 1px solid #f0f2f7; }
table.event-table th { background: #f5f8fc; color: var(--ink-light); }
table.event-table tr:last-child td { border-bottom: none; }
.actions-cell { display: flex; gap: 8px; }

footer.site-footer { text-align: center; padding: 30px 10px; color: var(--muted-on-dark); font-size: 0.8rem; }
footer.site-footer a { color: var(--pastel-yellow); font-weight: 600; }
footer.site-footer .footer-ligne { margin-top: 14px; }
footer.site-footer .footer-ligne:first-child { margin-top: 0; }
footer.site-footer .footer-nav-legale a { color: var(--muted-on-dark); font-weight: 400; text-decoration: underline; }
footer.site-footer .footer-infos { font-size: 0.72rem; opacity: 0.75; line-height: 1.5; }

.vignettes-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 640px) {
    .month-nav h2 { min-width: unset; font-size: 1.15rem; }
    .vignettes-3 { grid-template-columns: 1fr; }
}
