/* How-to guides and comparisons cluster (/how-to/, /how-to/<slug>/, /comparisons/ and
   /comparisons/<slug>/), loaded via ViewData["ExtraCss"] = "howto".
   Only spdf-howto-* classes live here; the shared code block, tabs, kicker, FAQ and buttons
   come from the core layers. */

/* ── Hero ─────────────────────────────────────────────────────────────── */
.spdf-howto-hero { border-bottom: 1px solid var(--spdf-line); padding: 40px 0 56px; }
.spdf-howto-hero-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.spdf-howto-crumbs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px;
  font-family: var(--spdf-font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--spdf-text-mute);
}
.spdf-howto-crumbs a { color: var(--spdf-text-dim); text-decoration: none; }
.spdf-howto-crumbs a:hover { color: var(--spdf-accent); }
.spdf-howto-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; }
.spdf-howto-hero-grid.is-single { grid-template-columns: minmax(0, 860px); }
.spdf-howto-h1 {
  font-family: var(--spdf-font-display); font-weight: var(--spdf-display-weight);
  letter-spacing: var(--spdf-display-letter);
  font-size: var(--spdf-h1-editorial); line-height: var(--spdf-h1-editorial-lh);
  margin: 16px 0 0; color: var(--spdf-text);
}
.spdf-howto-lede { font-size: 18px; line-height: 1.6; color: var(--spdf-text-dim); margin: 22px 0 0; max-width: 640px; }
.spdf-howto-verified {
  display: inline-flex; align-items: center; gap: 8px; margin: 22px 0 0; padding: 6px 12px;
  border: 1px solid var(--spdf-line-strong); border-radius: 999px;
  font-family: var(--spdf-font-mono); font-size: 12px; color: var(--spdf-text-dim);
}
.spdf-howto-check { color: var(--spdf-ok); font-weight: 700; }
.spdf-howto-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Video facade: our own thumbnail until the visitor clicks, then the youtube-nocookie player. */
.spdf-howto-video { margin: 0; }
.spdf-howto-video-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--spdf-line-strong); background: var(--spdf-code);
}
.spdf-howto-video-btn { all: unset; position: absolute; inset: 0; cursor: pointer; display: block; }
.spdf-howto-video-btn:focus-visible { outline: 3px solid var(--spdf-accent); outline-offset: -3px; }
.spdf-howto-video-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spdf-howto-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.spdf-howto-play {
  /* bottom-right, clear of the thumbnail's title */
  position: absolute; right: 5%; bottom: 8%; width: 76px; height: 54px;
  border-radius: 14px; background: var(--spdf-accent); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.spdf-howto-play::after {
  content: ""; position: absolute; left: 31px; top: 16px;
  border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #FFFFFF;
}
.spdf-howto-video-btn:hover .spdf-howto-play { transform: scale(1.06); }
.spdf-howto-figcap { margin-top: 10px; font-size: 13.5px; color: var(--spdf-text-mute); }
.spdf-howto-figcap a { color: var(--spdf-text-dim); }

.spdf-howto-preview { margin: 0; justify-self: center; max-width: 440px; width: 100%; }
.spdf-howto-preview img {
  display: block; width: 100%; height: auto; border-radius: 6px;
  border: 1px solid var(--spdf-line-strong); box-shadow: 0 18px 48px rgba(40, 24, 8, 0.12);
}
/* Hero code card (no video yet): the shared code block, sized for the hero column. */
.spdf-howto-herocode { min-width: 0; }
.spdf-howto-herocode .spdf-howto-code { margin-top: 0; box-shadow: 0 18px 48px rgba(40, 24, 8, 0.10); }

/* In the hero only the top of the first page is shown: most sample output is short. */
.spdf-howto-hero .spdf-howto-preview img { aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
/* Guides whose result is at the foot of the page (footers, page numbers) show the bottom instead. */
.spdf-howto-hero .spdf-howto-preview.is-bottom img { object-position: bottom; }
.spdf-howto-preview.is-inline { margin-top: 28px; justify-self: start; max-width: 520px; }

/* ── Body: sticky table of contents + article ─────────────────────────── */
.spdf-howto-body {
  max-width: 1280px; margin: 0 auto; padding: 8px 32px 24px;
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 64px;
}
.spdf-howto-toc { position: sticky; top: 96px; align-self: start; padding-top: 56px; }
.spdf-howto-toc-k { font-family: var(--spdf-font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--spdf-text-mute); margin-bottom: 12px; }
.spdf-howto-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--spdf-line); }
.spdf-howto-toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent;
  font-size: 14px; color: var(--spdf-text-dim); text-decoration: none;
}
.spdf-howto-toc a:hover { color: var(--spdf-text); border-left-color: var(--spdf-accent); }
.spdf-howto-main { min-width: 0; max-width: 860px; }
.spdf-howto-main .spdf-code-pre { min-width: 0; }

.spdf-howto-sec { padding: 48px 0; scroll-margin-top: 88px; }   /* even space on both sides of the divider */
.spdf-howto-sec + .spdf-howto-sec { border-top: 1px solid var(--spdf-line); }
.spdf-howto-sec .spdf-doc-h2 { margin-top: 12px; }
.spdf-howto-p { font-size: 16.5px; line-height: 1.65; color: var(--spdf-text-dim); margin: 16px 0 0; }
.spdf-howto-p a, .spdf-howto-facts a, .spdf-howto-index-note a { color: var(--spdf-accent); }
.spdf-howto-sub { font-family: var(--spdf-font-body); font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--spdf-text); margin: 40px 0 0; }

/* Standalone code block: the shared .spdf-qs-code is drawn to hang under a tab strip. */
.spdf-howto-code { border-top: 1px solid var(--spdf-line); border-radius: 12px; margin-top: 16px; }

/* Numbered steps */
.spdf-howto-steps { list-style: none; margin: 28px 0 0; padding: 0; counter-reset: none; }
.spdf-howto-step { position: relative; padding: 0 0 36px 52px; }
.spdf-howto-step::before {
  content: ""; position: absolute; left: 15px; top: 36px; bottom: 6px; width: 1px; background: var(--spdf-line);
}
.spdf-howto-step:last-child::before { display: none; }
.spdf-howto-step-title {
  font-family: var(--spdf-font-body); font-size: 20px; font-weight: 600; line-height: 1.3;
  color: var(--spdf-text); margin: 0; display: flex; align-items: center; min-height: 32px;
}
.spdf-howto-n {
  position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--spdf-chip); color: var(--spdf-chip-text);
  font-family: var(--spdf-font-mono); font-size: 13px; font-weight: 600;
}
.spdf-howto-step .spdf-qs-tabs { margin-top: 16px; }
.spdf-howto-step .spdf-howto-p { margin-top: 12px; }

.spdf-howto-download { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0 0; font-size: 14px; color: var(--spdf-text-mute); }

/* Troubleshooting notes */
.spdf-howto-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 28px; }
.spdf-howto-note { border: 1px solid var(--spdf-line); border-radius: 12px; background: var(--spdf-panel); padding: 20px 22px; }
.spdf-howto-note-title { font-family: var(--spdf-font-body); font-size: 16.5px; font-weight: 600; line-height: 1.35; margin: 0; color: var(--spdf-text); }
.spdf-howto-note .spdf-howto-p { font-size: 15px; margin-top: 8px; }

/* Good to know */
.spdf-howto-facts { margin: 24px 0 0; padding: 0; list-style: none; }
.spdf-howto-facts li {
  position: relative; padding: 12px 0 12px 26px; border-bottom: 1px solid var(--spdf-line);
  font-size: 16px; line-height: 1.6; color: var(--spdf-text-dim);
}
.spdf-howto-facts li::before { content: "◆"; position: absolute; left: 0; top: 13px; font-size: 11px; color: var(--spdf-accent); }
.spdf-howto-src { font-family: var(--spdf-font-mono); font-size: 11.5px; letter-spacing: 0.04em; white-space: nowrap; }

/* Tables (comparison pages): scroll sideways inside their frame on narrow screens, never the page. */
.spdf-howto-table-wrap {
  margin-top: 24px; overflow-x: auto; border: 1px solid var(--spdf-line); border-radius: 12px; background: var(--spdf-panel);
}
.spdf-howto-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; color: var(--spdf-text-dim); }
.spdf-howto-table th {
  text-align: left; vertical-align: bottom; padding: 12px 16px; border-bottom: 1px solid var(--spdf-line-strong);
  font-family: var(--spdf-font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--spdf-text-mute); background: var(--spdf-surface);
}
.spdf-howto-table td { padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--spdf-line); min-width: 160px; }
.spdf-howto-table tr:last-child td { border-bottom: 0; }
.spdf-howto-table td:first-child { color: var(--spdf-text); }
.spdf-howto-table code { overflow-wrap: break-word; }

/* ── Further reading ──────────────────────────────────────────────────── */
.spdf-howto-more { border-top: 1px solid var(--spdf-line); padding: 64px 0; }
.spdf-howto-more-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.spdf-howto-more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px 56px; margin-top: 8px; }
.spdf-howto-links { list-style: none; margin: 16px 0 0; padding: 0; }
.spdf-howto-links a {
  display: flex; justify-content: space-between; gap: 16px; padding: 12px 0;
  border-bottom: 1px solid var(--spdf-line); color: var(--spdf-text); text-decoration: none; font-size: 15.5px;
}
.spdf-howto-links a:hover { color: var(--spdf-accent); }

/* ── Index ────────────────────────────────────────────────────────────── */
.spdf-howto-index { max-width: 1280px; margin: 0 auto; padding: 0 32px 72px; }
.spdf-howto-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; margin-top: 20px; }
.spdf-howto-card {
  display: flex; flex-direction: column; gap: 10px; padding: 24px 26px; border-radius: 14px;
  border: 1px solid var(--spdf-line); background: var(--spdf-panel); color: var(--spdf-text); text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.spdf-howto-card:hover { border-color: var(--spdf-accent); transform: translateY(-2px); }
.spdf-howto-card-title { font-family: var(--spdf-font-body); font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0; }
.spdf-howto-card-desc { font-size: 15px; line-height: 1.55; color: var(--spdf-text-dim); margin: 0; flex: 1; }
.spdf-howto-card-meta { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--spdf-font-mono); font-size: 12px; color: var(--spdf-text-mute); }
.spdf-howto-index-note { margin-top: 48px; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .spdf-howto-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .spdf-howto-toc { display: none; }
  .spdf-howto-main { max-width: none; }
}
@media (max-width: 980px) {
  .spdf-howto-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 640px) {
  .spdf-howto-hero { padding: 28px 0 40px; }
  .spdf-howto-hero-inner, .spdf-howto-body, .spdf-howto-more-inner, .spdf-howto-index { padding-left: 18px; padding-right: 18px; }
  .spdf-howto-step { padding-left: 0; }
  .spdf-howto-step::before { display: none; }
  .spdf-howto-n { position: static; flex-shrink: 0; margin-right: 12px; }
  .spdf-howto-notes, .spdf-howto-cards, .spdf-howto-more-grid { grid-template-columns: minmax(0, 1fr); }
  .spdf-howto-lede { font-size: 16.5px; }
  /* tables keep readable columns and scroll inside their frame */
  .spdf-howto-table { min-width: 620px; }
}
