/* Shared styles for Civil War deep-dive pages.
   Linked from /civilwar/*.html
   ------------------------------------------------------------- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body { font-family:'Iowan Old Style', Georgia, 'Times New Roman', serif; background:#f6f1e7; color:#2c2620; line-height:1.55; }
::selection { background:#3a5a8c; color:#fff; }
a { color:#243f66; text-decoration:none; border-bottom:1px dotted #d8c8a8; }
a:hover { color:#3a5a8c; }

header.im-hero { background:linear-gradient(135deg, #1f2e45 0%, #283d5b 100%); color:#f6f1e7; padding:1.6rem 1.5rem 1.4rem; border-bottom:4px double #33507a; }
header.im-hero .crumbs { font-size:0.82rem; color:#c8b896; margin-bottom:0.4rem; }
header.im-hero .crumbs a { color:#f1cf85; border-bottom:none; }
header.im-hero h1 { color:#f6f1e7; font-size:2.0rem; line-height:1.2; }
header.im-hero .sub { color:#e8dfc8; font-style:italic; margin-top:0.3rem; }
header.im-hero .meta-row { margin-top:0.7rem; display:flex; flex-wrap:wrap; gap:0.6rem; align-items:center; }
.badge { display:inline-block; font-size:0.72rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; padding:3px 10px; border-radius:4px; }
.badge.battery { background:#33507a; color:#fff; }
.badge.context { background:#243f66; color:#fff; }
.date { color:#c8b896; font-size:0.85rem; }

main { max-width:1100px; margin:0 auto; padding:1.6rem 1.4rem 4rem; }

.summary-card { background:linear-gradient(140deg, #fffaf0, #f6ebd2); border:2px solid #33507a; border-radius:6px; padding:1.2rem 1.4rem; margin-bottom:1.4rem; }
.summary-card h2 { font-size:1.18rem; color: var(--brand-dark); margin-bottom:0.6rem; padding-bottom:0.3rem; border-bottom:1px solid #d8c8a8; }
.summary-card .bottom-line { font-size:1rem; color:#3a2f1e; line-height:1.5; margin-bottom:0.6rem; }
.summary-card .quick-facts { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:0.5rem; margin-top:0.6rem; }
.summary-card .qf { background:#fffaf0; border:1px solid #d8c8a8; border-radius:4px; padding:0.4rem 0.6rem; font-size:0.84rem; }
.summary-card .qf .qf-label { font-size: 0.72rem; text-transform:uppercase; letter-spacing:0.06em; color:#243f66; font-weight:700; display:block; margin-bottom:0.1rem; }
.summary-card .qf .qf-value { color:#3a2f1e; line-height:1.35; }

h2 { color: var(--brand-dark); font-size:1.4rem; padding-bottom:0.3rem; border-bottom:2px solid #d8c8a8; margin:1.4rem 0 0.8rem; }
h3 { color: var(--brand-dark); font-size:1.1rem; margin:1.2rem 0 0.5rem; padding-bottom:0.2rem; border-bottom:1px solid #d8c8a8; }
p { margin-bottom:0.8rem; }
ul, ol { padding-left:1.4rem; margin-bottom:0.8rem; }
li { margin-bottom:0.3rem; }

table.kv { width:100%; border-collapse:collapse; margin:0.6rem 0 1rem; background:#fffaf0; border:1px solid #d8c8a8; border-radius:4px; overflow:hidden; }
table.kv td { padding:0.55rem 0.8rem; vertical-align:top; border-bottom:1px solid #d8c8a8; font-size:0.92rem; }
table.kv tr:last-child td { border-bottom:none; }
table.kv td:first-child { background:#f6ebd2; font-weight:600; color:#4a3a22; width:30%; font-size:0.82rem; text-transform:uppercase; letter-spacing:0.04em; }
table.kv th { background:#f6ebd2; color:#4a3a22; font-weight:700; font-size:0.82rem; text-transform:uppercase; letter-spacing:0.04em; padding:0.4rem 0.8rem; text-align:left; }

.timeline-vert { position:relative; margin:0.8rem 0 1.4rem; padding-left:1.6rem; border-left:4px solid #3a5a8c; }
.tl-event { position:relative; margin-bottom:0.9rem; padding:0.55rem 0.8rem; background:#fffaf0; border:1px solid #d8c8a8; border-radius:4px; }
.tl-event::before { content:""; position:absolute; left:-1.95rem; top:0.65rem; width:0.85rem; height:0.85rem; border-radius:50%; background:#3a5a8c; border:2px solid #fffaf0; box-shadow:0 0 0 1px #243f66; }
.tl-event .when { font-family:'SF Mono', Menlo, Consolas, monospace; font-size:0.8rem; color:#243f66; font-weight:700; letter-spacing:0.03em; }
.tl-event .what { display:block; margin-top:0.18rem; font-size:0.92rem; line-height:1.5; color:#3a2f1e; }
.tl-event .src { display:block; font-size:0.78rem; color:#6a5a42; font-style:italic; margin-top:0.25rem; }
.tl-event.life::before { background:#4a668a; box-shadow:0 0 0 1px #2a466a; }
.tl-event.context::before { background:#243f66; box-shadow:0 0 0 1px #5a3a08; }

.card { background:#fffaf0; border:1px solid #d8c8a8; border-radius:4px; padding:0.9rem 1.1rem; margin-bottom:0.8rem; }
.card.battery { border-left:4px solid #33507a; background:#e6ecf4; }
.card.context { border-left:4px solid #33507a; }
.card h4 { color: var(--brand-dark); font-size:1.05rem; margin-bottom:0.4rem; }

.person-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:0.8rem; margin:0.6rem 0 1rem; }
.person-card { display:flex; flex-direction:column; background:#fffaf0; border:1px solid #d8c8a8; border-radius:6px; padding:1rem; text-decoration:none; color:#2c2620; transition:all 0.15s; border-left:4px solid #33507a; border-bottom:none; }
.person-card:hover { background:#e6ecf4; border-left-color:#33507a; box-shadow:0 2px 8px rgba(0,0,0,0.08); }
.person-card .role { display:inline-block; font-size: 0.76rem; text-transform:uppercase; letter-spacing:0.06em; color:#243f66; font-weight:700; margin:0 0 0.45rem; padding:0.18rem 0.45rem; background:rgba(144, 103, 71,0.12); border-radius:4px; align-self:flex-start; }
.person-card h4 { color: var(--brand-dark); font-size:1.02rem; margin:0 0 0.35rem; }
.person-card .summary { font-size:0.85rem; line-height:1.5; color:#4a3a22; margin:0 0 0.4rem; flex:1; }
.person-card .meta { font-size:0.76rem; color:#6a5a42; font-style:italic; margin-top:auto; }

.pull { background:linear-gradient(140deg, #e6ecf4, #f4ede2); border-left:4px solid #33507a; padding:0.9rem 1.1rem; margin:0.8rem 0; font-style:italic; color:#3a2f1e; border-radius:0 4px 4px 0; }
.pull strong { font-style:normal; color:#243f66; }

footer.back-nav { margin-top:2rem; text-align:center; padding:1rem; }
footer.back-nav a { display:inline-block; padding:0.5rem 1rem; background:#2c2620; color:#3a5a8c; border:1px solid #33507a; border-radius:4px; font-weight:600; letter-spacing:0.04em; border-bottom:none; }
footer.back-nav a:hover { background:#33507a; color:#fff; }


@media print {
  header.fam-hero, header.cw-hero, header.ca-hero, header.im-hero, header.ge-hero, header.src-hero,
  footer.back-nav, .crumbs, details.research-log:not([open]) > .log-body { display:none !important; }
  details.research-log > .log-body { display:block !important; }
  body { background:#fff !important; color:#000 !important; font-size:11pt; }
  a { color:#000 !important; text-decoration:none !important; border-bottom:none !important; }
  a[href^="http"]::after { content:" (" attr(href) ")"; font-size:9pt; color:#666; }
  .summary-card, .card, table.kv { background:#fff !important; border:1px solid #999 !important; page-break-inside:avoid; }
  h1, h2, h3, h4 { page-break-after:avoid; }
  img, svg { max-width:100% !important; page-break-inside:avoid; }
}



/* ============================================================
   Theme override · added 3 May 2026 design pass
   Pulls in tokens from /assets/theme.css and applies them.
   Overrides are scoped to keep section identity while unifying chrome.
   ============================================================ */

/* Typography hierarchy — sharper 1.25× scale */
h1 { font-size: var(--type-h1); line-height: 1.2; font-weight: 700; }
h2 { font-size: var(--type-h2); line-height: 1.25; font-weight: 700; }
h3 { font-size: var(--type-h3); line-height: 1.3;  font-weight: 700; }
h4 { font-size: var(--type-h4); line-height: 1.35; font-weight: 700; }

/* Link contrast fix — darken from #c9a76a to #a88a4a (AA-3:1 on cream) */
a { border-bottom-color: var(--border-medium); }
a.fsn { background: rgba(212,160,23,0.08); }
a.fsn.pid { background: rgba(74,118,200,0.12); }

/* Body text contrast — darken italic captions from #6a5a42 to #4a3a22 (AA on cream) */
.meta, .small em, em.note, p.small, .ev-body p { color: var(--text-meta); }

/* Standardize border-left widths: cards 3px, tiles 4px, banners/heroes 5px */
.card, .summary-card { border-left-width: var(--bl-card) !important; }
.cw-tile, .ca-tile, .im-tile, .ge-tile, .schrader-tile,
.person-card, .child-card, .doc-card, .actor-card,
.cw-tile.keystone, .ca-tile.keystone,
header.fam-hero, header.cw-hero, header.ca-hero, header.im-hero, header.ge-hero, header.src-hero, header.up-hero {
  border-left-width: 0;
}

/* Unified hover transition for all clickable surfaces */
.cw-tile, .ca-tile, .im-tile, .ge-tile, .schrader-tile,
.person-card, .child-card, .doc-card, .actor-card,
.tree .sib, a.parent-card, a.entry, a.chart-link {
  transition: var(--transition);
}
.cw-tile:hover, .ca-tile:hover, .im-tile:hover, .ge-tile:hover,
.schrader-tile:hover, .person-card:hover, .child-card:hover,
.doc-card:hover, .actor-card:hover, .tree .sib:hover, a.parent-card:hover {
  transform: var(--hover-lift);
  box-shadow: var(--hover-shadow);
}

/* Specialize the gold — only brand surfaces use it now.
   "Open" status was using gold (conflict). Switch to amber. */
.summary-card.open { border-color: var(--status-open); }
.summary-card.open h2 { border-bottom-color: var(--status-open); }
.summary-card .card-pill.open { background: var(--status-open); color: #1f1a14; }
.badge.open { background: var(--status-open); color: #1f1a14; }

/* Section accent for Charles in America: switch from gold to amber/copper
   to differentiate from brand */
.ca-tile, .ca-tile.primary { border-left-color: var(--section-charles); }
.ca-tile:hover { border-left-color: var(--section-charles-d); background: var(--section-charles-t); }
.ca-tile-eyebrow { color: var(--section-charles-d); }
.ca-tile:hover .ca-tile-title { color: var(--section-charles-d); }

/* Active-tab indicator strengthening (only relevant on main index) */
nav.tabs button.active {
  background: rgba(212,160,23,0.18);
  border-bottom: 3px solid var(--brand) !important;
}

/* Konze-status banner consistency */
.konze-status-banner {
  background: linear-gradient(140deg, var(--status-open-t), #f6ebd2) !important;
  border-color: var(--status-open) !important;
  border-left-color: var(--status-open) !important;
}

/* BEGIN-DARK-MODE-BODY-OVERRIDE */
/* ============================================================
   Dark-mode body override — updated 11 May 2026 (robust fallback)
   ============================================================
   The body rule earlier in this file hardcodes background:#f6f1e7
   (cream). We override with `:root:not(.theme-light)` so the page
   renders DARK whenever the user is in dark mode OR when the theme
   init script fails to run (e.g., scripts blocked on file:// URLs).
   The only way to get cream is to explicitly toggle to light, which
   adds the .theme-light class.
   ------------------------------------------------------------ */
:root:not(.theme-light) body,
:root.theme-dark body {
  background: #1c2a3f !important;
  color: #e8dfc8 !important;
}
:root:not(.theme-light) a,
:root.theme-dark a { color: #e6c47a; }
:root:not(.theme-light) a:hover,
:root.theme-dark a:hover { color: #fadea0; }
/* END-DARK-MODE-BODY-OVERRIDE */
