/* KorvAI content pages (blog, help, compare)
 * Loaded after main.css on every content page; reuses main.css tokens (--bg, --text, --muted, --surface,
 * --line, --accent-text, --accent-display, --r-card, --r-inner, --section, --ease, --font-display/text/mono).
 *
 * Article components (article pages: blog posts, help articles, compare posts):
 *   .content            main wrapper, sets top padding to clear the fixed nav
 *   .breadcrumb          breadcrumb nav list, "/" separators
 *   .article-head         title block: eyebrow, h1, .article-meta
 *   .article-meta         date + reading time line under the h1
 *   .short-answer         the "Short answer" callout box answering the title question
 *   .toc                  table of contents card; sticky on wide screens inside .content-grid
 *   .content-grid          two-column grid: article body + sticky .toc
 *   .article-body          prose column: headings, paragraphs, lists, tables, callouts
 *   .callout               generic tinted note/box inside prose (also used by .short-answer)
 *   .steps-list            ordered numbered step list (HowTo content)
 *   .takeaways             "Key takeaways" bullet list with check icons
 *   .cta-card              in-article call-to-action card with two buttons
 *   .faq-list              visible FAQ using <details>/<summary>
 *   .related                "Related" links block at the end of an article
 *   .related-grid           grid of .related-link cards inside .related
 *
 * Hub-page components (future blog/help/compare index pages):
 *   .hub-hero              hub page intro header
 *   .card-grid              responsive card grid
 *   .post-card              one card: title, one-line summary, meta row
 *   .compare-table          styled comparison table wrapper
 *
 * Figures and interactive components (blog.js):
 *   .figure                 image figure with rounded corners, border, caption; [data-zoom] opens lightbox
 *   .figure--tall            portrait panel crop, max-height ~560px, centered
 *   .figure--diagram         inline SVG diagram figure, no border/shadow
 *   .compare-slider          before/after image compare with injected range input + handle
 *   .tab-figure              tabbed figure (e.g. caption presets)
 *   video.loop               plays only while in view, respects reduced motion
 *   .look-grid / .look-card  grid of look thumbnails
 *   .reading-progress        slim fixed progress bar at top of article pages
 *   .heading-anchor          small "#" link injected after .article-body h2[id]
 *   .lightbox                dialog used by [data-zoom] figures
 */

/* ---------- Content shell ---------- */
.content { padding-top: 150px; padding-bottom: var(--section); }
.content-container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 28px; }
.breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.25s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span[aria-current] { color: var(--text); }
.breadcrumb .sep { opacity: 0.5; }

/* ---------- Article head ---------- */
.article-head { max-width: 80ch; }
.article-head h1 { margin-top: 10px; font-family: var(--font-display); font-size: clamp(38px, 5.2vw, 60px); line-height: 0.98; padding-bottom: 0.08em; }
.article-meta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.article-meta .dot { opacity: 0.5; }

/* ---------- Short answer ---------- */
.callout {
  margin-top: 28px; padding: 22px 24px; border-radius: var(--r-inner);
  background: var(--surface); border: 1px solid var(--line);
}
.callout p { margin-top: 0; }
.callout p + p { margin-top: 10px; }
.short-answer { border-left: 3px solid var(--accent); }
.short-answer .label {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text);
}
.short-answer p { color: var(--text); font-size: 16.5px; line-height: 1.6; }

/* ---------- Content grid + TOC ---------- */
.content-grid { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(32px, 5vw, 64px); align-items: start; }
.content-grid .article-body { order: 1; }
.content-grid .toc { order: 2; }
.toc {
  padding: 20px 22px; border-radius: var(--r-inner); background: var(--surface); border: 1px solid var(--line);
}
.toc h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc ol { display: flex; flex-direction: column; gap: 9px; counter-reset: toc; }
.toc li { counter-increment: toc; font-size: 14px; line-height: 1.4; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent-text); }
.toc li::before { content: counter(toc) ". "; color: var(--muted); font-family: var(--font-mono); font-size: 12.5px; }
@media (min-width: 901px) {
  .toc { position: sticky; top: 96px; }
}

/* ---------- Article body (prose) ---------- */
.article-body { max-width: none; }
.article-body > * + * { margin-top: 20px; }
.article-body h2 {
  margin-top: 52px; scroll-margin-top: 100px;
  font-family: var(--font-display); font-size: clamp(26px, 3vw, 34px); line-height: 1.05; padding-bottom: 0.06em;
}
.article-body h3 { margin-top: 32px; scroll-margin-top: 100px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.article-body p { color: var(--muted); font-size: 16px; line-height: 1.7; }
.article-body p strong, .article-body li strong { color: var(--text); font-weight: 600; }
.article-body a:not(.btn):not(.related-link) { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.article-body a.btn, .article-body a.related-link { text-decoration: none; }
.article-body ul, .article-body ol:not(.steps-list) { color: var(--muted); font-size: 16px; line-height: 1.7; padding-left: 22px; }
.article-body ul { list-style: disc; }
.article-body ol:not(.steps-list) { list-style: decimal; }
.article-body li + li { margin-top: 8px; }
.article-body figure { margin: 0; }
.article-body img { border-radius: var(--r-inner); border: 1px solid var(--line); }
.article-body figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.article-body code { font-size: 0.9em; padding: 0.15em 0.4em; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }

/* ---------- Tables ---------- */
.article-body table, .compare-table table {
  width: 100%; border-collapse: collapse; font-size: 14.5px;
  border-radius: var(--r-inner); overflow: hidden; border: 1px solid var(--line);
}
.article-body th, .article-body td, .compare-table th, .compare-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top;
}
.article-body thead th, .compare-table thead th {
  background: var(--surface-2); font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.article-body tbody tr:last-child td, .compare-table tbody tr:last-child td { border-bottom: 0; }
.article-body td, .compare-table td { color: var(--muted); }
.compare-table { margin-top: 20px; overflow-x: auto; }
.compare-table table { min-width: 560px; }

/* ---------- Numbered steps ---------- */
.steps-list { display: flex; flex-direction: column; gap: 18px; counter-reset: step; padding-left: 0; list-style: none; }
.steps-list > li {
  position: relative; padding: 20px 22px 20px 64px; border-radius: var(--r-inner);
  background: var(--surface); border: 1px solid var(--line);
}
.steps-list > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 20px; top: 20px;
  width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-family: var(--font-mono); font-size: 13px; font-weight: 700;
}
.steps-list h3 { margin: 0 0 6px; font-size: 16.5px; }
.steps-list p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ---------- Key takeaways ---------- */
.takeaways, .article-body .takeaways {
  padding: 22px 24px; border-radius: var(--r-inner); background: var(--surface); border: 1px solid var(--line);
  list-style: none; display: flex; flex-direction: column; gap: 10px;
}
.takeaways li { position: relative; padding-left: 28px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.takeaways li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 999px;
  background: linear-gradient(currentColor, currentColor) center / 9px 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 9px no-repeat;
  color: var(--accent-text); transform: rotate(45deg); opacity: 0.9;
}
.takeaways li strong { color: var(--text); }

/* ---------- In-article CTA card ---------- */
.cta-card {
  margin-top: 20px; padding: 28px 30px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
}
.cta-card h3 { font-family: var(--font-display); font-size: clamp(24px, 2.8vw, 30px); line-height: 1; padding-bottom: 0.08em; }
.cta-card p { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 42ch; }
.cta-card .cta-row { margin-top: 0; }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-list details { border-radius: var(--r-inner); background: var(--surface); border: 1px solid var(--line); transition: border-color 0.3s; }
.faq-list details[open] { border-color: var(--line-2); }
.faq-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; font-weight: 600; font-size: 15.5px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; flex: none; width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--line-2);
  background: linear-gradient(currentColor, currentColor) center / 10px 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 10px no-repeat;
  transition: transform 0.4s var(--ease);
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list .a { padding: 0 20px 20px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.faq-list .a a { color: var(--accent-text); }
@supports (interpolate-size: allow-keywords) {
  .faq-list { interpolate-size: allow-keywords; }
  .faq-list details::details-content { height: 0; overflow: clip; transition: height 0.45s var(--ease), content-visibility 0.45s allow-discrete; }
  .faq-list details[open]::details-content { height: auto; }
}

/* ---------- Related links ---------- */
.related { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.related h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.related-link {
  display: block; padding: 18px 20px; border-radius: var(--r-inner); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; transition: border-color 0.25s, transform 0.25s var(--ease);
}
.related-link:hover { border-color: var(--line-2); transform: translateY(-2px); }
.related-link .kind { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.related-link .title { display: block; color: var(--text); font-weight: 600; font-size: 15px; line-height: 1.35; }

/* ---------- Hub hero ---------- */
.hub-hero { padding-top: clamp(28px, 4vw, 56px); padding-bottom: clamp(36px, 5vw, 72px); }
.hub-hero h1 { font-family: var(--font-display); font-size: clamp(42px, 6vw, 72px); line-height: 0.95; padding-bottom: 0.08em; }
.hub-hero p { margin-top: 18px; color: var(--muted); font-size: clamp(16px, 1.3vw, 18px); max-width: 56ch; }

/* ---------- Card grid (hub pages) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-bottom: var(--section); }
.post-card {
  display: flex; flex-direction: column; padding: 24px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.post-card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.post-card .title { color: var(--text); font-weight: 600; font-size: 18px; line-height: 1.3; }
.post-card .summary { margin-top: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.6; flex: 1; }
.post-card .meta { margin-top: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .related-grid { grid-template-columns: minmax(0, 1fr); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .content { padding-top: 120px; }
  .cta-card { flex-direction: column; align-items: flex-start; }
  .steps-list > li { padding-left: 56px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Hub cards with images ---------- */
.card-grid { align-items: stretch; }
.post-card { padding: 0; overflow: hidden; }
.post-card .thumb { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--section); border-bottom: 1px solid var(--line); }
.post-card .card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px; }
.post-card .category { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.post-card--lead { grid-column: span 3; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; }
.post-card--lead .thumb { height: 100%; aspect-ratio: auto; min-height: 240px; border-bottom: none; border-right: 1px solid var(--line); }
.post-card--lead .card-body { justify-content: center; padding: 32px 36px; }
.post-card--lead .title { font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.05; }
.post-card--lead .summary { font-size: 15.5px; }
@media (max-width: 900px) {
  .post-card--lead { grid-column: span 2; grid-template-columns: minmax(0, 1fr); }
  .post-card--lead .thumb { border-right: none; border-bottom: 1px solid var(--line); aspect-ratio: 1200 / 630; }
}
@media (max-width: 560px) {
  .post-card--lead { grid-column: span 1; }
}

/* ---------- Grouped hub (compare) ---------- */
.hub-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 clamp(36px, 4vw, 56px); }
.hub-jump a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text); font-size: 14px; text-decoration: none; transition: border-color 0.25s;
}
.hub-jump a:hover { border-color: var(--accent-text); }
.hub-group { margin-bottom: clamp(44px, 5vw, 72px); scroll-margin-top: 110px; }
.hub-group h2 { font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 42px); line-height: 1; padding-bottom: 0.08em; margin-bottom: 18px; }
.hub-group .card-grid { padding-bottom: 0; }
.card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .card-grid--4 { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  .related-link, .post-card { transition: none; }
  .faq-list summary::after { transition: none; }
}

/* ---------- Figures and interactive components ---------- */
.article-body .figure img,
.article-body .figure video { border: 0; border-radius: 0; }
.figure {
  margin: 0; border-radius: var(--r-inner); border: 1px solid var(--line); background: var(--surface);
  overflow: hidden; box-shadow: 0 24px 48px -36px var(--shadow);
}
.figure img, .figure video { display: block; width: 100%; height: auto; }
.figure figcaption {
  padding: 12px 16px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center;
}
@media (min-width: 700px) { .figure figcaption { font-size: 14px; } }
.figure[data-zoom] img { cursor: zoom-in; }
.figure--tall { max-width: 420px; margin-inline: auto; }
.figure--tall img, .figure--tall video { max-height: 560px; width: auto; max-width: 100%; margin-inline: auto; object-fit: contain; background: var(--surface-2); }
.figure--diagram { background: transparent; border: 0; box-shadow: none; }
.figure--diagram svg { display: block; width: 100%; height: auto; color: var(--text); }

/* ---------- Compare slider ---------- */
.compare-slider { position: relative; isolation: isolate; cursor: ew-resize; }
.compare-slider .cs-stage { position: relative; width: 100%; overflow: hidden; user-select: none; -webkit-user-select: none; }
.compare-slider img { display: block; width: 100%; height: auto; pointer-events: none; }
.compare-slider .cs-after { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: inset(0 0 0 50%); }
.compare-slider .cs-before { position: relative; }
.compare-slider .cs-label { position: absolute; top: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgba(8, 9, 10, 0.65); color: #edefe8; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; pointer-events: none; }
.compare-slider .cs-label-before { left: 12px; }
.compare-slider .cs-label-after { right: 12px; }
.compare-slider .cs-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 0; z-index: 3; pointer-events: none;
  transform: translateX(-50%);
}
.compare-slider .cs-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--accent-display); box-shadow: 0 0 10px var(--glow); transform: translateX(-50%); }
.compare-slider .cs-handle::after {
  content: ""; position: absolute; top: 50%; left: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-display); transform: translate(-50%, -50%);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
}
.compare-slider .cs-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; z-index: 4; cursor: ew-resize;
  opacity: 0; appearance: none; -webkit-appearance: none; background: transparent;
}
.compare-slider .cs-range:focus-visible ~ .cs-handle::after { outline: 2px solid var(--accent-display); outline-offset: 3px; }
.compare-slider .cs-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 38px; height: 38px; opacity: 0; }
.compare-slider .cs-range::-moz-range-thumb { width: 38px; height: 38px; opacity: 0; border: 0; }
.compare-slider figcaption { padding: 12px 16px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Tabbed figure ---------- */
.tab-figure { margin: 0; border-radius: var(--r-inner); border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: 0 24px 48px -36px var(--shadow); }
.tf-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tf-tabs [role="tab"] {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--muted);
  font-family: var(--font-text); font-size: 13.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  cursor: pointer; transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.tf-tabs [role="tab"]:hover { color: var(--text); }
.tf-tabs [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.tf-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent-display); outline-offset: 2px; }
.tf-panel { display: none; }
.tf-panel[data-active] { display: block; }
.tf-panel img, .tf-panel video { display: block; width: 100%; height: auto; }
.tab-figure figcaption { padding: 12px 16px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Looping clip ---------- */
video.loop { background: var(--surface-2); }

/* ---------- Look grid ---------- */
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.look-card { margin: 0; border-radius: var(--r-inner); border: 1px solid var(--line); background: var(--surface); overflow: hidden; text-align: center; }
.look-card img, .look-card video { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.look-card figcaption { padding: 10px 8px; font-size: 13px; color: var(--muted); }

/* ---------- Reading progress ---------- */
.reading-progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 90;
  background: transparent; pointer-events: none;
}
.reading-progress .rp-bar {
  height: 100%; width: 0%; background: var(--accent-display); box-shadow: 0 0 8px var(--glow);
  transform-origin: left; transition: width 0.12s linear;
}

/* ---------- Heading anchors ---------- */
.article-body h2 { position: relative; }
.heading-anchor {
  display: inline-block; margin-left: 8px; color: var(--accent-text); text-decoration: none;
  opacity: 0; font-size: 0.78em; vertical-align: middle;
  transition: opacity 0.2s var(--ease);
}
.article-body h2:hover .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }

/* ---------- Lightbox ---------- */
.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1400px, 94vw); max-height: 92vh; width: auto; overflow: visible; }
.lightbox::backdrop { background: rgba(8, 9, 10, 0.82); }
.lightbox-inner {
  position: relative; display: flex; flex-direction: column; gap: 0; border-radius: var(--r-inner);
  background: var(--surface); border: 1px solid var(--line-2); overflow: hidden;
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.6);
}
.lightbox img { display: block; max-width: min(1400px, 94vw); max-height: 80vh; width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { padding: 12px 18px; font-size: 13.5px; color: var(--muted); text-align: center; background: var(--surface); }
.lightbox-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2);
  background: rgba(8, 9, 10, 0.55); color: #edefe8; cursor: pointer; font-size: 18px; line-height: 1;
  transition: background 0.2s var(--ease);
}
.lightbox-close:hover { background: rgba(8, 9, 10, 0.78); }
.lightbox-close:focus-visible { outline: 2px solid var(--accent-display); outline-offset: 2px; }

@media (max-width: 560px) {
  .look-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .compare-slider .cs-handle::after { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .tf-tabs [role="tab"] { transition: none; }
  .heading-anchor { transition: none; }
  .reading-progress .rp-bar { transition: none; }
  .lightbox-close { transition: none; }
}
