/* =====================================================================
   THE PUBLIC LEDGER — responsive.css
   Layouts are recomposed per range, not merely scaled down.
   ===================================================================== */

/* ---------- ≤ 1360: quick navigation trimmed ---------- */
@media (max-width: 1360px) {
  .quicknav li.q-opt { display: none; }
}

/* ---------- ≤ 1180 ---------- */
@media (max-width: 1180px) {
  .quicknav { display: none; }
  .section-flag { display: block; }
  .site-index__list { grid-template-columns: repeat(2, 1fr); }
  .record-ledger__head, .record-ledger li { grid-template-columns: 56px 120px minmax(0, 1fr) 160px; gap: 18px; }
  .fact-strip dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fact-strip dl > div:nth-child(4) { border-left: 0; padding-left: 0; }
  .fact-strip dl > div:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .fact-strip dl > div:nth-child(5) { grid-column: span 2; }
  .home-field { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .home-field > :last-child { grid-column: 1 / -1; }
  .work-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-kind:nth-child(2) { border-right: 0; }
  .work-kind:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend div:nth-child(2) { border-right: 0; }
  .legend div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .theme { grid-template-columns: 64px minmax(0, 1fr); }
  .theme__evidence { grid-column: 2; border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 20px; }
  .transcript { grid-template-columns: 140px minmax(0, 1fr); }
  .transcript__side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .news-front { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .news-front > *:first-child { grid-column: 1 / -1; padding-right: 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .news-front > *:nth-child(2) { padding-left: 0; }
}

/* ---------- ≤ 1024 (tablet landscape) ---------- */
@media (max-width: 1024px) {
  :root { --header-h: 62px; }
  .site-index__inner { grid-template-columns: 1fr; gap: 28px; }
  .home-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .current-file { grid-template-columns: 1fr; }
  .dossier-head__grid { grid-template-columns: 1fr; gap: 32px; }
  .dossier-idcard { max-width: 560px; }
  .dossier-body { grid-template-columns: 1fr; }
  .dossier-toc { position: static; }
  .dossier-toc ol { display: flex; flex-wrap: wrap; gap: 0 4px; border-left: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .dossier-toc a { padding: 6px 10px 6px 0; border-left: 0; }
  .dossier-toc a:hover, .dossier-toc a.is-active { border-left: 0; }
  .eng-hero__grid { grid-template-columns: 1fr; }
  .report-body { grid-template-columns: 1fr; }
  .tor { position: static; }
  .geo-hero__grid { grid-template-columns: 1fr; }
  .geo-map { max-width: 720px; }
  .parl-split { grid-template-columns: 1fr; }
  .parl-split .plate { max-width: 520px; }
  .volumes { grid-template-columns: 1fr; }
  .volume, .volume + .volume { padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .volume:last-child { border-bottom: 0; }
  .volume__no { font-size: 56px; }
  .issue-archive { grid-template-columns: 220px minmax(0, 1fr); }
  .reel > li { grid-template-columns: 1fr; gap: 16px; }
  .reel .aside { max-width: 560px; }
  .book-feature { grid-template-columns: 1fr; }
  .writing-cols { grid-template-columns: 1fr; }
  .speech-hero { grid-template-columns: 1fr; }
  .speech-hero .plate { max-width: 560px; }
  .fig { grid-template-columns: 1fr; }
  .fig .plate { max-width: 560px; }
  .contact-grid { grid-template-columns: 1fr; }
  .slip { position: static; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .news-section { grid-template-columns: 1fr; gap: 20px; }
  .news-section__name { position: static; }
}

/* ---------- ≤ 900 ---------- */
@media (max-width: 900px) {
  .record-ledger li.record-ledger__head { display: none; }
  .record-ledger li { grid-template-columns: 96px minmax(0, 1fr); gap: 6px 20px; padding: 20px 0; }
  .record-ledger .entry { grid-column: 1 / -1; }
  .record-ledger .year { grid-row: span 2; }
  .record-ledger .ref { grid-column: 2; }
  .report-cover dl { grid-template-columns: 1fr; }
  .report-cover dl div + div { padding-left: 0; border-left: 0; border-top: 1px solid rgba(241, 235, 221, .25); margin-top: 14px; }
  .landscape-notes { grid-template-columns: 1fr; }
  .landscape-notes article, .landscape-notes article + article { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--rule-dark); }
  .q-list li { grid-template-columns: 1fr; gap: 10px; }
  .journal-cols { columns: 1; }
  .issue-archive { grid-template-columns: minmax(0, 1fr); }
  .issue-tabs { min-width: 0; }
  .issue-tabs { border-right: 0; border-bottom: 1px solid var(--ink); }
  .issue-tabs [role="tablist"] { flex-direction: row; overflow-x: auto; scrollbar-width: thin; }
  .issue-tab { flex: 0 0 auto; grid-template-columns: auto; border-bottom: 0; border-right: 1px solid var(--rule); padding: 14px 16px; white-space: nowrap; }
  .issue-tab .n { display: none; }
  .issue-panel { padding: 28px 0; }
  .engagement { grid-template-columns: 1fr; }
  .engagement__date { border-right: 0; border-bottom: 1px solid var(--rule); padding: 20px 0 16px; }
  .engagement__body { padding: 20px 0 32px; }
  .repo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repo-stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .repo-stats div:nth-child(n+3) { border-top: 1px solid var(--rule-strong); }
  .g-row--a, .g-row--c { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: 1fr; }
  .archive-grid .archive-photo { max-width: 300px; order: -1; }
}

/* ---------- ≤ 768 (tablet portrait / large phones) ---------- */
@media (max-width: 768px) {
  .home-hero__grid { grid-template-columns: 1fr; }
  .home-hero__plate { max-width: 460px; }
  .home-hero__plate .coord--r { display: none; }
  .fact-strip dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-strip dl > div { padding: 18px 16px 18px 16px; }
  .fact-strip dl > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .fact-strip dl > div:nth-child(4) { border-left: 1px solid var(--rule); padding-left: 16px; }
  .fact-strip dl > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .fact-strip dl > div:nth-child(5) { grid-column: 1 / -1; }
  .contents-dir { grid-template-columns: 1fr; }
  .plate-row { flex-direction: column; gap: 32px; }
  .plate-row > .plate { flex: none; width: 100%; }
  .home-field { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .fields div:nth-child(odd) { border-right: 0; }
  .fields div:nth-child(even) { padding-left: 0; }
  .spec-row { grid-template-columns: 1fr; }
  .spec-row > * { padding: 14px 16px; }
  .spec-row > * + * { border-left: 0; }
  .spec-row .code { padding-bottom: 0; }
  .spec-row h3 { padding-top: 6px; padding-bottom: 0; }
  .tenure__scale { margin-left: 0; }
  .tenure__row { grid-template-columns: 1fr; }
  .tenure__row .who { padding: 12px 0 0; }
  .tenure__track { height: 48px; }
  .tenure__bar { top: 10px; }
  .tenure__bar { padding: 0 5px; }
  .tenure__bar .l { display: none; }
  .tenure__bar .s { display: inline; }
  .work-kinds { grid-template-columns: 1fr; }
  .work-kind { border-right: 0; border-bottom: 1px solid var(--rule); }
  .work-kind:last-child { border-bottom: 0; }
  .legend { grid-template-columns: 1fr; }
  .legend div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .legend div:last-child { border-bottom: 0; }
  .abstract { grid-template-columns: 1fr; gap: 10px; }
  .theme { grid-template-columns: 1fr; gap: 14px; }
  .theme__evidence { grid-column: 1; }
  .theme__no { font-size: 44px; }
  .issue-fields { grid-template-columns: 1fr; }
  .issue-fields dt { border-bottom: 0; padding-bottom: 0; }
  .transcript { grid-template-columns: 1fr; gap: 12px; }
  .transcript__side { grid-column: 1; }
  .engagement dl.kv, .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .biblio div { grid-template-columns: 1fr; }
  .biblio dt { padding-bottom: 0; }
  .contents-page li { grid-template-columns: 1fr; }
  .news-front { grid-template-columns: 1fr; }
  .news-front > * { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .news-front > *:last-child { border-bottom: 0; }
  .news-grid { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; gap: 24px; }
  .footer__top { grid-template-columns: 1fr; gap: 36px; padding-top: 56px; }
  .committee-table thead { display: none; }
  .committee-table, .committee-table tbody, .committee-table tr, .committee-table td { display: block; width: 100%; }
  .committee-table tr { border-bottom: 1px solid var(--rule); padding: 16px 0; }
  .committee-table td { border: 0; padding: 4px 0; }
  .committee-table td:first-child { width: auto; }
  .ledger--stack thead { display: none; }
  .ledger--stack, .ledger--stack tbody, .ledger--stack tr, .ledger--stack td { display: block; width: 100%; }
  .ledger--stack tr { border-bottom: 1px solid var(--rule); padding: 14px 0; }
  .ledger--stack td { border: 0; padding: 3px 0; }
  .ledger--stack td[data-th]::before { content: attr(data-th); display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate-ink); margin-top: 6px; }
  .controls { flex-direction: column; align-items: stretch; }
  .doc-table { min-width: 0; }
  .geo-map, .coord-plot { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .geo-map svg { min-width: 640px; }
  .coord-plot svg { min-width: 700px; }
  .diagram-scroll-hint { display: block; }
  .doc-table thead { display: none; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table tr { border-bottom: 1px solid var(--rule); padding: 16px 0; }
  .doc-table td { border: 0; padding: 3px 0; }
  .doc-table td.num::before { content: "Date · "; font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-ink); }
  .doc-table .doc-actions { margin-top: 10px; }
  .search { min-width: 0; }
}

/* ---------- ≤ 560 (phones) ---------- */
@media (max-width: 560px) {
  :root { --header-h: 58px; }
  .brand__sub { display: none; }
  .brand__name { font-size: 19px; }
  .brand__mark { width: 32px; height: 32px; font-size: 17px; }
  .section-flag { display: none; }
  .masthead__bar { gap: 12px; justify-content: space-between; }
  .index-toggle { padding: 0 12px; }
  .index-toggle .txt { display: none; }
  .index-toggle { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .site-index__list { grid-template-columns: 1fr; }
  .site-index__title { font-size: 32px; }
  .site-index__inner { padding-top: 24px; }
  .display { font-size: clamp(50px, 16vw, 72px); }
  .home-hero__title .display span:last-child { padding-left: .3em; }
  .home-hero__meta { margin-bottom: 24px; }
  .fact-strip dl { grid-template-columns: 1fr; }
  .fact-strip dl > div, .fact-strip dl > div:nth-child(4) { border-left: 0 !important; padding: 14px 0 !important; border-top: 1px solid var(--rule); }
  .fact-strip dl > div:first-child { border-top: 0; }
  .fact-strip dl > div:nth-child(5) { grid-column: auto; }
  .record-ledger li { grid-template-columns: 1fr; }
  .record-ledger .year { grid-row: auto; }
  .record-ledger .ref { grid-column: 1; }
  .contents-dir a { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .dossier-idcard div { grid-template-columns: 1fr; }
  .dossier-idcard dt { border-right: 0; padding-bottom: 0; }
  .dossier-section__head { grid-template-columns: 1fr; gap: 6px; }
  .archive-sheet::before { display: none; }
  .report-cover__sheet { padding: 28px 18px; }
  .paras > li { grid-template-columns: 1fr; gap: 4px; }
  .geo-coords { grid-template-columns: 1fr; }
  .geo-coords div:nth-child(even) { padding-left: 0; border-left: 0; }
  .segments { grid-template-columns: 1fr 1fr; }
  .segments .nm { font-size: 20px; }
  .journal-mast__row { grid-template-columns: 1fr; text-align: center; }
  .journal-mast__row .label:last-child { text-align: center; }
  .repo-stats dd { font-size: 28px; }
  .g-item figcaption { grid-template-columns: 1fr; gap: 4px; }
  .plate figcaption { grid-template-columns: 1fr; gap: 4px; }
  .editorial-note { grid-template-columns: 1fr; gap: 8px; }
  .record-marker { font-size: 10px; letter-spacing: .1em; }
  .record-marker > span, .record-marker > li { padding: 5px 8px; }
  .footer__links { columns: 1; }
  .footer__base { flex-direction: column; align-items: flex-start; }
  .lightbox { padding: 10px; }
  .lightbox__top .label { display: none; }
}

/* ---------- ≤ 380 ---------- */
@media (max-width: 380px) {
  .brand__name { font-size: 17px; }
  .brand { gap: 9px; }
  .segments { grid-template-columns: 1fr; }
  .h1 { font-size: 38px; }
  .btn { padding: 0 16px; letter-spacing: .08em; }
}

/* ---------- Print ---------- */
@media print {
  .masthead, .footer, .skip-link, .controls, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
  .surface-graphite, .surface-petrol, .surface-carbon { background: #fff !important; color: #000 !important; }
  a { color: #000; }
}

/* Gallery rows: keep equal-height rows on tablets, stack on phones */
@media (max-width: 600px) {
  .g-flex { flex-direction: column; gap: 32px; margin-bottom: 32px; }
  .g-flex > .g-item { flex: none; width: 100%; }
}
