/**
 * Public course overview pages (/courses/<slug>).
 *
 * These are the only crawlable pages on the portal: plain static HTML, no Nuxt,
 * no auth. They load /articles/article.css first for the house type, tokens and
 * header, and this file adds only what an overview page needs on top.
 *
 * Shared by every overview page, so a change here changes all of them.
 */

/* ─── Hero ──────────────────────────────────────────────────── */

.overview-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-5);
}

.overview-hero h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  color: var(--gray-900);
  margin: var(--space-3) 0 var(--space-3);
  letter-spacing: -0.02em;
}

.overview-dek {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--gray-600);
}

.overview-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-4);
  font-size: 0.9rem;
  color: var(--gray-500);
}

.overview-facts strong {
  color: var(--gray-700);
  font-weight: 600;
}

/* ─── Body ──────────────────────────────────────────────────── */

.overview-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-5) var(--space-7);
}

.overview-body h2 {
  font-size: 1.5rem;
  color: var(--db-navy);
  margin: var(--space-7) 0 var(--space-3);
  letter-spacing: -0.01em;
}

.overview-body h3 {
  font-size: 1.1rem;
  color: var(--gray-900);
  margin: var(--space-5) 0 var(--space-1);
}

.overview-body p { margin-bottom: var(--space-block); }

/* The lead answer. First thing a reader or a crawler gets, so it is styled to
   be read on its own and to survive being quoted out of context. */
.overview-lead {
  background: white;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--db-cyan);
  border-radius: 8px;
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.overview-lead p:last-child { margin-bottom: 0; }

/* ─── Figures ───────────────────────────────────────────────── */
/* The house figure classes (.prop-fig, .figure-embed, .equation-box, .spec-table,
   .caption) all come from article.css, which these pages load first. Only the
   lead image and the spacing around a caption need anything extra. */

.overview-figure {
  margin: 0 0 var(--space-6);
}

.overview-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
}

/* The LEAD figure only, meaning the one directly under the H1. Course card art
   is 16:9, which at full column width is 400px tall and pushes the first
   paragraph below the fold on a laptop, so crop it to a band. Figures further
   down the page are photographs of specific things and must not be cropped. */
.overview-body > .overview-figure:first-child img {
  max-height: 300px;
  object-fit: cover;
  object-position: center;
}

/* ─── Figures break out of the text column ──────────────────── */
/*
 * Prose stays at 760px because that is already about 89 characters a line, at
 * the wide end of comfortable. Two things genuinely need more room than a
 * sentence does, and both are framed objects the eye reads as pictures: an SVG
 * diagram and a 3D canvas. Those get up to 1080px where there is room.
 *
 * ⛔ NOT tables. A table is text, and a table given 1080px does not get better,
 * it gets stretched: a two-column table ends up with half a screen of gap
 * between the label and the value, and because it starts further left than the
 * paragraph above it, the page looks broken rather than deliberate. Tables keep
 * the text column, which is also what every lesson article does. If one ever
 * genuinely needs the room, give that one table the class and say why.
 */
/* The breakout is a symmetric negative margin, not a vw width. 100vw includes the
   scrollbar on any platform that reserves space for one, so a vw-sized breakout
   overflows by the scrollbar width and gives the whole page a horizontal scroll.
   -160px each side is 1032px of figure, and the 1180px breakpoint guarantees at
   least 50px of gutter left over, so nothing can reach the viewport edge. */
@media (min-width: 1180px) {
  /* Not the lead image either: it sits directly under the H1 and the dek, and a
     band wider than the text it introduces reads as misaligned, not generous. */
  .overview-body .prop-fig,
  .overview-body .figure-embed,
  .overview-body .table-wrap.wide {
    margin-inline: -160px;
  }

  /* A wider frame is a taller frame at a fixed ratio, so hold the interactive
     to something that still fits a laptop fold. */
  .overview-body .figure-embed iframe { aspect-ratio: 16 / 9; max-height: 560px; }
}

/* .overview-body p out-specifies .caption, so say it here or every caption
   inherits a paragraph's bottom margin and the figure drifts from its text. */
.overview-body .caption {
  margin-bottom: var(--space-6);
  text-align: center;
}

.overview-figure .caption { margin-top: var(--space-2); }

/* ─── Outline ───────────────────────────────────────────────── */

.outline {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}

.outline-section {
  padding: var(--space-2) var(--space-5);
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.outline-section:first-child { border-top: none; }

.outline-lesson {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-top: 1px solid var(--gray-100);
  font-size: 0.98rem;
}

.outline-num {
  flex: none;
  width: 26px;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.outline-name { color: var(--gray-800); }

/* ─── FAQ ───────────────────────────────────────────────────── */

.faq h3 {
  font-size: 1.05rem;
  color: var(--db-navy);
  margin: var(--space-5) 0 var(--space-1);
}

.faq p { margin-bottom: var(--space-3); }

/* ─── Call to action ────────────────────────────────────────── */

.cta-band {
  background: var(--db-navy);
  color: white;
  border-radius: 12px;
  padding: var(--space-6);
  margin: var(--space-7) 0 var(--space-5);
  text-align: center;
}

.cta-band h2 {
  color: white;
  margin: 0 0 var(--space-2);
  font-size: 1.4rem;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.82);
  margin: 0 auto var(--space-5);
  max-width: 46ch;
}

.cta-button {
  display: inline-block;
  background: var(--db-cyan);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 8px;
}

.cta-button:hover { background: #0095cc; }

.cta-fine {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ─── Related + footer ──────────────────────────────────────── */

.related {
  display: grid;
  gap: var(--space-2);
}

.related a {
  display: block;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 600;
}

.related a:hover { border-color: var(--db-cyan); }

.related span {
  display: block;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.overview-footer {
  border-top: 1px solid var(--gray-200);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
}

/* Who stands behind the page. It is the last thing read and the only place the
   author is a person rather than a string, so it gets a card rather than a
   sentence. The avatar is initials until there is a real photograph to use. */
.author-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.author-avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--db-navy), var(--db-cyan));
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-name {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--gray-500);
}

.author-name a {
  color: var(--gray-900);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--gray-300);
}

.author-name a:hover { color: var(--db-cyan); border-bottom-color: var(--db-cyan); }

.author-role {
  margin: 4px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gray-500);
}

.author-role a {
  color: var(--gray-600);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-300);
}

.author-role a:hover { color: var(--db-cyan); border-bottom-color: var(--db-cyan); }

@media (max-width: 640px) {
  .overview-hero { padding-top: var(--space-5); }
  .overview-hero h1 { font-size: 1.8rem; }
  .overview-dek { font-size: 1.05rem; }
  .outline-lesson { flex-wrap: wrap; }
  .cta-band { padding: var(--space-5) var(--space-4); }
}
