/* ===================================================================
   Layout — page shell, hero, sidebar, TOC, footer
   =================================================================== */

.page { padding: var(--space-4) 0 0; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin: var(--space-4) 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.breadcrumbs a { color: var(--muted); font-weight: 600; }

/* ---- Hero ---- */

.hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(60, 64, 67, 0.06);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(300px, 0.94fr);
  gap: var(--space-6);
  padding: var(--space-6);
}

.article-meta-row {
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.article-byline,
.article-update,
.top-info-card,
.summary-score-card,
.score-chip,
.meta-card,
.section-card,
.toc-card,
.highlight-card,
.visual-card,
.fact-card,
.timeline-item,
.faq-item,
.source-card,
.footer-card,
.footer-brand,
.footer-column,
.callout,
.descriptor-card,
.firmness-card,
.layer-card,
.list-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(60, 64, 67, 0.04);
}

.article-byline,
.article-update {
  padding: var(--space-3) var(--space-4);
  background: var(--surface-alt);
}

.top-info-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.top-info-card {
  padding: var(--space-4);
  background: var(--surface-alt);
}

.top-info-card p,
.summary-score-card p,
.highlight-card p,
.layer-card p,
.callout p,
.footer-brand p {
  margin: var(--space-3) 0 var(--space-4);
  color: var(--muted);
}

.top-info-card a,
.summary-score-card a,
.source-card a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.hero h1 {
  margin: var(--space-4) 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2.5rem;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 700;
}

.hero-summary {
  max-width: 70ch;
  color: var(--muted);
  font-size: 0.96rem;
  margin: 0 0 var(--space-4);
}

.hero-actions {
  grid-auto-flow: column;
  justify-content: start;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.hero-links {
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.resource-link,
.policy-links a,
.support-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.resource-link:hover { background: white; text-decoration: none; }

.hero-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.meta-card {
  padding: var(--space-4);
  background: var(--surface-alt);
}
.meta-card strong {
  display: block;
  font-size: 0.98rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
}
.meta-card span { color: var(--muted); font-size: 0.9rem; }

.hero-figure {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, #eff4fb, #f5f8fd);
}

.hero-figure img,
.visual-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-figure figcaption,
.visual-card figcaption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: var(--space-3);
  border-radius: 12px;
  background: rgba(32, 33, 36, 0.74);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.76rem;
  line-height: 1.45;
}

.hero-highlights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-4);
}

.highlight-card {
  padding: var(--space-4);
  background: var(--surface);
}
.highlight-head {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.highlight-card h3,
.fact-card h3,
.section-card h2,
.toc-card h2,
.footer-brand h3 { margin: 0 0 var(--space-2); }
.highlight-card h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
}

.hero-scoring {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-6);
}

.summary-score-card {
  padding: var(--space-4);
  background: var(--surface);
}

.summary-score-number {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2.6rem;
  line-height: 0.95;
  letter-spacing: 0;
  margin: var(--space-2) 0 var(--space-1);
  font-weight: 700;
}

.score-chip-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.score-chip {
  padding: var(--space-3) var(--space-4);
  background: var(--surface-alt);
}
.score-chip strong {
  display: block;
  font-size: 1rem;
  margin-bottom: var(--space-1);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
}
.score-chip span { color: var(--muted); font-size: 0.88rem; }

/* ---- Sidebar / TOC ---- */

.layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
  align-items: start;
  /* Break out left so content column aligns with the rest of the page */
  width: calc(var(--shell) + 220px);
  max-width: calc(100vw - 32px);
  margin-left: -220px;
}

.sidebar { position: sticky; top: 86px; display: grid; gap: var(--space-3); }
.toc-card { padding: var(--space-4); border-radius: 10px; }
.toc-card h2 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.toc-progress {
  height: 3px;
  margin-bottom: var(--space-2);
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}
.toc-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6ba4ff);
  transition: width 0.15s ease-out;
}
.toc-list { gap: 2px; list-style: none; padding: 0; margin: 0; }
.toc-list {
  position: relative;
  padding-left: 10px;
  display: grid;
}
.toc-list::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(26, 115, 232, 0.08), rgba(26, 115, 232, 0.3));
}
.toc-list a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.toc-list a:hover { color: var(--accent); background: var(--accent-soft); }
.toc-list a.active { color: var(--accent); background: var(--accent-soft); }
.toc-list a.active::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 999px;
  background: var(--accent);
}
.toc-list a.active .toc-index { background: var(--accent); color: white; border-color: var(--accent); }
.toc-index {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  font-size: 0.62rem;
  color: var(--muted);
}
.sidebar-note { color: var(--muted); font-size: 0.92rem; }

/* ---- Footer ---- */

.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.3), rgba(255, 255, 255, 0.88));
}
.site-footer-inner { padding: var(--space-6) 0 var(--space-7); }
.footer-grid { grid-template-columns: 1.2fr repeat(3, minmax(0, 0.8fr)); gap: var(--space-4); }
.footer-brand,
.footer-column { padding: var(--space-5); }
.footer-column h4 {
  margin: 0 0 var(--space-3);
  font-size: 0.96rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
}
.footer-links { gap: var(--space-3); }
.footer-links a { color: var(--muted); font-weight: 700; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  padding-top: var(--space-4);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- Layout responsive ---- */
@media (max-width: 1300px) {
  .hero-figure { min-height: 300px; max-height: 400px; }
}

@media (max-width: 920px) {
  .table-wrap,
  .section-card > .mini-table,
  .section-card > .comparison-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 640px) {
  .sidebar { display: none; }
  .layout { margin-top: var(--space-4); }
  .visual-card { min-height: 200px; }
  .hero-figure { min-height: 200px; max-height: 280px; }
  .breadcrumbs { font-size: 0.78rem; }
}
