/*
 * Course page v2 (/courses/{topic}/{course}): shared rules and components for every fold.
 * Loaded after home-v3/base.css, home-v3/hero.css and home-v3/skin.css, before the per-fold sheets (course-v2/<fold>.css).
 * Tokens only (base.css / skin.css): no new hex values. Amber is ONLY the one primary "Enquire now" per fold.
 * Prefixes: shared .cv2-* (this file and the hero), .cl- learn, .ex- exam, .cf- formats, .nl- next-level, .fq- faq, .cfn- final.
 * Contract: docs/ux-discovery/course-page/build-contract.md
 */

/* ---------- Page tokens (aliases of base.css tokens) ---------- */
.home-v3.course-v2 {
    --cv2-gap-1: 8px; --cv2-gap-2: 16px; --cv2-gap-3: 20px; --cv2-gap-4: 24px; --cv2-gap-5: 28px; --cv2-gap-6: 32px; --cv2-gap-7: 40px; --cv2-gap-8: 56px;
    --cv2-border: 1px solid var(--l200);
    --cv2-row-min: 52px;
    --cv2-ease: var(--ease);
    --cv2-t-move: 420ms;    /* glides: row marker, picker highlight */
    --cv2-t-fade: 240ms;    /* label cross-fades */
    --cv2-t-swap: 320ms;    /* fact-line swap (hv3Swap timing) */
    --cv2-rise: 14px;       /* hero entrance rise */
    --cv2-cap: 540px;       /* HARD CAP: a fold's content block at 1366x768 (direction section 2) */
}

/* ---------- Type floors: 16px minimum everywhere (direction section 2) ---------- */
.course-v2 .v3-eyebrow { font-size: 16px; letter-spacing: .02em; }
.course-v2 .v3-small, .course-v2 .v3-micro { font-size: 16px; line-height: 1.5; }
.course-v2 .v3-chip { font-size: 16px; }
.course-v2 .v3-lead { font-size: 17px; }
.course-v2 h1, .course-v2 .cv2-h1 { font-family: 'Outfit', sans-serif; font-weight: 600; }
.course-v2 h2, .course-v2 .v3-h2 { font-family: 'Outfit', sans-serif; font-weight: 700; }
.course-v2 h3, .course-v2 .v3-h3 { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: clamp(20px, 1.1rem + .3vw, 22px); line-height: 1.3; }
.course-v2 .cv2-num, .course-v2 .cv2-price, .course-v2 .cv2-date, .course-v2 time { font-variant-numeric: tabular-nums; }

/* ---------- One-screen folds (1024px+ wide and 620px+ tall). skin.css sets --fold-header 66px. ---------- */
@media (min-width: 1024px) and (min-height: 620px) {
    .home-v3.course-v2 .v3-fold .v3-lead { font-size: clamp(16px, .62rem + .95vh, 18px); }
}
/* Anchor jumps land below the fixed header */
.course-v2 [id] { scroll-margin-top: calc(var(--hv3-header, 66px) + 8px); }

/* ---------- Hero shell (the hero fold builder owns the rest in hero.css) ---------- */
.course-v2 .cv2-hero { position: relative; overflow: hidden; }
@media (min-width: 1024px) {
    .course-v2 .cv2-hero { min-height: calc(100svh - var(--hv3-header, 103px)); display: flex; align-items: center; padding: clamp(16px, 2.2vh, 40px) 0; }
}
@media (max-width: 1023px) { .course-v2 .cv2-hero { padding: 24px 0 32px; } }
.course-v2 .cv2-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; font-size: 16px; line-height: 1.5; color: var(--l300); }
.course-v2 .cv2-crumbs li:not(:last-child)::after { content: '/'; margin: 0 8px; color: var(--on-dark-2); opacity: .7; }
/* The separator trails its crumb, so a wrapped line never starts with an orphan "/" */
.course-v2 .cv2-crumbs a { display: inline-block; padding: 10px 0; margin: -10px 0; color: var(--l300); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.course-v2 .cv2-crumbs a:hover { color: var(--on-dark); }
.course-v2 .cv2-crumbs [aria-current] { color: var(--on-dark); }
.course-v2 .cv2-h1 { margin: 12px 0 0; font-size: clamp(1.875rem, 1.2rem + 4.4vw, 2.25rem); line-height: 1.1; letter-spacing: -.02em; color: var(--on-dark); }
@media (min-width: 1024px) { .course-v2 .cv2-h1 { font-size: clamp(2.25rem, 1.4rem + 2vw, 3.25rem); } }
.course-v2 .cv2-summary { max-width: 60ch; margin: 16px 0 0; font-size: 17px; line-height: 1.6; color: var(--on-dark-2); }
.course-v2 .cv2-placeholder-cta { margin-top: 24px; }

/* ---------- Text links, notes ---------- */
.course-v2 .cv2-link { color: var(--brand-deep); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.course-v2 .v3-ink .cv2-link, .course-v2 .v3-panel-ink .cv2-link { color: var(--l300); }
.course-v2 .cv2-note { font-size: 16px; line-height: 1.6; color: var(--mute); }
.course-v2 .v3-ink .cv2-note, .course-v2 .v3-panel-ink .cv2-note { color: var(--on-dark-2); }

/* ---------- Chips ---------- */
.course-v2 .cv2-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 14px; border-radius: var(--r-chip); font-size: 16px; font-weight: 600; line-height: 1.4; background: var(--l100); color: var(--brand-deep); }
.course-v2 .cv2-chip-outline { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 14px; border-radius: var(--r-chip); font-size: 16px; font-weight: 600; line-height: 1.4; background: var(--white); border: 1px solid var(--l300); color: var(--ink-2); }
.course-v2 .cv2-count { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 12px; border-radius: var(--r-chip); font-size: 16px; font-weight: 600; background: var(--l100); color: var(--brand-deep); }

/* ---------- Ticks (included lists, recap) ---------- */
.course-v2 .cv2-ticks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.course-v2 .cv2-ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.course-v2 .cv2-ticks .v3-i { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--brand); }
.course-v2 .v3-ink .cv2-ticks li { color: var(--on-dark); }
.course-v2 .v3-ink .cv2-ticks .v3-i { color: var(--l300); }

/* ---------- Certificate line (hero, exam card, final) ---------- */
.course-v2 .cv2-cert { display: flex; gap: 10px; align-items: center; font-size: 16px; font-weight: 500; line-height: 1.5; }
.course-v2 .cv2-cert .v3-i { flex: none; width: 20px; height: 20px; color: var(--brand); }
.course-v2 .v3-ink .cv2-cert, .course-v2 .v3-panel-ink .cv2-cert { color: var(--on-dark); }
.course-v2 .v3-ink .cv2-cert .v3-i, .course-v2 .v3-panel-ink .cv2-cert .v3-i { color: var(--l300); }

/* ---------- Key facts (<dl class="cv2-facts">: dt label, dd value) ---------- */
.course-v2 .cv2-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; margin: 0; }
.course-v2 .cv2-facts > div { min-width: 0; }
.course-v2 .cv2-facts dt { font-size: 16px; line-height: 1.4; color: var(--mute); }
.course-v2 .cv2-facts dd { margin: 2px 0 0; font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 22px; line-height: 1.25; color: var(--ink); font-variant-numeric: tabular-nums; }
.course-v2 .v3-ink .cv2-facts dt { color: var(--on-dark-3); }
.course-v2 .v3-ink .cv2-facts dd { color: var(--on-dark); }

/* ---------- Data tables (exam, formats, next-level): a real <table>, styled ---------- */
.course-v2 .cv2-table-card { background: var(--white); border: var(--cv2-border); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.course-v2 .cv2-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.course-v2 .cv2-table caption { caption-side: bottom; padding: 10px 16px; text-align: left; font-size: 16px; color: var(--mute); }
.course-v2 .cv2-table th, .course-v2 .cv2-table td { padding: 12px 16px; text-align: left; vertical-align: middle; font-size: 16px; border-bottom: var(--cv2-border); }
.course-v2 .cv2-table thead th { padding-block: 10px; font-weight: 600; color: var(--mute); background: var(--l50); }
.course-v2 .cv2-table tbody th[scope="row"] { font-weight: 600; color: var(--ink); }
.course-v2 .cv2-table tbody tr { height: var(--cv2-row-min); }
.course-v2 .cv2-table tbody tr:last-child > * { border-bottom: 0; }
.course-v2 .cv2-table a { color: var(--brand-deep); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.course-v2 .cv2-table .is-selected > * { background: var(--l50); }

/* ---------- Radio dot ---------- */
.course-v2 .cv2-dot { position: relative; display: inline-flex; flex: none; width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--l300); background: var(--white); transition: border-color var(--t-base) ease; }
.course-v2 .cv2-dot::after { content: ''; position: absolute; inset: 4px; border-radius: 999px; background: var(--brand); transform: scale(0); transition: transform 180ms var(--ease); }
.course-v2 .is-selected .cv2-dot, .course-v2 :checked + .cv2-dot { border-color: var(--brand); }
.course-v2 .is-selected .cv2-dot::after, .course-v2 :checked + .cv2-dot::after { transform: scale(1); }

/* ---------- Radio pill (pickers, switches): a label wrapping a visually hidden radio ---------- */
.course-v2 .cv2-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 2px solid var(--l200); border-radius: var(--r-chip); background: var(--white); color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.3; cursor: pointer; transition: border-color var(--t-base) ease, background-color var(--t-base) ease, color var(--t-base) ease; }
.course-v2 .cv2-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.course-v2 .cv2-pill:hover { border-color: var(--l300); }
.course-v2 .cv2-pill:has(input:checked) { border-color: var(--brand); background: var(--l100); color: var(--brand-deep); }
.course-v2 .cv2-pill:has(input:focus-visible) { outline: var(--focus-light); outline-offset: 2px; }

/* ---------- Action bar: note on the left, the fold's one amber button on the right ---------- */
.course-v2 .cv2-actionbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 24px; }
.course-v2 .cv2-actionbar .cv2-note { max-width: 480px; }
@media (max-width: 767px) {
    .course-v2 .cv2-actionbar { flex-direction: column; align-items: stretch; }
    .course-v2 .cv2-actionbar .v3-btn { width: 100%; }
}
/* Primary buttons: 52px floor (xl 56 to 58px), 16px text */
.course-v2 .v3-btn-primary { min-height: 52px; font-size: 16px; }
.course-v2 .v3-btn-primary.v3-btn-xl { min-height: 56px; }

/* ---------- Motion helpers ----------
   Hidden start states MUST be written as  html.hv-motion .course-v2 .cv2-armed:not(.cv2-in) .your-thing { opacity: 0; ... }
   and undone by .cv2-in (animated) and .cv2-done (forced, 1.6s later). page.js adds .cv2-armed only to folds below the viewport
   and polls geometry every 500ms, so content can never stay hidden. Never hide text without the armed class. */
html.hv-motion .course-v2 .cv2-armed:not(.cv2-in) .cv2-settle { opacity: 0; transform: translate3d(0, 6px, 0); }
html.hv-motion .course-v2 .cv2-settle { transition: opacity 420ms var(--cv2-ease), transform 520ms var(--cv2-ease); }
html.hv-motion .course-v2 .cv2-done .cv2-settle { opacity: 1; transform: none; }
.course-v2 .cv2-swap { transition: opacity var(--cv2-t-fade) var(--cv2-ease); }
.course-v2 .cv2-swap.cv2-swap-out { opacity: 0; }

/* ---------- Sticky enquiry bar on phones (<768px; motion.js toggles .is-visible, page.js double-checks) ---------- */
.course-v2 .cv2-sticky {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--white); box-shadow: 0 -1px 0 rgba(31, 3, 45, .08), 0 -10px 28px -10px rgba(31, 3, 45, .3);
    transform: translateY(110%); visibility: hidden;
    transition: transform var(--t-base) var(--ease), visibility 0s linear var(--t-base);
}
.course-v2 .cv2-sticky.is-visible { transform: none; visibility: visible; transition: transform var(--t-base) var(--ease), visibility 0s linear 0s; }
.course-v2 .cv2-sticky .v3-btn { min-height: 48px; padding: 10px 14px; }
.course-v2 .cv2-sticky .cv2-sticky-main { flex: 1.6 1 0; min-width: 0; }
.course-v2 .cv2-sticky .cv2-sticky-call { flex: 1 1 0; min-width: 0; color: var(--brand-deep); border-color: var(--brand); background: var(--white); }
.course-v2 .cv2-sticky .cv2-sticky-call:hover { background: var(--l100); }
@media (min-width: 768px) { .course-v2 .cv2-sticky { display: none; } }

/* ---------- Reduced motion, print and forced colours ---------- */
@media (prefers-reduced-motion: reduce) {
    .course-v2 .cv2-settle, .course-v2 .cv2-swap { opacity: 1 !important; transform: none !important; transition: none !important; }
}
@media print {
    html.hv-motion .course-v2 * { opacity: 1 !important; transform: none !important; }
    .course-v2 .cv2-sticky { display: none !important; }
}
@media (forced-colors: active) {
    .course-v2 .cv2-sticky { border-top: 1px solid CanvasText; }
    .course-v2 .cv2-pill:has(input:checked), .course-v2 .cv2-table .is-selected > * { outline: 2px solid Highlight; }
    .course-v2 .cv2-dot::after { background: Highlight; }
}
