@import url('https://fonts.googleapis.com/css2?family=IM+Fell+DW+Pica+SC&family=IM+Fell+English:ital@0;1&family=Sorts+Mill+Goudy:ital@0;1&display=swap');

/* ============================================================
   THE SAM HILL! REVIEW — shared stylesheet
   Linked by every piece page: <link rel="stylesheet" href="/style.css">
   ------------------------------------------------------------
   TO PUBLISH A PIECE
   1. Copy piece-template.html, rename it to the slug
   2. Change the <title>, the og: tags, and the title block
   3. Drop the image in /images/ and update the <img src>
   4. Write the editor's note, paste the body
   5. Add a line to the volume's table of contents
   ------------------------------------------------------------
   CLASSES WORTH KNOWING
   .piece--columns   two columns. Short prose only (~700 words),
                     never poetry, never with footnotes.
   p.drop            drop capital on a paragraph. Skip it if the
                     piece opens on dialogue or a date line.
   .verse            poetry — see the VERSE block below.
   .break            a * * * scene divider.
   .sec              a numbered section head.
   ------------------------------------------------------------
   FONTS: only IM Fell DW Pica SC and Sorts Mill Goudy are used.
   Each page must load them:
   <link href="https://fonts.googleapis.com/css2?family=IM+Fell+DW+Pica+SC&family=Sorts+Mill+Goudy:ital@0;1&display=swap" rel="stylesheet">
   ============================================================ */

:root {
  --paper:      #000000;
  --ink:        #FFFFFF;
  --ink-quiet:  #C9C4BC;
  --ink-faint:  #8F897C;
  --ink-hover:  #F2E4C0;
  --rule:       #3A3A3A;

  --face-display: 'IM Fell DW Pica SC', serif;
  --face-caps:    'IM Fell DW Pica SC', serif;
  --face-text:    'IM Fell English', serif;
  --face-nav:     'IM Fell DW Pica SC', serif;
  --face-aside:   'IM Fell English', serif;   /* italic connectives, asides */

  --measure:    660px;
  --plate:      720px;
  --logo-width: 400px;
  --space-para: 0.32em;
  --ornament-width: 90px;
  --arg-width: 850px;   /* the argument runs wider than the text column */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 30px 0 56px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--face-text);
  font-size: clamp(1.02rem, 2.2vw, 1.14rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px dotted var(--ink); outline-offset: 3px; }

.wrap  { max-width: var(--measure); margin: 0 auto; padding: 0 24px; }
.plate { max-width: var(--plate);   margin: 0 auto; padding: 0 24px; }

.ornament {
  text-align: center; letter-spacing: 8px;
  font-size: 1.3rem; line-height: 1;
  margin: 30px 0; transform: rotate(0.3deg);
}

/* ============================================================
   LETTERPRESS TILT — fixed, not random. Past ~1deg reads wrong.
   ============================================================ */
.site-logo     { transform: rotate(-0.4deg); }
.site-nav      { transform: rotate( 0.2deg); }
.piece-title   { transform: rotate(-0.45deg); }
.piece-author  { transform: rotate( 0.3deg); }
.note          { transform: rotate(-0.2deg);  }
.notes-head    { transform: rotate( 0.35deg); }
.colophon-line { transform: rotate(-0.25deg); }

/* ============================================================
   SITE HEADER — logo + navigation
   Change --logo-width to resize the mark.
   ============================================================ */
.site-head {
  max-width: var(--plate);
  margin: 0 auto 36px;
  padding: 0 24px 18px;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.site-logo { display: block; margin: 0 auto 16px; }
.site-logo img {
  display: block;
  width: 100%;
  max-width: var(--logo-width);
  height: auto;
  margin: 0 auto;
}

.site-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  font-family: var(--face-nav);
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  letter-spacing: 2px;
  color: var(--ink);
  text-transform: uppercase;
}
.site-nav a { transition: color 120ms linear; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink-hover); }

/* ============================================================
   PLATE — the wide image
   ============================================================ */
.plate-fig { margin: 0 0 38px; }
.plate-fig img { display: block; width: 100%; height: auto; margin: 0 auto;}
.plate-cap {
  display: block; text-align: center;
  font-family: var(--face-caps);
  letter-spacing: 3px; font-size: 0.66rem;
  color: var(--ink-faint); margin-top: 12px;
}

/* ============================================================
   TITLE BLOCK
   ============================================================ */
.piece-title {
  text-align: center;
  font-family: var(--face-display);
  font-weight: normal;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.12;
  margin: 0 0 14px;
}

.piece-author {
  text-align: center;
  font-family: var(--face-caps);
  letter-spacing: 3px;
  font-size: 1.25rem;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.kind-sep { opacity: 0.5; margin: 0 4px; }
.piece-kind {
  text-align: center;
  font-family: var(--face-caps);
  letter-spacing: 3px;
  font-size: 0.67rem;
  color: var(--ink-faint);
  margin: 0 0 34px;
  text-transform: uppercase;
}

/* ============================================================
   EDITOR'S NOTE
   ============================================================ */
.note {
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 0.95rem;
  line-height: 1.66;
  max-width: 86%;
  margin: 0 auto;
  padding-left: 18px;
  border-left: 1px solid var(--rule);
}
.note p { margin: 0 0 0.8em; text-align: left; }
.note p:last-child { margin-bottom: 0; }

/* ============================================================
   THE PIECE
   ============================================================ */
.piece { margin-top: 38px; }

.piece p {
  margin: 0 0 var(--space-para);
  text-indent: 1.5em;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* numbered section head */
.sec {
  text-align: center;
  font-family: var(--face-display);
  font-size: 1.6rem;
  color: var(--ink);
  margin: 1.7em 0 0.9em;
  line-height: 1;
}
.sec:first-child { margin-top: 0; }

/* a section's opening paragraph is never indented */
.piece p.drop,
.piece .sec + p,
.piece .break + p { text-indent: 0; }

/* drop capital */
.piece p.drop::first-letter {
  float: left;
  font-family: var(--face-display);
  font-size: 3.5em;
  line-height: 0.8;
  padding: 0.06em 0.09em 0 0;
}
.piece p.drop .lead {
  font-family: var(--face-caps);
  letter-spacing: 2px;
}

/* ---------- VERSE ----------
   .verse            flush left, hanging indent
   .verse--center    same, but the block is centered on the page
                     (lines stay left-aligned to each other)
   Both preserve line breaks exactly as typed, so strip any
   leading whitespace from the source and keep only the steps
   you actually want to see.
   -------------------------------------------------------- */
.piece .verse {
  white-space: pre-wrap;
  text-align: left;
  hyphens: none;
  font-size: 1.25em;
  line-height: 1.35;
  margin: 0 0 1.5em;
  /* (The old hanging indent — padding-left 1.3em / text-indent -1.3em —
     only ever caught the FIRST line of a pre-wrap block, so line one
     stuck out past the rest of the poem. Removed.) */
  padding-left: 0;
  text-indent: 0;
}

/* one line of verse (pages built from Vol. 1 onward wrap each line
   in <span class="vl">): a line too long for the screen hangs
   indented below itself */
.piece .verse .vl {
  display: inline-block;
  max-width: 100%;
  padding-left: 1.3em;
  text-indent: -1.3em;
  vertical-align: top;
}

.piece .verse--center {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* section break ornament */
.piece .break {
  text-align: center;
  letter-spacing: 8px;
  font-size: 1.15rem;
  margin: 1.9em 0;
  line-height: 1;
}

.piece blockquote {
  margin: 0 0 var(--space-para);
  padding-left: 20px;
  border-left: 1px solid var(--rule);
  font-size: 0.96em;
  color: var(--ink-quiet);
}

/* ---------- two-column mode: short prose only ---------- */
.piece--columns {
  columns: 21em 2;
  column-gap: 44px;
  column-rule: 1px solid var(--rule);
}
.piece--columns p { orphans: 3; widows: 3; }
.piece--columns p.drop { break-inside: avoid; }

/* ============================================================
   FOOTNOTES
   ============================================================ */
.fn {
  font-family: var(--face-caps);
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
  padding: 0 1px 0 2px;
  color: var(--ink-quiet);
  transition: color 120ms linear;
}
.fn:hover { color: var(--ink-hover); }

.notes {
  margin-top: 48px;
  padding-top: 4px;
  border-top: 1px solid var(--rule);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-quiet);
}
.notes-head {
  font-family: var(--face-caps);
  letter-spacing: 5px;
  font-size: 0.68rem;
  color: var(--ink-faint);
  text-align: center;
  margin: 16px 0 22px;
}
.notes ol { margin: 0; padding-left: 1.8em; }
.notes li { margin-bottom: 0.9em; scroll-margin-top: 24px; }
.notes li::marker { font-family: var(--face-caps); color: var(--ink-faint); }
.notes li:target { color: var(--ink); }
.fn-back {
  margin-left: 6px;
  color: var(--ink-faint);
  transition: color 120ms linear;
}
.fn-back:hover { color: var(--ink-hover); }

/* ============================================================
   CONTRIBUTOR + FOOT
   ============================================================ */
.bio-block {
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
  line-height: 1.66;
  color: var(--ink-quiet);
}
.bio-head {
  font-family: var(--face-caps);
  letter-spacing: 5px;
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.bio-block p { margin: 0; text-align: left; }
.bio-name { font-family: var(--face-caps); letter-spacing: 2px; }

.colophon-line {
  text-align: center;
  font-family: var(--face-caps);
  letter-spacing: 4px;
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 40px;
}
.colophon-line a { transition: color 120ms linear; }
.colophon-line a:hover { color: var(--ink-hover); }

.footer { margin-top: 52px; text-align: center; color: var(--ink-quiet); }
.footer .ornament { color: var(--ink-quiet); }
.socials {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 26px;
  font-family: var(--face-caps); letter-spacing: 3px; font-size: 0.9rem;
}
.socials a { transition: color 120ms linear; }
.socials a:hover { color: var(--ink); }

/* ============================================================
   VOLUME PAGE — broadside
   The type here is meant to shout. 1870, and the editors are
   running a confidence scheme.
   ============================================================ */
.vol-line {
  text-align: center;
  font-family: var(--face-display);
  font-size: clamp(2.4rem, 3vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0 0 6px;
  transform: rotate(-0.9deg);
}
.vol-season {
  text-align: center;
  font-family: var(--face-caps);
  letter-spacing: 8px;
  font-size: clamp(0.8rem, 2.2vw, 0.95rem);
  color: var(--ink);
  text-transform: uppercase;
  margin: 0 0 20px;
  transform: rotate(-0.4deg);
}
.vol-mark { letter-spacing: 0; margin: 0 6px; }

/* heavy rule under the volume line, broadside style */
.rule-heavy {
  border: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 1px;
  width: 100%;
  margin: 20px 0 26px;
  transform: rotate(-0.1deg);
}

/* ---------- THE ARGUMENT ----------
   The old chapter-heading summary, set as a broadside.
   Each clause its own line in <span class="arg-line">.
   Use .arg-lead on a clause to give it more size.
   ---------------------------------------------------------- */
.argument {
  text-align: center;
  font-family: var(--face-display);
  color: var(--ink);
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  line-height: 1.28;
  margin: 0 auto;
  width: 92vw;
  max-width: var(--arg-width);
  margin-left: 50%;
  transform: translateX(-50%) rotate(-0.2deg);
}
.argument p { margin: 0; text-indent: 0; }

.arg-line { display: block; margin: 0 0 10px; }
.arg-line:last-child { margin-bottom: 0; }

/* a clause you want louder */
.arg-lead {
  font-size: 1.35em;
  line-height: 1.14;
  letter-spacing: 1px;
}

/* the small connective words between clauses */
.arg-small {
  display: block;
  font-family: var(--face-aside);
  font-style: italic;
  font-size: 1em;
  letter-spacing: 0;
  color: var(--ink);
  text-transform: none;
  margin: 14px 0;
}

/* editor's introduction */
.intro { margin: 0 auto; }
.intro p {
  margin: 0 0 0.9em;
  text-indent: 1.5em;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.intro p:first-child { text-indent: 0; }
.intro p:last-child { margin-bottom: 0; }
.intro-sig {
  display: block;
  text-align: right;
  font-family: var(--face-caps);
  letter-spacing: 3px;
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: 14px;
  text-transform: uppercase;
}

/* ---------- table of contents ---------- */
.toc { margin: 0 auto; transform: rotate(0.12deg); }

.toc-entry {
  display: flex;
  align-items: baseline;
  padding: 9px 0;
  transition: color 120ms linear;
}
.toc-entry:hover, .toc-entry:focus-visible { color: var(--ink-hover); }

.toc-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: clamp(0.98rem, 2.2vw, 1.14rem);
}
.toc-leader {
  flex: 1; overflow: hidden; white-space: nowrap;
  margin: 0 6px; letter-spacing: 3px;
  font-size: clamp(0.98rem, 2.2vw, 1.14rem);
}
.toc-author {
  white-space: nowrap;
  font-style: italic;
  color: var(--ink);
  font-size: clamp(0.9rem, 2vw, 1.04rem);
}

.toc-entry:nth-child(5n+1) { transform: rotate(-0.18deg); }
.toc-entry:nth-child(5n+2) { transform: rotate( 0.24deg); }
.toc-entry:nth-child(5n+3) { transform: rotate(-0.3deg);  }
.toc-entry:nth-child(5n+4) { transform: rotate( 0.14deg); }
.toc-entry:nth-child(5n+5) { transform: rotate(-0.22deg); }

/* a genre label above a run of entries */
.toc-group {
  font-family: var(--face-caps);
  letter-spacing: 5px;
  font-size: 0.8rem;
  color: var(--ink);
  text-align: center;
  margin: 34px 0 12px;
  text-transform: uppercase;
}
.toc-group:first-child { margin-top: 0; }

/* ============================================================
   ORNAMENTAL CUT — a small image ending a piece
   <div class="ornament-img">
     <img class="negative-img" src="/images/ornaments/x.png" alt="">
   </div>
   .negative-img flips black-on-transparent art to white.
   ============================================================ */
.ornament-img { text-align: center; margin: 2.4em 0 0; }
.ornament-img img {
  display: inline-block;
  width: 100%;
  max-width: var(--ornament-width);
  height: auto;
}
.negative-img { filter: invert(100%); }

/* colophon line under the socials */
.colophon {
  font-family: var(--face-caps);
  letter-spacing: 3px;
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-top: 18px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media (max-width: 640px) {
  .piece .verse { font-size: 1.1em; }
  .piece--columns { columns: auto; column-rule: none; }
  .piece p { text-align: left; hyphens: none; }
  .note { max-width: 100%; }
}

/* ============================================================
   PREVIOUS / NEXT — bottom of every piece, in order of setting
   ============================================================ */
.piece-nav {
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: 40px; padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.piece-nav a { max-width: 46%; transition: color 120ms linear; }
.piece-nav a:hover { color: var(--ink-hover); }
.pn-next { text-align: right; margin-left: auto; }
.pn-label {
  display: block; font-family: var(--face-caps); letter-spacing: 3px;
  font-size: 0.68rem; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 4px;
}
.pn-title { font-style: italic; font-size: 0.98rem; line-height: 1.35; }
