/* =============================================================================
   BLACK FLAG: PRIVATEERS AND PIRATES: Era Book web theme
   Served at exodusnds.com/era-books/black-flag. Load AFTER assets/exodus/era-book.css.

   The printed book's look (shared/css/black-flag.css in the book repository,
   locked by Paul 2026-10-27): a pilot's chart, with numbered clause boxes for
   rules, a legend box for what a tale says, cartouches for adversaries and a
   ship's registry card for hulls. Flat colours only; no gradients on type, no
   aged-paper effects. Fonts: Cinzel (display, headings), Crimson Pro (body),
   IM Fell English (map keys and legends), from Google Fonts via site.yml.
   ============================================================================= */

/* ── Part 1: tokens ───────────────────────────────────────────────────────── */
:root {
  --bf-vellum:     #E8DDBF;
  --bf-sand:       #D8C792;
  --bf-white:      #F7F2E4;
  --bf-ink:        #2A2118;
  --bf-tar:        #4A3523;
  --bf-ultra:      #2C4C8F;
  --bf-sea:        #3F6E96;
  --bf-vermilion:  #B83A2B;
  --bf-oxblood:    #8E2A25;
  --bf-brass:      #B88A2E;
  --bf-sap:        #5E7B3B;
  --bf-water:      #D9E4EA;

  --eb-paper:        var(--bf-vellum);
  --eb-paper-2:      var(--bf-sand);
  --eb-ink:          var(--bf-ink);
  --eb-muted:        #5A4632;
  --eb-primary:      var(--bf-ultra);
  --eb-on-primary:   var(--bf-white);
  --eb-accent:       var(--bf-vermilion);
  --eb-on-accent:    var(--bf-white);
  --eb-accent-2:     var(--bf-tar);
  --eb-highlight:    var(--bf-brass);
  --eb-border:       var(--bf-ink);
  --eb-rule:         var(--bf-ultra);
  --eb-font-display: 'Cinzel', Georgia, serif;
  --eb-font-heading: 'Cinzel', Georgia, serif;
  --eb-font-body:    'Crimson Pro', Georgia, serif;

  /* The Exodus snippet palette, remapped as the printed book does it. */
  --ends-green:   var(--bf-sap);
  --ends-red:     var(--bf-vermilion);
  --ends-amber:   var(--bf-brass);
  --ends-desc-header: var(--bf-brass);
  --ends-note-border: var(--bf-ultra);
  --ends-quote-border: var(--bf-sea);
}

/* ── Part 2: the structure, in the book's hand ────────────────────────────── */
/* Header: a ribbon cartouche on a chart-blue ground, a brass rule beneath. */
.eb-header { border-bottom: 3px solid var(--bf-ink); box-shadow: inset 0 -6px 0 var(--bf-vellum), inset 0 -7px 0 var(--bf-brass); }
.eb-header-inner { padding-bottom: 1.3rem; }
.eb-brand-title { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.2rem 1.6rem; clip-path: polygon(0 0, 100% 0, 97% 50%, 100% 100%, 0 100%, 3% 50%); }
.eb-nav-link { font-weight: 700; }

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

.eb-hero { background-color: var(--bf-ultra); }
.eb-hero::before { background: rgba(28, 46, 92, 0.8); }
.eb-hero-subtitle { color: var(--bf-sand); }
.eb-hero-cover { border-color: var(--bf-white); outline-color: var(--bf-brass); }

.eb-part { background: var(--bf-sand); border: 3px double var(--bf-ultra); }
.eb-part-list li + li { border-top-color: rgba(42, 33, 24, 0.18); }
.eb-part-link-summary { color: var(--eb-muted); }

.eb-cast { background: var(--bf-vellum); border-top: 1px solid var(--bf-ultra); border-bottom: 1px solid var(--bf-ultra); }
.eb-cast-image { border-color: var(--bf-ink); outline-color: var(--bf-ultra); }
.eb-cast-name { color: var(--bf-ultra); }

.eb-license-note { background: var(--bf-sand); }

details.eb-fold { background: var(--bf-sand); border: 3px double var(--bf-ultra); }
.eb-toc-link.is-active { background: var(--bf-ultra); color: var(--bf-white); }
.eb-chapter-title { color: var(--bf-ultra); }
.eb-pager-link { background: var(--bf-vellum); }
.eb-pager-link:hover,
.eb-pager-link:focus-visible { background: var(--bf-sand); }
.eb-footer { background: var(--bf-ultra); color: var(--bf-white); border-top-color: var(--bf-ink); }

/* ── Part 3: the chapters ─────────────────────────────────────────────────── */
.eb-prose.rulebook-content { font-family: 'Crimson Pro', Georgia, serif; color: var(--bf-ink); }

.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: 'Cinzel', Georgia, serif;
  font-weight: 700;
  color: var(--bf-ultra);
  text-transform: none;
  letter-spacing: 0.04em;
}
.eb-prose.rulebook-content h2 {
  margin: 2.2rem 0 0.9rem;
  padding-bottom: 0.3rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  border-bottom: 2px solid var(--bf-ultra);
}
.eb-prose.rulebook-content h3 { margin: 1.8rem 0 0.6rem; font-size: 1.35rem; border: none; }
.eb-prose.rulebook-content h4 { margin: 1.4rem 0 0.4rem; font-size: 1.15rem; color: var(--bf-tar); }
.eb-prose.rulebook-content h5,
.eb-prose.rulebook-content h6 { margin: 1.2rem 0 0.35rem; font-size: 1rem; color: var(--bf-tar); }
.eb-prose.rulebook-content h2 + h3,
.eb-prose.rulebook-content h3 + h4 { margin-top: 0.6rem; }

.eb-prose a { color: var(--bf-ultra); text-decoration-color: var(--bf-sea); }
.eb-prose a:hover,
.eb-prose a:focus-visible { color: var(--bf-vermilion); }
.eb-prose strong { color: var(--bf-ink); }
.eb-prose em, .eb-prose i { font-family: 'Crimson Pro', Georgia, serif; }

/* Divider: a dotted track line. */
.eb-prose hr {
  border: none;
  height: 6px;
  margin: 1.5rem 0;
  background: repeating-linear-gradient(90deg, var(--bf-vermilion) 0 8px, transparent 8px 14px) center / 100% 2px no-repeat;
}

/* Tables: ultramarine head, sand banding, tar rules. */
.eb-prose.rulebook-content table { background: var(--bf-white); color: var(--bf-ink); font-size: 0.95rem; }
.eb-prose.rulebook-content th {
  background: var(--bf-ultra);
  color: var(--bf-white);
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}
.eb-prose.rulebook-content td { border-bottom: 1px solid var(--bf-tar); }
.eb-prose.rulebook-content tbody tr:nth-child(even) { background: rgba(216, 199, 146, 0.6); }
.eb-prose.rulebook-content tbody tr:nth-child(odd) { background: var(--bf-white); }

/* Ledger tables (money): red column rules, right-aligned figures, double rule at the head. */
.eb-prose .ledger table { border: 1px solid var(--bf-ink); }
.eb-prose .ledger table th { background: var(--bf-sand); color: var(--bf-ink); border-bottom: 3px double var(--bf-ink); }
.eb-prose .ledger table th,
.eb-prose .ledger table td { border-left: 1px solid var(--bf-oxblood); text-align: right; }
.eb-prose .ledger table th:first-child,
.eb-prose .ledger table td:first-child { border-left: 0; text-align: left; }
.eb-prose .ledger table tbody tr:nth-child(even),
.eb-prose .ledger table tbody tr:nth-child(odd) { background: transparent; }

/* Articles: numbered clauses for canonical rules and worked examples. */
.eb-prose .articles {
  margin: 1.4rem 0;
  padding: 0.9rem 1.1rem;
  background: rgba(247, 242, 228, 0.85);
  border: 3px double var(--bf-ultra);
  display: flow-root;
}
.eb-prose .articles > :first-child { margin-top: 0; }
.eb-prose .articles > :last-child { margin-bottom: 0; }
.eb-prose .articles p { display: flow-root; }
.eb-prose .articles h5,
.eb-prose .articles h4 {
  margin: 0 0 0.6rem;
  color: var(--bf-ultra);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.98rem;
}
.eb-prose .articles .no {
  float: left;
  min-width: 1.75em;
  margin: 0 0.2em 0 0;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 2.3em;
  line-height: 0.9;
  color: var(--bf-oxblood);
}

/* Legend: what the tale says, who tells it, why it may not be so. */
.eb-prose .legend {
  position: relative;
  margin: 1.4rem 0;
  padding: 0.7rem 1rem 0.7rem 3.4rem;
  background: rgba(247, 242, 228, 0.85);
  border-left: 5px solid var(--bf-vermilion);
}
.eb-prose .legend::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: 0.8rem;
  width: 1.7rem;
  height: 1.7rem;
  border: 2px solid var(--bf-vermilion);
  border-radius: 50%;
  background: radial-gradient(circle, var(--bf-vermilion) 0 14%, transparent 15%);
}
.eb-prose .legend > :first-child { margin-top: 0; }
.eb-prose .legend > :last-child { margin-bottom: 0; }
.eb-prose .legend h5,
.eb-prose .legend h4 {
  margin: 0 0 0.4rem;
  font-family: 'IM Fell English SC', Georgia, serif;
  color: var(--bf-vermilion);
  letter-spacing: 0.1em;
}
.eb-prose .legend p,
.eb-prose .legend em { font-style: italic; }

/* Cartouche: adversaries, hooks and cast entries. Rope-bordered panel with a ribbon head. */
.eb-prose .cartouche {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem 1rem;
  background: rgba(247, 242, 228, 0.9);
  border: 3px double var(--bf-sea);
  outline: 2px dashed var(--bf-brass);
  outline-offset: -8px;
}
.eb-prose .cartouche > :last-child { margin-bottom: 0; }
.eb-prose .cartouche h5,
.eb-prose .cartouche h4 {
  margin: -0.75rem -1rem 0.8rem;
  padding: 0.35rem 1rem;
  background: var(--bf-ultra);
  color: var(--bf-white);
  text-align: center;
  letter-spacing: 0.1em;
  font-size: 1.02rem;
}
.eb-prose .cartouche p,
.eb-prose .cartouche ul,
.eb-prose .cartouche ol { max-width: none; }
.eb-prose .cartouche table { table-layout: fixed; width: 100%; }
.eb-prose .cartouche table th { font-size: 0.7rem; letter-spacing: 0; text-align: center; padding: 2px 1px; }
.eb-prose .cartouche table td { text-align: center; padding: 2px 1px; }

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

/* Sidebar note: short practical notes. Sand ground, brass left rule. */
.eb-prose .sidebarNote {
  margin: 1.4rem 0;
  padding: 0.75rem 1rem;
  background: rgba(216, 199, 146, 0.7);
  border-left: 6px solid var(--bf-brass);
  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(--bf-tar); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.95rem; }

/* Descriptive band: tar ground, brass heading, vermilion left rule. */
.eb-prose.rulebook-content .descriptive {
  margin: 1.6rem 0 0.8rem;
  padding: 0.8rem 1.1rem;
  background: var(--bf-tar);
  color: var(--bf-white);
  border-left: 5px solid var(--bf-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(--bf-sand); 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(--bf-ultra); background: var(--bf-sand); }
.eb-prose .legalLinks h3 { margin: 0.2rem 0; font-size: 1.1rem; }

/* Stat blocks: ultramarine tiles with white figures; adversaries in tar. */
.eb-prose .archetype,
.eb-prose .adversary,
.eb-prose .minion { font-family: 'Cinzel', Georgia, serif; margin: 0.4rem 0 0.8rem; }
.eb-prose .archetype .stat,
.eb-prose .adversary .stat,
.eb-prose .minion .stat { background: var(--bf-ultra); color: var(--bf-white); border-radius: 0; min-width: 44px; }
.eb-prose .adversary .stat,
.eb-prose .minion .stat { background: var(--bf-tar); }
.eb-prose .archetype .stat::before,
.eb-prose .adversary .stat::before,
.eb-prose .minion .stat::before { opacity: 0.85; letter-spacing: 0.08em; }

/* Hull block (Ships chapter): a ship's registry card. */
.eb-prose .hull {
  margin: 1.2rem 0;
  background: rgba(247, 242, 228, 0.9);
  border: 2px solid var(--bf-ink);
  border-left: 5px solid var(--bf-sea);
  font-size: 0.95rem;
}
.eb-prose .hull h3 {
  margin: 0;
  padding: 0.3rem 0.7rem;
  background: var(--bf-ultra);
  color: var(--bf-white);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eb-prose .hull h3 .hull-class { margin-left: 0.5em; color: var(--bf-sand); font-size: 0.7em; letter-spacing: 0.1em; font-weight: 500; }
.eb-prose .hull .hull-id { display: flex; justify-content: space-between; align-items: center; padding: 0.2rem 0.7rem; background: var(--bf-sea); color: var(--bf-white); }
.eb-prose .hull .hull-id b { background: var(--bf-vermilion); font-family: 'Cinzel', Georgia, serif; font-size: 0.8em; letter-spacing: 0.1em; text-transform: uppercase; padding: 0 0.5rem; border-radius: 2px; }
.eb-prose .hull img { display: block; width: 100%; margin: 0; border: 0; border-bottom: 2px solid var(--bf-ink); outline: 0; }
.eb-prose .hull table { margin: 0; width: 100%; table-layout: fixed; }
.eb-prose .hull table th { background: transparent; color: var(--bf-tar); font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 1px 0; text-align: center; }
.eb-prose .hull table td { background: transparent; font-family: 'Cinzel', Georgia, serif; font-weight: 700; text-align: center; padding: 0 1px 4px; }
.eb-prose .hull p { margin: 0; padding: 0.2rem 0.7rem; border-top: 1px solid rgba(74, 53, 35, 0.25); max-width: none; }
.eb-prose .hull p > strong:first-child { display: inline-block; min-width: 3.4em; color: var(--bf-oxblood); font-family: 'Cinzel', Georgia, serif; font-size: 0.72em; letter-spacing: 0.08em; text-transform: uppercase; }

/* Maps: framed, with the "large map" link as a brass badge. */
.eb-prose .mapview { margin: 1.2rem auto; }
.eb-prose .mapview img { display: block; width: 100%; height: auto; }
.eb-prose .mapview.half { display: inline-block; width: 48%; vertical-align: top; }
.eb-prose .mapview p { margin: 0; }
@media (max-width: 640px) { .eb-prose .mapview.half { display: block; width: 100%; } }
.eb-prose .mapseal { display: block; width: max-content; margin: 5px 0 2px auto; padding: 2px 10px; background: var(--bf-white); border: 2px solid var(--bf-brass); border-radius: 12px; color: var(--bf-tar); font-family: 'Cinzel', Georgia, serif; font-size: 0.75rem; letter-spacing: 0.1em; text-decoration: none; }
.eb-prose .mapseal::after { content: "LARGE MAP"; }
.eb-prose .mapKey { border: 3px double var(--bf-ultra); background: var(--bf-white); padding: 0.4rem 0.8rem; font-family: 'IM Fell English', Georgia, serif; }

/* Framed pictures: ink frame, thin ultramarine outline. */
.eb-prose img.framed { border: 3px solid var(--bf-ink); outline: 1px solid var(--bf-ultra); outline-offset: 3px; }
.eb-prose figcaption { font-family: 'Crimson Pro', Georgia, serif; color: var(--eb-muted); }
.eb-prose .eb-fig figcaption { font-family: 'Cinzel', Georgia, serif; color: var(--bf-ultra); }

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