/* Know Your ML — blog explainers (/blog/).
   Loaded only by the blog pages. Everything else reuses the report article
   classes already in css/styles.css (report-header, report-content, toc, faq,
   report-figure, report-sources, compare, callout, reports-grid, card).
   Colours and type come from the :root tokens in styles.css. */

/* --- Hero image ----------------------------------------------------------- */
.blog-hero {
  margin: 0 0 2rem;
}

.blog-hero img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
}

.blog-hero figcaption,
.blog-figure figcaption {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0.75rem;
  text-align: left;
}

.blog-figure {
  text-align: left;
}

.blog-figure img {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.blog-credit {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted-dim);
}

/* --- Inline SVG figures (illustrative, drawn for this page) --------------- */
.blog-svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.blog-svg text {
  font-family: var(--font-sans);
}

/* Three fit panels: one column on phones, three side by side from 620px. */
.fit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

/* Scoped under .report-figure so these beat the generic `.report-figure svg`
   rule in styles.css (max-width: 100%). */
.report-figure .fit-panel {
  max-width: 280px;
  margin: 0 auto;
}

.report-figure .lc-svg {
  max-width: 440px;
  margin: 0 auto;
}

@media (min-width: 620px) {
  .fit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .report-figure .fit-panel {
    max-width: none;
  }
}

.bf-frame {
  fill: var(--surface-raised);
  stroke: var(--border);
  stroke-width: 1;
}

.bf-true {
  fill: none;
  stroke: var(--muted-dim);
  stroke-width: 1.3;
  stroke-dasharray: 4 4;
}

.bf-fit {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.bf-dot {
  fill: var(--accent-2);
}

.bf-title {
  fill: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
}

.bf-cap {
  fill: var(--muted);
  font-size: 13px;
}

.lc-axis {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.lc-train {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.lc-val {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.lc-label {
  fill: var(--muted);
  font-size: 15px;
}

.lc-label-strong {
  fill: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.lc-gap {
  fill: var(--accent-soft);
  stroke: none;
}

/* --- Tables: numeric columns read right-aligned ------------------------- */
.blog-content .compare td.num,
.blog-content .compare th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Text tables that wrap on phones instead of scrolling ---------------- */
.blog-content .compare--fluid {
  min-width: 0;
}

@media (max-width: 560px) {
  .blog-content .compare--fluid th,
  .blog-content .compare--fluid td {
    padding: 0.7rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* --- Key takeaways callout list spacing -------------------------------- */
.blog-content .callout ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.blog-content .callout li {
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* --- Related reading --------------------------------------------------- */
.blog-related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.blog-related h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.blog-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.blog-related li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.9rem 1.1rem;
}

.blog-related a {
  font-family: var(--font-sans);
  font-weight: 600;
}

.blog-related p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* --- Blog index -------------------------------------------------------- */
.blog-index-intro {
  max-width: 68ch;
}

.blog-index-grid {
  margin-top: 2rem;
}

.blog-card .report-card-head {
  aspect-ratio: 4 / 3;
}

.blog-card .report-card-head img {
  object-position: 50% 30%;
}

.blog-card .card-title {
  font-size: 1.2rem;
  line-height: 1.3;
}

.blog-card .card-summary {
  font-size: 0.97rem;
}

.blog-note {
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 68ch;
}

/* --- Small screens ----------------------------------------------------- */
@media (max-width: 480px) {
  .blog-hero {
    margin-bottom: 1.5rem;
  }

  .blog-hero img,
  .blog-figure img {
    border-radius: var(--radius);
  }
}
