/* Deep Dives (Media‑agnostic) Redesigned Layout
   Goals: Clear primary task (select a deep dive), industry‑standard 2‑column layout,
   progressive disclosure of secondary nav (outline), strong visual hierarchy, a11y friendly.
   Principles: "Don't Make Me Think" – obvious affordances, reduced cognitive load, consistent patterns.
*/

:root {
  --dd-accent: #2f6feb;
  --dd-accent-book: #b58118;
  --dd-panel-bg: #ffffff;
  --dd-border: #d1dae3;
  --dd-bg-radial: radial-gradient(circle at 70% 0%, #ffffff 0%, #eef4ef 70%);
  --dd-shadow-sm: 0 1px 2px rgba(0,0,0,.06); 
  --dd-shadow: 0 4px 12px -4px rgba(0,0,0,.10), 0 18px 36px -18px rgba(0,0,0,.20);
  --dd-radius: 18px;
  --dd-focus: 2px solid var(--dd-accent);
  /* Fallback navbar height (updated dynamically via JS) */
  --nav-offset: 72px;
}

body.deep-dives-page { background: var(--dd-bg-radial) fixed #f5f7f9; }

/* Layout */
.deep-dives-shell { max-width:1800px; margin:0 auto; padding:calc(var(--nav-offset) + 30px) 22px 90px; display:grid; grid-template-columns:300px 1fr; gap:32px; align-items:start; }
@media (max-width:1400px){ .deep-dives-shell { grid-template-columns:300px 1fr; gap:32px; } }
@media (max-width:1080px){ .deep-dives-shell { grid-template-columns:280px 1fr; } }
@media (max-width:960px){ .deep-dives-shell { grid-template-columns:1fr; } #mediaPanel { position:static; max-height:none; } }

/* Hero */
.dd-hero { margin:0 auto 8px; padding:36px 28px 8px; max-width:1400px; text-align:center; }
.dd-hero h1 { margin:0 0 10px; font-size:clamp(2.2rem,3.2vw + .25rem,2.8rem); font-weight:800; line-height:1.04; background:linear-gradient(135deg,var(--kg-hero-start,#2f6feb), var(--kg-hero-end,#2d5a27)); -webkit-background-clip:text; background-clip:text; color:transparent; letter-spacing:-.5px; }
.dd-hero .dd-tagline { margin:0 auto; max-width:72ch; color:var(--color-text-dim,#46566a); font-size:1.02rem; line-height:1.45; }

/* Media Panel (primary action) */
#mediaPanel { position:sticky; top:calc(var(--nav-offset) + 24px); display:flex; flex-direction:column; gap:12px; background:#ffffffcc; border:1px solid var(--dd-border); border-radius:16px; backdrop-filter:saturate(160%) blur(8px); box-shadow:var(--dd-shadow); padding:18px 18px 20px; max-height:calc(100vh - (var(--nav-offset) + 64px)); overflow:auto; z-index:40; }
#mediaPanel h2 { margin:0; font:600 12px/1.1 Inter, var(--font-sans); letter-spacing:.25em; text-transform:uppercase; color:var(--color-text-dim,#4a5b6d); }

.media-type-tabs { display:flex; gap:4px; }
/* Slightly tighter padding to prevent overflow scrollbar */
.media-type-tabs button { flex:1 1 0; min-width:0; background:#fff; border:1px solid var(--dd-border); padding:9px 10px 9px 12px; border-radius:12px; cursor:pointer; font:600 11px/1 Inter; letter-spacing:.45px; color:#495c6f; position:relative; transition:.25s background,.25s color,.25s border-color, .25s box-shadow; display:flex; align-items:center; justify-content:center; gap:6px; }
.media-type-tabs button .count { background:#eef3ff; color:#2f4b88; font-size:10px; padding:2px 6px 3px; border-radius:20px; font-weight:700; letter-spacing:.5px; line-height:1; }
.media-type-tabs button.active { background:var(--dd-accent); color:#fff; border-color:var(--dd-accent); box-shadow:0 2px 8px -2px rgba(47,111,235,.45); }
.media-type-tabs button[data-type=book].active { background:var(--dd-accent-book); border-color:var(--dd-accent-book); }
.media-type-tabs button:focus-visible { outline:var(--dd-focus); outline-offset:2px; }

.media-search-block label { display:none; }
.media-search-block input { width:100%; padding:10px 12px; font:500 13px/1 Inter; border:1px solid var(--dd-border); border-radius:12px; background:#fff; }
.media-search-block input:focus { outline:var(--dd-focus); }

.domain-filter-pills { display:flex; flex-wrap:wrap; gap:6px; }
.domain-filter-pills button { background:#fff; border:1px solid var(--dd-border); font:600 10px/1 Inter; letter-spacing:.5px; padding:6px 10px; border-radius:999px; cursor:pointer; color:#536676; transition:.25s; }
.domain-filter-pills button.active { background:var(--dd-accent); border-color:var(--dd-accent); color:#fff; box-shadow:0 0 0 2px #eef4ff; }
.domain-filter-pills button:focus-visible { outline:var(--dd-focus); outline-offset:2px; }

/* Condensed list (denser) */
.media-list { list-style:none; margin:2px 0 0; padding:0; display:flex; flex-direction:column; gap:2px; }
/* Media list item simplified; strong left accent on hover/focus to cue clickability */
.media-list a { display:block; padding:6px 10px 6px 12px; background:#fff; border:1px solid #e0e6ed; border-radius:8px; text-decoration:none; color:#162a38; position:relative; box-shadow:var(--dd-shadow-sm); transition:.18s background,.18s border-color,.18s transform; }
.media-list a:before { content:""; position:absolute; left:0; top:0; bottom:0; width:2px; background:linear-gradient(var(--dd-accent),var(--dd-accent-book)); border-top-left-radius:8px; border-bottom-left-radius:8px; opacity:0; transform:scaleY(.35); transform-origin:center; transition:.28s opacity,.28s transform; }
.media-list a:hover:before, .media-list a:focus-visible:before, .media-list a.active:before { opacity:1; transform:scaleY(1); }
.media-list a:hover { background:#f6f9fc; border-color:#c8d4e1; }
.media-list a.active { background:#f0f6ff; border-color:var(--dd-accent); box-shadow:0 0 0 2px #e0eefc; }
/* Arrow / check indicators removed per request */
.media-list a:hover { border-color:var(--dd-border); background:linear-gradient(180deg,#fff,#f4f8fc); }
.media-list a.active { border-color:var(--dd-accent); background:linear-gradient(180deg,#ffffff,#f0f6ff); box-shadow:0 0 0 2px #e6f0ff; }
.media-list a:focus-visible { outline:var(--dd-focus); outline-offset:2px; }
.media-list .title-row { display:block; }
.media-list .media-title { font:600 12.5px/1.15 Inter; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin:0; letter-spacing:.1px; overflow-wrap:anywhere; word-break:break-word; }
.media-list .counts { display:none; }
/* Hide domains in condensed list to reduce vertical space; can revisit with hover reveal */
.media-list .domains { display:none; }
.media-list .domains span { display:none; }
.media-empty { font-size:11px; color:#5a6b7c; margin:4px 0 0; }
.media-instructions { margin:4px 0 2px; font:500 11px/1.35 Inter; background:linear-gradient(90deg,#eef4ff,#f6f9ff); border:1px solid #d6e2f2; padding:8px 10px; border-radius:10px; color:#2a4a63; }
.media-instructions strong { font-weight:600; }
.media-instructions kbd { background:#fff; border:1px solid #c7d4e4; padding:2px 5px 3px; border-radius:6px; font-size:10px; font-weight:600; letter-spacing:.5px; }

/* Main Card Panel */
#cardPanel { min-height:520px; position:relative; }
.card-empty-state { border:2px dashed #cbd6e0; border-radius:24px; padding:48px 42px; background:#ffffffa8; text-align:center; max-width:860px; margin:14px auto 0; backdrop-filter:blur(4px) saturate(140%); }
/* Extra vertical offset when on landing (no hero) so card clears fixed / global header */
.deep-dives-page.landing-state .deep-dives-shell { padding:calc(var(--nav-offset) + 12px) 26px 32px; }
.deep-dives-page.landing-state .card-empty-state { margin-top:8px; }
.card-empty-state h2 { margin:0 0 18px; font:700 1.9rem/1.15 Inter,Montserrat,system-ui; color:#1c3142; }
.card-empty-state ol { margin:0 auto 22px; padding-left:20px; text-align:left; max-width:540px; font:500 .9rem/1.45 Inter; }
.card-empty-state li { margin:0 0 8px; }
.primary-hint { display:inline-block; background:#2f6feb; color:#fff; padding:10px 18px; font:600 12px/1 Inter; border-radius:10px; letter-spacing:.5px; text-decoration:none; box-shadow:0 4px 12px -3px rgba(47,111,235,.45); }
.primary-hint:hover { background:#255dcc; }
.card-empty-state .micro-hint { font:600 11px/1.4 Inter; letter-spacing:.35px; text-transform:uppercase; color:#5a7286; margin:4px 0 0; }

/* Outline (secondary nav) appears after selection */
#outlineBar { position:sticky; top:calc(var(--nav-offset) + 6px); display:none; gap:6px; flex-wrap:wrap; background:#ffffffd9; border:1px solid var(--dd-border); border-radius:14px; padding:10px 14px; margin:0 0 26px; backdrop-filter:saturate(170%) blur(6px); box-shadow:var(--dd-shadow-sm); z-index:45; }
#outlineBar a { position:relative; text-decoration:none; font:600 11px/1 Inter; padding:6px 14px; border:1px solid #d3dce5; border-radius:10px; background:#fff; color:#2a475e; letter-spacing:.35px; transition:.2s background,.2s box-shadow,.2s transform,.2s border-color; display:inline-flex; align-items:center; }
#outlineBar a:hover { background:#f2f7ff; border-color:#b8c8d8; box-shadow:0 2px 6px -2px rgba(0,0,0,.18); }
#outlineBar a:active { transform:translateY(1px); }
#outlineBar a.active { background:var(--dd-accent); border-color:var(--dd-accent); color:#fff; box-shadow:0 2px 8px -2px rgba(47,111,235,.55); }
#outlineBar a:focus-visible { outline:var(--dd-focus); outline-offset:3px; }
#outlineBar .outline-sep { font:700 13px/1 Inter; color:#8aa0b2; padding:0 4px; display:inline-flex; align-items:center; user-select:none; pointer-events:none; }

/* Panels inside content */
#content .panel { background:var(--dd-panel-bg); border:1px solid var(--dd-border); border-radius:20px; padding:22px 24px 24px; box-shadow:var(--dd-shadow-sm); position:relative; }
#content section + section { margin-top:26px; }
.collapse-btn { position:absolute; top:14px; left:14px; background:#eef4fa; border:1px solid #d3dde7; font:600 11px/1 Inter; padding:6px 10px; border-radius:14px; cursor:pointer; letter-spacing:.5px; color:#305075; }
.collapse-btn:hover { background:#dfeaf4; }
section.section-collapsed .panel > *:not(.collapse-btn):not(h2):not(.section-title) { display:none; }
section.section-collapsed .panel { opacity:.92; }

/* Claims */
.claims-grid { display:grid; gap:14px; }
@media (min-width:860px){ .claims-grid { grid-template-columns:repeat(auto-fill,minmax(330px,1fr)); } }
.card { background:linear-gradient(180deg,#ffffff,#f9fbfd); border:1px solid var(--dd-border); border-radius:14px; padding:14px 16px 14px; box-shadow:0 1px 3px rgba(0,0,0,.08); position:relative; transition:.28s; }
.card:hover { transform:translateY(-3px); box-shadow:0 5px 16px -6px rgba(0,0,0,.22); }
.claim-strength { position:absolute; top:8px; right:8px; font-size:9.5px; font-weight:700; padding:3px 6px 3px; border-radius:5px; background:#2d5a27; color:#fff; letter-spacing:.55px; }
.claim-time { font-size:10px; color:#5d6b77; margin-bottom:2px; letter-spacing:.45px; }
.claim-text { margin:0 0 10px; font:600 .95rem/1.3 Inter; color:#122e42; }
.sub-list { margin:2px 0 0; padding-left:14px; font:500 .73rem/1.3 Inter; color:#4a5d6d; }
.legend { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 8px; }
/* Claims tools */
.claims-tools-row { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; margin:0 0 12px; }
.claims-search input { padding:8px 10px; border:1px solid var(--dd-border); border-radius:10px; font:500 12.5px/1 Inter; min-width:230px; }
.claims-stats { display:flex; flex-wrap:wrap; gap:6px; }
.claims-stats .stat-chip { background:#eef3f8; border:1px solid var(--dd-border); padding:5px 8px; border-radius:8px; font:600 .52rem/1 Inter; letter-spacing:.35px; }
.claims-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
.claims-filters label, .claims-filters legend { font:600 .55rem/1 Inter; letter-spacing:.15em; text-transform:uppercase; color:#5c6975; }
.claims-filters fieldset { margin:0; padding:0; border:0; display:flex; gap:6px; }
.claims-filters #strengthChecks label { display:flex; align-items:center; gap:4px; font:600 .55rem/1 Inter; background:#fff; padding:5px 7px; border:1px solid var(--dd-border); border-radius:8px; cursor:pointer; }
.claims-filters #strengthChecks input { accent-color:var(--dd-accent); }
.claims-filters select { padding:6px 8px; border:1px solid var(--dd-border); border-radius:8px; background:#fff; font:500 11.5px/1 Inter; }
.claims-filters .btn { padding:6px 10px; font-size:.6rem; }
/* Embedded video (denser) */
.video-embed { margin:12px 0 4px; width:100%; aspect-ratio:16/9; background:#000; border-radius:16px; overflow:hidden; box-shadow:0 3px 14px -5px rgba(0,0,0,.32); }
.video-embed--small { width:360px; max-width:100%; aspect-ratio:16/9; margin:6px 0 12px; border-radius:14px; box-shadow:0 2px 10px -4px rgba(0,0,0,.28); }
@media (max-width:600px){ .video-embed--small { width:100%; } }
.video-embed iframe { width:100%; height:100%; border:0; display:block; }

/* Utilities */
.visually-hidden { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0 0 0 0) !important; white-space:nowrap !important; border:0 !important; }

@media (max-width:760px){
  .claims-tools-row { flex-direction:column; align-items:stretch; }
  .claims-search input { width:100%; }
  #outlineBar { position:static; }
}

@media (prefers-reduced-motion: reduce){
  .card, .collapse-btn, .media-list a { transition:none !important; }
}

/* ===== Density & Toggle Clarity Tweaks (override layer) ===== */
/* Show full media titles (unclamped) */
.media-list .media-title{display:block;-webkit-line-clamp:unset;line-clamp:unset;overflow:visible;max-height:none;}
/* Make collapse button more visually clear */
.collapse-btn {
  background:linear-gradient(135deg,#f2f6fa,#e3edf6);
  border:1px solid #c4d2df;
  color:#23445d;
  padding:5px 9px 5px 26px; /* leave room for icon bar */
  font-weight:600;
  font-size:10.5px;
  letter-spacing:.6px;
  position:absolute;
  top:10px;
  left:10px;
  border-radius:11px;
  box-shadow:0 1px 2px rgba(0,0,0,.08);
}
.collapse-btn::before {
  content:"";
  position:absolute;
  left:8px; top:50%; width:10px; height:10px; margin-top:-5px;
  border-radius:3px;
  background:#2f6feb;
  mask:linear-gradient(90deg,#000 0 0);
  -webkit-mask:linear-gradient(90deg,#000 0 0);
  box-shadow:0 0 0 1.5px #d9e4ef inset;
}
.collapse-btn::after {
  content:"▾";
  position:absolute;
  left:8px; top:50%; transform:translateY(-50%);
  font-size:10px; line-height:1; color:#fff; font-weight:700;
}
section.section-collapsed .collapse-btn::after { content:"▸"; }
.collapse-btn:hover { background:linear-gradient(135deg,#e8f1f9,#d8e7f3); border-color:#b3c5d3; }
section.section-collapsed .panel { border-style:dashed; }

/* Tighter vertical rhythm between panels */
#content section + section { margin-top:18px; }

/* Tighter claims grid spacing */
.claims-grid { gap:10px; }

/* Slightly tighter card internal padding */
.card { padding:12px 14px 12px; }
.card .claim-text { margin-bottom:8px; }
.sub-list { margin-top:2px; }

/* Extra left breathing room inside cards */
.card { padding-left:20px; }

/* Indent lists inside panels slightly more for readability */
.tldr-list,
.next-steps-list,
.rhetoric-list,
.misconceptions-list,
.glossary-item,
.panel ul,
.panel ol { padding-left:26px; }

/* Avoid over-indent for nested evidence sub-lists */
.card .sub-list { padding-left:18px; }

/* Inline TL;DR + Video paired layout (equal visual space) */
/* Video bigger, TL;DR anchored right */
.header-with-tldr .header-paired-row { display:flex; flex-wrap:wrap; gap:20px; align-items:stretch; margin-top:14px; }
@media (max-width:900px){ .header-with-tldr .header-paired-row { flex-direction:column; } }
.header-with-tldr .header-video-col, .header-with-tldr .header-tldr-col { display:flex; flex-direction:column; }
.header-with-tldr .header-video-col { flex:0 0 520px; min-width:420px; max-width:560px; position:relative; }
.header-with-tldr .header-tldr-col { flex:1 1 auto; min-width:320px; max-width:640px; order:2; margin-left:0; }
.header-with-tldr .header-video-col .video-embed--small { width:100%; max-width:560px; border:1px solid var(--border-subtle); border-radius:14px; overflow:hidden; box-shadow:0 2px 8px -4px rgba(0,0,0,.2); }
.header-with-tldr .header-video-col .video-thumb-wrapper { aspect-ratio:16/9; display:block; background:#000; }
.header-with-tldr .header-tldr-col { background:linear-gradient(180deg,#f6f9fc,#f1f6fa); border:1px solid #d2dde7; border-radius:12px; padding:14px 16px 16px; box-shadow:0 2px 6px -3px rgba(0,0,0,.12); }
.header-with-tldr .tldr-inline { margin:0; }
.header-with-tldr .tldr-inline-title { margin:0 0 8px; font:700 12px/1 Inter; letter-spacing:.18em; text-transform:uppercase; color:#2b4a62; }
.header-with-tldr .tldr-inline-list { margin:0; padding-left:18px; font:500 .78rem/1.38 Inter; color:#2a3f4f; display:flex; flex-direction:column; gap:4px; }
.header-with-tldr .tldr-inline-list li { margin:0; }

/* Timestamp buttons (timeline + claims) */
.ts-btn { 
  background:#eef4ff; 
  border:1px solid #c5d5ea; 
  color:#1f4970; 
  font:600 11px/1 Inter; 
  padding:4px 8px 4px; 
  border-radius:7px; 
  cursor:pointer; 
  letter-spacing:.4px; 
  display:inline-flex; 
  align-items:center; 
  gap:4px; 
  position:relative; 
  transition:.18s background,.18s border-color,.18s box-shadow,.18s transform; 
}
.ts-btn:before { 
  content:""; 
  width:6px; height:6px; 
  border-radius:50%; 
  background:linear-gradient(135deg,#2f6feb,#2d5a27); 
  box-shadow:0 0 0 2px #ffffff; 
}
.ts-btn:hover { background:#e3eefc; border-color:#b5c7dc; box-shadow:0 2px 6px -2px rgba(0,0,0,.18); }
.ts-btn:active { transform:translateY(1px); }
.ts-btn:focus-visible { outline:2px solid #2f6feb; outline-offset:2px; }
.ts-btn:focus-visible:before { box-shadow:0 0 0 2px #fff,0 0 0 4px #2f6feb; }
.claim-time .ts-btn { margin-right:4px; }
.timeline td .ts-btn { min-width:auto; justify-content:center; padding:3px 6px 3px; font-size:10.5px; }

/* Enhanced timeline table styling (deep dives) */
table.timeline { width:100%; border-collapse:separate; border-spacing:0 2px; font:500 12px/1.35 Inter, var(--font-sans); table-layout:fixed; }
table.timeline thead th { background:#f0f6fb; color:#2a4a63; font:600 10px/1.2 Inter; letter-spacing:.18em; text-transform:uppercase; padding:8px 10px 7px; border:1px solid #c7d6e3; border-bottom:2px solid #b7c9d6; position:sticky; top:0; z-index:2; }
table.timeline thead th:first-child { border-top-left-radius:10px; }
table.timeline thead th:last-child { border-top-right-radius:10px; }
table.timeline tbody td { background:#ffffff; border:1px solid #d6e1ea; padding:6px 10px 7px; vertical-align:top; position:relative; }
table.timeline tbody tr { transition:.18s background; }
table.timeline tbody tr:hover { background:#f4f9fd; }
table.timeline tbody tr:hover td { background:transparent; }
table.timeline tbody tr:nth-child(even) td { background:#fbfdfe; }
/* Narrow timestamp columns; let segment & summary share space */
table.timeline col.col-start { width:1%; }
table.timeline col.col-end { width:1%; }
table.timeline tbody td.col-start, table.timeline tbody td.col-end { text-align:center; font:600 10.5px/1 Inter; letter-spacing:.4px; color:#294761; padding-left:6px; padding-right:6px; white-space:nowrap; }
/* Unified segment & summary text (same size, normal weight) */
table.timeline tbody td.col-seg,
table.timeline tbody td.col-sum { font:400 11.5px/1.42 Inter, var(--font-sans); color:#17374b; font-weight:400; }
/* Allow segment & summary to dominate width */
table.timeline { table-layout:auto; }
table.timeline tbody td.col-seg, table.timeline tbody td.col-sum { width:auto; }
@media (max-width:820px){
  table.timeline thead th:nth-child(2),
  table.timeline tbody td.col-end { display:none; }
  table.timeline { font-size:11.5px; }
  table.timeline tbody td.col-start { width:64px; }
  table.timeline tbody td.col-seg { width:140px; }
}
@media (max-width:580px){
  table.timeline thead th:nth-child(1),
  table.timeline tbody td.col-start { width:56px; }
  table.timeline tbody td.col-seg { width:auto; }
  table.timeline tbody td.col-sum { font-size:11px; }
}
/* Compact mode when many segments (>30) – rely on attribute hook set dynamically later if needed */
section#section-timeline[data-dense='true'] table.timeline tbody td { padding:4px 8px 5px; }
section#section-timeline[data-dense='true'] table.timeline tbody td.col-sum { font-size:10.5px; line-height:1.3; }

