/* The web wrap — the paper's sibling on a screen (DESIGN.md). Paper-colored,
   the paper's own fonts, oxblood for links and errors only, no rounded
   corners, no system colors, state transitions only. */

@font-face { font-family: "Literata"; src: url("/fonts/literata/Literata-Regular.ttf"); font-weight: 400; font-style: normal; }
@font-face { font-family: "Literata"; src: url("/fonts/literata/Literata-Italic.ttf"); font-weight: 400; font-style: italic; }
@font-face { font-family: "Literata"; src: url("/fonts/literata/Literata-Medium.ttf"); font-weight: 500; font-style: normal; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces/Fraunces72pt-Regular.ttf"); font-weight: 400; font-style: normal; }

:root {
  --ink: #1A1817;
  --paper: #FAF7F2;
  --oxblood: #7A2E2E;
  --hairline: rgba(26, 24, 23, 0.2); /* ink at reduced weight */
}

* { margin: 0; padding: 0; box-sizing: border-box; border-radius: 0; }

/* The hidden attribute must beat any display rule we set ourselves. */
[hidden] { display: none !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Literata", "Charter", Georgia, serif;
  font-size: 17px;
  line-height: 1.55;
  max-width: 42rem;
  margin: 0 auto;
  padding: 40px 16px 96px;
}

a { color: var(--oxblood); text-decoration: none; }
a:hover { text-decoration: underline; }

.furniture {
  font-variant-caps: all-small-caps;
  font-feature-settings: "smcp", "c2sc";
  letter-spacing: 0.08em;
}

.rule { border: none; border-top: 1px solid var(--ink); }

/* ---------------------------------------------------------------- header */

.masthead {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  text-align: center;
  letter-spacing: 0.01em;
}

.dateline { text-align: center; margin-top: 8px; }
.edition-no { color: var(--oxblood); }

.meta-line {
  text-align: center;
  font-size: 13px;
  margin: 8px 0 16px;
}

/* ------------------------------------------------------------------ CTA */

.wrap-header { position: relative; }

.over { color: var(--oxblood); }

/* The primary action, top right of the main header — the only framed,
   inverting control. In the flow, above the masthead; the margins stay
   empty. */
.generate-btn {
  display: block;
  margin: 0 0 16px auto;
  font: inherit;
  font-size: 14px;
  font-variant-caps: all-small-caps;
  font-feature-settings: "smcp", "c2sc";
  letter-spacing: 0.08em;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 6px 24px;
  cursor: pointer;
}
.generate-btn:hover { background: var(--ink); color: var(--paper); }

/* Curate's header pair: Generate (primary) with send-now quietly beneath. */
.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 16px;
}
.header-actions .generate-btn { margin: 0; }

/* ------------------------------------------------- the editions homepage */

.editions { margin-top: 40px; }

.edition-list { list-style: none; }

.edition-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.edition-title { font-style: italic; font-size: 19px; }
span.edition-title { color: rgba(26, 24, 23, 0.75); }

.edition-meta {
  grid-column: 1;
  font-size: 13px;
  margin-top: 2px;
  color: rgba(26, 24, 23, 0.75);
}

/* The masthead number, large and standalone — same voice as the curate
   page's per-piece page counts. */
.edition-folio {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: "Fraunces", serif;
  font-size: 28px;
  line-height: 1;
  min-width: 2ch;
  text-align: right;
}

/* ------------------------------------------------------------ candidates */

.toc, .pub { margin-top: 40px; }

/* The contents-preview header doubles as the pages-column header: the
   running totals sit beneath their titles, pieces left, pages right. */
.toc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.toc-title {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.14em;
}

.toc-sub {
  font-size: 13px;
  color: rgba(26, 24, 23, 0.75);
  margin: 2px 0 8px;
}

.toc-head-right { text-align: right; }

.group-label {
  font-size: 13px;
  letter-spacing: 0.14em;
  font-weight: 400;
  margin-bottom: 8px;
}

.pub-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.pub-head .group-label { margin-bottom: 8px; }

/* Quiet inline controls: type does the work, no chrome. The star's hover
   simply previews the opposite state — no background, no color shift. */
.star-btn {
  font: inherit;
  font-size: 14px;
  background: none;
  border: none;
  padding: 0 4px;
  cursor: pointer;
  color: var(--ink);
}
.star-btn::after { content: "☆"; }
.star-btn.starred::after { content: "★"; }
.star-btn:hover::after { content: "★"; }
.star-btn.starred:hover::after { content: "☆"; }

/* Per-publication settings: a native details/summary dropdown, no script. */
.pub-menu { position: relative; }
.pub-menu summary {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  color: rgba(26, 24, 23, 0.55);
  padding: 0 2px;
}
.pub-menu summary::-webkit-details-marker { display: none; }
.pub-menu summary:hover { color: var(--ink); }
.pub-menu .menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--paper);
  border: 1px solid var(--ink);
  min-width: 13rem;
  z-index: 2;
}
.pub-menu .menu button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
}
.pub-menu .menu button:hover { background: rgba(26, 24, 23, 0.06); }

/* Mark-as-read: sits at the end of the meta line, dimmed until meant.
   .quiet-action is the same voice for inline actions elsewhere in the
   furniture (send-now beside "open" in the dateline). */
.read-btn,
.quiet-action {
  font: inherit;
  font-variant-caps: all-small-caps;
  font-feature-settings: "smcp", "c2sc";
  letter-spacing: 0.08em;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(26, 24, 23, 0.55);
}
.read-btn:hover,
.quiet-action:hover { color: var(--oxblood); }
.quiet-action:disabled { cursor: default; color: rgba(26, 24, 23, 0.55); }

.candidates { list-style: none; }

.candidates li { border-bottom: 1px solid var(--hairline); }

/* Not a <label>: only the checkbox itself toggles selection — titles and
   meta are read, not clicked. */
.cand-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 12px;
  align-items: baseline;
  padding: 12px 0;
}

input[type="checkbox"] {
  accent-color: var(--ink);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.cand-title { font-style: italic; }

.cand-meta {
  grid-column: 2;
  font-size: 13px;
  margin-top: 2px;
  color: rgba(26, 24, 23, 0.75);
}

/* The key fact per row: estimated pages, large and standalone. */
.cand-pages {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: "Fraunces", serif;
  font-size: 28px;
  line-height: 1;
  min-width: 2ch;
  text-align: right;
}

/* Under a publication heading the source is redundant; in the contents
   preview (rows move there live) it matters. */
.pub .cand-source { display: none; }

.toc-empty {
  font-size: 13px;
  color: rgba(26, 24, 23, 0.6);
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}

/* ------------------------------------------------------- admin app pages */

.masthead-link { color: inherit; text-decoration: none; }
.masthead-link:hover { text-decoration: none; }

a.generate-btn { text-decoration: none; text-align: center; width: fit-content; }
.generate-btn.inline { position: static; display: inline-block; margin: 0; }

.quiet-btn {
  font: inherit;
  font-size: 12px;
  font-variant-caps: all-small-caps;
  font-feature-settings: "smcp", "c2sc";
  letter-spacing: 0.08em;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(26, 24, 23, 0.55);
}
.quiet-btn:hover { color: var(--oxblood); }

.reader { margin-top: 40px; }
.reader-head { display: flex; justify-content: space-between; align-items: baseline; }
.reader-head .group-label { font-size: 16px; margin-bottom: 8px; }
.reader-links { font-size: 12px; }
.reader-meta { font-size: 13px; color: rgba(26, 24, 23, 0.75); margin-top: 8px; }
.reader-status { font-size: 15px; margin-top: 8px; }
.scheduler-line { margin-top: 48px; font-size: 12px; color: rgba(26, 24, 23, 0.55); }
.empty { margin-top: 40px; }

.form-page { margin-top: 8px; }
.settings fieldset {
  border: none;
  border-top: 1px solid var(--ink);
  padding: 12px 0 4px;
  margin-top: 24px;
}
.settings legend {
  font-size: 13px;
  letter-spacing: 0.14em;
  padding-right: 12px;
}
.settings label {
  display: grid;
  grid-template-columns: 11rem 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 15px;
}
.settings input, .settings select {
  font: inherit;
  font-size: 15px;
  background: var(--paper);
  color: var(--ink);
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 2px 0;
}
.settings input:focus, .settings select:focus {
  outline: none;
  border-bottom-color: var(--ink);
}
.settings .actions { margin-top: 32px; }

.feed-actions { margin: 24px 0 40px; }
.inline-form { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; }
.inline-form input {
  font: inherit;
  font-size: 14px;
  flex: 1;
  background: var(--paper);
  color: var(--ink);
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 2px 0;
}
.inline-form input:focus { outline: none; border-bottom-color: var(--ink); }
.feed-row .cand-row { grid-template-columns: auto 1fr auto; }
.feed-hidden .cand-title, .feed-hidden .cand-meta { color: rgba(26, 24, 23, 0.4); }
.star-form { display: inline; }
.send-now-form { display: inline; }

/* -------------------------------------------------- contents view triage */

.triage-row {
  touch-action: pan-y;
  will-change: transform;
  background: var(--paper);
}
/* Leaning: the swipe previews its verdict in plain words, no color flood. */
.triage-row.leaning-later, .triage-row.leaning-never { opacity: 0.75; }
.triage-row.swiped-right { transition: transform 0.2s, opacity 0.2s; transform: translateX(110%); opacity: 0; }
.triage-row.swiped-left { transition: transform 0.2s, opacity 0.2s; transform: translateX(-110%); opacity: 0; }

/* Triage and bench rows: the title with its meta stacked beneath on the
   left, then the page count, then the action squares at the far right. */
.triage-row .cand-row, .pool-row .cand-row {
  grid-template-columns: 1fr auto auto;
}
.triage-row .cand-title, .pool-row .cand-title { grid-column: 1; grid-row: 1; }
.triage-row .cand-meta, .pool-row .cand-meta { grid-column: 1; grid-row: 2; }
.triage-row .cand-pages, .pool-row .cand-pages { grid-column: 2; }

.row-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}

/* The selection square: filled = in this edition, empty = on the bench.
   Hover previews the opposite state, gently. */
.select-box {
  width: 15px;
  height: 15px;
  border: 1px solid var(--ink);
  background: none;
  padding: 0;
  cursor: pointer;
}
.select-box:hover { background: rgba(26, 24, 23, 0.25); }
.select-box.selected { background: var(--ink); }
.select-box.selected:hover { background: rgba(26, 24, 23, 0.55); }

/* The archive square: mark as read, gone for good. Quiet line icon. */
.icon-btn {
  width: 15px;
  height: 15px;
  display: inline-flex;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(26, 24, 23, 0.55);
}
.icon-btn:hover { color: var(--oxblood); }
.icon-btn svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

.triage-hint {
  font-size: 12px;
  color: rgba(26, 24, 23, 0.55);
  margin-top: 12px;
}

/* The bench: its heading announces the shelf; the publication groups
   beneath bring their own rules, so the heading sits close. */
.pool-head { margin-top: 56px; }
.pool-head .toc-sub { margin-bottom: 0; }
.pool-head + .pub { margin-top: 20px; }

.edition-links { font-size: 13px; margin-top: 32px; }

/* Reading view (The Print): the paper's typography on a screen. */
.reader-view .piece { margin-top: 56px; }
.reader-view .headline {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  margin-bottom: 8px;
}
.reader-view .byline { font-size: 13px; color: rgba(26, 24, 23, 0.75); margin-bottom: 16px; }
.reader-view .body p { margin: 0 0 14px; }
.reader-view .body h1, .reader-view .body h2, .reader-view .body h3, .reader-view .body h4 {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: 20px;
  margin: 24px 0 8px;
}
.reader-view .body ul, .reader-view .body ol { margin: 0 0 14px 24px; }
.reader-view .body li { margin-bottom: 4px; }
.reader-view .body blockquote {
  margin: 0 0 14px 16px;
  padding-left: 12px;
  border-left: 1px solid var(--hairline);
}
.reader-view .body img { max-width: 100%; height: auto; margin: 8px 0; }
.reader-view .body figure { margin: 8px 0; }
.reader-view .body figcaption { font-size: 12px; color: rgba(26, 24, 23, 0.6); }
.reader-view .body pre { overflow-x: auto; font-size: 13px; margin: 0 0 14px; }
.reader-view .continues { font-size: 13px; }
.print-contents { margin-top: 32px; }
.contents-label { font-size: 13px; letter-spacing: 0.14em; margin-bottom: 8px; }
.print-toc { list-style: none; font-size: 13px; margin-bottom: 16px; }
.print-toc li { padding: 3px 0; }
.pending-actions { margin-top: 8px; }
.pending-actions .where { margin-top: 12px; }

/* Small screens: the triage list is a thumb surface. */
@media (max-width: 600px) {
  body { padding: 24px 14px 96px; font-size: 16px; }
  .masthead { font-size: 32px; }
  .cand-pages { font-size: 22px; }
  .toc, .pub { margin-top: 28px; }
  /* Swipe is the verb on paper rows; the squares are desktop. The bench
     keeps its squares — bench rows don't swipe. */
  .triage-row .row-actions { display: none; }
  .edition-folio { font-size: 22px; }
}

/* ---------------------------------------------------------------- result */

.result { margin-top: 32px; }
.lede { margin-bottom: 16px; }
.pdfs { list-style: none; }
.pdfs li { padding: 4px 0; }
.where { font-size: 13px; margin-top: 16px; }
.send-now-block { margin-top: 8px; }
.error { color: var(--oxblood); }
.back { margin-top: 32px; }

/* ------------------------------------------------------------ footer nav */

.site-nav {
  margin-top: 64px;
  font-size: 12px;
  text-align: center;
  color: rgba(26, 24, 23, 0.55);
}
.site-nav a { color: inherit; }
.site-nav a:hover { color: var(--oxblood); }
