/* ============================================================
   THE PLENCNER LAB POST: wireframe stylesheet
   ------------------------------------------------------------
   Newsprint for the Morning Edition, salmon "sports final"
   stock for the Evening Edition. Ink only; no accent colour.
   Blue-pencil notes are wireframe-only annotations.
   ============================================================ */

:root {
  --paper:      #E8E1CB;   /* aged newsprint */
  --paper-deep: #DDD4BA;   /* boxes, ears */
  --ink:        #1E1C19;
  --press:      #5E5850;   /* secondary ink */
  --rule:       #2B2823;
  --hair:       #9C9482;   /* hairline column rules */
  --pencil:     #3E7CC9;   /* non-photo blue, notes only */

  --f-mast: 'UnifrakturMaguntia', serif;
  --f-head: 'Old Standard TT', 'Times New Roman', serif;
  --f-body: 'Libre Caslon Text', Georgia, serif;
  --f-note: 'Caveat', 'Comic Sans MS', cursive;

  --measure: 1240px;
  --gutter: 16px;
}

/* Evening Edition: salmon stock */
body.evening {
  --paper:      #EFD3C2;
  --paper-deep: #E5C3AF;
  --hair:       #A88A7A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
img { max-width: 100%; display: block; }

.sheet { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter) 3rem; }

/* ── Masthead ─────────────────────────────────────────────── */
.masthead {
  display: grid;
  grid-template-columns: 190px 1fr 190px;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 0 0.75rem;
}
.title {
  font-family: var(--f-mast);
  font-weight: 400;
  font-size: clamp(2.3rem, 5.6vw, 4.6rem);
  line-height: 1;
  text-align: center;
  margin: 0;
  letter-spacing: 0.01em;
}
.title a:hover { text-decoration: none; }

.ear {
  border: 1px solid var(--rule);
  padding: 0.5rem 0.6rem;
  font-family: var(--f-head);
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: center;
  position: relative;
  min-height: 92px;
}
.ear h4 {
  font-family: var(--f-body);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 400;
  font-size: 0.78rem;
  margin: 0 0 0.3rem;
  border-bottom: 1px solid var(--hair);
  padding-bottom: 0.2rem;
}
.ear p { margin: 0.1rem 0; }
.ear .w { font-weight: 700; }
.ear .motto { font-style: italic; font-family: var(--f-body); font-size: 0.82rem; padding-top: 0.4rem; }

.late-city {
  position: absolute;
  top: -0.7rem; right: -0.6rem;
  transform: rotate(6deg);
  border: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.4rem;
}

/* Masthead artwork (img/masthead-*.svg). The art has its own ears,
   motto and double rule, so the dateline under it drops its top rule. */
.masthead-art { margin: 1rem 0 0; line-height: 0; font-size: 1rem; }
.masthead-art a { display: block; }
.masthead-art img { width: 100%; height: auto; }
/* the art ships with a flat paper-colored background; darken lets the
   page's paper grain show through while the ink stays as drawn */
.masthead-art img, .lockup img { mix-blend-mode: darken; }
.dateline.under-art { border-top: 0; }
.dateline .scoreline { font-variant: normal; letter-spacing: 0; font-size: 0.85rem; text-align: right; }
.dateline .scoreline b { font-weight: 700; }

/* dateline: thick-and-thin above, single below */
.dateline {
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0.1rem;
  font-family: var(--f-body);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.88rem;
}
.dateline .edition { font-weight: 700; }

.index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.4rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-head);
  font-size: 0.92rem;
}

.index .wx {
  font-family: var(--f-body); font-style: italic; font-size: 0.86rem;
  padding-right: 1.4rem; border-right: 1px solid var(--hair); margin-right: auto;
}

/* ── Section heads ────────────────────────────────────────── */
.section { margin-top: 2.25rem; }
.section-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
}
.section-head::before, .section-head::after {
  content: ''; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); height: 3px;
}
.section-head h2 {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 1.55rem;
  margin: 0;
  letter-spacing: 0.02em;
}
.section-head .pg {
  display: block; text-align: center;
  font-family: var(--f-body); font-style: italic; font-size: 0.8rem; font-weight: 400; color: var(--press);
}

/* ── Front page grid ──────────────────────────────────────── */
.front {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  margin-top: 1.25rem;
}
.front > * { padding: 0 1rem; border-left: 1px solid var(--hair); }
.front > *:first-child { padding-left: 0; border-left: 0; }
.front > *:last-child { padding-right: 0; }
.front .lead { grid-column: span 6; }
.front .second { grid-column: span 3; }
.front .brief { grid-column: span 3; }

/* ── Stories ──────────────────────────────────────────────── */
.kicker {
  font-family: var(--f-body);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  color: var(--press);
  margin: 0 0 0.2rem;
}
.story h3, .lead h3, .second h3 {
  font-family: var(--f-head);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 0.4rem;
}
.lead h3 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1.04; }
.lead .deck { font-family: var(--f-head); font-style: italic; font-size: 1.15rem; line-height: 1.3; margin: 0 0 0.75rem; }
.second h3 { font-size: 1.4rem; }
.story h3 { font-size: 1.12rem; }
.story.top h3 { font-size: 1.38rem; }

.blurb {
  margin: 0 0 0.35rem;
  text-align: justify;
  hyphens: auto;
  font-size: 0.95rem;
  line-height: 1.52;
}
.lead .blurb { font-size: 1.02rem; }
.lead .blurb.drop::first-letter {
  float: left;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 3.6rem;
  line-height: 0.85;
  padding: 0.3rem 0.4rem 0 0;
}
.byline { font-size: 0.78rem; color: var(--press); font-style: italic; margin: 0; }
.byline .hn { font-style: normal; }

.new {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.72rem;
  border: 1px solid var(--ink);
  padding: 0 0.25rem;
  margin-right: 0.35rem;
  vertical-align: 0.15em;
  letter-spacing: 0.04em;
}

/* stories flowing in columns inside a section */
.columns {
  column-count: 3;
  column-gap: 2rem;
  column-rule: 1px solid var(--hair);
}
.columns > .story { break-inside: avoid; padding-bottom: 0.9rem; margin-bottom: 0.9rem; border-bottom: 1px solid var(--hair); }
.columns > .story:last-child { border-bottom: 0; }

.with-rail { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; }
.with-rail .columns { column-count: 2; }

/* ── World in Brief (Wikipedia) ───────────────────────────── */
.brief h4, .box h4 {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  margin: 0 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 3px double var(--rule);
}
.brief ul { list-style: none; margin: 0; padding: 0; }
.brief li { padding: 0.45rem 0; border-bottom: 1px solid var(--hair); font-size: 0.86rem; line-height: 1.38; }
.brief li .kicker { font-size: 0.74rem; margin-bottom: 0.05rem; }
.brief .cite { color: var(--press); font-size: 0.76rem; font-style: italic; }
.attrib { font-size: 0.72rem; color: var(--press); font-style: italic; margin: 0.5rem 0 0; }

/* ── Inside today strip ───────────────────────────────────── */
.inside {
  margin-top: 1.5rem;
  border-top: 3px double var(--rule);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.inside > a { display: block; padding: 0.6rem 0.8rem; border-left: 1px solid var(--hair); }
.inside > a:first-child { border-left: 0; padding-left: 0; }
.inside .kicker { margin: 0; }
.inside b { font-family: var(--f-head); font-size: 0.98rem; line-height: 1.2; display: block; }
.inside .pg { font-size: 0.75rem; font-style: italic; color: var(--press); }

/* ── Boxes (scoreboard, reviews) ──────────────────────────── */
.box { border: 1px solid var(--rule); padding: 0.75rem 0.85rem; background: color-mix(in srgb, var(--paper-deep) 55%, transparent); }
.box + .box { margin-top: 1.25rem; }

.agate { width: 100%; border-collapse: collapse; font-family: var(--f-head); font-size: 0.84rem; font-variant-numeric: tabular-nums lining-nums; }
.agate caption { text-align: left; font-family: var(--f-body); font-variant: small-caps; letter-spacing: 0.06em; font-size: 0.8rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--rule); }
.agate th { font-weight: 400; font-style: italic; text-align: left; color: var(--press); font-size: 0.76rem; padding: 0.25rem 0.3rem 0.1rem 0; }
.agate td { padding: 0.22rem 0.3rem 0.22rem 0; border-bottom: 1px dotted var(--hair); vertical-align: top; }
.agate td.n, .agate th.n { text-align: right; }
.agate .w { font-weight: 700; }
.agate .off { font-style: italic; color: var(--press); }
.agate + .agate { margin-top: 0.9rem; }

.reviews li { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px dotted var(--hair); font-size: 0.85rem; }
.reviews ul { list-style: none; padding: 0; margin: 0; }
.reviews .score { font-family: var(--f-head); font-weight: 700; }

/* ── Classifieds ──────────────────────────────────────────── */
.ads { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; }
.ad {
  border: 1px solid var(--rule);
  padding: 0.7rem 0.75rem 0.6rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  font-size: 0.82rem; line-height: 1.35;
}
.ad.display { grid-column: span 2; border-width: 3px; border-style: double; padding: 1rem; font-size: 0.95rem; }
.ad .logo {
  height: 64px; display: grid; place-items: center;
  filter: grayscale(1) contrast(1.15); mix-blend-mode: multiply;
}
.ad.display .logo { height: 110px; }
.logo-slot { border: 1px dashed var(--press); color: var(--press); font-style: italic; font-size: 0.75rem; width: 100%; height: 100%; display: grid; place-items: center; }
.wordmark { font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; line-height: 1.05; text-align: center; letter-spacing: 0.01em; }
.ad.display .wordmark { font-size: 1.9rem; }
.ad .tag { margin: 0; text-align: center; font-style: italic; }
.ad .go { margin-top: auto; border-top: 1px solid var(--hair); padding-top: 0.35rem; font-family: var(--f-head); font-weight: 700; text-align: center; font-size: 0.85rem; }
.ad .go .ig { display: inline-block; width: 0.85em; height: 0.85em; border: 1.5px solid currentColor; border-radius: 0.25em; position: relative; vertical-align: -0.08em; margin-right: 0.25rem; }
.ad .go .ig::after { content: ''; position: absolute; inset: 0.18em; border: 1.5px solid currentColor; border-radius: 50%; }
.ad .more { text-align: center; font-size: 0.78rem; margin: 0; }
.ad .more a { text-decoration: underline; text-decoration-color: var(--hair); }

/* ── Puzzles ──────────────────────────────────────────────── */
.puzzles { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 0; }
.puzzles > * { padding: 0 1.1rem; border-left: 1px solid var(--hair); }
.puzzles > *:first-child { padding-left: 0; border-left: 0; }
.puzzles > *:last-child { padding-right: 0; }
.puzzles h3 { font-family: var(--f-head); font-size: 1.3rem; margin: 0 0 0.2rem; }
.puzzles .how { font-style: italic; font-size: 0.85rem; color: var(--press); margin: 0 0 0.8rem; }

.jumble-row { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.6rem; align-items: center; margin-bottom: 0.7rem; }
.scramble { font-family: var(--f-head); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.2em; }
.clue { font-size: 0.78rem; font-style: italic; color: var(--press); grid-column: 1 / -1; margin-top: -0.4rem; }
.cells { display: flex; gap: 3px; }
.cell { width: 1.7rem; height: 1.7rem; border: 1px solid var(--ink); background: transparent; font-family: var(--f-head); font-size: 1rem; text-align: center; text-transform: uppercase; color: var(--ink); padding: 0; border-radius: 0; }
.cell.circ { border-radius: 50%; }
.final { border-top: 1px solid var(--hair); padding-top: 0.6rem; margin-top: 0.4rem; font-size: 0.88rem; }

.crypto { display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; }
.crypto .word { display: flex; gap: 2px; }
.crypto .ch { display: grid; grid-template-rows: auto auto; text-align: center; width: 1.25rem; }
.crypto .ch input { width: 1.25rem; height: 1.45rem; border: 0; border-bottom: 1px solid var(--ink); background: transparent; text-align: center; font-family: var(--f-head); font-size: 0.95rem; text-transform: uppercase; color: var(--ink); padding: 0; border-radius: 0; }
.crypto .ch span { font-family: var(--f-head); font-size: 0.78rem; color: var(--press); }
.crypto .ch.punct { width: 0.5rem; }
.crypto .given input { font-weight: 700; }
.attribution { margin-top: 0.6rem; font-style: italic; font-size: 0.85rem; }

.sudoku { display: grid; grid-template-columns: repeat(9, 1fr); border: 2px solid var(--ink); width: 100%; max-width: 330px; aspect-ratio: 1; }
.sudoku div { border: 1px solid var(--hair); display: grid; place-items: center; font-family: var(--f-head); font-size: 1rem; }
.sudoku div.g { font-weight: 700; }
.sudoku div:nth-child(9n+3), .sudoku div:nth-child(9n+6) { border-right: 2px solid var(--ink); }
.sudoku div:nth-child(n+19):nth-child(-n+27), .sudoku div:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--ink); }
.difficulty { font-size: 0.82rem; margin: 0.5rem 0 0; }

.answers { transform: rotate(180deg); border: 1px solid var(--rule); padding: 0.5rem 0.7rem; font-size: 0.78rem; margin-top: 1.2rem; }
.answers b { font-family: var(--f-head); }

.elsewhere ul { margin: 0; padding: 0; list-style: none; }
.elsewhere li { padding: 0.3rem 0; border-bottom: 1px dotted var(--hair); font-size: 0.88rem; }

/* ── Footer ───────────────────────────────────────────────── */
.colophon {
  margin-top: 2.5rem;
  border-top: 4px double var(--rule);
  padding-top: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--press);
}
.colophon .press-mark { width: 56px; height: 56px; }
.colophon p { margin: 0 0 0.25rem; }
.colophon .health { font-style: italic; }

/* ── Blue-pencil wireframe notes ──────────────────────────── */
.note {
  display: block;
  font-family: var(--f-note);
  font-size: 1.15rem;
  line-height: 1.15;
  color: var(--pencil);
  margin: 0.35rem 0 0.6rem;
  padding-left: 1.1rem;
  position: relative;
  text-align: left;
  font-variant: normal;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.note::before { content: '✎'; position: absolute; left: 0; top: 0; font-size: 0.95rem; }
.note.box-note { border: 1.5px dashed var(--pencil); padding: 0.4rem 0.6rem 0.4rem 1.6rem; border-radius: 2px; }
.note.box-note::before { left: 0.5rem; top: 0.4rem; }
.note code { font-family: inherit; font-size: 1em; background: rgba(62,124,201,.1); padding: 0 .2em; }
body.notes-off .note { display: none; }

.wf-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-body); font-size: 0.8rem;
  padding: 0.45rem var(--gutter);
}
.wf-bar a { text-decoration: underline; text-underline-offset: 2px; }
.wf-bar nav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.wf-bar nav a[aria-current] { text-decoration: none; font-weight: 700; }
.wf-bar button {
  font: inherit; background: transparent; color: var(--paper);
  border: 1px solid currentColor; padding: 0.15rem 0.6rem; cursor: pointer;
}
body.embed .wf-bar { display: none; }

.sample-banner {
  max-width: var(--measure); margin: 0.75rem auto 0; padding: 0 var(--gutter);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .masthead { grid-template-columns: 140px 1fr 140px; gap: 0.75rem; }
  .front { grid-template-columns: repeat(2, 1fr); }
  .front .lead { grid-column: 1 / -1; padding: 0 0 1rem; border-left: 0; border-bottom: 1px solid var(--hair); margin-bottom: 1rem; }
  .front .second { grid-column: span 1; padding-left: 0; border-left: 0; }
  .front .brief { grid-column: span 1; }
  .columns { column-count: 2; }
  .with-rail { grid-template-columns: 1fr; }
  .inside { grid-template-columns: repeat(3, 1fr); }
  .inside > a:nth-child(4) { border-left: 0; padding-left: 0; }
  .ads { grid-template-columns: repeat(3, 1fr); }
  .puzzles { grid-template-columns: 1fr 1fr; row-gap: 1.75rem; }
  .puzzles > *:nth-child(3) { grid-column: 1 / -1; padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); padding-top: 1.25rem; }
}

@media (max-width: 639px) {
  .masthead { grid-template-columns: 1fr 1fr; padding-top: 1rem; }
  .title { grid-column: 1 / -1; grid-row: 1; font-size: 2.35rem; }
  .ear { min-height: 0; font-size: 0.74rem; }
  .dateline { flex-wrap: wrap; justify-content: center; text-align: center; font-size: 0.8rem; gap: 0.1rem 0.8rem; }
  .dateline .edition { flex-basis: 100%; order: -1; }
  .dateline .scoreline { flex-basis: 100%; text-align: center; }
  /* crop the masthead art to the title and motto */
  .masthead-art img { aspect-ratio: 3.1; object-fit: cover; object-position: 50% 50%; }
  .index { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; font-size: 0.88rem; }  .front { grid-template-columns: 1fr; }
  .front > * { padding: 0 !important; border-left: 0 !important; }
  .front .second { border-bottom: 1px solid var(--hair); padding-bottom: 1rem !important; margin-bottom: 1rem; }
  .columns, .with-rail .columns { column-count: 1; }
  .inside { grid-template-columns: 1fr; }
  .inside > a { border-left: 0; padding-left: 0; border-top: 1px solid var(--hair); }
  .inside > a:first-child { border-top: 0; }
  .ads { grid-template-columns: 1fr 1fr; }
  .ad.display { grid-column: 1 / -1; }
  .puzzles { grid-template-columns: 1fr; }
  .puzzles > * { padding: 0 !important; border-left: 0 !important; }
  .puzzles > * + * { border-top: 1px solid var(--hair); padding-top: 1.25rem !important; }
  .colophon { grid-template-columns: auto 1fr; }
  .colophon > div:last-child { grid-column: 2; }
  .section-head h2 { font-size: 1.3rem; }
}

@media print {
  .wf-bar, .note { display: none !important; }
  body { background: #fff; }
}
