/* =========================================================================
   DS v4 — LEGISLATION DOSSIER — primary Acts + statutory instruments.
   The page is Guvnor's dossier ON an official document. The throughline:
   what it is → who it binds → what it requires → help complying → paper
   trail. Verbatim section titles link out BLUE (the link-colour promise
   does the voice-keeping); Guvnor's extraction and ranking stay teal.
   Consequence uses the severity ladder — labelled chips, never bare badges.
   Dark scope adapted [data-mode="dark"] → .dark.
   ========================================================================= */

/* ---- fact strip (replaces the "At a glance" box) ---------------------------- */
.lex-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 32px; margin-top: calc(32px * var(--rk)); padding: calc(24px * var(--rk)) 0; border-top: 1px solid var(--color-border-light); border-bottom: 1px solid var(--color-border-light); }
@media (max-width: 760px) { .lex-facts { grid-template-columns: 1fr; gap: 16px; } }
.lex-facts dt { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: var(--tracking-caps, 0.1em); text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 6px; }
.lex-facts dd { font-size: 15px; line-height: 24px; margin: 0; color: var(--color-text-primary); }
.lex-facts dd a { color: var(--color-link); font-weight: 600; text-decoration: none; }
.lex-facts dd a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.lex-facts .note { font-size: 13px; line-height: 20px; color: var(--color-text-muted); }
/* Curated prose sitting under the fact strip — currently the no-enforcer
   reason, which runs too long for a one-third grid cell. */
.lex-note { font-size: 13px; line-height: 20px; color: var(--color-text-muted); margin: 12px 0 0; max-width: var(--measure); }

/* ---- severity ladder chips (labelled — never colour alone) ------------------ */
.sev { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--border-radius-pill); padding: 2px 10px; font-size: 12px; line-height: 16px; font-weight: 650; white-space: nowrap; }
.sev svg { width: 12px; height: 12px; flex: none; }
.sev--info { background: color-mix(in srgb, #6b7c93 12%, transparent); color: #4d5d73; }
.sev--warn { background: color-mix(in srgb, #f59e0b 14%, transparent); color: #92590a; }
.sev--crit { background: color-mix(in srgb, #d4351c 10%, transparent); color: #b3261a; }
.dark .sev--info { background: color-mix(in srgb, #94a7bd 22%, transparent); color: #b9c6d6; }
.dark .sev--warn { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #fcd34d; }
.dark .sev--crit { background: color-mix(in srgb, #ef4444 22%, transparent); color: #fca5a5; }

/* ---- actor chips ("does this bind you?") ------------------------------------ */
.actors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: calc(16px * var(--rk)); }
.actor-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: var(--border-radius-pill); background: var(--color-bg-white); border: 1px solid var(--color-border-light); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--color-text-primary); }
.actor-chip .n { font-size: 12px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; font-weight: 650; }
.actors-note { font-size: 13px; line-height: 20px; color: var(--color-text-muted); margin-top: 10px; max-width: var(--measure); }

/* ---- provisions: part groups + section rows ---------------------------------- */
.part-head { display: flex; align-items: baseline; gap: 12px; margin-top: calc(40px * var(--rk)); }
.part-head:first-of-type { margin-top: calc(20px * var(--rk)); }
.part-head .lbl { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: var(--tracking-caps, 0.1em); text-transform: uppercase; color: var(--color-text-muted); white-space: nowrap; }
.part-head h3 { font-family: var(--font-heading); font-size: 20px; line-height: 24px; letter-spacing: -0.01em; font-weight: 600; margin: 0; }
.part-head .n { margin-left: auto; font-size: 13px; line-height: 20px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.provs { border-top: 1px solid var(--color-border-light); margin-top: calc(12px * var(--rk)); }
.prov { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 4px 16px; padding: calc(16px * var(--rk)) 0; border-bottom: 1px solid var(--color-border-light); align-items: baseline; }
.prov .ref { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 20px; color: var(--color-text-muted); white-space: nowrap; }
.prov .ttl { font-size: 15px; line-height: 24px; font-weight: 650; }
.prov .ttl a { color: #1d70b8; text-decoration: none; }
.prov .ttl a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.dark .prov .ttl a { color: var(--official-blue-on-dark, #7fb3e8); }
.prov .sev { justify-self: end; }
.prov .duties { grid-column: 2; margin: 2px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.prov .duties li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }
.prov .duties .who { font-size: 12px; line-height: 16px; font-weight: 650; color: var(--color-text-muted); background: var(--color-bg-elevated); border-radius: var(--border-radius-pill); padding: 1px 8px; white-space: nowrap; }
.prov .quiet { grid-column: 2; font-size: 12px; line-height: 16px; color: var(--color-text-muted); margin: 4px 0 0; }
.prov .quiet a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.prov .quiet a:hover { color: var(--color-link); }
@media (max-width: 640px) { .prov { grid-template-columns: minmax(0,1fr) auto; } .prov .ref { grid-column: 1 / -1; } .prov .duties, .prov .quiet { grid-column: 1; } }

/* folded procedural / definitional rows */
.prov-fold { border-bottom: 1px solid var(--color-border-light); }
.prov-fold summary { list-style: none; cursor: pointer; user-select: none; padding: calc(12px * var(--rk)) 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: var(--tracking-caps, 0.1em); text-transform: uppercase; color: var(--color-text-muted); display: flex; align-items: center; gap: 8px; }
.prov-fold summary::-webkit-details-marker { display: none; }
.prov-fold summary:hover { color: var(--color-text-primary); }
.prov-fold summary .caret { width: 14px; height: 14px; transition: transform var(--transition-base); flex: none; }
.prov-fold[open] summary .caret { transform: rotate(180deg); }
.prov-fold .prov { border-bottom: 0; border-top: 1px solid var(--color-border-light); }
.prov-fold .prov .ttl { font-weight: 500; }

/* ---- connected legislation rows ---------------------------------------------- */
.lex-rel { display: flex; flex-direction: column; margin-top: calc(16px * var(--rk)); }
.lex-rel > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: calc(14px * var(--rk)) 0; border-top: 1px solid var(--color-border-light); }
.lex-rel > div:first-child { border-top: 0; }
.lex-rel a { color: var(--color-link); font-size: 15px; line-height: 24px; font-weight: 600; text-decoration: none; }
.lex-rel a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.lex-rel .yr { font-size: 13px; line-height: 20px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.lex-rel .badge { margin-left: auto; }
@media print { .prov { break-inside: avoid; } }
