/* Agenda public : cartes compactes colorées par type. Chargée après directory.css.
   Hiérarchie d'une carte : type et heure, titre, commune, description en très petit, site source. */

.agenda-page { --agenda-ink: #22302a; --agenda-muted: #66736b; --agenda-line: #e3e8e4; }
.agenda-heading { margin-bottom: .35rem; }
.agenda-lead { color: var(--agenda-muted); margin-bottom: 1.4rem; }

/* Teintes par type : --tone sert au liseré et au texte de la pastille (contraste AA sur --tint). */
.agenda-tone-none { --tone: #176a57; --tint: #e7f1ec; }
.agenda-tone-market { --tone: #b4470f; --tint: #fbeadf; }
.agenda-tone-local_festivity { --tone: #b0275f; --tint: #fbe6ee; }
.agenda-tone-festival { --tone: #7a2fb3; --tint: #f1e7f8; }
.agenda-tone-concert { --tone: #4a3fbf; --tint: #ebe9fa; }
.agenda-tone-show { --tone: #9c2a8f; --tint: #f7e6f4; }
.agenda-tone-exhibition { --tone: #0e6f68; --tint: #e0f2f0; }
.agenda-tone-conference { --tone: #1f55b8; --tint: #e5edfa; }
.agenda-tone-workshop { --tone: #0b6688; --tint: #e1f0f6; }
.agenda-tone-sport { --tone: #2f7a2c; --tint: #e6f3e4; }
.agenda-tone-game { --tone: #8a5a00; --tint: #f8efd9; }
.agenda-tone-civic { --tone: #4b5866; --tint: #eceff2; }
.agenda-tone-professional { --tone: #5c534c; --tint: #efecea; }

/* Périodes : boutons-liens (vraies pages), l'actif en vert plein. */
.agenda-periods { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 1rem; }
.agenda-period { border: 1px solid #176a57; border-radius: 999px; color: #176a57; font-size: .85rem; font-weight: 650; padding: .35rem .95rem; }
.agenda-period:hover, .agenda-period:focus-visible { background: #e7f1ec; color: #104c40; }
.agenda-period.is-active { background: #176a57; color: #fff; }
.agenda-warning { max-width: 60rem; }

/* Filtres sur une ligne, puis pastilles de types (légende des couleurs et filtre en un clic). */
.agenda-filters { align-items: end; display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1rem; }
.agenda-filter { min-width: 150px; }
.agenda-filter .label { color: var(--agenda-muted); font-size: .72rem; font-weight: 600; letter-spacing: .02em; margin-bottom: .25rem; text-transform: uppercase; }
.agenda-filter .select, .agenda-filter .select select { width: 100%; }
.agenda-filter-submit { background: #176a57; border: 0; color: #fff; font-weight: 650; }
.agenda-filter-submit:hover, .agenda-filter-submit:focus-visible { background: #104c40; color: #fff; }

.agenda-types { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.8rem; }
.agenda-type-chip { background: var(--tint); border: 1px solid transparent; border-radius: 999px; color: var(--tone); font-size: .76rem; font-weight: 600; padding: .25rem .7rem; }
.agenda-type-chip::before { background: var(--tone); border-radius: 50%; content: ""; display: inline-block; height: .5rem; margin-right: .4rem; vertical-align: .05rem; width: .5rem; }
.agenda-type-chip:hover { border-color: var(--tone); color: var(--tone); }
.agenda-type-chip.is-active { background: var(--tone); color: #fff; }
.agenda-type-chip.is-active::before { background: #fff; }
.agenda-type-count { font-variant-numeric: tabular-nums; font-weight: 500; margin-left: .15rem; opacity: .75; }
/* Filtre Alpine : rien ne s'affiche avant l'initialisation pour ce qui en dépend. */
[x-cloak] { display: none !important; }

/* Jours : intertitre sobre, date en petit. */
.agenda-day { margin-bottom: 2rem; }
.agenda-day-title { border-bottom: 1px solid var(--agenda-line); color: var(--agenda-ink); font-size: 1.15rem; font-weight: 700; margin-bottom: .9rem; padding-bottom: .35rem; }
.agenda-day-title small { color: var(--agenda-muted); font-size: .8rem; font-weight: 500; margin-left: .4rem; }
.agenda-now { background: #f1f5f2; border-radius: 12px; padding: 1rem 1rem .4rem; }
.agenda-now .agenda-day-title { border-bottom-color: #dbe4dd; }

/* Grille automatique : environ 5 cartes en grand écran, 4 en bureau, 3 en tablette, 1 sur mobile. */
/* align-items: start : chaque carte garde sa hauteur naturelle, sans blanc sous les cartes courtes. */
.agenda-grid { align-items: start; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: .6rem; }

.agenda-card { background: #fff; border: 1px solid var(--agenda-line); border-left: 4px solid var(--tone); border-radius: 8px;
    display: flex; flex-direction: column; gap: .3rem; min-width: 0; overflow-wrap: anywhere; padding: .65rem .75rem .6rem;
    position: relative; transition: box-shadow .15s ease, transform .15s ease; }
.agenda-card:hover, .agenda-card:focus-within { box-shadow: 0 6px 18px rgba(34, 48, 42, .1); transform: translateY(-2px); }
.agenda-card-top { align-items: center; display: flex; flex-wrap: wrap; gap: .35rem .5rem; justify-content: space-between; }
.agenda-type { background: var(--tint); border-radius: 999px; color: var(--tone); font-size: .66rem; font-weight: 700;
    letter-spacing: .02em; line-height: 1.5; padding: .05rem .5rem; text-transform: uppercase; }
.agenda-when { color: var(--agenda-ink); font-size: .74rem; font-variant-numeric: tabular-nums; font-weight: 600; }

.agenda-title { font-size: .95rem; font-weight: 700; line-height: 1.3; margin: .1rem 0 0; }
.agenda-title, .agenda-place, .agenda-description { -webkit-box-orient: vertical; display: -webkit-box; overflow: hidden; }
.agenda-title { -webkit-line-clamp: 3; line-clamp: 3; }
.agenda-link { color: var(--agenda-ink); }
.agenda-link:hover { color: var(--tone); }
/* Toute la carte est cliquable, sans imbriquer de lien. */
.agenda-link::after { content: ""; inset: 0; position: absolute; }
.agenda-link:focus-visible { outline: none; }
.agenda-card:has(.agenda-link:focus-visible) { outline: 2px solid var(--tone); outline-offset: 2px; }

.agenda-place { font-size: .78rem; line-height: 1.35; -webkit-line-clamp: 2; line-clamp: 2; }
.agenda-city { color: var(--agenda-ink); font-weight: 600; }
.agenda-city::before { color: var(--tone); content: "●"; font-size: .55rem; margin-right: .3rem; vertical-align: .1rem; }
.agenda-location { color: var(--agenda-muted); }
.agenda-description { color: var(--agenda-muted); font-size: .7rem; line-height: 1.4; -webkit-line-clamp: 2; line-clamp: 2; }
.agenda-site { color: #6f7b74; font-size: .66rem; overflow: hidden; padding-top: .15rem; text-overflow: ellipsis; white-space: nowrap; }

.agenda-more { margin: 1rem 0; text-align: center; }
.agenda-note { color: var(--agenda-muted); font-size: .76rem; margin-top: 1.2rem; }

/* Mobile et tablette : « En ce moment » en bandeau horizontal, pour ne pas repousser les événements du jour. */
@media (max-width: 768px) {
    .agenda-now > .agenda-grid { grid-auto-columns: minmax(230px, 78%); grid-auto-flow: column; grid-template-columns: none;
        overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
    .agenda-now .agenda-card { scroll-snap-align: start; }
    .agenda-types { flex-wrap: nowrap; margin-left: -.25rem; overflow-x: auto; padding: 0 .25rem .4rem; }
    .agenda-type-chip { flex: none; white-space: nowrap; }
}
@media (max-width: 480px) {
    .agenda-filter { flex: 1 1 140px; min-width: 0; }
    .agenda-now { padding: .8rem .7rem .2rem; }
}
