/*
 * Topic hub v3: page-wide layer (spec docs/ux-discovery/topic/spec.md section 3).
 * Loaded after home-v3/base.css and skin.css (reused read-only). Tokens only; scoped to main.topic-v3.
 *   - 16px type floor (overrides the base.css fold lead clamp(15px..))
 *   - CMS reset (.tv3-cms): neutralises Word inline styles in stored HTML
 *   - flow sections (.tv3-flow), reading measure, shared footers and notes
 *   - fold reveal (html.tv3-js + .cp-armed only, so there is no hidden state without JS)
 */
.topic-v3 { --measure: 68ch; }

/* ---------- Type floor ---------- */
.topic-v3 .v3-lead { font-size: 18px; }
@media (min-width: 1024px) and (min-height: 620px) {
    .topic-v3 .v3-fold .v3-lead { font-size: clamp(16px, .62rem + .95vh, 18px); }
}
.topic-v3 .v3-small, .topic-v3 .v3-micro { font-size: 16px; }
.topic-v3 .v3-head { margin-bottom: 32px; }
.topic-v3 .v3-h2 { text-wrap: balance; }
.topic-v3 .tv3-h2-sm { font-size: clamp(1.375rem, 1rem + 1.2vw, 1.875rem); }

/* ---------- Flow sections: long content grows naturally ---------- */
.topic-v3 .v3-section.tv3-flow { padding: 64px 0; }
@media (min-width: 1024px) { .topic-v3 .v3-section.tv3-flow { padding: 112px 0 104px; } }
.topic-v3 .tv3-measure { max-width: var(--measure); }

/* ---------- CMS reset: stored HTML renders in the page type, never in its pasted inline styles ---------- */
.topic-v3 .tv3-cms, .topic-v3 .tv3-cms p, .topic-v3 .tv3-cms li { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.topic-v3 .tv3-cms [style], .topic-v3 .tv3-cms [style] * {
    font-size: inherit !important; color: inherit !important; font-family: inherit !important;
    line-height: inherit !important; background: none !important; text-align: left !important;
}
.topic-v3 .tv3-cms font { font: inherit; color: inherit; }
/* Headings keep the page heading sizes even when the CMS pasted an inline style on them */
.topic-v3 .tv3-cms h2[style], .topic-v3 .tv3-cms h2 [style] { font-size: clamp(1.625rem, 1.15rem + 1.6vw, 2.25rem) !important; line-height: 1.12 !important; }
.topic-v3 .tv3-cms h3[style], .topic-v3 .tv3-cms h3 [style] { font-size: clamp(1.25rem, 1rem + .6vw, 1.5rem) !important; line-height: 1.25 !important; }
.topic-v3 .tv3-cms > * + * { margin-top: 16px; }
.topic-v3 .tv3-cms p:empty { display: none; }
.topic-v3 .tv3-cms h2 { font-size: clamp(1.625rem, 1.15rem + 1.6vw, 2.25rem); line-height: 1.12; font-weight: 600; margin: 0 0 18px; color: var(--ink); }
.topic-v3 .tv3-cms h3 { font-size: clamp(1.25rem, 1rem + .6vw, 1.5rem); line-height: 1.25; font-weight: 600; margin: 28px 0 10px; color: var(--ink); }
.topic-v3 .tv3-cms h4 { font-size: 18px; line-height: 1.3; font-weight: 600; margin: 22px 0 8px; color: var(--ink); }
.topic-v3 .tv3-cms h2 + *, .topic-v3 .tv3-cms h3 + *, .topic-v3 .tv3-cms h4 + * { margin-top: 0; }
.topic-v3 .tv3-cms ul, .topic-v3 .tv3-cms ol { display: grid; gap: 8px; padding: 0; }
.topic-v3 .tv3-cms ul > li { position: relative; padding-left: 26px; }
.topic-v3 .tv3-cms ul > li::before { content: ''; position: absolute; left: 4px; top: .7em; width: 8px; height: 8px; border-radius: 999px; background: var(--brand); }
.topic-v3 .tv3-cms ol { counter-reset: tv3ol; }
.topic-v3 .tv3-cms ol > li { position: relative; padding-left: 30px; counter-increment: tv3ol; }
.topic-v3 .tv3-cms ol > li::before { content: counter(tv3ol) '.'; position: absolute; left: 0; font-weight: 600; color: var(--brand-deep); }
.topic-v3 .tv3-cms a { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.topic-v3 .tv3-cms img { max-width: 100%; height: auto; border-radius: 12px; }
.topic-v3 .tv3-cms strong, .topic-v3 .tv3-cms b { font-weight: 600; color: var(--ink); }
.topic-v3 .tv3-cms table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.topic-v3 .tv3-cms td, .topic-v3 .tv3-cms th { padding: 8px 10px; border: 1px solid var(--l200); text-align: left; }

/* ---------- Shared bits ---------- */
.topic-v3 .tv3-foot { display: flex; justify-content: center; margin-top: 32px; }
.topic-v3 .tv3-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; margin: 20px auto 0; max-width: 720px; font-size: 16px; color: var(--mute); text-align: center; }
.topic-v3 .tv3-note .v3-i { color: var(--brand-deep); }
@media (min-width: 1024px) and (min-height: 620px) {
    .topic-v3 .v3-fold .tv3-foot { margin-top: clamp(16px, 3vh, 32px); }
}
@media (max-width: 599px) {
    .topic-v3 .tv3-foot .v3-btn { width: 100%; }
}

/* ---------- motion.js .rv tags: the fold reveal below replaces them on this page ---------- */
html.hv-motion .topic-v3 .rv { opacity: 1; transform: none; transition: none; will-change: auto; }

/* ---------- Fold reveal (page.js): armed only below the first screen, only with JS ---------- */
html.tv3-js .topic-v3 .cp-armed:not(.cp-in) .tv3-rv { opacity: 0; transform: translate3d(0, 12px, 0); }
html.tv3-js .topic-v3 .cp-armed .tv3-rv { transition: opacity 400ms var(--ease), transform 400ms var(--ease); transition-delay: calc(var(--tv3-i, 0) * 60ms); }
html.tv3-js .topic-v3 .cp-done .tv3-rv { transition: none; }
@media (prefers-reduced-motion: reduce) {
    html.tv3-js .topic-v3 .cp-armed:not(.cp-in) .tv3-rv { opacity: 1; transform: none; }
}
@media print {
    html.tv3-js .topic-v3 .tv3-rv { opacity: 1 !important; transform: none !important; }
}

/* ---------- Section rhythm on desktop (QA fix 28 Nov 2026) ----------
   base.css makes every .v3-fold at least one screen tall and centres its content. Most hub sections are far shorter
   than a screen, so the page read as small islands of content between 200-450px empty bands. Here a section is as tall
   as its content plus a steady 96px/88px of padding; the hero still fills the first screen under the header. */
html:has(main.topic-v3) { scroll-snap-type: none !important; }
@media (min-width: 1024px) and (min-height: 620px) {
    .topic-v3 .v3-section.v3-fold:not(.tv3-hero) {
        min-height: 0; display: block; padding: 80px 0 72px; scroll-snap-align: none;
    }
    .topic-v3 .v3-fold:not(.tv3-hero) .v3-head { margin-bottom: 32px; }
}
