/* Agenda AECV 2026-27 — feuille de style (vue publique : liste verticale) */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --border: #e3e6ea;
    --text: #1c1f23;
    --text-soft: #61666d;
    --accent: #4f46e5;
    --warm: #c25a38;
    --radius: 12px;
    --shadow: none;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Palette sombre — réutilisée par le suivi OS et par le thème forcé */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #16181c;
        --surface: #1f2228;
        --surface-2: #23272e;
        --border: #333941;
        --text: #eceef1;
        --text-soft: #9aa0a8;
        --accent: #8b8bff;
        --warm: #e2895f;
    }
}
:root[data-theme="dark"] {
    --bg: #16181c;
    --surface: #1f2228;
    --surface-2: #23272e;
    --border: #333941;
    --text: #eceef1;
    --text-soft: #9aa0a8;
    --accent: #8b8bff;
    --warm: #e2895f;
}
/* :root[data-theme="light"] = valeurs de :root, rien à redéclarer */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- en-tête ---------- */
.app-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 34px 20px 20px;
    text-align: center;
}
.app-header__title {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.app-header__title h1 {
    margin: 0;
    font-family: "Climate Crisis", var(--font);
    font-weight: 400;
    font-size: clamp(2.2rem, 10vw, 3.4rem);
    letter-spacing: .01em;
    text-transform: uppercase;
    color: var(--text);
}
.app-header__script {
    position: relative;
    z-index: 1;
    font-family: "Oleo Script", "Snell Roundhand", "Segoe Script", cursive;
    font-size: clamp(1.45rem, 6vw, 2.15rem);
    line-height: 1;
    color: #6FA934;
    margin-top: -.4em;
}

/* segmented control « À venir / Toute l'année » */
.viewnav {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    background: var(--surface-2);
    border-radius: 10px;
}
.seg {
    appearance: none;
    border: none;
    background: transparent;
    font: inherit;
    font-size: .83rem;
    color: var(--text-soft);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.seg.is-active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
}

/* ---------- liste des événements ---------- */
.list-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}
.event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.month-sep {
    padding: 20px 4px 6px;
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-soft);
}
.month-sep:first-child { padding-top: 4px; }

.ev-row {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    appearance: none;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background .12s ease;
}
.ev-row:hover { background: var(--surface-2); }
.ev-row.is-past { opacity: .5; }

.ev-row__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
}
.ev-row__date b { font-size: 1.3rem; font-weight: 700; }
.ev-row__date i {
    font-style: normal;
    font-size: .64rem;
    letter-spacing: .04em;
    color: var(--text-soft);
}

.ev-row__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ev-row__title { font-weight: 600; font-size: .95rem; }
.ev-row__meta {
    font-size: .8rem;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ev-row__cat {
    font-size: .64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
    background: var(--evt-color, #64748b);
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.list-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-soft);
    font-size: .9rem;
}

/* ---------- modale ---------- */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal[hidden] { display: none; }
.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 18, .5);
    backdrop-filter: blur(2px);
}
.modal__card {
    position: relative;
    max-width: 440px;
    margin: 12vh auto 0;
    background: var(--surface);
    border-radius: 14px;
    padding: 26px 24px 24px;
    overflow: hidden;
}
.modal__bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
}
.modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-soft);
    cursor: pointer;
}
.modal__badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
    padding: 3px 9px;
    border-radius: 999px;
}
.modal__title {
    margin: 10px 0 14px;
    font-size: 1.25rem;
    letter-spacing: -.01em;
}
.modal__meta {
    margin: 0 0 14px;
    display: grid;
    gap: 10px;
}
.modal__meta div { display: grid; grid-template-columns: 62px 1fr; gap: 8px; }
.modal__meta dt {
    font-size: .78rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.modal__meta dd { margin: 0; font-size: .9rem; }
.modal__desc {
    margin: 0;
    font-size: .92rem;
    line-height: 1.5;
    color: var(--text-soft);
    white-space: pre-wrap;
}

/* ---------- responsive ---------- */
@media (max-width: 560px) {
    .app-header { padding: 12px 14px; }
    .ev-row { grid-template-columns: 40px 1fr auto; gap: 10px; padding: 12px; }
    .ev-row__cat { font-size: .58rem; padding: 2px 6px; }
    .modal__card { margin: 8vh 12px 0; }
}
