/*
 * Coalitieakkoord signature ("the archivist": cites the source, no opinion).
 * Load after kit.css + themes/coalitieakkoord.css.
 * Elements: archive record (catalogue card), seat bar (ink tones, parties as text), page strip (where in the
 * document a theme is), quote with page stamp, full text as numbered pages, coverage table.
 * Rule: no element encodes a party with colour. Order parties by seats, then alphabetically.
 */

/* ---------- Archive record: one ruled catalogue card instead of loose meta cards ---------- */
.ca-record { border-top: 2px solid var(--zs-ink); border-bottom: 1px solid var(--zs-ink); margin: 1.25rem 0 1.75rem; }
.ca-record dl { display: grid; grid-template-columns: 1fr; margin: 0; }
.ca-record dl > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--zs-line); }
.ca-record dl > div:last-child { border-bottom: 0; }
@media (min-width: 48rem) { .ca-record dl { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; } .ca-record dl > div:nth-last-child(2):nth-child(odd) { border-bottom: 0; } }
.ca-record dt { font-size: .85rem; color: var(--zs-muted); }
.ca-record dd { margin: 0; font-variant-numeric: tabular-nums; }
.ca-record__cite { overflow-wrap: anywhere; margin: 0; padding: .6rem 0; border-top: 1px solid var(--zs-line); font-size: .85rem; color: var(--zs-muted); }
.ca-record__cite span { color: var(--zs-ink); font-family: var(--zs-font-display); font-size: .95rem; }
.ca-status { display: inline-block; font-size: .85rem; background: var(--zs-highlight); color: var(--zs-highlight-ink); padding: .1rem .5rem; border-radius: var(--zs-radius-sm); }

/* ---------- Seat bar: coalition seats out of the council, ink tones only ----------
 * <div class="ca-seats" style="--total: 21; --majority: 11">  (majority = floor(total / 2) + 1, set by the server)  segments: <span style="--s: 6"></span> ... <span class="is-opposition" style="--s: 9"></span>
 */
.ca-seats__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .2rem 1rem; margin-bottom: .45rem; }
.ca-seats__head strong { font: 600 1.6rem/1 var(--zs-font-display); font-variant-numeric: tabular-nums; }
.ca-seats__head span { font-size: .9rem; color: var(--zs-muted); }
.ca-seats__bar { position: relative; display: flex; gap: 2px; height: 1.1rem; }
.ca-seats__bar > span { flex: var(--s) 1 0; min-width: 3px; background: var(--ca-seat); }
.ca-seats__bar > span:nth-child(even) { background: var(--ca-seat-alt); }
.ca-seats__bar > span:first-child { border-radius: 2px 0 0 2px; }
.ca-seats__bar > span.is-opposition { background: var(--ca-opposition); border-radius: 0 2px 2px 0; }
/* Majority line: half of the seats plus one. */
.ca-seats .ca-seats__bar::after { content: ""; position: absolute; top: -.3rem; bottom: -.3rem; left: calc(var(--majority) / var(--total) * 100%); border-left: 2px dashed var(--zs-ink); }
.ca-seats__parties { list-style: none; margin: .55rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; font-size: .92rem; }
.ca-seats__parties b { font-variant-numeric: tabular-nums; }
.ca-seats__note { font-size: .78rem; color: var(--zs-muted); margin: .35rem 0 0; }

/* ---------- Page strip: one tick per page, marked where this theme is quoted ----------
 * Also usable without .is-hit as a page index above a long full text (links to #pN).
 * <ol class="ca-pages" style="--n: 13"> <li><a href="#p1" aria-label="Pagina 1"></a></li> ... <li class="is-hit"> ...
 */
.ca-pages { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; max-width: 40rem; }
.ca-pages li { display: block; }
.ca-pages a { display: block; height: 1.1rem; background: var(--zs-line); border-radius: 1px; }
.ca-pages li.is-hit a { background: var(--zs-accent); }
.ca-pages a:hover, .ca-pages a:focus-visible { outline: 2px solid var(--zs-ink); outline-offset: 1px; }
.ca-pages__axis { display: flex; justify-content: space-between; max-width: 40rem; font-size: .75rem; color: var(--zs-muted); margin-top: .2rem; font-variant-numeric: tabular-nums; }

/* ---------- Theme block: summary, quotes with a page stamp ---------- */
.ca-theme { padding: 1.5rem 0; border-top: 1px solid var(--zs-line); }
.ca-theme h3 { font-size: 1.35rem; }
.ca-theme__summary { max-width: 66ch; margin: .6rem 0 1rem; }
.ca-label { font-size: .8rem; color: var(--zs-muted); margin: 0; }
.ca-quote { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; margin: 0 0 .7rem; padding: .1rem 0 .1rem 1rem; border-left: 2px solid var(--zs-line); max-width: 66ch; }
.ca-quote p { margin: 0; font-family: var(--zs-font-display); font-size: 1.05rem; line-height: 1.5; }
.ca-stamp { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--zs-accent); border: 1px solid currentColor; border-radius: var(--zs-radius-sm); padding: 0 .4rem; text-decoration: none; white-space: nowrap; line-height: 1.6; }
.ca-stamp:hover { background: var(--zs-accent); color: var(--zs-accent-ink); border-color: var(--zs-accent); }

/* ---------- Full text: numbered pages with the number in the margin (no accordion per page) ---------- */
.ca-fulltext { counter-reset: none; max-width: 48rem; }
.ca-page { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--zs-line); scroll-margin-top: 1rem; }
.ca-page__no { font: 600 .85rem/1.6 var(--zs-font-body); color: var(--zs-muted); font-variant-numeric: tabular-nums; position: sticky; top: .5rem; align-self: start; }
.ca-page:target { background: var(--zs-highlight); }
.ca-page__text { white-space: pre-line; font-size: .95rem; }
.ca-page mark { background: var(--zs-highlight); color: var(--zs-highlight-ink); }
@media (max-width: 30rem) { .ca-page { grid-template-columns: 1fr; gap: .2rem; } .ca-page__no { position: static; } }

/* ---------- Coverage: plain count with one ochre bar ---------- */
.ca-coverage { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ca-coverage th, .ca-coverage td { padding: .45rem 0; border-bottom: 1px solid var(--zs-line); text-align: left; }
.ca-coverage thead th { font-size: .8rem; font-weight: 600; color: var(--zs-muted); }
.ca-coverage td:last-child, .ca-coverage th:last-child { text-align: right; white-space: nowrap; padding-left: .75rem; width: 1%; }
.ca-coverage tbody th { font-weight: 400; padding-right: 1rem; white-space: nowrap; width: 1%; }
.ca-coverage__track { display: block; height: .55rem; min-width: 4rem; background: var(--zs-surface-alt); border-radius: 2px; }
.ca-coverage__track span { display: block; height: 100%; width: var(--w); background: var(--zs-accent); border-radius: 2px; }
