/* =============================================================================
   THE OLD WEST: Era Book web theme
   Served at exodusnds.com/era-books/old-west. Load AFTER assets/exodus/era-book.css.

   The printed book's look (shared/css/old-west.css in the book repository,
   locked by Paul 2026-10-20): the broadside for what catches the eye, the legal
   instrument for what holds the rules. Flat colours only; no gradients on type,
   no aged-paper effects. Fonts: Alfa Slab One (display), Playfair Display SC
   (headings, labels), Libre Caslon Text (body), from Google Fonts via site.yml.

   Part 1 sets the --eb-* tokens the shared structure reads. Part 2 themes the
   structure (the header is a broadside with a vermilion banner). Part 3 styles
   the book's own blocks as the chapters use them: bounty, instrument,
   sidebarNote, glass, descriptive, legalPage, tables, stat blocks, figures.
   ============================================================================= */

/* ── Part 1: tokens ───────────────────────────────────────────────────────── */
:root {
  --ow-paper:      #F1E9D4;
  --ow-buff:       #DFCAA0;
  --ow-pale:       #E8D98B;
  --ow-ink:        #24211E;
  --ow-prussian:   #244B70;
  --ow-vermilion:  #CB3526;
  --ow-deepred:    #872E2C;
  --ow-gold:       #E5AF33;
  --ow-ochre:      #B58439;
  --ow-saddle:     #6B4226;
  --ow-forest:     #366145;
  --ow-tan:        #B99B71;
  --ow-slate:      #6F8DA3;

  --eb-paper:        var(--ow-paper);
  --eb-paper-2:      var(--ow-buff);
  --eb-ink:          var(--ow-ink);
  --eb-muted:        #5A4A3A;
  --eb-primary:      var(--ow-prussian);
  --eb-on-primary:   var(--ow-paper);
  --eb-accent:       var(--ow-vermilion);
  --eb-on-accent:    var(--ow-paper);
  --eb-accent-2:     var(--ow-saddle);
  --eb-highlight:    var(--ow-gold);
  --eb-border:       var(--ow-ink);
  --eb-rule:         var(--ow-prussian);
  --eb-font-display: 'Alfa Slab One', 'Playfair Display SC', Georgia, serif;
  --eb-font-heading: 'Playfair Display SC', Georgia, serif;
  --eb-font-body:    'Libre Caslon Text', Georgia, serif;

  /* The Exodus snippet palette, remapped as the printed book does it. */
  --ends-green:   var(--ow-forest);
  --ends-red:     var(--ow-vermilion);
  --ends-amber:   var(--ow-ochre);
  --ends-desc-header: var(--ow-gold);
  --ends-note-border: var(--ow-prussian);
  --ends-quote-border: var(--ow-slate);
}

/* ── Part 2: the structure, in the book's hand ────────────────────────────── */
/* Header: a broadside. Ruled frame below, the title on the vermilion banner. */
.eb-header { border-bottom: 3px solid var(--ow-ink); box-shadow: inset 0 -6px 0 var(--ow-paper), inset 0 -7px 0 var(--ow-prussian), inset 0 -10px 0 var(--ow-paper), inset 0 -11px 0 var(--ow-prussian); }
.eb-header-inner { padding-bottom: 1.3rem; }
.eb-brand-title { font-weight: 400; letter-spacing: 0.06em; padding: 0.2rem 1rem; }
.eb-nav-link { font-weight: 700; }

.eb-title { font-weight: 400; }
.eb-kicker { font-weight: 700; }
.eb-section-title { text-transform: uppercase; letter-spacing: 0.06em; }

/* Landing hero: the cover on a Prussian ground with the opener behind. */
.eb-hero { background-color: var(--ow-prussian); }
.eb-hero::before { background: rgba(36, 75, 112, 0.78); }
.eb-hero-subtitle { color: var(--ow-gold); }
.eb-hero-cover { border-color: var(--ow-paper); outline-color: var(--ow-gold); }

/* Contents parts: legal instruments. */
.eb-part { background: var(--ow-buff); border: 3px double var(--ow-prussian); }
.eb-part-list li + li { border-top-color: rgba(36, 33, 30, 0.15); }
.eb-part-link-summary { color: var(--eb-muted); }

/* The cast: poster panels. */
.eb-cast { background: var(--ow-paper); border-top: 1px solid var(--ow-prussian); border-bottom: 1px solid var(--ow-prussian); }
.eb-cast-image { border-color: var(--ow-ink); outline-color: var(--ow-prussian); }
.eb-cast-name { color: var(--ow-prussian); }

.eb-license-note { background: var(--ow-buff); }

/* Chapter page frame. */
details.eb-fold { background: var(--ow-buff); border: 3px double var(--ow-prussian); }
.eb-toc-link.is-active { background: var(--ow-prussian); color: var(--ow-paper); }
.eb-chapter-title { color: var(--ow-prussian); }
.eb-pager-link { background: var(--ow-paper); }
.eb-pager-link:hover,
.eb-pager-link:focus-visible { background: var(--ow-buff); }
.eb-footer { background: var(--ow-prussian); color: var(--ow-paper); border-top-color: var(--ow-ink); }

/* ── Part 3: the chapters ─────────────────────────────────────────────────── */
.eb-prose.rulebook-content { font-family: var(--ow-body, 'Libre Caslon Text', Georgia, serif); color: var(--ow-ink); }

/* Headings: Playfair SC in Prussian blue; H2 with a rule under it; H4 to H6 saddle brown. */
.eb-prose.rulebook-content h2,
.eb-prose.rulebook-content h3,
.eb-prose.rulebook-content h4,
.eb-prose.rulebook-content h5,
.eb-prose.rulebook-content h6 {
  font-family: 'Playfair Display SC', Georgia, serif;
  font-weight: 700;
  color: var(--ow-prussian);
  text-transform: none;
  letter-spacing: 0.01em;
}
.eb-prose.rulebook-content h2 {
  margin: 2.2rem 0 0.9rem;
  padding-bottom: 0.3rem;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  border-bottom: 2px solid var(--ow-prussian);
}
.eb-prose.rulebook-content h3 { margin: 1.8rem 0 0.6rem; font-size: 1.45rem; border: none; }
.eb-prose.rulebook-content h4 { margin: 1.4rem 0 0.4rem; font-size: 1.2rem; color: var(--ow-saddle); }
.eb-prose.rulebook-content h5,
.eb-prose.rulebook-content h6 { margin: 1.2rem 0 0.35rem; font-size: 1.05rem; color: var(--ow-saddle); }
.eb-prose.rulebook-content h2 + h3,
.eb-prose.rulebook-content h3 + h4 { margin-top: 0.6rem; }

.eb-prose a { color: var(--ow-prussian); text-decoration-color: var(--ow-slate); }
.eb-prose a:hover,
.eb-prose a:focus-visible { color: var(--ow-vermilion); }
.eb-prose strong { color: var(--ow-ink); }

/* Rail divider: a double rule with ties. */
.eb-prose hr {
  border: none;
  height: 6px;
  margin: 1.5rem 0;
  background:
    repeating-linear-gradient(90deg, var(--ow-prussian) 0 2px, transparent 2px 10px) bottom / 100% 6px no-repeat,
    linear-gradient(var(--ow-prussian), var(--ow-prussian)) top / 100% 1px no-repeat;
}

/* Tables: Prussian header, buff banding, saddle-brown rules. */
.eb-prose.rulebook-content table { background: var(--ow-paper); color: var(--ow-ink); font-size: 0.95rem; }
.eb-prose.rulebook-content th {
  background: var(--ow-prussian);
  color: var(--ow-paper);
  font-family: 'Playfair Display SC', Georgia, serif;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.92rem;
}
.eb-prose.rulebook-content td { border-bottom: 1px solid var(--ow-saddle); }
.eb-prose.rulebook-content tbody tr:nth-child(even) { background: var(--ow-buff); }
.eb-prose.rulebook-content tbody tr:nth-child(odd) { background: var(--ow-paper); }

/* Instrument: canonical rule wording and worked examples. Buff fill, Prussian double rule. */
.eb-prose .instrument {
  margin: 1.4rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--ow-buff);
  border: 3px double var(--ow-prussian);
}
.eb-prose .instrument > :first-child { margin-top: 0; }
.eb-prose .instrument > :last-child { margin-bottom: 0; }
.eb-prose .instrument h5,
.eb-prose .instrument h4 {
  margin: 0 0 0.6rem;
  font-family: 'Playfair Display SC', Georgia, serif;
  color: var(--ow-prussian);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.98rem;
}
.eb-prose .instrument em { font-family: 'Libre Caslon Text', Georgia, serif; }

/* Bounty: adversaries, hooks, cast entries. Ink frame with an inner Prussian rule, the heading on a vermilion strip. */
.eb-prose .bounty {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem 1rem;
  background: var(--ow-paper);
  border: 4px solid var(--ow-ink);
  outline: 1px solid var(--ow-prussian);
  outline-offset: -8px;
  box-shadow: inset 0 0 0 10px var(--ow-paper);
}
.eb-prose .bounty > :last-child { margin-bottom: 0; }
.eb-prose .bounty h5,
.eb-prose .bounty h4 {
  margin: -0.75rem -1rem 0.8rem;
  padding: 0.35rem 1rem;
  font-family: 'Alfa Slab One', 'Playfair Display SC', Georgia, serif;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--ow-paper);
  background: var(--ow-vermilion);
  border-bottom: 3px double var(--ow-ink);
}
.eb-prose .bounty h5 + p > em:only-child,
.eb-prose .bounty h4 + p > em:only-child { color: var(--eb-muted); }
.eb-prose .bounty p,
.eb-prose .bounty ul,
.eb-prose .bounty ol { max-width: none; }
/* A bounty over a full-page picture in print; here, the same box on buff. */
.eb-prose .bounty.glass { background: var(--ow-buff); box-shadow: inset 0 0 0 10px var(--ow-buff); }

/* Glass: a translucent panel over art in print; a quiet buff panel on the web. */
.eb-prose .glass:not(.bounty) {
  margin: 1.4rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--ow-buff);
  border: 1px solid var(--ow-prussian);
}
.eb-prose .glass:not(.bounty) > :first-child { margin-top: 0; }
.eb-prose .glass:not(.bounty) > :last-child { margin-bottom: 0; }

/* Sidebar note: short practical notes. Pale ground, ochre left rule. */
.eb-prose .sidebarNote {
  margin: 1.4rem 0;
  padding: 0.75rem 1rem;
  background: var(--ow-pale);
  border-left: 6px solid var(--ow-ochre);
  font-size: 0.98rem;
}
.eb-prose .sidebarNote > :first-child { margin-top: 0; }
.eb-prose .sidebarNote > :last-child { margin-bottom: 0; }
.eb-prose .sidebarNote h5,
.eb-prose .sidebarNote h4 { margin: 0 0 0.4rem; color: var(--ow-saddle); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.95rem; }

/* Descriptive band: saddle brown, gold heading, vermilion left rule. */
.eb-prose.rulebook-content .descriptive {
  margin: 1.6rem 0 0.8rem;
  padding: 0.8rem 1.1rem;
  background: var(--ow-saddle);
  color: var(--ow-paper);
  border-left: 5px solid var(--ow-vermilion);
  border-radius: 0;
}
.eb-prose.rulebook-content .descriptive h2,
.eb-prose.rulebook-content .descriptive h3,
.eb-prose.rulebook-content .descriptive h4 { margin: 0; color: var(--ow-gold); border: none; }
.eb-prose.rulebook-content .descriptive > :last-child { margin-bottom: 0; }

/* The credits and licensing pages. */
.eb-prose .legalPage,
.eb-prose .legalLinks { max-width: var(--eb-prose-width); }
.eb-prose .legalLinks { margin: 1.2rem 0; padding: 0.8rem 1rem; text-align: center; border: 3px double var(--ow-prussian); background: var(--ow-buff); }
.eb-prose .legalLinks h3 { margin: 0.2rem 0; font-size: 1.1rem; }

/* Stat blocks: Prussian tiles with paper figures. */
.eb-prose .archetype,
.eb-prose .adversary,
.eb-prose .minion { font-family: 'Playfair Display SC', Georgia, serif; margin: 0.4rem 0 0.8rem; }
.eb-prose .archetype .stat,
.eb-prose .adversary .stat,
.eb-prose .minion .stat { background: var(--ow-prussian); color: var(--ow-paper); border-radius: 0; min-width: 44px; }
.eb-prose .adversary .stat,
.eb-prose .minion .stat { background: var(--ow-saddle); }
.eb-prose .archetype .stat::before,
.eb-prose .adversary .stat::before,
.eb-prose .minion .stat::before { opacity: 0.85; letter-spacing: 0.08em; }

/* Framed pictures: ink frame, thin Prussian outline. */
.eb-prose img.framed { border: 3px solid var(--ow-ink); outline: 1px solid var(--ow-prussian); outline-offset: 3px; }
.eb-prose figcaption { font-family: 'Libre Caslon Text', Georgia, serif; color: var(--eb-muted); }
.eb-prose .eb-fig figcaption { font-family: 'Playfair Display SC', Georgia, serif; color: var(--ow-prussian); }

/* Blockquotes: slate rule. */
.eb-prose.rulebook-content blockquote { border-left: 4px solid var(--ow-slate); color: var(--eb-muted); }
