/* Gazette — a broadsheet theme for Hugo. lisot.to */

/* ---------- tokens ---------- */
:root {
  --paper: #f9f6ee;
  --paper-raised: #f3eede;
  --ink: #14120e;
  --heading: #14120e;
  --ink-80: rgba(20, 18, 14, .8);
  --ink-70: rgba(20, 18, 14, .7);
  --ink-60: rgba(20, 18, 14, .6);
  --ink-55: rgba(20, 18, 14, .55);
  --ink-50: rgba(20, 18, 14, .5);
  --ink-25: rgba(20, 18, 14, .25);
  --brick: #b5532a;
  --brick-soft: rgba(181, 83, 42, .4);
  --brick-tint: rgba(181, 83, 42, .09);
  --code-string: #8f4620;
  --code-number: #6d5126;
  --serif: 'Newsreader', Georgia, serif;
  --display: 'Playfair Display', Georgia, serif;
  --label: 'Libre Franklin', system-ui, sans-serif;
  --mono: 'Courier Prime', 'Courier New', monospace;
  --versal: 'UnifrakturMaguntia', serif;
}
[data-theme="dark"] {
  --paper: #16130f;
  --paper-raised: #211c15;
  --ink: #ece7dc;
  --heading: #faf9f5;
  --ink-80: rgba(236, 231, 220, .82);
  --ink-70: rgba(236, 231, 220, .72);
  --ink-60: rgba(236, 231, 220, .6);
  --ink-55: rgba(236, 231, 220, .55);
  --ink-50: rgba(236, 231, 220, .5);
  --ink-25: rgba(236, 231, 220, .25);
  --brick: #d0703f;
  --brick-soft: rgba(208, 112, 63, .45);
  --brick-tint: rgba(208, 112, 63, .13);
  --code-string: #d8a06a;
  --code-number: #cbb27a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16130f;
    --paper-raised: #211c15;
    --ink: #ece7dc;
    --heading: #faf9f5;
    --ink-80: rgba(236, 231, 220, .82);
    --ink-70: rgba(236, 231, 220, .72);
    --ink-60: rgba(236, 231, 220, .6);
    --ink-55: rgba(236, 231, 220, .55);
    --ink-50: rgba(236, 231, 220, .5);
    --ink-25: rgba(236, 231, 220, .25);
    --brick: #d0703f;
    --brick-soft: rgba(208, 112, 63, .45);
    --brick-tint: rgba(208, 112, 63, .13);
    --code-string: #d8a06a;
    --code-number: #cbb27a;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.66;
  overflow-x: clip;  /* contain the full-bleed rule breakouts without breaking sticky TOC */
}
img { max-width: 100%; height: auto; }
::selection { background: rgba(181, 83, 42, .25); }
.sheet { max-width: 1200px; margin: 0 auto; padding: 0 22px; }
.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 12px; top: 12px; z-index: 10; background: var(--ink); color: var(--paper);
  padding: 6px 12px; font-family: var(--label); font-size: 12px;
}

/* rules (the printed lines) */
.rule { border-top: 1px solid var(--ink); }
.rule--heavy { border-top-width: 3px; }
.rule + .rule { margin-top: 2px; }
.masthead > .rule--heavy { margin-top: 10px; }

/* full-bleed structural bands: the printed lines run edge-to-edge across the page */
.masthead > .rule,
.site-footer .rule,
.mast-nav,
.dateline {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ---------- masthead ---------- */
.masthead { position: relative; }
.brand { text-align: center; padding-top: 24px; }
.brand-mark { display: inline-block; }
.logo { width: 58px; height: 58px; display: block; margin: 0 auto; }
.logo--dark { display: none; }
[data-theme="dark"] .logo--light { display: none; }
[data-theme="dark"] .logo--dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo--light { display: none; }
  :root:not([data-theme="light"]) .logo--dark { display: block; }
}
.tagline { font-style: italic; font-size: 15px; color: var(--ink-60); margin: 10px 0 0; }

.mast-nav { margin-top: 16px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.mast-nav-inner {
  position: relative; display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 10px; padding: 8px 28px;
  font-family: var(--label); font-size: 11px; font-weight: 600; letter-spacing: .2em;
}
.mast-nav a { color: var(--ink); text-decoration: none; }
.mast-nav a:hover, .mast-nav a.is-active { color: var(--brick); }
.mast-nav .dot { color: var(--brick); }
.theme-toggle {
  background: none; border: 0; padding: 0 2px; cursor: pointer;
  color: var(--ink-60); font-size: 14px; line-height: 1;
}
.theme-toggle:hover { color: var(--brick); }

.dateline {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  padding: 7px max(22px, calc(50vw - 578px)); font-family: var(--label); font-size: 10px; letter-spacing: .18em;
  color: var(--ink-60);
}
.dateline-slot { display: flex; align-items: center; gap: 12px; }

/* utility cluster: social + theme toggle, pinned to the top-right corner of the page (viewport edge, 22px gutter) */
.mast-util {
  position: absolute; top: 15px; right: calc(50% - 50vw + 22px); z-index: 2;
  display: inline-flex; align-items: center; gap: 14px;
}
.mast-util a.soc { display: inline-flex; align-items: center; color: var(--ink-60); }
.mast-util a.soc:hover { color: var(--brick); }
.mast-util a.soc svg { width: 14px; height: 14px; }

/* ---------- page + post headers ---------- */
.post-header, .notfound { max-width: 780px; margin: 40px auto 0; text-align: center; padding: 0 20px; }
.post-title {
  font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 43px);
  line-height: 1.16; margin: 0 0 14px; color: var(--heading); text-wrap: balance;
}
.post-kicker { font-family: var(--serif); font-size: 17px; letter-spacing: .22em; margin: 0 0 14px; color: var(--ink); }
.fleuron { color: var(--brick); font-size: 16px; line-height: 1; }
.post-deck {
  font-style: italic; font-size: 20px; line-height: 1.45; color: var(--ink-70);
  max-width: 600px; margin: 14px auto 18px; text-wrap: pretty;
}
.post-meta {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--label); font-size: 10.5px; font-weight: 600; letter-spacing: .2em;
  color: var(--ink);
}
.meta-rule { flex: 1; border-top: 1px solid var(--ink); }

/* ---------- article layout: sticky index left, 620px column ---------- */
.post-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 620px) 220px;
  column-gap: 60px;
  justify-content: center;
  margin-top: 42px;
}
.post-aside { grid-column: 1; }
.post-layout .prose { grid-column: 2; }

.toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; padding-top: 6px; }
.toc-head {
  font-family: var(--label); font-size: 10.5px; font-weight: 700; letter-spacing: .28em;
  color: var(--ink-55); border-bottom: 1px solid var(--ink);
  padding-bottom: 8px; margin-bottom: 12px;
}
#TableOfContents ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 9px;
}
#TableOfContents > ul { counter-reset: toc; }
#TableOfContents > ul > li { counter-increment: toc; }
#TableOfContents > ul > li > a::before {
  content: counter(toc, upper-roman) ".";
  color: var(--brick); font-style: italic; margin-right: 7px;
}
#TableOfContents ul ul { margin-top: 9px; padding-left: 18px; }
#TableOfContents a {
  font-family: var(--serif); font-size: 15px; line-height: 1.35;
  color: var(--ink-70); text-decoration: none; display: block;
}
#TableOfContents ul ul a { color: var(--ink-60); }
#TableOfContents a:hover { color: var(--brick); }
#TableOfContents a.is-active {
  color: var(--ink); font-weight: 600;
  border-left: 2px solid var(--brick); margin-left: -11px; padding-left: 9px;
}

/* ---------- prose ---------- */
.prose { font-family: var(--serif); font-size: 17.5px; line-height: 1.66; }
.prose p { margin: 0 0 15px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.prose p + p { text-indent: 1.6em; }
.prose a {
  color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--brick); text-underline-offset: 3px;
}
.prose a:hover { color: var(--brick); }
.prose h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 33px);
  line-height: 1.18; color: var(--heading); text-align: center; text-wrap: balance;
  margin: 42px 0 18px;
}
.prose h2 {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--heading); text-align: center;
  margin: 32px 0 15px;
}
.prose h2::before, .prose h2::after { content: ""; flex: 1; border-top: 1px solid var(--ink); }
.prose h3 {
  font-family: var(--serif); font-weight: 600; font-size: 15.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--heading); margin: 28px 0 12px;
}
.prose h4 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 18px; margin: 24px 0 10px; }
.prose blockquote {
  max-width: 460px; margin: 30px auto; padding: 0;
  font-style: italic; font-size: 23px; line-height: 1.4; color: var(--heading);
  text-align: center;
}
.prose blockquote::before, .prose blockquote::after {
  content: ""; display: block; width: 100%; border-top: 1px solid var(--ink);
}
.prose blockquote::before { margin-bottom: 16px; }
.prose blockquote::after { margin-top: 16px; }
.prose blockquote p { margin: 0 0 8px; text-align: center; text-indent: 0; hyphens: manual; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono); font-size: .85em;
  background: var(--brick-tint); padding: 1px 5px;
}
.prose pre {
  background: var(--paper-raised); padding: 18px 20px; margin: 26px 0;
  overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.55;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose .highlight { margin: 26px 0; }
.prose .highlight pre { margin: 0; }
.prose figure { margin: 26px 0; }
.prose figure img, .prose > p > img { display: block; margin: 0 auto; }
.prose figcaption {
  font-style: italic; font-size: 14.5px; color: var(--ink-60);
  text-align: center; margin-top: 9px;
}
.prose hr { border: none; margin: 30px 0; text-align: center; }
.prose hr::after { content: "❦ ❦ ❦"; color: var(--brick); font-size: 15px; letter-spacing: .35em; }
.prose table { margin: 26px auto; border-collapse: collapse; font-size: 15.5px; }
.prose th {
  font-family: var(--label); font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; text-align: left; padding: 8px 12px;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.prose td { padding: 8px 12px; border-bottom: 1px solid var(--ink-25); }
.prose ul, .prose ol { margin: 0 0 15px; padding-left: 1.6em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--brick); }
sup a { text-decoration: none; color: var(--brick); }

/* the medieval drop cap — automatic on the first paragraph */
.has-dropcap > p:first-of-type { text-indent: 0; }
.has-dropcap > p:first-of-type::first-letter {
  float: left;
  font-family: var(--versal);
  font-weight: 400;
  font-size: 57px;
  line-height: 1;
  color: var(--brick);
  background: var(--brick-tint);
  border: 1px solid var(--brick-soft);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--brick-soft);
  padding: 15px 16px 17px;
  margin: 6px 16px 6px 1px;
}

/* ---------- post end matter ---------- */
.post-end {
  max-width: 620px; margin: 30px auto 0; text-align: center;
  color: var(--brick); font-size: 15px; letter-spacing: .35em;
}
.post-footer {
  max-width: 620px; margin: 20px auto 0; border-top: 1px solid var(--ink);
  padding: 10px 0 0; text-align: center;
  font-style: italic; font-size: 14.5px; color: var(--ink-70);
}
.post-footer a { color: var(--ink); text-decoration: none; }
.post-footer a.tag-link { color: var(--brick); }
.post-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- home & listings ---------- */
.home, .listing { max-width: 660px; margin: 0 auto; padding: 0 20px; }
.home-intro, .listing-intro { margin-top: 34px; }
.lead { margin-top: 44px; text-align: center; }
.lead-eyebrow {
  font-family: var(--label); font-size: 10px; font-weight: 600; letter-spacing: .3em;
  color: var(--brick); margin-bottom: 12px;
}
.lead-title {
  font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4.5vw, 34px);
  line-height: 1.18; margin: 0 0 12px; text-wrap: balance;
}
.lead-title a { color: var(--heading); text-decoration: none; }
.lead-title a:hover { color: var(--brick); }
.lead-deck {
  font-style: italic; font-size: 18.5px; line-height: 1.45; color: var(--ink-70);
  max-width: 520px; margin: 0 auto 14px; text-wrap: pretty;
}
.lead .post-meta { margin-top: 2px; }
.btn-continue {
  display: inline-block; margin-top: 16px;
  font-family: var(--label); font-size: 10.5px; font-weight: 600; letter-spacing: .2em;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--ink); padding: 9px 18px;
  box-shadow: 2px 2px 0 var(--brick-soft);
  background: transparent;
}
.btn-continue:hover { background: var(--ink); color: var(--paper); }

.archive-head {
  display: flex; align-items: center; gap: 14px; justify-content: center;
  font-family: var(--serif); font-weight: 500; font-size: 16px; letter-spacing: .24em;
  color: var(--heading); margin: 36px 0 8px;
}
.archive-head::before, .archive-head::after { content: ""; flex: 1; border-top: 1px solid var(--ink); }

.archive-row {
  display: grid; grid-template-columns: 112px 1fr; gap: 18px;
  padding: 16px 0; border-bottom: 1px solid var(--ink-25);
}
.archive-row:last-child { border-bottom: none; }
.archive-when {
  font-family: var(--label); font-size: 10px; font-weight: 600; letter-spacing: .14em;
  color: var(--ink-60); padding-top: 5px;
}
.archive-when time { display: block; }
.archive-part { color: var(--brick); margin-top: 4px; }
.archive-title { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.25; margin: 0 0 6px; }
.archive-title a { color: var(--heading); text-decoration: none; }
.archive-title a:hover { text-decoration: underline; text-decoration-color: var(--brick); text-underline-offset: 3px; }
.archive-deck { font-style: italic; font-size: 15.5px; line-height: 1.45; color: var(--ink-70); margin: 0; text-wrap: pretty; }

.more-link { text-align: center; margin: 24px 0 0; }
.more-link a {
  font-family: var(--label); font-size: 10.5px; font-weight: 600; letter-spacing: .2em;
  color: var(--ink); text-decoration: none;
}
.more-link a:hover { color: var(--brick); }

.pager {
  display: flex; justify-content: space-between; align-items: center; margin: 28px 0 0;
  font-family: var(--label); font-size: 10.5px; font-weight: 600; letter-spacing: .18em;
}
.pager a { color: var(--ink); text-decoration: none; }
.pager a:hover { color: var(--brick); }
.pager-state { color: var(--ink-55); }

.terms { margin-top: 10px; }
.term-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--ink-25); text-decoration: none;
}
.term-row:last-child { border-bottom: none; }
.term-name { font-family: var(--display); font-weight: 700; font-size: 21px; color: var(--heading); }
.term-count { font-style: italic; font-size: 15px; color: var(--brick); }
.term-row:hover .term-name { color: var(--brick); }

.empty-note { text-align: center; font-style: italic; color: var(--ink-60); margin: 60px 0; }
.notfound { padding-bottom: 20px; }
.notfound .btn-continue { margin-top: 20px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 48px; }
.colophon {
  text-align: center; padding: 12px 0 16px; margin: 0;
  font-family: var(--label); font-size: 9.5px; letter-spacing: .18em; color: var(--ink-55);
}

/* ---------- syntax highlighting (Chroma, noClasses = false) ---------- */
.chroma { background: transparent; }
.chroma .c, .chroma .c1, .chroma .cm, .chroma .ch, .chroma .cs, .chroma .cp, .chroma .cpf { color: var(--ink-50); font-style: italic; }
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .sh, .chroma .sd, .chroma .sx, .chroma .sr { color: var(--code-string); }
.chroma .k, .chroma .kd, .chroma .kn, .chroma .kr, .chroma .kt, .chroma .kc, .chroma .kp, .chroma .ow { font-weight: 700; color: var(--ink); }
.chroma .m, .chroma .mi, .chroma .mf, .chroma .mh, .chroma .mo, .chroma .mb, .chroma .il { color: var(--code-number); }
.chroma .err { color: inherit; background: none; }
.chroma .hl { background: var(--brick-tint); display: block; }
.chroma .ln, .chroma .lnt { color: var(--ink-50); margin-right: .7em; }

/* ---------- responsive ---------- */
@media (max-width: 1140px) {
  .post-layout { display: block; max-width: 660px; margin: 42px auto 0; padding: 0 20px; }
  .post-aside { margin-bottom: 30px; }
  .toc { position: static; max-height: none; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .sheet { padding: 0 14px; }

  .mast-nav-inner { letter-spacing: .16em; padding: 8px 24px; }
  .prose { font-size: 16.5px; }
  .prose blockquote { font-size: 20px; }
  .archive-row { grid-template-columns: 1fr; gap: 6px; }
  .archive-when { padding-top: 0; display: flex; gap: 10px; align-items: baseline; }
  .archive-part { margin-top: 0; }
  .has-dropcap > p:first-of-type::first-letter { font-size: 46px; padding: 12px 13px 14px; margin-right: 12px; }
}

/* ---------- print ---------- */
@media print {
  .mast-nav, .theme-toggle, .site-footer .rule { display: none; }
  .toc { position: static; }
  body { background: #fff; }
}
