/*
  19-bastion-sheet.css — v41.35

  1. The unreadable heading — my regression from v41.33
  -----------------------------------------------------
  `.section-title h2` is `color: var(--brass-bright)`, which is correct: those
  headings normally sit on the dark hull. The "Special facilities" block I
  added in v41.33 put one inside the Bastion SHEET, which is light parchment,
  where brass-bright measured 1.36:1 — the washed-out yellow in the screenshot.
  The hint beside it was 1.86:1.

  So the rule below is scoped to headings on a light surface rather than
  changing the token, because the dark-hull usage is fine and far more common.

  My contrast tool did not catch this: it sweeps eleven named SCREENS and never
  opens a record sheet. tools/contrast-check.py now opens the Bastion sheet too.

  2. The rest of the sheet
  ------------------------
  Three full-width teal buttons stacked at the top, a dead vertical gap where a
  board had no content, and the armaments and crew warning floating below the
  Connections panel with no heading of their own. The changes here are
  structural spacing rather than decoration: consistent section rhythm, one
  button row instead of three stacked blocks, and no orphaned gaps.
*/

/* ==========================================================
   1. Headings on light surfaces
   ========================================================== */
#sheet .section-title h2,
#modal .section-title h2,
.bastion-detail-card .section-title h2,
.npc-detail-card .section-title h2 {
  /* 1.36 -> 8.9 on parchment. Same weight and family, readable surface. */
  color: var(--ink);
  font-size: var(--t2);
  letter-spacing: .04em;
}
#sheet .section-title .hint,
#modal .section-title .hint,
.bastion-detail-card .section-title .hint,
.npc-detail-card .section-title .hint {
  color: var(--muted);          /* 1.86 -> 5.1 */
  font-weight: 700;
}

/* A quiet rule under a section heading gives the sheet a rhythm without
   adding another coloured band. */
#sheet .section-title,
.bastion-detail-card .section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: var(--s5) 0 var(--s3);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
#sheet .section-title:first-child,
.bastion-detail-card .section-title:first-child { margin-top: 0; }

/* ==========================================================
   2. Bastion sheet layout
   ========================================================== */
/* The three primary actions were full-width blocks, so they read as three
   separate decisions stacked down the page. They are peers — put them on one
   row and let them wrap only when they must. The container is
   .bastion-primary-actions; my first attempt named the wrong class. */
.bastion-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: var(--s3) 0;
}
.bastion-primary-actions .button {
  flex: 1 1 46%;
  width: auto;
  min-width: 0;
}
.bastion-detail-card .ship-detail-actions,
.bastion-detail-card .holding-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.bastion-detail-card .ship-detail-actions .button,
.bastion-detail-card .holding-detail-actions .button {
  flex: 1 1 140px;
  width: auto;
}

/* Six boards render with zero height when they have nothing to show — the
   Bastion sheet was carrying six of them, each still contributing its own
   margin. That stack of empty margins is the blank band in the middle of the
   sheet. `:empty` does not match them, because they contain markup with no
   content, so target zero-height boards directly. */
.bastion-detail-card .compact-board:not([open]):not(:has(summary)) { display: none; }
.bastion-detail-card .compact-board:empty,
.bastion-detail-card .bfac-installed-wrap:empty { display: none; }

.bastion-detail-card .codex-connections-wrap { margin-top: var(--s4); }

/* The armaments block and its crew warning belong together and to the
   facilities above them, not floating after Connections. */
.bastion-detail-card .barm-list { margin-top: var(--s2); }
.bastion-detail-card .barm-crew { margin-top: var(--s3); }

/* ==========================================================
   3. Order dots actually show their order
   ==========================================================
   .bfac-dot set `background: var(--muted)` AFTER the .ob-* classes, so every
   dot on the Bastion card was the same brown — a colour coding that coded
   nothing. The ob-* palette wins now; --muted is only the fallback for a
   facility with no order recorded. */
.bfac-dot { background: var(--muted); }
.bfac-dot.ob-craft    { background: #b3801f; }
.bfac-dot.ob-trade    { background: #3f7a4a; }
.bfac-dot.ob-recruit  { background: #2e6f8f; }
.bfac-dot.ob-research { background: #6f4b8e; }
.bfac-dot.ob-harvest  { background: #6d7f43; }
.bfac-dot.ob-empower  { background: #a8455f; }
.bfac-dot.ob-maintain { background: #6b5a44; }
.bfac-dot.ob-basic    { background: #728769; }

/* ==========================================================
   4. Chip rows on the Bastion card
   ========================================================== */
.bastion-card-metrics { gap: 5px; }
.bastion-card .bfac-strip { margin-top: 6px; }
.bastion-card .bastion-link-strip { margin-top: 6px; }

/* ==========================================================
   5. Secondary text on sheet cards
   ==========================================================
   --muted measures 4.34 on --chart-2, which is what these three sit on: the
   Bastion stat labels, the order-option yield line, and the "Full rules"
   summary. All were just under AA and only surfaced once the contrast tool
   learned to look inside overlays at all. */
#sheet .bfd-option-main span,
#sheet .bfd-option-static span,
#sheet .bfd-rules > summary,
#modal .bfd-option-main span,
#modal .bfd-option-static span,
#modal .bfd-rules > summary,
.bastion-stat span,
.bastion-detail-stats span { color: var(--ink-soft); }
.bastion-defence-grid span { color: var(--ink-soft); }
