/* ==========================================================================
   ANALYSIS SINGLE PAGE — v3 architecture
   Prefix: rv-ans-

   Module-based, article-first composition:
   - Full-bleed dark hero with featured image
   - Drop-cap lede with italic standfirst
   - Single-column body (NO sidebar) with module shortcodes for visual breaths:
     [rv_ans_stat]      — big number callout
     [rv_ans_quote]     — pull quote with attribution
     [rv_ans_table]     — comparison table
     [rv_ans_chart_*]   — SVG charts (scatter, slope)
     [rv_ans_h2]        — H2 with gold kicker
     [rv_ans_closing]   — closing italic standfirst
   - Meta footer with correction link
   - Related posts grid

   All colors via --rv-* tokens for dark-mode compatibility.
   ========================================================================== */

/* ===================================================
   ROOT WRAPPER + RESET — kill sticky-sidebar + cream-hero
   from the older two-column layout. The new template
   uses .rv-ans-single as a flat container.
   =================================================== */

.rv-ans-single { font-family: 'Literata', Georgia, serif; color: var(--rv-text-primary); }
.rv-ans-single * { box-sizing: border-box; }

/* Kill margin injected by wp-site-blocks */
:where(.wp-site-blocks) > .rv-analysis-single,
.rv-analysis-single,
.rv-analysis-single > * {
    margin-block-start: 0 !important;
    margin-top: 0 !important;
}
.rv-analysis-single { padding-top: 0 !important; }

/* Stray empty paragraphs from wpautop never get rendered as gaps */
.rv-ans-single > p:empty,
.rv-ans-single .rv-ans-prose > p:empty,
.rv-ans-single .rv-ans-lede__inner > p:empty { display: none; }

/* Full-bleed helper — for hero, comparison spreads, etc. */
.rv-ans-single .rv-ans-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* ===================================================
   HERO — full-bleed dark navy with image overlay
   =================================================== */

.rv-ans-single .rv-ans-hero {
    position: relative;
    background: var(--rv-brand-fill-dark, #0f172a);
    color: #fff;
    padding: 5rem 1.5rem 4rem;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
}
.rv-ans-single .rv-ans-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 35%;
    opacity: 0.32;
    filter: saturate(0.85) contrast(1.05);
}
.rv-ans-single .rv-ans-hero__veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.93) 90%, var(--rv-brand-fill-dark, #0f172a) 100%);
}
.rv-ans-single .rv-ans-hero__inner {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
}
.rv-ans-single .rv-ans-hero__crumbs {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 2.5rem;
}
.rv-ans-single .rv-ans-hero__crumbs a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
}
.rv-ans-single .rv-ans-hero__crumbs a:hover { color: #fff; text-decoration: underline; }
.rv-ans-single .rv-ans-hero__crumbs span { margin: 0 0.6rem; opacity: 0.5; }

.rv-ans-single .rv-ans-hero__kicker {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rv-gold);
    margin: 0 0 1.25rem;
}

.rv-ans-single .rv-ans-hero__title {
    font-family: 'Literata', Georgia, serif;
    font-weight: 500;
    font-size: clamp(2.1rem, 5.2vw, 3.75rem);
    line-height: 1.08;
    letter-spacing: -0.022em;
    margin: 0 0 1.5rem;
    max-width: 22ch;
    color: #fff;
}

.rv-ans-single .rv-ans-hero__dek {
    font-family: 'Literata', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.05rem, 1.7vw, 1.3rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    max-width: 60ch;
    margin: 0 0 2rem;
}

.rv-ans-single .rv-ans-hero__meta {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.rv-ans-single .rv-ans-hero__meta-sep { opacity: 0.4; }

/* No-image hero variant — brand-fill solid with subtle gradient */
.rv-ans-single .rv-ans-hero--no-image .rv-ans-hero__bg { display: none; }
.rv-ans-single .rv-ans-hero--no-image .rv-ans-hero__veil {
    background: linear-gradient(135deg, var(--rv-brand-fill) 0%, var(--rv-brand-fill-dark) 100%);
}

/* ===================================================
   LEDE — drop-cap opening narrative, narrow column
   =================================================== */

.rv-ans-single .rv-ans-lede { padding: 4rem 1.5rem 1rem; }
.rv-ans-single .rv-ans-lede__inner {
    max-width: 680px;
    margin: 0 auto;
}
.rv-ans-single .rv-ans-lede__standfirst {
    font-family: 'Literata', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.3rem, 2vw, 1.625rem);
    line-height: 1.5;
    color: var(--rv-text-secondary);
    margin: 0 0 3rem;
    letter-spacing: -0.005em;
}
.rv-ans-single .rv-ans-lede__standfirst::before {
    content: "";
    display: block;
    width: 48px;
    height: 2px;
    background: var(--rv-gold);
    margin-bottom: 1.5rem;
}
.rv-ans-single .rv-ans-lede__inner > p:not(.rv-ans-lede__standfirst) {
    margin: 0 0 1.5rem;
    font-size: var(--rv-text-base);
    line-height: 1.78;
    color: var(--rv-text-primary);
}

/* Drop cap on first body paragraph (after the standfirst).
   `:not(.standfirst):first-of-type` doesn't work because the
   standfirst is also a <p>, so the first NON-standfirst is the
   element AFTER it. Use sibling selector. */
.rv-ans-single .rv-ans-lede__standfirst + p::first-letter {
    font-family: 'Literata', Georgia, serif;
    float: left;
    font-size: 4.6rem;
    line-height: 0.85;
    padding: 0.35rem 0.7rem 0 0;
    color: var(--rv-gold);
    font-weight: 500;
    font-style: normal;
}
/* If no standfirst, drop-cap the first paragraph */
.rv-ans-single .rv-ans-lede__inner > p:first-child:not(.rv-ans-lede__standfirst)::first-letter {
    font-family: 'Literata', Georgia, serif;
    float: left;
    font-size: 4.6rem;
    line-height: 0.85;
    padding: 0.35rem 0.7rem 0 0;
    color: var(--rv-gold);
    font-weight: 500;
    font-style: normal;
}

/* Legacy posts: drop-cap the first paragraph of the first prose section.
   The PHP wrapper adds .rv-ans-prose--first to the first body chunk that
   appears after the first H2. */
.rv-ans-single .rv-ans-prose--first > p:first-child::first-letter {
    font-family: 'Literata', Georgia, serif;
    float: left;
    font-size: 4.6rem;
    line-height: 0.85;
    padding: 0.35rem 0.7rem 0 0;
    color: var(--rv-gold);
    font-weight: 500;
    font-style: normal;
}

/* Module-driven posts where the lede block has no body paragraph after the
   standfirst: drop-cap the FIRST paragraph inside .rv-ans-modules so the
   page still has the editorial opener treatment. */
.rv-ans-single .rv-ans-modules > p:first-of-type::first-letter,
.rv-ans-single .rv-ans-modules > section:first-of-type + p::first-letter {
    font-family: 'Literata', Georgia, serif;
    float: left;
    font-size: 4.6rem;
    line-height: 0.85;
    padding: 0.35rem 0.7rem 0 0;
    color: var(--rv-gold);
    font-weight: 500;
    font-style: normal;
}

/* ===================================================
   PROSE BLOCKS — narrow centered column for body text
   =================================================== */

.rv-ans-single .rv-ans-prose,
.rv-ans-single .rv-ans-modules > p,
.rv-ans-single .rv-ans-modules > ul,
.rv-ans-single .rv-ans-modules > ol,
.rv-ans-single .rv-ans-modules > h3,
.rv-ans-single .rv-ans-modules > blockquote:not(.rv-ans-quote) {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.rv-ans-single .rv-ans-prose > p,
.rv-ans-single .rv-ans-modules > p {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: var(--rv-text-base);
    line-height: 1.78;
    color: var(--rv-text-primary);
}
.rv-ans-single .rv-ans-modules > h3 {
    font-family: 'Literata', Georgia, serif;
    font-weight: 600;
    font-size: var(--rv-text-xl);
    line-height: 1.3;
    color: var(--rv-text-primary);
    margin: 2.25rem auto 0.75rem;
}
.rv-ans-single .rv-ans-modules > ul,
.rv-ans-single .rv-ans-modules > ol {
    margin-top: 0;
    margin-bottom: 1.5rem;
}
.rv-ans-single .rv-ans-modules > ul li,
.rv-ans-single .rv-ans-modules > ol li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
    color: var(--rv-text-primary);
}
.rv-ans-single .rv-ans-modules > p strong,
.rv-ans-single .rv-ans-modules > p a,
.rv-ans-single .rv-ans-prose strong,
.rv-ans-single .rv-ans-prose a {
    /* Inherits from the dedicated rules below */
}
html[data-theme="dark"] .rv-ans-single .rv-ans-modules > p,
html[data-theme="dark"] .rv-ans-single .rv-ans-modules > h3,
html[data-theme="dark"] .rv-ans-single .rv-ans-modules > ul li,
html[data-theme="dark"] .rv-ans-single .rv-ans-modules > ol li { color: var(--rv-text-primary); }
.rv-ans-single .rv-ans-modules > p strong,
.rv-ans-single .rv-ans-modules > p a {
    /* same as .rv-ans-prose strong/a below — but inherited cleanly */
}
.rv-ans-single .rv-ans-prose strong { font-weight: 600; color: var(--rv-text-heading); }
.rv-ans-single .rv-ans-prose a {
    color: var(--rv-brand-primary);
    text-decoration: underline;
    text-decoration-color: rgba(30, 58, 95, 0.3);
    text-underline-offset: 2px;
}
.rv-ans-single .rv-ans-prose a:hover { text-decoration-color: var(--rv-brand-primary); }
.rv-ans-single .rv-ans-prose ul,
.rv-ans-single .rv-ans-prose ol { padding-left: 1.5rem; margin: 0 0 1.5rem; }
.rv-ans-single .rv-ans-prose li { margin-bottom: 0.5rem; line-height: 1.75; }

html[data-theme="dark"] .rv-ans-single .rv-ans-prose strong { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-prose a { color: #93c5fd; text-decoration-color: rgba(147, 197, 253, 0.4); }

/* ===================================================
   H2 SECTION HEADERS — gold kicker + scannable title
   =================================================== */

.rv-ans-single .rv-ans-section {
    padding: 2.5rem 1.5rem 1rem;
}
.rv-ans-single .rv-ans-section__inner {
    max-width: 680px;
    margin: 0 auto;
}
.rv-ans-single .rv-ans-h2 {
    font-family: 'Literata', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--rv-text-heading);
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--rv-cream-line);
}
.rv-ans-single .rv-ans-h2__kicker {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rv-gold-on-light);
    margin-bottom: 0.5rem;
}

html[data-theme="dark"] .rv-ans-single .rv-ans-h2 { color: var(--rv-text-primary); border-bottom-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-h2__kicker { color: var(--rv-gold); }

/* Fallback styles for bare h2/h3 inside content area (legacy posts) */
.rv-ans-single .rv-ans-prose h2,
.rv-ans-single .rv-ans-lede__inner h2 {
    font-family: 'Literata', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--rv-text-heading);
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--rv-cream-line);
}
.rv-ans-single .rv-ans-prose h3,
.rv-ans-single .rv-ans-lede__inner h3 {
    font-family: 'Literata', Georgia, serif;
    font-weight: 600;
    font-size: var(--rv-text-xl);
    line-height: 1.3;
    color: var(--rv-text-primary);
    margin: 2.25rem 0 0.75rem;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-prose h2 { color: var(--rv-text-primary); border-bottom-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-prose h3 { color: var(--rv-text-primary); }

/* ===================================================
   STAT CALLOUT — big number with caption, between rules
   =================================================== */

.rv-ans-single .rv-ans-stat {
    margin: 2.5rem auto 2.5rem;
    padding: 1.75rem 1.5rem;
    max-width: 680px;
    border-top: 1px solid var(--rv-line);
    border-bottom: 1px solid var(--rv-line);
    text-align: center;
}
.rv-ans-single .rv-ans-stat__label {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-md);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rv-ink-3);
    margin: 0 0 0.4rem;
    font-weight: 600;
}
.rv-ans-single .rv-ans-stat__value {
    font-family: 'Literata', Georgia, serif;
    font-weight: 500;
    font-size: clamp(3rem, 6vw, 4.5rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: var(--rv-text-heading);
    margin: 0 0 0.5rem;
}
.rv-ans-single .rv-ans-stat__value .rv-ans-stat__unit {
    font-size: 0.55em;
    color: var(--rv-gold-on-light);
    margin-left: 0.05em;
}
.rv-ans-single .rv-ans-stat__caption {
    font-family: 'Literata', Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--rv-ink-2);
    margin: 0 auto;
    max-width: 46ch;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-stat { border-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-stat__value { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-stat__value .rv-ans-stat__unit { color: var(--rv-gold); }
html[data-theme="dark"] .rv-ans-single .rv-ans-stat__caption { color: var(--rv-text-muted); }

/* ===================================================
   PULL QUOTE — inline, gold left rule, elegant
   =================================================== */

.rv-ans-single .rv-ans-quote {
    margin: 2.5rem auto;
    padding: 0 0 0 1.75rem;
    border-left: 3px solid var(--rv-gold);
    max-width: 560px;
}
.rv-ans-single .rv-ans-quote__text {
    font-family: 'Literata', Georgia, serif;
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.5;
    color: var(--rv-text-primary);
    margin: 0 0 0.6rem;
    font-weight: 400;
    letter-spacing: -0.008em;
}
.rv-ans-single .rv-ans-quote__attr {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rv-gold-on-light);
    margin: 0;
}
.rv-ans-single .rv-ans-quote__attr::before { content: "— "; opacity: 0.5; }
html[data-theme="dark"] .rv-ans-single .rv-ans-quote__text { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-quote__attr { color: var(--rv-gold); }

/* ===================================================
   CHART (scatter + slope) — text-bounded
   =================================================== */

.rv-ans-single .rv-ans-chart {
    margin: 3rem auto 3.5rem;
    max-width: 840px;
    padding: 0 1.5rem;
}
.rv-ans-single .rv-ans-chart__head { margin-bottom: 1.5rem; }
.rv-ans-single .rv-ans-chart__eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rv-gold-on-light);
    margin: 0 0 0.35rem;
}
.rv-ans-single .rv-ans-chart__title {
    font-family: 'Literata', Georgia, serif;
    font-size: var(--rv-text-xl);
    font-weight: 600;
    line-height: 1.25;
    color: var(--rv-text-heading);
    margin: 0 0 0.35rem;
    letter-spacing: -0.01em;
}
.rv-ans-single .rv-ans-chart__deck {
    font-family: 'Literata', Georgia, serif;
    font-size: 0.98rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--rv-ink-2);
    margin: 0;
    max-width: 60ch;
}
.rv-ans-single .rv-ans-chart__wrap {
    background: var(--rv-surface-primary);
    border: 1px solid var(--rv-line);
    border-radius: 8px;
    padding: 1.5rem 1rem 1rem;
}
.rv-ans-single .rv-ans-chart__svg {
    width: 100%;
    height: auto;
    display: block;
}
.rv-ans-single .rv-ans-chart__legend {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rv-line-soft);
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    color: var(--rv-ink-3);
}
.rv-ans-single .rv-ans-chart__legend-item { display: flex; align-items: center; gap: 0.4rem; }
.rv-ans-single .rv-ans-chart__legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.rv-ans-single .rv-ans-chart__caption {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-md);
    line-height: 1.55;
    color: var(--rv-ink-3);
    margin: 1rem 0 0;
    font-style: italic;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-chart__title { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-chart__deck { color: var(--rv-text-muted); }
html[data-theme="dark"] .rv-ans-single .rv-ans-chart__wrap { background: var(--rv-surface-secondary); border-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-chart__legend { border-color: var(--rv-border-primary); color: var(--rv-text-muted); }
html[data-theme="dark"] .rv-ans-single .rv-ans-chart__caption { color: var(--rv-text-muted); }

/* Slope chart variant — cream wrap */
.rv-ans-single .rv-ans-slope {
    margin: 3rem auto 3rem;
    max-width: 680px;
    padding: 0 1.5rem;
}
.rv-ans-single .rv-ans-slope__wrap {
    background: var(--rv-cream);
    border-radius: 10px;
    padding: 2rem 2rem 1.75rem;
}
.rv-ans-single .rv-ans-slope__eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rv-gold-on-light);
    margin: 0 0 0.5rem;
}
.rv-ans-single .rv-ans-slope__title {
    font-family: 'Literata', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--rv-text-heading);
    margin: 0 0 1.25rem;
}
.rv-ans-single .rv-ans-slope__svg { width: 100%; height: auto; display: block; }
.rv-ans-single .rv-ans-slope__caption {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-md);
    line-height: 1.55;
    color: var(--rv-ink-3);
    margin: 0.75rem 0 0;
    font-style: italic;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-slope__wrap { background: var(--rv-surface-secondary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-slope__title { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-slope__caption { color: var(--rv-text-muted); }

/* ===================================================
   COMPARISON TABLE — inline, modest
   =================================================== */

.rv-ans-single .rv-ans-table {
    margin: 2.5rem auto;
    max-width: 780px;
    padding: 0 1.5rem;
}
.rv-ans-single .rv-ans-table__head { margin-bottom: 1.25rem; }
.rv-ans-single .rv-ans-table__eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rv-gold-on-light);
    margin: 0 0 0.35rem;
}
.rv-ans-single .rv-ans-table__title {
    font-family: 'Literata', Georgia, serif;
    font-size: var(--rv-text-xl);
    font-weight: 600;
    line-height: 1.25;
    color: var(--rv-text-heading);
    margin: 0;
    letter-spacing: -0.01em;
}
.rv-ans-single .rv-ans-table__wrap {
    border: 1px solid var(--rv-line);
    border-radius: 8px;
    overflow: hidden;
}
.rv-ans-single table.rv-ans-table__el {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-md);
    margin: 0;
    background: var(--rv-surface-primary);
}
.rv-ans-single .rv-ans-table__el th {
    background: var(--rv-surface-tertiary);
    text-align: left;
    padding: 0.65rem 1.1rem;
    font-size: var(--rv-text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rv-ink-3);
    border-bottom: 1px solid var(--rv-line);
}
.rv-ans-single .rv-ans-table__el td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--rv-line-soft);
    vertical-align: middle;
    color: var(--rv-ink-2);
}
.rv-ans-single .rv-ans-table__el tr:last-child td { border-bottom: none; }
.rv-ans-single .rv-ans-table__el td.rv-ans-table__name {
    font-family: 'Literata', Georgia, serif;
    font-weight: 500;
    color: var(--rv-text-heading);
}
.rv-ans-single .rv-ans-table__el a { color: var(--rv-brand-primary); text-decoration: none; }
.rv-ans-single .rv-ans-table__el a:hover { text-decoration: underline; }

html[data-theme="dark"] .rv-ans-single .rv-ans-table__title { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-table__wrap { border-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single table.rv-ans-table__el { background: var(--rv-surface-secondary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-table__el th { background: var(--rv-surface-tertiary); border-color: var(--rv-border-primary); color: var(--rv-text-muted); }
html[data-theme="dark"] .rv-ans-single .rv-ans-table__el td { border-color: var(--rv-border-primary); color: var(--rv-text-secondary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-table__el td.rv-ans-table__name { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-table__el a { color: #93c5fd; }

/* Level pills inside tables */
.rv-ans-single .rv-ans-pill-l1,
.rv-ans-single .rv-ans-pill-l2,
.rv-ans-single .rv-ans-pill-l3,
.rv-ans-single .rv-ans-pill-l4,
.rv-ans-single .rv-ans-pill-l5 {
    display: inline-block;
    padding: 1px 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 3px;
}
.rv-ans-single .rv-ans-pill-l1 { background: #fee2e2; color: #991b1b; }
.rv-ans-single .rv-ans-pill-l2 { background: #fef3c7; color: #92400e; }
.rv-ans-single .rv-ans-pill-l3 { background: #dbeafe; color: #1e40af; }
.rv-ans-single .rv-ans-pill-l4 { background: #d1fae5; color: #065f46; }
.rv-ans-single .rv-ans-pill-l5 { background: #e0e7ff; color: #3730a3; }
html[data-theme="dark"] .rv-ans-single .rv-ans-pill-l1 { background: rgba(254, 226, 226, 0.18); color: #fca5a5; }
html[data-theme="dark"] .rv-ans-single .rv-ans-pill-l2 { background: rgba(254, 243, 199, 0.18); color: #fbbf24; }
html[data-theme="dark"] .rv-ans-single .rv-ans-pill-l3 { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
html[data-theme="dark"] .rv-ans-single .rv-ans-pill-l4 { background: rgba(34, 197, 94, 0.18); color: #6ee7b7; }
html[data-theme="dark"] .rv-ans-single .rv-ans-pill-l5 { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }

/* ===================================================
   INLINE ROBOT CARD — small product card embedded in body
   =================================================== */

.rv-ans-single .rv-ans-robot-card {
    margin: 2.25rem auto;
    max-width: 580px;
    padding: 0 1.5rem;
}
.rv-ans-single .rv-ans-robot-card__link {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.25rem;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    background: var(--rv-cream);
    border: 1px solid var(--rv-cream-line);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.rv-ans-single .rv-ans-robot-card__link:hover {
    border-color: var(--rv-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(184, 135, 58, 0.1);
}
.rv-ans-single .rv-ans-robot-card__img {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    /* Container stays transparent — multiply on the <img> drops out the
       white background of product photos so they blend seamlessly into
       the surrounding cream card. Site-wide pattern. */
}
.rv-ans-single .rv-ans-robot-card__img img {
    max-width: 100%;
    max-height: 130px;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-robot-card__img img {
    mix-blend-mode: normal;
}
.rv-ans-single .rv-ans-robot-card__img--placeholder {
    background: linear-gradient(135deg, var(--rv-cream), var(--rv-cream-line));
}
.rv-ans-single .rv-ans-robot-card__body {
    padding: 1rem 1.25rem 1rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.rv-ans-single .rv-ans-robot-card__mfr {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rv-ink-3);
    margin: 0 0 0.3rem;
}
.rv-ans-single .rv-ans-robot-card__name {
    font-family: 'Literata', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--rv-text-heading);
    margin: 0 0 0.5rem;
}
.rv-ans-single .rv-ans-robot-card__meta {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    margin-bottom: 0.4rem;
}
.rv-ans-single .rv-ans-robot-card__price {
    font-family: 'Literata', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--rv-text-heading);
}
.rv-ans-single .rv-ans-robot-card__note {
    font-size: var(--rv-text-md);
    line-height: 1.45;
    color: var(--rv-ink-2);
    margin: 0.3rem 0 0.6rem;
}
.rv-ans-single .rv-ans-robot-card__cta {
    margin-top: auto;
    padding-top: 0.4rem;
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--rv-brand-primary);
    text-transform: uppercase;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-robot-card__link {
    background: var(--rv-surface-secondary);
    border-color: var(--rv-border-primary);
}
html[data-theme="dark"] .rv-ans-single .rv-ans-robot-card__name { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-robot-card__price { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-robot-card__cta { color: #93c5fd; }
@media (max-width: 580px) {
    .rv-ans-single .rv-ans-robot-card__link { grid-template-columns: 1fr; }
    .rv-ans-single .rv-ans-robot-card__img { min-height: 180px; }
    .rv-ans-single .rv-ans-robot-card__body { padding: 0 1.25rem 1.25rem; }
}

/* ===================================================
   DEFINITION BOX — inline term + definition
   =================================================== */

.rv-ans-single .rv-ans-defbox {
    margin: 2rem auto;
    max-width: 680px;
    padding: 1.1rem 1.4rem;
    border: 1px solid var(--rv-line);
    border-left: 3px solid var(--rv-brand-primary);
    border-radius: 0 8px 8px 0;
    background: var(--rv-surface-tertiary);
}
.rv-ans-single .rv-ans-defbox__label {
    font-family: 'Inter', sans-serif;
    font-size: 0.625rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rv-ink-3);
    font-weight: 700;
    margin: 0 0 0.4rem;
}
.rv-ans-single .rv-ans-defbox__term {
    font-family: 'Literata', Georgia, serif;
    font-style: italic;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--rv-brand-primary);
    margin-right: 0.5rem;
}
.rv-ans-single .rv-ans-defbox__def {
    font-size: var(--rv-text-base);
    color: var(--rv-ink-2);
    line-height: 1.55;
    display: inline;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-defbox {
    background: var(--rv-surface-secondary);
    border-color: var(--rv-border-primary);
    border-left-color: var(--rv-gold);
}
html[data-theme="dark"] .rv-ans-single .rv-ans-defbox__term { color: var(--rv-gold); }
html[data-theme="dark"] .rv-ans-single .rv-ans-defbox__def { color: var(--rv-text-secondary); }

/* ===================================================
   DIAGRAM — hand-built SVG illustration for a technical concept
   =================================================== */

.rv-ans-single .rv-ans-diagram {
    margin: 2.5rem auto;
    max-width: 760px;
    padding: 0 1.5rem;
}
.rv-ans-single .rv-ans-diagram__head { margin-bottom: 1rem; }
.rv-ans-single .rv-ans-diagram__eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rv-gold-on-light);
    margin: 0 0 0.35rem;
}
.rv-ans-single .rv-ans-diagram__title {
    font-family: 'Literata', Georgia, serif;
    font-size: var(--rv-text-xl);
    font-weight: 600;
    line-height: 1.25;
    color: var(--rv-text-heading);
    margin: 0;
    letter-spacing: -0.01em;
}
.rv-ans-single .rv-ans-diagram__svg-wrap {
    background: var(--rv-surface-primary);
    border: 1px solid var(--rv-line);
    border-radius: 10px;
    padding: 1.25rem;
}
.rv-ans-single .rv-ans-diagram__svg {
    width: 100%;
    height: auto;
    max-height: 360px;
    display: block;
}
.rv-ans-single .rv-ans-diagram__caption {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-md);
    line-height: 1.55;
    color: var(--rv-ink-3);
    margin: 0.75rem 0 0;
    font-style: italic;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-diagram__title { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-diagram__svg-wrap { background: var(--rv-surface-secondary); border-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-diagram__caption { color: var(--rv-text-muted); }
/* Dark-mode SVG colors: most SVG fills are hard-coded for legibility; dark mode dims via wrap */
html[data-theme="dark"] .rv-ans-single .rv-ans-diagram__svg { filter: brightness(0.95) contrast(1.05); }

/* ===================================================
   FIGURE — full-width image with caption
   =================================================== */

.rv-ans-single .rv-ans-figure {
    margin: 2.5rem auto;
    max-width: 840px;
    padding: 0 1.5rem;
}
.rv-ans-single .rv-ans-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid var(--rv-line);
}
.rv-ans-single .rv-ans-figure figcaption {
    margin-top: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-md);
    line-height: 1.55;
    color: var(--rv-ink-3);
    text-align: left;
}
.rv-ans-single .rv-ans-figure__caption { font-style: italic; }
.rv-ans-single .rv-ans-figure__credit {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--rv-text-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rv-ink-3);
    opacity: 0.7;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-figure img { border-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-figure figcaption { color: var(--rv-text-muted); }

/* ===================================================
   CLOSING STANDFIRST — italic centered close
   =================================================== */

.rv-ans-single .rv-ans-closing { padding: 3.5rem 1.5rem 1rem; }
.rv-ans-single .rv-ans-closing__inner { max-width: 680px; margin: 0 auto; }
.rv-ans-single .rv-ans-closing__ornament {
    width: 64px;
    height: 1px;
    background: var(--rv-gold);
    margin: 0 auto 2rem;
}
.rv-ans-single .rv-ans-closing__text {
    font-family: 'Literata', Georgia, serif;
    font-size: clamp(1.2rem, 1.9vw, 1.5rem);
    line-height: 1.5;
    color: var(--rv-text-primary);
    margin: 0 auto;
    text-align: center;
    max-width: 46ch;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.005em;
}
.rv-ans-single .rv-ans-closing__text strong {
    color: var(--rv-text-heading);
    font-style: normal;
    font-weight: 600;
}
html[data-theme="dark"] .rv-ans-single .rv-ans-closing__text strong { color: #fff; }

/* ===================================================
   META FOOTER — quiet meta + correction link
   =================================================== */

.rv-ans-single .rv-ans-foot { padding: 3.5rem 1.5rem 2rem; }
.rv-ans-single .rv-ans-foot__inner {
    max-width: 680px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--rv-line);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-md);
    color: var(--rv-ink-3);
    letter-spacing: 0.03em;
}
.rv-ans-single .rv-ans-foot__correction {
    color: var(--rv-brand-primary);
    font-weight: 600;
    text-decoration: none;
}
.rv-ans-single .rv-ans-foot__correction::after { content: " \2192"; }
.rv-ans-single .rv-ans-foot__correction:hover { text-decoration: underline; }
html[data-theme="dark"] .rv-ans-single .rv-ans-foot__inner { border-color: var(--rv-border-primary); color: var(--rv-text-muted); }
html[data-theme="dark"] .rv-ans-single .rv-ans-foot__correction { color: #93c5fd; }

/* ===================================================
   RELATED ANALYSIS — card grid below the article
   =================================================== */

.rv-ans-single .rv-ans-related {
    padding: 4rem 1.5rem;
    margin-top: 2rem;
    background: var(--rv-surface-secondary);
    border-top: 1px solid var(--rv-line);
}
.rv-ans-single .rv-ans-related__inner {
    max-width: 1200px;
    margin: 0 auto;
}
.rv-ans-single .rv-ans-related__eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: var(--rv-text-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rv-gold-on-light);
    font-weight: 600;
    margin: 0 0 0.25rem;
}
.rv-ans-single .rv-ans-related__title {
    font-family: 'Literata', Georgia, serif;
    font-weight: 500;
    font-size: var(--rv-text-xl);
    color: var(--rv-text-heading);
    margin: 0 0 1.5rem;
}
.rv-ans-single .rv-ans-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.rv-ans-single .rv-ans-related__card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--rv-line);
    border-top: 3px solid var(--rv-gold);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: var(--rv-surface-primary);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.rv-ans-single .rv-ans-related__card:hover {
    border-color: var(--rv-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(184, 135, 58, 0.08);
}
.rv-ans-single .rv-ans-related__cover {
    height: 140px;
    background: linear-gradient(135deg, var(--rv-cream), var(--rv-cream-line));
    overflow: hidden;
}
.rv-ans-single .rv-ans-related__img { width: 100%; height: 100%; object-fit: cover; }
.rv-ans-single .rv-ans-related__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Literata', Georgia, serif;
    font-size: var(--rv-text-xl);
    color: var(--rv-cream-line);
    opacity: 0.6;
}
.rv-ans-single .rv-ans-related__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.rv-ans-single .rv-ans-related__meta {
    display: flex;
    gap: 0.625rem;
    margin: 0 0 0.5rem;
    font-size: var(--rv-text-xs);
}
.rv-ans-single .rv-ans-related__cat {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rv-gold-on-light);
}
.rv-ans-single .rv-ans-related__date { color: var(--rv-ink-3); }
.rv-ans-single .rv-ans-related__card-title {
    font-family: 'Literata', Georgia, serif;
    font-weight: 500;
    font-size: var(--rv-text-base);
    line-height: 1.3;
    color: var(--rv-text-primary);
    margin: 0 0 0.375rem;
}
.rv-ans-single .rv-ans-related__excerpt {
    font-size: var(--rv-text-xs);
    color: var(--rv-ink-3);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}
.rv-ans-single .rv-ans-related__read {
    font-family: 'Literata', Georgia, serif;
    font-size: var(--rv-text-xs);
    color: var(--rv-ink-3);
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rv-line-soft);
}

html[data-theme="dark"] .rv-ans-single .rv-ans-related { background: var(--rv-surface-secondary); border-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-related__title { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-related__card { background: var(--rv-surface-primary); border-color: var(--rv-border-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-related__cover { background: linear-gradient(135deg, var(--rv-surface-tertiary), var(--rv-surface-secondary)); }
html[data-theme="dark"] .rv-ans-single .rv-ans-related__card-title { color: var(--rv-text-primary); }
html[data-theme="dark"] .rv-ans-single .rv-ans-related__excerpt { color: var(--rv-text-muted); }
html[data-theme="dark"] .rv-ans-single .rv-ans-related__read { color: var(--rv-text-muted); border-color: var(--rv-border-primary); }

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 880px) {
    .rv-ans-single .rv-ans-hero { padding: 4rem 1.25rem 3rem; min-height: auto; }
    .rv-ans-single .rv-ans-related__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .rv-ans-single .rv-ans-hero { padding: 3rem 1.25rem 2.5rem; }
    .rv-ans-single .rv-ans-lede,
    .rv-ans-single .rv-ans-prose,
    .rv-ans-single .rv-ans-section,
    .rv-ans-single .rv-ans-chart,
    .rv-ans-single .rv-ans-table,
    .rv-ans-single .rv-ans-slope,
    .rv-ans-single .rv-ans-stat,
    .rv-ans-single .rv-ans-closing,
    .rv-ans-single .rv-ans-foot { padding-left: 1.25rem; padding-right: 1.25rem; }
    .rv-ans-single .rv-ans-stat__value { font-size: 2.75rem; }
    .rv-ans-single .rv-ans-related { padding: 3rem 1.25rem; }
    .rv-ans-single .rv-ans-related__grid { grid-template-columns: 1fr; }
    .rv-ans-single .rv-ans-table { padding: 0 0.75rem; }
    .rv-ans-single .rv-ans-table__wrap { overflow-x: auto; }
    .rv-ans-single table.rv-ans-table__el { min-width: 520px; }
}
