/* Components for inner pages, built only from the tokens and shapes in juice.css */

.page-head { padding-top: 20px; }
.page-head .hero-frame { padding: 45px 40px 40px; }
.page-head .hero-headline { font-size: 52px; max-width: 1100px; }
.page-head .hero-line-inner { transform: none; }

.crumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  margin-bottom: 26px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crumbs a:hover { color: var(--ink-bright); }

.meta-row {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.meta-row .card-evidence-badge { position: static; }
.lead {
  margin-top: 24px;
  max-width: 820px;
  font-size: 17px;
  line-height: 26px;
  color: var(--ink-muted);
}

.page-cover {
  margin-top: 40px;
  position: relative;
  border: 1px solid var(--rule);
  background: #0b0e0c;
  padding: 12px;
}
.page-cover img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: var(--bg-frame-sat);
}

/* Section heading row */
.block { margin-top: 70px; }
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.block-head .section-heading { font-size: 34px; line-height: 38px; }
.block-count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }

/* Key findings */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}
.finding {
  background: var(--bg-brown-panel);
  border: 1px solid var(--rule-brown);
  padding: 22px 24px;
  display: flex;
  gap: 18px;
}
.finding-n {
  font-size: 28px;
  line-height: 30px;
  font-weight: 300;
  color: var(--accent-bronze);
  min-width: 34px;
}
.finding p { font-size: 15px; line-height: 22.5px; color: var(--ink-bright); }

/* Layout: article + sticky TOC */
.article-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 20px;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  padding: 18px;
  font-size: 12px;
  line-height: 18px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.toc-title { font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); letter-spacing: .4px; margin-bottom: 10px; }
.toc ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.toc a { color: var(--ink-muted); }
.toc a:hover { color: var(--ink-bright); }

/* Prose (rendered research text) */
.prose {
  max-width: 820px;
  font-size: 16px;
  line-height: 26px;
  color: var(--ink-bright);
}
.prose > * + * { margin-top: 16px; }
.prose h1 { display: none; }
.prose h2 { margin-top: 48px; font-size: 28px; line-height: 33px; font-weight: 300; letter-spacing: -0.7px; padding-top: 18px; border-top: 1px solid var(--rule); }
.prose h3 { margin-top: 32px; font-size: 20px; line-height: 25px; font-weight: 400; letter-spacing: -0.4px; }
.prose h4 { margin-top: 24px; font-size: 16px; font-weight: 700; }
.prose p, .prose li { color: #cfd3cc; }
.prose strong { color: var(--ink-white); font-weight: 700; }
.prose a { color: var(--accent-bronze); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; word-break: break-word; }
.prose a:hover { color: var(--ink-bright); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose blockquote { border-left: 2px solid var(--accent-bronze); background: var(--bg-brown-panel); padding: 14px 18px; color: var(--ink-muted); }
.prose code { font-size: 13px; background: var(--bg-card); border: 1px solid var(--rule); padding: 1px 5px; }
.prose pre { background: var(--bg-card); border: 1px solid var(--rule); padding: 14px; overflow-x: auto; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
.prose img { margin: 8px 0; border: 1px solid var(--rule); }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); }
.prose table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 19px; }
.prose th { text-align: left; font-weight: 400; color: var(--ink-dim); font-family: var(--font-mono); font-size: 11px; background: var(--bg-green-panel); }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }

/* Gallery */
.tab-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tab-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  height: 30px;
  padding: 0 12px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--ink-muted);
  cursor: pointer;
}
.tab-btn:hover { color: var(--ink-bright); }
.tab-btn.is-active { background: var(--btn-light-bg); border-color: var(--btn-light-bg); color: var(--btn-light-ink); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  cursor: zoom-in;
  text-align: left;
  color: inherit;
  font: inherit;
  padding: 0;
  transition: border-color 200ms ease;
}
.gallery-item:hover { border-color: var(--accent-bronze); }
.gallery-item .card-media { height: 240px; background: var(--bg-frame-sat); }
.gallery-item .card-media img { object-fit: contain; filter: none; transform: none; }
.gallery-item .card-media img.cover { object-fit: cover; }
.gallery-cap { padding: 12px 14px 14px; font-size: 12px; line-height: 18px; color: var(--ink-muted); border-top: 1px solid var(--rule); }
.is-hidden { display: none !important; }

/* Before / after */
.ba {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--bg-frame-sat);
  overflow: hidden;
  user-select: none;
}
.ba img { width: 100%; display: block; }
.ba-top { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.ba-top img { height: 100%; object-fit: cover; }
.ba-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--ink-bright); pointer-events: none; }
.ba input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; }
.ba-labels { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.ba-labels .card-evidence-badge { position: static; }

/* Social evidence: reuse .tg-post in a grid */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); align-items: start; }
.posts-grid .tg-post { opacity: 1; transform: none; }
.posts-grid .tg-media { height: auto; max-height: 420px; cursor: zoom-in; }
.posts-grid .tg-media img { height: auto; object-fit: contain; filter: none; }
.tg-post .tg-noshot { margin-top: 12px; padding: 14px; border: 1px dashed #3c342d; font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); }
.tg-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* Sources */
.src-groups { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.src-group { background: var(--bg-green-panel); border: 1px solid var(--rule); padding: 22px 24px; }
.src-group.is-claim { background: var(--bg-brown-panel); border-color: var(--rule-brown); }
.src-group h3 { font-size: 18px; line-height: 23px; font-weight: 300; letter-spacing: -0.4px; display: flex; justify-content: space-between; gap: 10px; }
.src-note { margin-top: 6px; font-size: 12px; line-height: 18px; color: var(--ink-dim); }
.src-list { margin-top: 14px; list-style: none; display: flex; flex-direction: column; }
.src-list li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 13px; line-height: 19px; }
.src-group.is-claim .src-list li { border-color: var(--rule-brown); }
.src-list a { color: var(--ink-bright); word-break: break-word; }
.src-list a:hover { color: var(--accent-bronze); }
.src-meta { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); }

/* Downloads, corrections, details */
.dl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.corr-list { list-style: none; display: flex; flex-direction: column; gap: var(--gutter); }
.corr-item { background: var(--bg-brown-panel); border: 1px solid var(--rule-brown); padding: 18px 22px; display: grid; grid-template-columns: 140px 1fr; gap: 18px; font-size: 14px; line-height: 21px; }
.corr-date { font-family: var(--font-mono); font-size: 11px; color: var(--accent-bronze); }
.corr-item a { color: var(--ink-dim); font-size: 12px; }
details.fold { border: 1px solid var(--rule); background: var(--bg-card); }
details.fold > summary { cursor: pointer; padding: 18px 22px; font-size: 18px; font-weight: 300; list-style: none; display: flex; justify-content: space-between; }
details.fold > summary::after { content: "+"; color: var(--ink-dim); }
details.fold[open] > summary::after { content: "−"; }
details.fold > .prose { padding: 0 22px 24px; }
.cite-box { background: var(--bg-card); border: 1px solid var(--rule); padding: 18px 22px; font-family: var(--font-mono); font-size: 12px; line-height: 19px; color: var(--ink-muted); }

/* Catalog */
.catalog-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.search-input {
  height: 34px;
  min-width: 280px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--btn-border);
  color: var(--ink-bright);
  font-family: var(--font-sans);
  font-size: 13px;
}
.search-input::placeholder { color: var(--ink-dim); }
.search-input:focus { outline: none; border-color: var(--accent-bronze); }
.research-card .card-media { height: 260px; }
.cards-grid .research-card { opacity: 1; }
.empty-note { padding: 40px; text-align: center; color: var(--ink-dim); border: 1px dashed var(--rule); }

/* Real chart image in analytics panel */
.chart-panel .chart-img { flex: 1; margin-top: 24px; min-height: 0; display: flex; align-items: center; justify-content: center; background: #0b0e0c; border: 1px solid var(--rule); }
.chart-panel .chart-img img { max-height: 360px; width: 100%; object-fit: contain; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(8, 9, 8, 0.94); display: none; flex-direction: column; }
.lightbox.is-open { display: flex; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px var(--margin-x); border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--ink-muted); }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-nav { display: flex; gap: 8px; }

@media (max-width: 1100px) {
  .gallery-grid, .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .page-head .hero-frame { padding: 32px 20px 26px; }
  .page-head .hero-headline { font-size: 34px; }
  .findings-grid, .src-groups, .gallery-grid, .posts-grid { grid-template-columns: 1fr; }
  .corr-item { grid-template-columns: 1fr; gap: 6px; }
  .search-input { min-width: 0; width: 100%; }
  .block-head .section-heading { font-size: 28px; line-height: 32px; }
}
@media print {
  html, body { background: #fff; color: #111; }
  .site-nav, .site-footer, .toc, .lightbox, .tab-row { display: none !important; }
  .prose, .prose p, .prose li { color: #111; }
}

/* Home evidence case: keep the photo inside the fixed-height frame whatever its aspect */
.case-grid > * { min-height: 0; }
.case-sat-inner { min-height: 0; }
.case-sat-inner img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
@media (max-width: 760px) { .case-sat-panel { height: 520px; } }

/* Long URLs and tables must not widen the page on phones */
.prose { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 1100px) { .article-layout { grid-template-columns: minmax(0, 1fr); } }
.posts-grid .tg-post, .src-group, .finding { min-width: 0; overflow-wrap: anywhere; }
