/* dirty.news — web edition of the paper. Mirrors tools/build_pdf.py:
   Old Standard for text, Roboto Slab for display, one ink colour on paper. */

@font-face { font-family: "Old Standard"; src: url("/fonts/OldStandard-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("/fonts/OldStandard-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("/fonts/OldStandard-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto Slab"; src: url("/fonts/RobotoSlab-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto Slab"; src: url("/fonts/RobotoSlab-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --ink: #1d1915;
  --paper: #e5dbc0;
  --paper-light: #efe6cf;
  --rule: 0.6px solid var(--ink);
  --text: "Old Standard", "Times New Roman", Georgia, serif;
  --display: "Roboto Slab", "Rockwell", Georgia, serif;
  --gap: clamp(14px, 2.4vw, 22px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: #b9ad8f url("/paper.jpg") center / 620px auto;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 400 17px/1.5 var(--text);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

a { color: inherit; text-decoration-thickness: 0.06em; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* The sheet: one broadsheet page on the table */
.sheet {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px clamp(14px, 3.5vw, 44px) 32px;
  background: var(--paper) url("/paper.jpg") center top / 100% auto;
  box-shadow: 0 1px 2px rgba(29, 25, 21, .25), 0 10px 40px rgba(29, 25, 21, .25);
  min-height: 100vh;
}
@media (min-width: 1160px) { .sheet { margin: 24px auto; min-height: 0; } }

/* Top bar with the language switch */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: 4px 0 10px; font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.brand { opacity: .75; }
.langs { display: inline-flex; border: var(--rule); }
.langs a { padding: 6px 10px; text-decoration: none; }
.langs a + a { border-left: var(--rule); }
.langs a[aria-current] { background: var(--ink); color: var(--paper-light); }

/* Masthead */
.masthead { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--gap); align-items: end; }
.nameplate { display: flex; flex-direction: column; line-height: .86; min-width: 0; }
.name-small { font: 700 clamp(13px, 2.2vw, 22px)/1.2 var(--display); letter-spacing: .55em; display: flex; align-items: center; gap: .6em; }
.name-small::after { content: ""; flex: 1; border-top: 1.4px solid var(--ink); max-width: 60%; }
.name-big { font: 900 clamp(64px, 15.5vw, 172px)/.86 var(--display); letter-spacing: -.01em; margin-left: -.04em; padding-bottom: .1em; }
.ears { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; text-align: center; padding-bottom: 6px; }
.motto { margin: 0 0 8px; font-style: italic; font-size: 15px; text-align: right; }
.organ { margin: 0; padding: 10px 16px; border: 2px solid var(--ink); outline: .6px solid var(--ink); outline-offset: -5px; font-size: 16px; line-height: 1.25; }
.organ b { display: block; }
.organ i { display: block; font-size: 14px; margin-top: 4px; }
.dateline { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1em; margin: 12px 0 0; padding: 5px 0; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); font: 700 13px/1.3 var(--display); letter-spacing: .03em; }

@media (max-width: 720px) {
  .masthead { grid-template-columns: 1fr; }
  .ears { order: -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; }
  .motto { text-align: left; margin: 0; font-size: 13px; }
  .organ { font-size: 12px; padding: 6px 10px; outline-offset: -4px; }
  .organ i { font-size: 11px; }
  .dateline { font-size: 11px; }
  .dateline span:nth-child(2) { text-align: center; }
}
@media (max-width: 420px) { .ears .motto { display: none; } .ears { justify-content: flex-end; } }

/* Notice about the project + PDF */
.notice { display: flex; gap: var(--gap); align-items: center; justify-content: space-between; margin: 14px 0 0; padding: 10px 0 12px; border-bottom: var(--rule); font-size: 16px; }
.notice p { margin: 0; max-width: 62ch; font-style: italic; }
@media (max-width: 720px) { .notice { flex-direction: column; align-items: stretch; } }

.pdf { display: inline-flex; flex-direction: column; align-items: center; padding: 8px 16px; border: 2px solid var(--ink); outline: .6px solid var(--ink); outline-offset: -5px; text-decoration: none; background: var(--paper-light); white-space: nowrap; text-align: center; }
.pdf:hover { background: var(--ink); color: var(--paper-light); outline-color: var(--paper-light); }
.pdf-label { font: 700 14px/1.25 var(--display); letter-spacing: .03em; }
.pdf-meta { font-size: 13px; font-style: italic; }

/* Layout: story + rail */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: var(--gap); margin-top: 16px; }
.rail { border-left: var(--rule); padding-left: var(--gap); }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .rail { border-left: 0; padding-left: 0; border-top: 3px double var(--ink); padding-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); align-items: start; }
}

/* Headline block */
.rubric { display: flex; align-items: center; gap: 12px; margin: 0; font: 700 13px/1 var(--display); letter-spacing: .5em; }
.rubric::before, .rubric::after { content: ""; flex: 1; border-top: var(--rule); }
.rubric span { margin-right: -.5em; }
h1 { margin: 6px 0 2px; font: 900 clamp(34px, 6.3vw, 60px)/1.02 var(--display); text-align: center; letter-spacing: -.005em; text-wrap: balance; }
.subtitle { margin: 4px 0 14px; text-align: center; font-style: italic; font-size: clamp(17px, 2vw, 20px); text-wrap: balance; }

/* Figures: ink drawings multiply onto the paper */
.fig { margin: 0 0 14px; }
.fig img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.fig figcaption { margin-top: 6px; text-align: center; font-style: italic; font-size: 14px; line-height: 1.3; }
.columns .fig-wide { margin: 18px 0 16px; }
.fig-narrow { break-inside: avoid; max-width: 260px; margin: 8px auto 14px; }

/* Text: every chapter is a balanced block of columns */
.part { columns: 3 15.5em; column-gap: var(--gap); column-rule: var(--rule); orphans: 3; widows: 3; }
.part + .part { margin-top: 14px; padding-top: 12px; border-top: var(--rule); }
.columns h2 { column-span: all; }
.columns p { margin: 0; text-align: justify; text-indent: 1.2em; hyphens: manual; }
.columns h2 { margin: .9em 0 .35em; font: 700 14px/1.25 var(--display); text-align: center; letter-spacing: .02em; break-after: avoid; }
.columns h2 { margin-top: 0 !important; }
sup.fn { font-size: .62em; line-height: 0; margin-left: .05em; }
sup.fn a { text-decoration: none; }
sup.fn a:hover { text-decoration: underline; }

.sign { break-inside: avoid; margin: 10px 4px 12px !important; padding: 8px 6px; border: 1.4px solid var(--ink); text-align: center !important; text-indent: 0 !important; line-height: 1.25; }
.sign b, .sign i { display: block; }
.sign b { letter-spacing: .02em; }

.signoff { text-align: right !important; font-style: italic; margin-top: .6em !important; text-indent: 0 !important; }
.ornament { text-align: center !important; text-indent: 0 !important; letter-spacing: .4em; margin: 4px 0 0 !important; }

@media (max-width: 560px) {
  body { font-size: 18px; }
  .columns p { text-align: left; }
}

/* Editorial note + sources */
.editorial { margin: 18px 0 0; padding-top: 10px; border-top: var(--rule); font-size: 15px; }
.editorial p { margin: 0; }
.sources { margin-top: 14px; padding-top: 8px; border-top: var(--rule); font-size: 14px; line-height: 1.4; }
.sources h2 { margin: 0 0 4px; font: 700 14px/1.3 var(--text); }
.sources ol { margin: 0; padding-left: 1.6em; }
.sources li { overflow-wrap: anywhere; }
.sources li:target { background: rgba(29, 25, 21, .1); }

/* Rail */
.headlines h2 { margin: 0 0 10px; padding: 7px 6px 6px; background: var(--ink); color: var(--paper-light); font: 700 15px/1.2 var(--display); text-align: center; letter-spacing: .03em; }
.headlines h2 small { display: block; font: italic 400 14px/1.3 var(--text); letter-spacing: 0; }
.headlines ol { margin: 0; padding: 0 0 12px; list-style: none; counter-reset: h; border-bottom: 2.4px solid var(--ink); }
.headlines li { counter-increment: h; position: relative; padding: 6px 0 7px 1.4em; font-weight: 700; font-size: 15.5px; line-height: 1.28; }
.headlines li + li { border-top: .5px solid var(--ink); }
.headlines li::before { content: counter(h) "."; position: absolute; left: 0; }
.headlines a { text-decoration: none; }
.headlines a:hover { text-decoration: underline; }

.note { margin: 16px 0; font-size: 14.5px; line-height: 1.4; hyphens: manual; }

.ad { padding: 12px 12px 14px; border: 2.4px solid var(--ink); outline: .6px solid var(--ink); outline-offset: -6px; text-align: center; }
.ad p { margin: 0; }
.ad-label { font-style: italic; font-size: 14px; }
.ad-title { margin: 6px 0 !important; font: 900 17px/1.2 var(--display); }
.ad-tag { font-style: italic; font-size: 15px; padding-bottom: 8px; border-bottom: var(--rule); }
.ad-prices-title { margin-top: 8px !important; font: 700 12px/1 var(--display); letter-spacing: .45em; }
.ad-prices { list-style: none; margin: 8px 0; padding: 0 0 8px; border-bottom: var(--rule); font-size: 14.5px; }
.ad-prices li { display: flex; align-items: baseline; gap: 4px; }
.ad-prices li::after { content: ""; order: 1; flex: 1; border-bottom: 1.4px dotted var(--ink); }
.ad-prices b { order: 2; }
.ad-address { font-size: 14.5px; line-height: 1.3; }
.rail > .pdf { margin-top: 16px; width: 100%; }
@media (max-width: 1000px) { .rail > .pdf { margin-top: 0; } .note { margin: 0; } }

/* Footer */
.foot { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; margin-top: 22px; padding-top: 8px; border-top: 3px double var(--ink); font-size: 14px; font-style: italic; }
.foot p { margin: 0; }

@media print {
  html, .sheet { background: none; box-shadow: none; }
  .bar, .notice, .pdf, .skip { display: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
