/* The Trench Times: a broadsheet printed on black newsprint, red and cream ink. */
:root {
  --paper: #121212;
  --ink: #ede3cf;
  --ink-dim: #a49b88;
  --ink-faint: #5d574c;
  --red: #e5322d;
  --red-dim: #8f2320;
  --rule: rgba(229, 50, 45, 0.85);
  --hair: rgba(237, 227, 207, 0.22);
  --name: "Pirata One", "UnifrakturCook", serif;
  --head: "Archivo", "Arial Narrow", sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --gutter: 20px;
  --maxw: 1720px;
}
* { box-sizing: border-box; }
html { font-synthesis: none; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper) url("/art/web/paper.jpg") repeat; background-size: 512px 512px;
  color: var(--ink); font: 16px/1.5 var(--body); font-variation-settings: "wdth" 100;
  cursor: url("/art/web/cursor.png") 2 30, auto;
  overflow-x: hidden;
}
body.no-tile { background-image: none; }
a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; cursor: url("/art/web/cursor.png") 2 30, pointer; }
button, [role="button"] { cursor: url("/art/web/cursor.png") 2 30, pointer; font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.mono { font-family: var(--mono); }
.dim { color: var(--ink-dim); }
.red { color: var(--red); }
b { font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- the newsstand strip (archive) ---- */
.newsstand { border-bottom: 1px solid var(--rule); background: rgba(0, 0, 0, 0.35); }
.newsstand .inner { max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gutter) 0; display: flex; align-items: flex-end; gap: 10px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--red-dim) transparent; }
.newsstand .label { font-family: var(--mono); font-size: 13px; color: var(--red); letter-spacing: 0.08em; text-transform: uppercase; flex: 0 0 auto; padding-bottom: 12px; padding-right: 6px; white-space: nowrap; }
.stand { flex: 0 0 auto; background: none; border: 0; padding: 4px 6px 8px; display: grid; justify-items: center; gap: 2px; min-width: 92px; min-height: 48px; color: var(--ink-dim); transition: transform 0.18s; }
.stand img { width: 64px; height: 57px; object-fit: contain; }
.stand .d { font-family: var(--mono); font-size: 13px; line-height: 1.2; white-space: nowrap; }
.stand .n { font-family: var(--head); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.stand[aria-current="true"] { color: var(--ink); transform: translateY(-6px); }
.stand[aria-current="true"] .n { color: var(--red); }
.stand:hover { transform: translateY(-4px); }
.stand.extra .n { color: var(--red); }
.newsstand .empty { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); padding-bottom: 14px; white-space: nowrap; }

/* ---- masthead ---- */
.masthead { max-width: var(--maxw); margin: 0 auto; padding: 18px var(--gutter) 10px; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr) minmax(200px, 1fr); gap: 20px; align-items: stretch; }
.ear { border: 1px solid var(--rule); padding: 10px 12px; display: grid; gap: 6px; align-content: start; min-height: 120px; }
.ear h2 { margin: 0; font-family: var(--head); font-variation-settings: "wdth" 70, "wght" 800; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.ear p { margin: 0; font-size: 14px; line-height: 1.35; }
.ear-left { grid-template-columns: 96px 1fr; grid-template-rows: auto auto 1fr auto; column-gap: 14px; }
.ear-left h2 { grid-column: 2; }
.ear-left .plate { grid-row: 1 / 5; grid-column: 1; align-self: center; width: 96px; height: 96px; object-fit: contain; }
.ear-left .next { grid-column: 2; align-self: end; font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
.ear-left p { grid-column: 2; }
.ear-left .extra-seal { grid-column: 2; justify-self: start; }
.extra-seal { border: 2px solid var(--red); background: var(--red); color: #111; font-family: var(--head); font-variation-settings: "wdth" 62, "wght" 900; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 12px; min-height: 36px; transform: rotate(-3deg); }
.extra-seal:hover { transform: rotate(-3deg) scale(1.05); }
.nameplate { text-align: center; display: grid; justify-items: center; align-content: center; gap: 4px; min-width: 0; }
.nameplate .row { display: flex; align-items: flex-end; justify-content: center; gap: 14px; min-width: 0; max-width: 100%; }
.nameplate h1 { margin: 0; font-family: var(--name); font-weight: 400; color: var(--red); font-size: clamp(44px, 6.4vw, 118px); line-height: 1.25; letter-spacing: 0.01em; white-space: nowrap; }
.nameplate .rat { width: clamp(56px, 6.5vw, 110px); height: auto; flex: 0 0 auto; }
.nameplate .motto { margin: 0; font-family: var(--head); font-variation-settings: "wdth" 75, "wght" 600; font-size: clamp(12px, 1vw, 15px); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-dim); }
.idle { position: relative; overflow: hidden; }
.idle img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.idle img.on { opacity: 1; }
.ear-right { grid-template-columns: 1fr; }
.card { display: grid; gap: 6px; }
.card .line { font-family: var(--mono); font-size: 14px; }
.card .line b { color: var(--ink); }
.btn { border: 1px solid var(--ink); background: transparent; color: var(--ink); font-family: var(--head); font-variation-settings: "wdth" 75, "wght" 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 14px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; transition: transform 0.12s, background 0.12s; }
.btn:hover { background: rgba(237, 227, 207, 0.08); }
.btn:active { transform: translateY(2px); }
.btn.red { border-color: var(--red); color: var(--red); }
.btn.solid { background: var(--red); border-color: var(--red); color: #111; }
.btn.solid:hover { background: #f04b46; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn img { width: 20px; height: 20px; object-fit: contain; }
.btn.small { min-height: 40px; padding: 6px 10px; font-size: 13px; }
.stand-btn { display: none; }

/* ---- dateline ---- */
.dateline { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.dateline .inner { border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule); padding: 6px 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 18px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.dateline .inner > span { white-space: nowrap; }
.wire { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; text-transform: none; letter-spacing: 0; }
.wire img { width: 16px; height: 16px; }
.wire[aria-disabled="true"] { color: var(--ink-dim); }
.wire[aria-disabled="true"] img { opacity: 0.5; }

/* ---- the page ---- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 14px var(--gutter) 40px; }
.notice { border: 1px solid var(--rule); padding: 14px 16px; font-family: var(--mono); font-size: 14px; display: grid; gap: 8px; }
.notice b { color: var(--red); }
.pageone { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr); gap: 0 28px; position: relative; }
.pageone > * { min-width: 0; }
.pageone .col-l { border-right: 1px solid var(--hair); padding-right: 24px; }
.pageone .col-r { border-left: 1px solid var(--hair); padding-left: 24px; }
.kicker { font-family: var(--head); font-variation-settings: "wdth" 70, "wght" 800; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); margin: 0 0 6px; }
.kicker.rule { border-top: 1px solid var(--rule); padding-top: 8px; }
h2.head { margin: 0 0 8px; font-family: var(--head); font-variation-settings: "wdth" 62, "wght" 900; font-weight: 900; text-transform: uppercase; line-height: 1.1; letter-spacing: -0.005em; }
.lead h2.head { font-size: clamp(34px, 4.2vw, 74px); }
.deck { margin: 0 0 14px; font-family: var(--head); font-variation-settings: "wdth" 85, "wght" 500; font-size: clamp(16px, 1.3vw, 21px); line-height: 1.3; color: var(--ink); }
.byline { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); margin: 0 0 12px; }
.lead figure { margin: 0 0 14px; border: 1px solid var(--rule); padding: 6px; }
.lead figure img { width: 100%; height: auto; }
.lead figcaption { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); padding: 6px 2px 0; }
.text { columns: 2; column-gap: 28px; column-rule: 1px solid var(--hair); }
.text p, .col p { margin: 0 0 12px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; font-size: 16px; line-height: 1.55; }
.text p:first-child::first-letter { font-family: var(--name); font-size: 3.2em; line-height: 0.8; float: left; padding: 6px 8px 0 0; color: var(--red); }
a.num { font-family: var(--mono); font-size: 0.94em; color: var(--ink); text-decoration: underline dotted var(--red); text-underline-offset: 3px; white-space: nowrap; }
a.num:hover { color: var(--red); }
h3.head { margin: 0 0 8px; font-family: var(--head); font-variation-settings: "wdth" 66, "wght" 900; font-weight: 900; text-transform: uppercase; line-height: 1.1; font-size: clamp(22px, 2vw, 32px); }
.tape { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13.5px; }
.tape th, .tape td { text-align: right; padding: 5px 4px; border-bottom: 1px solid var(--hair); white-space: nowrap; vertical-align: top; }
.tape th { color: var(--red); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; }
.tape th:first-child, .tape td:first-child { text-align: left; }
.tape td:first-child a { text-decoration: none; }
.tape td:first-child a:hover { color: var(--red); }
.tape .up { color: #9fd08a; } .tape .dn { color: #f07b77; }
.tape tr.hi td:first-child { font-weight: 700; }
.inside { margin: 0 0 22px; }
.inside ol { list-style: none; margin: 0; padding: 0; }
.inside li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--hair); }
.inside a { display: flex; justify-content: space-between; width: 100%; padding: 7px 0; text-decoration: none; font-family: var(--head); font-variation-settings: "wdth" 80, "wght" 600; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; min-height: 40px; align-items: center; }
.inside a span:last-child { font-family: var(--mono); color: var(--red); text-transform: none; letter-spacing: 0; }
.inside a:hover { color: var(--red); }
.brief { margin: 0 0 22px; }
.brief p { font-size: 15px; }
.plate { width: 72px; height: 72px; object-fit: contain; float: right; margin: 0 0 8px 12px; }

/* ---- ad band + circulation ---- */
.adband { margin: 22px 0 0; border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule); padding: 12px 0; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; min-height: 96px; }
.adband .tag { font-family: var(--mono); font-size: 12px; color: var(--red); text-transform: uppercase; letter-spacing: 0.1em; writing-mode: horizontal-tb; }
.adband .creative { display: flex; align-items: center; gap: 18px; min-width: 0; }
.adband .creative img { max-height: 120px; width: auto; max-width: 240px; object-fit: contain; border: 1px solid var(--hair); }
.adband .creative .line { font-family: var(--head); font-variation-settings: "wdth" 70, "wght" 800; font-size: clamp(20px, 2.4vw, 40px); text-transform: uppercase; line-height: 1.1; }
.adband .auction { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); display: grid; gap: 4px; text-align: right; }
.adband .auction b { color: var(--ink); }
.circulation { margin: 22px 0 0; border: 1px solid var(--rule); padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: center; }
.circulation h3 { grid-column: 1 / -1; margin: 0; font-family: var(--head); font-variation-settings: "wdth" 70, "wght" 800; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.circulation .ca { display: grid; gap: 6px; min-width: 0; }
.circulation .ca .k { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.circulation code { font-family: var(--mono); font-size: 15px; word-break: break-all; user-select: all; line-height: 1.4; }
.circulation .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.copy-note { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); min-height: 1.2em; }

/* ---- inner pages ---- */
.inner-pages { margin-top: 30px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 26px 28px; }
.sec { min-width: 0; padding-top: 4px; }
.sec > .kicker { border-top: 3px double var(--rule); padding-top: 8px; }
.sec p { margin: 0 0 12px; font-size: 15.5px; line-height: 1.55; text-align: justify; hyphens: auto; }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; } .span-3 { grid-column: span 3; }
.obit { border: 1px solid var(--hair); padding: 10px 12px; margin: 0 0 10px; }
.obit b { color: var(--red); font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; }
.obit p { margin: 4px 0 0; font-size: 14.5px; text-align: left; }
.weather { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
.weather img { width: 96px; height: 96px; object-fit: contain; }
.weather .line { font-family: var(--head); font-variation-settings: "wdth" 66, "wght" 900; font-size: clamp(22px, 2vw, 34px); text-transform: uppercase; line-height: 1.1; margin: 0 0 6px; }
.comic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.frame { border: 2px solid var(--ink); padding: 10px; display: grid; grid-template-rows: auto 1fr; gap: 8px; min-height: 240px; background: rgba(0, 0, 0, 0.3); }
.frame .bubble { border: 1px solid var(--ink); padding: 8px 10px; font-family: var(--head); font-variation-settings: "wdth" 80, "wght" 600; font-size: 14px; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.02em; }
.frame img { width: 100%; height: 150px; object-fit: contain; align-self: end; }
.classifieds .ad { font-family: var(--mono); font-size: 14px; border-bottom: 1px dotted var(--hair); padding: 8px 0; display: grid; gap: 2px; }
.classifieds .ad .meta { font-size: 12px; color: var(--ink-dim); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rates { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); margin: 8px 0 12px; display: grid; gap: 4px; }
.rates b { color: var(--ink); }
.columnist { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: start; }
.columnist img { width: 110px; height: 110px; object-fit: contain; }
.letter { border-left: 3px solid var(--red); padding-left: 14px; }
.letter .reply { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
.masthead-box { border: 1px solid var(--hair); padding: 12px 14px; font-family: var(--mono); font-size: 13px; color: var(--ink-dim); display: grid; gap: 6px; }
.masthead-box b { color: var(--ink); }
.masthead-box .title { font-family: var(--name); font-size: 22px; color: var(--red); }

/* ---- dialogs ---- */
dialog { background: var(--paper) url("/art/web/paper.jpg") repeat; background-size: 512px 512px; color: var(--ink); border: 1px solid var(--rule); padding: 0; max-width: min(720px, calc(100vw - 32px)); width: 100%; max-height: min(90vh, 900px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); margin: 0; }
.dlg-head h2 { margin: 0; font-family: var(--head); font-variation-settings: "wdth" 66, "wght" 900; font-size: 22px; text-transform: uppercase; line-height: 1.1; }
.dlg-body { padding: 16px; display: grid; gap: 12px; overflow: auto; max-height: calc(min(90vh, 900px) - 60px); }
.dlg-body p { margin: 0; }
.field { display: grid; gap: 6px; font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
.field input, .field textarea, .field select { font: 15px/1.4 var(--mono); background: rgba(0, 0, 0, 0.35); color: var(--ink); border: 1px solid var(--hair); padding: 10px; min-height: 44px; width: 100%; }
.field textarea { min-height: 90px; resize: vertical; }
.log { margin: 0; padding-left: 18px; font-family: var(--mono); font-size: 13px; display: grid; gap: 4px; }
.log .err { color: #f07b77; }
.wbtns { display: flex; flex-wrap: wrap; gap: 8px; }
dialog.extra { background: var(--red); color: #111; border-color: #111; max-width: min(760px, calc(100vw - 32px)); }
dialog.extra .dlg-head { border-color: #111; }
dialog.extra .dlg-head h2 { font-family: var(--name); font-size: 44px; font-weight: 400; }
dialog.extra .btn { border-color: #111; color: #111; }
dialog.extra .kicker { color: #111; }
dialog.extra h3 { margin: 0; font-family: var(--head); font-variation-settings: "wdth" 62, "wght" 900; font-size: clamp(30px, 5vw, 56px); text-transform: uppercase; line-height: 1.1; }
dialog.extra p { font-size: 17px; }
dialog.extra a { color: #111; text-decoration-color: #111; }
dialog.extra a.num { color: #111; text-decoration: underline dotted #111; }
dialog.extra .rat { width: 120px; float: right; margin: 0 0 8px 12px; }
.stand-list { display: grid; gap: 6px; }
.stand-list .stand { min-width: 0; grid-template-columns: 48px 1fr auto; justify-items: start; text-align: left; align-items: center; column-gap: 12px; }
.stand-list .stand img { width: 40px; height: 36px; }

/* ---- phone: the folded paper ---- */
@media (max-width: 1100px) {
  .pageone { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pageone .lead { grid-column: 1 / -1; }
  .pageone .col-l { border-right: 0; padding-right: 0; border-top: 1px solid var(--hair); padding-top: 14px; }
  .pageone .col-r { padding-left: 24px; border-top: 1px solid var(--hair); padding-top: 14px; }
  .span-4, .span-3 { grid-column: span 6; }
  .span-8 { grid-column: span 12; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .newsstand { display: none; }
  .stand-btn { display: inline-flex; }
  .masthead { grid-template-columns: 1fr; gap: 12px; padding-top: 12px; }
  .nameplate { order: -1; }
  .nameplate h1 { font-size: clamp(38px, 12.5vw, 60px); white-space: normal; }
  .nameplate .row { flex-direction: column; align-items: center; gap: 6px; }
  .ear { min-height: 0; }
  .dateline .inner { font-size: 12px; gap: 4px 12px; justify-content: flex-start; }
  .pageone { grid-template-columns: 1fr; }
  .pageone .lead { order: 1; }
  .pageone .col-r { order: 2; padding-left: 0; border-left: 0; }
  .pageone .col-l { order: 3; }
  .ear-left { grid-template-columns: 72px 1fr; }
  .ear-left .plate { width: 72px; height: 72px; }
  .text { columns: 1; }
  .lead h2.head { font-size: clamp(30px, 9vw, 44px); }
  .inner-pages { grid-template-columns: 1fr; gap: 22px; }
  .span-4, .span-6, .span-8, .span-12, .span-3 { grid-column: 1 / -1; }
  .adband { grid-template-columns: 1fr; gap: 10px; }
  .adband .auction { text-align: left; }
  .adband .creative { flex-direction: column; align-items: flex-start; }
  .circulation { grid-template-columns: 1fr; }
  .comic { grid-template-columns: 1fr; }
  .frame { min-height: 0; }
  .frame img { height: 130px; }
  .weather { grid-template-columns: 72px 1fr; }
  .weather img { width: 72px; height: 72px; }
  .columnist { grid-template-columns: 80px 1fr; }
  .columnist img { width: 80px; height: 80px; }
  .tape { font-size: 12.5px; }
  .tape th, .tape td { padding: 5px 3px; }
}
@media (max-width: 360px) {
  .nameplate h1 { font-size: 34px; }
  .tape { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .stand, .btn, .extra-seal { transition: none; }
}
