/* ==========================================================
   The Gazette — newspaper front-page theme
   ========================================================== */
:root {
  --paper: #f1ecdf;
  --ink: #1a1814;
  --muted: #5d5849;
  --accent: #8c2a1e;
  --head: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Old Standard TT", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .28  0 0 0 0 .15  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --img-blend: multiply;
}
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1c1b17;
  --ink: #e9e4d4;
  --muted: #a8a290;
  --accent: #e48a78;
  --img-blend: normal;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .86em; background: rgba(128,120,100,.18); padding: .05em .3em; }

.sheet { padding: 0 clamp(16px, 3vw, 48px) 2rem; }

/* ---------- Masthead ---------- */
.masthead { padding-top: 1.1rem; text-align: center; }
.masthead-kicker {
  display: flex; align-items: center; gap: 1rem; margin: 0 0 .15rem; line-height: 1; text-align: center;
  font-family: var(--head); font-style: italic; font-weight: 700; font-size: 1.05rem; letter-spacing: .02em;
}
.masthead-kicker::before, .masthead-kicker::after { content: ""; flex: 1; border-top: 1px solid var(--ink); }
.masthead h1 {
  margin: 0; font-family: var(--head); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2rem, min(9.2vw, 12vh), 6rem); line-height: 1; letter-spacing: -.012em; white-space: nowrap;
}
.masthead h1 a { text-decoration: none; color: inherit; }
.dateline {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; margin-top: .7rem; padding: .28rem 0;
  border-top: 1px solid var(--ink); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
}
.dateline span:first-child { text-align: left; }
.dateline span:last-child { text-align: right; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; background: var(--paper) var(--grain);
  border-top: 3px double var(--ink); border-bottom: 3px double var(--ink);
}
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; }
.nav li + li { border-left: 1px solid var(--ink); }
.nav a {
  display: block; padding: .55rem 1.2rem; font-family: var(--head); font-weight: 700; font-size: .82rem;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- Hero (front page headline) ---------- */
.hero { padding: 1.6rem 0 .6rem; }
.hero .big {
  margin: 0; text-align: center; font-family: var(--head); font-weight: 900;
  font-size: clamp(2.3rem, 7.4vw, 5.2rem); line-height: 1; letter-spacing: -.02em;
}
.deck-hero {
  margin: .9rem auto 1.3rem; text-align: center; font-style: italic; font-weight: 700;
  font-size: clamp(1.05rem, 2.1vw, 1.45rem); line-height: 1.3; max-width: 62ch;
}
.hero-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 2.4rem; padding-top: 1.1rem; border-top: 1px solid var(--ink);
}
.hero-lead p { margin: 0; text-align: justify; hyphens: auto; font-size: 1.12rem; }
.hero-lead p::first-letter {
  float: left; font: 900 3.9em/.78 var(--head); padding: .06em .08em 0 0;
}

/* ---------- Boxes ---------- */
.box { border: 2px solid var(--ink); }
.box h3 {
  margin: 0; padding: .32rem .7rem; background: var(--ink); color: var(--paper); text-align: center;
  font: 800 .8rem var(--head); letter-spacing: .16em; text-transform: uppercase;
}
.box-body { padding: .7rem .9rem .9rem; }
.box-body .name { margin: 0 0 .5rem; font: 900 1.25rem/1.15 var(--head); }
.box-body h4 {
  margin: .9rem 0 .25rem; font: 700 .7rem var(--head); letter-spacing: .16em; text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
}
.box-body ul { list-style: none; margin: 0; padding: 0; }
.box-body li { padding: .12rem 0; font-size: .95rem; }
.edition ul { list-style: none; margin: 0; padding: .3rem .9rem .5rem; }
.edition li {
  display: flex; justify-content: space-between; align-items: baseline; gap: .6rem;
  padding: .45rem 0; border-bottom: 1px dotted var(--ink);
}
.edition li:last-child { border-bottom: 0; }
.edition a { font: 900 1.05rem var(--head); text-transform: uppercase; letter-spacing: .02em; text-decoration: none; }
.edition span { font-size: .8rem; font-style: italic; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding-bottom: 1.6rem; }
.section:not(.home) { max-width: 1180px; margin: 0 auto; padding-top: 1.6rem; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin: 1.8rem 0 1.2rem; padding: .35rem 0; border-top: 5px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.section-head h2 {
  margin: 0; font: 900 clamp(1.6rem, 4vw, 2.5rem)/1.05 var(--head); text-transform: uppercase; letter-spacing: .015em;
}
.folio { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-style: italic; color: var(--muted); white-space: nowrap; }
.empty { font-style: italic; color: var(--muted); }
.subscribe { margin: -.4rem 0 1.4rem; font-style: italic; color: var(--muted); }

/* ---------- Stories ---------- */
.story { break-inside: avoid; }
.kicker {
  margin: 0 0 .25rem; font: 700 .68rem var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.headline { margin: 0 0 .35rem; font: 900 1.65rem/1.08 var(--head); letter-spacing: -.005em; }
.deck { margin: 0 0 .7rem; font-style: italic; font-weight: 700; font-size: 1.08rem; line-height: 1.3; }
.byline {
  margin: 0 0 .8rem; padding-top: .3rem; border-top: 1px solid var(--ink);
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.more { margin: .5rem 0 0; font: 700 .78rem var(--head); letter-spacing: .1em; text-transform: uppercase; }

.body { hyphens: auto; -webkit-hyphens: auto; }
.body > * { margin-top: 0; }
.body p { margin: 0; text-align: justify; text-indent: 1.3em; }
.body > p:first-child, .body h4 + p, .body h5 + p, .body h6 + p { text-indent: 0; }
.body h4, .body h5, .body h6 {
  margin: .9rem 0 .3rem; font: 900 1.05rem/1.2 var(--head); text-transform: uppercase; letter-spacing: .04em; break-after: avoid;
}
.body ul, .body ol { margin: .5rem 0; padding-left: 1.3rem; }
.body li { margin: .15rem 0; }
.body blockquote {
  margin: 1rem 0; padding: .6rem 0; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink);
  font: italic 700 1.2rem/1.3 var(--head); text-align: center; break-inside: avoid;
}
.body blockquote p { text-indent: 0; text-align: center; }
.body pre {
  break-inside: avoid; overflow-x: auto; margin: 1rem 0; padding: .8rem 1rem; font: .85rem/1.5 var(--mono);
  border: 1px solid var(--ink); background: rgba(128,120,100,.12);
}
.body pre code { background: none; padding: 0; }
.body table { break-inside: avoid; width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .92rem; }
.body th, .body td { padding: .3rem .6rem; border-bottom: 1px solid var(--ink); text-align: left; }
.body th { font: 700 .75rem var(--head); text-transform: uppercase; letter-spacing: .12em; border-bottom: 2px solid var(--ink); }
.body hr { border: 0; border-top: 1px solid var(--ink); margin: 1rem 0; }
.body img { max-width: 100%; height: auto; filter: grayscale(1) contrast(1.08); mix-blend-mode: var(--img-blend); }

/* drop caps */
.dropcap .body > p:first-child::first-letter {
  float: left; font: 900 3.7em/.78 var(--head); padding: .06em .08em 0 0;
}

/* lead stories & notes: multi-column body */
.story.lead { margin-bottom: 1.6rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--ink); }
.story.lead .headline { font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.02; }
.story.lead .deck { font-size: 1.25rem; }
.story.lead.long .body, .story.note .body, .about-grid .body {
  column-count: 2; column-gap: 2.4rem; column-rule: 1px solid var(--ink);
}
.story.note { margin-bottom: 2rem; padding-bottom: 1.8rem; border-bottom: 3px double var(--ink); break-inside: auto; }
.story.note:last-of-type { border-bottom: 0; }
.story.note .headline { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.04; }

/* secondary stories in ruled columns */
.stories-cols { column-count: var(--cols, 3); column-gap: 2.4rem; column-rule: 1px solid var(--ink); }
.stories-cols .story { margin-bottom: 1.6rem; }
.stories-cols .story:last-child { margin-bottom: 0; }
.stories-cols .body p { font-size: .98rem; }

/* about */
.about-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2.4rem; align-items: start; }
.about-grid .headline { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.side .photo { margin: 0 0 1.2rem; }
.side .photo img { display: block; width: 100%; height: auto; filter: grayscale(1) contrast(1.1); mix-blend-mode: var(--img-blend); border: 1px solid var(--ink); }
.side .photo figcaption { margin-top: .3rem; font-size: .78rem; font-style: italic; color: var(--muted); }


/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .story.lead.long .body, .story.note .body, .about-grid .body { column-count: 1; }
  .stories-cols { column-count: 1; }
  .stories-cols .story { padding-bottom: 1.2rem; border-bottom: 1px solid var(--ink); }
  .stories-cols .story:last-child { border-bottom: 0; }
  .dateline { grid-template-columns: 1fr; gap: 0; text-align: center; }
  .dateline span:first-child, .dateline span:last-child { text-align: center; }
  .nav a { padding: .5rem .8rem; font-size: .72rem; letter-spacing: .08em; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .sheet { padding: 0 16px 1.5rem; }
  .masthead h1 { white-space: normal; }
  .nav ul { justify-content: flex-start; }
}

/* ---------- Print: show the whole edition ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .nav { display: none; }
  [hidden] { display: block !important; }
  a { text-decoration: none; }
}

/* ==========================================================
   Home: a one-screen front page (exactly the viewport size)
   ========================================================== */
.front-lead { text-align: center; padding-bottom: .6rem; }
.front-lead .kicker { text-align: center; margin-bottom: .2rem; }
.front-lead .big {
  margin: 0; font: 900 clamp(1.8rem, min(6.2vw, 9.5vh), 4.6rem)/1 var(--head); letter-spacing: -.02em;
}
.front-lead .big a { text-decoration: none; }
.front .deck-hero { margin: .5rem auto .7rem; max-width: 72ch; font-size: clamp(.95rem, min(1.8vw, 2.6vh), 1.3rem); }
.front-cols {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; padding-top: .9rem;
}
.fcol { min-width: 0; padding: 0 1.2rem; border-left: 1px solid var(--ink); }
.fcol:first-child { padding-left: 0; border-left: 0; }
.fcol:last-child { padding-right: 0; }
.col-title {
  margin: 0 0 .6rem; padding-bottom: .2rem; border-bottom: 2px solid var(--ink);
  font: 800 .72rem var(--head); letter-spacing: .16em; text-transform: uppercase;
}
.teaser { margin-bottom: .9rem; padding-bottom: .8rem; border-bottom: 1px dotted var(--ink); }
.teaser:last-child { margin-bottom: 0; border-bottom: 0; }
.teaser .headline { font-size: 1.28rem; }
.teaser .headline a { text-decoration: none; }
.teaser .headline a:hover { text-decoration: underline; }
.teaser .deck { font-size: .95rem; margin-bottom: .4rem; }
.snippet { margin: 0; font-size: .92rem; text-align: justify; hyphens: auto; }
.fcol-main .body { font-size: 1.02rem; }
.subscribe-mini { margin: .7rem 0 0; text-align: center; font-size: .78rem; font-style: italic; }

@media (min-width: 861px) and (min-height: 521px) {
  body[data-view="home"] { height: 100dvh; overflow: hidden; }
  body[data-view="home"] .sheet { height: 100dvh; display: flex; flex-direction: column; padding-bottom: .8rem; }
  body[data-view="home"] main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body[data-view="home"] .section.home { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0; }
  body[data-view="home"] .front { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-top: .7rem; }
  body[data-view="home"] .front-lead { flex: 0 0 auto; }
  body[data-view="home"] .front-cols { flex: 1 1 auto; min-height: 0; }
  body[data-view="home"] .fcol {
    min-height: 0; overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 calc(100% - 2rem), transparent);
    mask-image: linear-gradient(#000 calc(100% - 2rem), transparent);
  }
  body[data-view="home"] .colophon { flex: 0 0 auto; margin-top: .4rem; }
}
@media (max-width: 860px), (max-height: 520px) {
  .front-cols { grid-template-columns: 1fr; row-gap: 1.4rem; }
  .fcol, .fcol:first-child, .fcol:last-child { padding: 0; border-left: 0; }
}

.edition span { white-space: nowrap; }
.edition a { font-size: .95rem; }

/* ---------- Theme toggle ---------- */
.nav .theme-li { border-left: 1px solid var(--ink); }
@media (min-width: 861px) { .nav .theme-li { position: absolute; right: 0; top: 0; bottom: 0; border-left: 0; } }
.theme-toggle {
  display: flex; align-items: center; gap: .45rem; height: 100%; padding: .55rem 1.1rem; cursor: pointer;
  background: none; border: 0; color: inherit; font: 700 .82rem var(--head); letter-spacing: .14em; text-transform: uppercase;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle .ico { font-size: 1.05rem; line-height: 1; letter-spacing: 0; }
.nav ul { position: relative; }
@media (max-width: 860px) {
  .theme-toggle { padding: .5rem .8rem; font-size: .72rem; letter-spacing: .08em; }
}

/* Latest note headline sits above its text, in the left column */
.fcol-main .kicker { margin-bottom: .2rem; }
.fcol-main .big {
  margin: 0 0 .4rem; font: 900 clamp(1.8rem, min(3.6vw, 6.2vh), 3.1rem)/1.04 var(--head); letter-spacing: -.015em; text-align: left;
}
.fcol-main .big a { text-decoration: none; }
.fcol-main .big a:hover { text-decoration: underline; }
.fcol-main .deck-hero { margin: 0 0 .8rem; max-width: none; text-align: left; font-size: 1.12rem; line-height: 1.3; }

/* ---------- Footer: only the ex libris, tinted by the current theme ---------- */
.colophon { margin-top: 1.5rem; height: 0; border-top: 3px double var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Mobile menu: collapsible, items listed vertically ---------- */
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .7rem .2rem; cursor: pointer;
    background: none; border: 0; color: inherit; font: 700 .85rem var(--head); letter-spacing: .14em; text-transform: uppercase;
  }
  .burger i { display: block; width: 22px; height: 2px; margin: 4px 0; background: currentColor; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] .burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .burger i:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .nav ul { display: none; flex-direction: column; justify-content: flex-start; border-top: 1px solid var(--ink); }
  .nav.open ul { display: flex; }
  .nav li + li, .nav .theme-li { border-left: 0; border-top: 1px solid var(--ink); }
  .nav a { padding: .8rem .6rem; font-size: .8rem; letter-spacing: .12em; }
  .theme-toggle { width: 100%; padding: .8rem .6rem; font-size: .8rem; letter-spacing: .12em; }
}

/* ---------- The ex libris, "stamped" beside the masthead title ---------- */
.masthead-row { display: flex; justify-content: center; align-items: center; }
.masthead-row h1 { position: relative; z-index: 1; }
.stamp {
  position: relative; z-index: 2; flex: none; display: block; width: auto; pointer-events: none;
  height: clamp(66px, min(9.5vw, 14vh), 128px); aspect-ratio: 640 / 893;
  margin: -.9rem .6rem -1.1rem 0;
  transform: rotate(-9deg);
  opacity: .93; mix-blend-mode: multiply;      /* ink soaks into the paper and over the rules */
  filter: url(#ink);
}
:root[data-theme="dark"] .stamp {
  mix-blend-mode: screen;
  filter: url(#ink) invert(1) brightness(.92) sepia(.12);
}
@media (max-width: 860px) {
  .stamp { height: clamp(52px, 15vw, 84px); margin: -.4rem .5rem -.6rem 0; }
}
