/**
 * Page « Calendrier de l'école » (page-calendrier.php).
 *
 * Frise par mois, très aérée. Beaucoup de blanc, hiérarchie typographique forte,
 * couleur par parcimonie. La carte elle-même est stylée dans components/calendar-card.css.
 */

.cal-page {
    --cal-page-accent: #009C8E;
    /* Fond crème de base du site (design-system : --color-bg) plutôt que blanc :
       les cartes éditoriales/action ressortent (blanches + ombre) et les cartes
       « info » se fondent dans la page — la hiérarchie se lit d'elle-même. */
    background: var(--color-bg, #fffcf6);
}

.cal-page__container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px 96px;
}

/* Hero : composant partagé template-parts/components/hero.php (CSS embarqué). */

/* ── Filtres ──────────────────────────────────────────────────────────────── */

.cal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 22px 44px;
    padding: 40px 0 12px;
}

.cal-filters__group {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.cal-filters__label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #9aa0ac;
}

.cal-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.cal-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3d4451;
    background: #f4f3f1;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    min-height: 40px;
}

.cal-chip:hover {
    background: #e9e7e3;
}

.cal-chip:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--cal-page-accent) 55%, #ffffff);
    outline-offset: 2px;
}

.cal-chip.is-active {
    color: #ffffff;
    background: var(--cal-page-accent);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--cal-page-accent) 32%, transparent);
}

/* ── Navigation entre les mois (sticky, scrollable) ───────────────────────── */

.cal-monthnav {
    position: sticky;
    /* Se cale sous l'en-tête du site (sticky, 72px) — même repère que la nav
       de la page École. À top:0, la barre passerait derrière l'en-tête et les
       ancres atterriraient masquées : « le scroll ne marche pas ». */
    top: 72px;
    z-index: 20;
    margin: 28px -24px 12px;
    padding: 11px 24px;
    background: rgba(255, 252, 246, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.03);
}

.cal-monthnav__list {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.cal-monthnav__item {
    flex: 0 0 auto;
    margin: 0;
}

.cal-monthnav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 9px 15px;
    font-size: 0.86rem;
    font-weight: 600;
    text-transform: capitalize;
    color: #6b7280;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.cal-monthnav__link:hover {
    color: #111827;
    background: #f4f3f1;
}

.cal-monthnav__link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--cal-page-accent) 55%, #ffffff);
    outline-offset: 2px;
}

.cal-monthnav__link.is-active {
    color: var(--cal-page-accent);
    background: color-mix(in srgb, var(--cal-page-accent) 10%, #ffffff);
    font-weight: 700;
}

/* Repère discret du mois actif : un petit trait sous l'onglet, pas seulement
   la couleur — la barre reste lisible même sans percevoir la teinte. */
.cal-monthnav__link.is-active::after {
    content: '';
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--cal-page-accent);
}

/* ── Sections mensuelles ──────────────────────────────────────────────────── */

.cal-month {
    padding-top: 60px;
    /* En-tête (72px) + barre des mois : l'ancre s'arrête juste sous les deux. */
    scroll-margin-top: 132px;
}

/* En-tête de mois : pastille d'accent, titre, puis un filet décoratif qui file
   jusqu'au bord droit — pose le rythme de la frise, calme et élégant. */
.cal-month__title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 26px;
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: capitalize;
    letter-spacing: -0.02em;
    color: #14171d;
}

.cal-month__title::before {
    content: '';
    flex: 0 0 auto;
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: var(--cal-page-accent);
}

/* Filet décoratif à droite du titre : un dégradé qui s'estompe, pas un trait
   dur. */
.cal-month__title::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.10), rgba(15, 23, 42, 0));
}

.cal-month__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── État vide ────────────────────────────────────────────────────────────── */

.cal-empty {
    margin: 64px 0;
    padding: 64px 32px;
    text-align: center;
    background: #faf8f5;
    border: 1px dashed #ddd9d0;
    border-radius: 24px;
}

.cal-empty__title {
    margin: 0 0 10px;
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #313846;
}

.cal-empty__text {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .cal-page__container {
        padding: 0 16px 72px;
    }

    .cal-filters {
        gap: 18px 24px;
        padding: 32px 0 8px;
    }

    .cal-monthnav {
        top: 56px; /* en-tête mobile = 56px */
        margin: 22px -16px 8px;
        padding: 9px 16px;
    }

    .cal-month {
        padding-top: 44px;
        scroll-margin-top: 112px;
    }

    .cal-month__title {
        font-size: 1.3rem;
        gap: 12px;
    }

    .cal-month__title::before {
        width: 20px;
    }

    .cal-month__list {
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cal-chip,
    .cal-monthnav__link {
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}
