/*
 * voter2027.fr — the candidates' public agenda: /calendrier "Prochains rendez-vous publics" and the
 * fiche's "Agenda" section (templates/partials/agenda-*.php). Tokens only (base.css), so light and
 * dark come from the same variables. Rows are hairline-separated like every list on the site; the
 * same row shape for every candidate.
 */

.ag-sec { margin: var(--space-6) 0 var(--space-5); }
.ag-sec .sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4); }
.ag-note { margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: 0.9375rem; }
.ag-cal-link { font-size: 0.9375rem; }

/* ---- filters */
.ag-filters { display: grid; gap: var(--space-3); margin: 0 0 var(--space-3); }
.ag-chips { display: flex; gap: var(--space-2); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 2px 0 6px; margin: 0; -webkit-overflow-scrolling: touch; }
.ag-chips .chip { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; text-decoration: none; font-size: 0.9375rem; }
.ag-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3) var(--space-5); }
.ag-media-toggle { flex: 0 0 auto; }
.ag-near { display: grid; gap: 6px; min-width: 0; flex: 1 1 18rem; }
.ag-near[hidden] { display: none; }
.ag-near-l { font-size: var(--fs-1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }
.ag-near-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ag-near-input { flex: 1 1 10rem; min-width: 0; width: auto; }
.ag-near-radius { flex: 0 0 auto; width: auto; }
.ag-near-clear { flex: 0 0 auto; min-height: 44px; }
.ag-near-note, .ag-near-err { margin: 0; font-size: var(--fs-1); color: var(--color-text-muted); }
.ag-near-err { color: var(--color-badge-1); }
.ag-kinds { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 32rem; }
.ag-kinds .segbtn { font-size: 0.9375rem; min-height: 44px; }
.ag-media-note { margin: 0 0 var(--space-3); font-size: var(--fs-1); color: var(--color-text-muted); }
.ag-media-note[hidden] { display: none; }

/* ---- the list: day heading, then rows */
.ag-days { list-style: none; margin: 0; padding: 0; }
.ag-day { margin: 0; padding: 0; }
.ag-day[hidden], .ag-row[hidden] { display: none; }
.ag-day-h { margin: var(--space-4) 0 0; padding: var(--space-2) 0 6px; border-bottom: 1px solid var(--color-rule, var(--color-text)); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.ag-list { list-style: none; margin: 0; padding: 0; }
.ag-row { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); gap: 2px var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider); }
.ag-when { margin: 0; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; line-height: 1.4; }
.ag-notime { display: block; font-size: var(--fs-1); font-weight: 400; color: var(--color-text-muted); line-height: 1.3; }
.ag-body { min-width: 0; }
.ag-body p { margin: 0; overflow-wrap: anywhere; }
.ag-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ag-cand { font-weight: 600; color: var(--color-text); text-decoration: none; }
.ag-cand:hover { text-decoration: underline; }
.ag-title { margin-top: 4px !important; line-height: 1.4; }
.ag-where { margin-top: 2px !important; font-size: 0.9375rem; color: var(--color-text-muted); }
.ag-links { display: flex; flex-wrap: wrap; gap: 4px var(--space-4); margin-top: 6px !important; }
.ag-links a { font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.ag-missing { margin-top: 4px !important; font-size: var(--fs-1); color: var(--color-badge-2); }
.ag-src { margin-top: 4px !important; font-size: var(--fs-1); color: var(--color-text-muted); }
.ag-src a { color: var(--color-text-muted); }
.ag-status { background: none; border: 1px dotted var(--color-badge-2); color: var(--color-badge-2); }
.ag-status-annule { border: 1px dashed var(--color-badge-1); color: var(--color-badge-1); }
.is-cancelled .ag-title { text-decoration: line-through; text-decoration-thickness: 1px; }

.ag-empty { margin: var(--space-3) 0; color: var(--color-text-muted); }
.ag-empty[hidden] { display: none; }
.ag-none { margin: var(--space-4) 0 var(--space-3); font-size: 0.9375rem; }
.ag-none-l { color: var(--color-text-muted); }
.ag-none-fiche { margin-top: 0; }
.ag-sec .rule { margin-top: var(--space-4); }

/* ---- fiche: the last 30 days, folded */
.ag-recent { margin: var(--space-4) 0 var(--space-2); border-top: 1px solid var(--color-divider); }
.ag-recent > summary { padding: var(--space-3) 32px var(--space-3) 0; }
.ag-recent > summary::after { content: "+"; position: absolute; right: 4px; top: var(--space-3); font-size: 1.25rem; line-height: 1; color: var(--color-text-muted); }
.ag-recent[open] > summary::after { content: "×"; }
.ag-recent .ag-day-h { font-size: 1rem; }

/* ---- fiche figures strip */
.fi-agenda-date { display: block; font-size: 1.0625rem; line-height: 1.3; }

@media (min-width: 44rem) {
  .ag-chips { flex-wrap: wrap; overflow: visible; }
  .ag-row { grid-template-columns: 6rem minmax(0, 1fr); }
  .ag-day-h { font-size: 1.1875rem; }
}

/* The figures strip gains one cell. From a 40rem-wide strip (fiche.css: four columns on two rows) it takes
   its own full row below them rather than squeezing an eighth column in. */
@container (min-width: 40rem) {
  .fi-score .fi-cell-agenda { grid-column: 1 / -1; }
}
