/*
 * Course v2 fold 1: HERO CONSOLE (#course). Prefix .cv2-hero*. Tokens only (base.css), no hex.
 * Loaded after home-v3/base.css, home-v3/hero.css, home-v3/skin.css and course-v2/page.css (which owns the shell, breadcrumb,
 * H1 base, summary base, .cv2-facts and .cv2-cert). Reuses home-v3 hero.css: .hv3-decor glows, .hv3-grad and the .hv3-formats
 * sliding highlight (re-pinned to a 2x2 grid here).
 * Desktop one-screen rule (1024px+): page.css sets min-height calc(100svh - --hv3-header) and flex-centres the content.
 * Content budget at 1366x768: about 540px (card about 422px). Every text is 16px or more.
 * Motion: transform and opacity only. The entrance runs only while html.cv2-enter is set (inline script in the partial,
 * removed 1.7s later), so text is always visible if animations never run. Reduced motion: base.css turns everything off.
 */

/* ---------- Shell and background ---------- */
.course-v2 .cv2-hero { isolation: isolate; border-top: 1px solid rgba(255, 255, 255, .1); }
.course-v2 .cv2-hero .hv3-glow-c { top: 46%; left: 30%; }
.course-v2 .cv2-hero.is-offscreen .hv3-glow, .course-v2 .cv2-hero.is-paused .hv3-glow { animation-play-state: paused; }
.course-v2 .cv2-hero-wrap { position: relative; z-index: 1; width: 100%; }

/* ---------- Layout (mobile first; DOM order = visual order on every breakpoint) ---------- */
.course-v2 .cv2-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.course-v2 .cv2-hero-copy, .course-v2 .cv2-hero-side { min-width: 0; }

/* ---------- Left column ---------- */
.course-v2 .cv2-hero .cv2-crumbs a { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; padding: 0; } /* 44px hit area, 24px of layout */
.course-v2 .cv2-hero .cv2-h1 { text-wrap: balance; }
.course-v2 .cv2-hero .cv2-summary { margin-top: 14px; font-size: 16px; line-height: 1.55; color: var(--l100); }

/* Phones and tablets: the first-screen amber button (hidden on desktop, where the card button is in view) */
.course-v2 .cv2-hero-mcta { margin-top: 20px; }
.course-v2 .cv2-hero-mcta .v3-btn { min-height: 56px; }

/* Key facts: quiet tiles on ink (2 columns on phones, one content-sized row from 640px). */
.course-v2 .cv2-hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.course-v2 .cv2-hero-facts[data-count="3"] > div:nth-child(3) { grid-column: 1 / -1; }
.course-v2 .cv2-hero-fact {
    padding: 12px 16px; border-radius: var(--r-choice);
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
    transition: transform var(--t-base) var(--ease), background-color var(--t-base) ease;
}
.course-v2 .cv2-hero .cv2-hero-facts dt { font-size: 16px; line-height: 1.4; color: var(--on-dark-3); }
.course-v2 .cv2-hero .cv2-hero-facts dd { margin-top: 2px; font-size: 20px; line-height: 1.25; color: var(--on-dark); }
@media (pointer: fine) {
    .course-v2 .cv2-hero-fact:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .09); }
}

/* Certificate line */
.course-v2 .cv2-hero-cert { margin-top: 20px; color: var(--l300); }
.course-v2 .cv2-hero .cv2-hero-cert { color: var(--l100); }
.course-v2 .cv2-hero .cv2-hero-cert .v3-i { color: var(--l300); }
.course-v2 .cv2-hero .cv2-hero-cert span { min-width: 0; }

/* ---------- Right column: the white picker card ---------- */
.course-v2 .cv2-hero-card { position: relative; padding: 20px 16px 12px; background: var(--white); color: var(--ink); }
.course-v2 .cv2-hero-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.course-v2 .cv2-hero-legend {
    float: left; width: 100%; margin: 0 0 14px; padding: 0;
    font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; color: var(--ink);
}
.course-v2 .cv2-hero-legend + * { clear: both; }

/* Tiles: 2x2 at every width; the home highlight (::before) slides to the chosen tile */
.course-v2 .cv2-hero .cv2-hero-tiles { --hv3-cols: 2; --hv3-rows: 2; --hv3-gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.course-v2 .cv2-hero .cv2-hero-tiles:has(.hv3-format:nth-child(1) input:checked) { --hv3-fx: 0; --hv3-fy: 0; }
.course-v2 .cv2-hero .cv2-hero-tiles:has(.hv3-format:nth-child(2) input:checked) { --hv3-fx: 1; --hv3-fy: 0; }
.course-v2 .cv2-hero .cv2-hero-tiles:has(.hv3-format:nth-child(3) input:checked) { --hv3-fx: 0; --hv3-fy: 1; }
.course-v2 .cv2-hero .cv2-hero-tiles:has(.hv3-format:nth-child(4) input:checked) { --hv3-fx: 1; --hv3-fy: 1; }
.course-v2 .cv2-hero .cv2-hero-card .cv2-hero-tile {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; align-items: center;
    column-gap: 10px; row-gap: 2px; min-height: 84px; padding: 12px 14px; text-align: left;
    background: var(--white); border-color: var(--l200); color: var(--ink); box-shadow: none;
}
.course-v2 .cv2-hero .cv2-hero-card .cv2-hero-tile:has(input:checked) { background: transparent; border-color: transparent; box-shadow: none; }
.course-v2 .cv2-hero .cv2-hero-card .cv2-hero-tile:has(input:focus-visible) { outline: var(--focus-light); outline-offset: 2px; }
.course-v2 .cv2-hero .cv2-hero-card .cv2-hero-tile:active { transform: scale(.975); }
.course-v2 .cv2-hero-tile-icon { grid-column: 1; grid-row: 1; width: 22px; height: 22px; }
.course-v2 .cv2-hero-tile-name {
    grid-column: 2; grid-row: 1; min-width: 0;
    font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--ink); transition: color 220ms ease;
}
.course-v2 .cv2-hero-tile-status { grid-column: 1 / -1; grid-row: 2; min-width: 0; font-size: 16px; font-weight: 400; line-height: 1.4; color: var(--mute); }
.course-v2 .cv2-hero-tile input:checked ~ .cv2-hero-tile-name { color: var(--brand-deep); }
/* Formats with no listed data stay selectable, muted (never aria-disabled) */
.course-v2 .cv2-hero-tile.is-ask > :not(input) { opacity: .72; transition: opacity 220ms ease; }
.course-v2 .cv2-hero-tile.is-ask:has(input:checked) > :not(input), .course-v2 .cv2-hero-tile.is-ask:hover > :not(input) { opacity: 1; }
@media (pointer: fine) {
    .course-v2 .cv2-hero .cv2-hero-card .cv2-hero-tile:hover { border-color: var(--l300); background: var(--l50); transform: none; box-shadow: none; }
    .course-v2 .cv2-hero .cv2-hero-card .cv2-hero-tile:has(input:checked):hover { background: transparent; border-color: transparent; }
}

/* Live fact line: fixed two-line height so the card never changes size */
.course-v2 .cv2-hero-factline { min-height: 48px; margin: 14px 0 0; font-size: 16px; line-height: 1.5; color: var(--mute); }
.course-v2 .cv2-hero-factline.is-swap { animation: hv3Swap 320ms var(--ease); }

/* The card's amber button and links */
.course-v2 .cv2-hero-card .cv2-hero-cta { margin-top: 12px; min-height: 58px; font-size: 17px; box-shadow: 0 14px 30px -12px rgba(255, 159, 28, .75); }
.course-v2 .cv2-hero-card .cv2-hero-cta.is-nudge .v3-i { animation: hv3Nudge 700ms var(--ease) 1; }
.course-v2 .cv2-hero-card a:focus-visible, .course-v2 .cv2-hero-card button:focus-visible { outline: var(--focus-light); outline-offset: 2px; }
.course-v2 .cv2-hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 24px; margin: 4px 0 0; }
.course-v2 .cv2-hero .cv2-hero-card .v3-link { min-height: 44px; font-size: 16px; color: var(--brand-deep); }
.course-v2 .cv2-hero .cv2-hero-card .v3-link .v3-i-sm { width: 18px; height: 18px; }
.course-v2 .cv2-hero-dates .v3-i { transform: rotate(-90deg); transition: transform var(--t-base) var(--ease); }
@media (pointer: fine) { .course-v2 .cv2-hero-dates:hover .v3-i { transform: rotate(-90deg) translateY(3px); } }
.course-v2 .cv2-hero-links:empty { display: none; }

/* ---------- Tablet (640 to 1023px): calmer card padding ---------- */
@media (min-width: 640px) {
    .course-v2 .cv2-hero-card { padding: 24px 24px 12px; }
    /* One row of facts sized to their content (long town labels never wrap into a tall column) */
    .course-v2 .cv2-hero-facts { display: flex; flex-wrap: wrap; }
    .course-v2 .cv2-hero-facts > div { flex: 0 1 auto; min-width: 132px; }
}

/* ---------- Desktop (1024px+): two columns, one screen ---------- */
@media (min-width: 1024px) {
    .course-v2 .cv2-hero-grid { grid-template-columns: minmax(0, 1fr) 440px; gap: 48px; align-items: center; }
    .course-v2 .cv2-hero-copy { container-type: inline-size; }
    .course-v2 .cv2-hero .cv2-h1 { margin-top: 16px; font-size: clamp(2.25rem, 8.3cqi, 3.25rem); letter-spacing: -.025em; }
    .course-v2 .cv2-hero .cv2-summary { margin-top: 18px; font-size: 17px; line-height: 1.6; }
    .course-v2 .cv2-hero-mcta { display: none; }
    /* Up to 4 facts stay on ONE row: labels may wrap, values never do */
    .course-v2 .cv2-hero-facts { flex-wrap: nowrap; gap: 12px; margin-top: 28px; }
    .course-v2 .cv2-hero-facts > div { min-width: 0; padding: 10px 14px; }
    .course-v2 .cv2-hero .cv2-hero-facts dd { white-space: nowrap; }
    .course-v2 .cv2-hero .cv2-hero-facts dd { font-size: 22px; }
    .course-v2 .cv2-hero-card .cv2-hero-tile { min-height: 76px; }
    .course-v2 .cv2-hero-call { display: none; }   /* desktop: the header carries the phone number; keeps the card at about 422px */
    .course-v2 .cv2-hero-links .cv2-hero-call { display: none; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
    .course-v2 .cv2-hero-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; }
    .course-v2 .cv2-hero-facts { gap: 8px; }
    .course-v2 .cv2-hero-facts > div { padding: 10px 12px; }
    .course-v2 .cv2-hero .cv2-hero-facts dd { white-space: normal; }
    .course-v2 .cv2-hero .cv2-hero-facts dd { font-size: 20px; }
}
/* Short desktop screens: smaller H1 (never smaller text) */
@media (min-width: 1024px) and (max-height: 639px) {
    .course-v2 .cv2-hero .cv2-h1 { font-size: 2.125rem; }
}
/* Tall desktop screens: a little more air around the facts */
@media (min-width: 1200px) and (min-height: 1000px) {
    .course-v2 .cv2-hero .cv2-summary { margin-top: 22px; }
    .course-v2 .cv2-hero-facts { margin-top: 32px; }
    .course-v2 .cv2-hero-cert { margin-top: 24px; }
}

/* ---------- Entrance (only while html.cv2-enter is set; see the note at the top) ---------- */
html.cv2-enter .course-v2 .cv2-hero .cv2-crumbs,
html.cv2-enter .course-v2 .cv2-hero .cv2-h1,
html.cv2-enter .course-v2 .cv2-hero .cv2-summary,
html.cv2-enter .course-v2 .cv2-hero-mcta,
html.cv2-enter .course-v2 .cv2-hero-fact,
html.cv2-enter .course-v2 .cv2-hero-cert { animation: cv2HeroIn 560ms var(--ease) both; }
html.cv2-enter .course-v2 .cv2-hero .cv2-h1 { animation-delay: 80ms; }
html.cv2-enter .course-v2 .cv2-hero .cv2-summary { animation-delay: 160ms; }
html.cv2-enter .course-v2 .cv2-hero-mcta { animation-delay: 200ms; }
html.cv2-enter .course-v2 .cv2-hero-fact:nth-child(1) { animation-delay: 240ms; }
html.cv2-enter .course-v2 .cv2-hero-fact:nth-child(2) { animation-delay: 300ms; }
html.cv2-enter .course-v2 .cv2-hero-fact:nth-child(3) { animation-delay: 360ms; }
html.cv2-enter .course-v2 .cv2-hero-fact:nth-child(4) { animation-delay: 420ms; }
html.cv2-enter .course-v2 .cv2-hero-cert { animation-delay: 480ms; }
html.cv2-enter .course-v2 .cv2-hero-card { animation: cv2HeroCard 640ms var(--ease) 200ms both; }
@media (max-width: 1023px) {
    html.cv2-enter .course-v2 .cv2-hero-card { animation-name: cv2HeroIn; }
}
@keyframes cv2HeroIn { from { opacity: 0; transform: translate3d(0, 14px, 0); } }
@keyframes cv2HeroCard { from { opacity: 0; transform: translate3d(18px, 0, 0); } }

/* ---------- Accessibility fallbacks (base.css turns every animation and transition off for reduced motion) ---------- */
@media (prefers-reduced-motion: reduce) {
    .course-v2 .cv2-hero .hv3-glow { will-change: auto; }
    .course-v2 .cv2-hero-fact:hover { transform: none; }
}
@media (forced-colors: active) {
    .course-v2 .cv2-hero-card { border: 1px solid CanvasText; }
    .course-v2 .cv2-hero-fact { border-color: CanvasText; }
    .course-v2 .cv2-hero .cv2-hero-card .cv2-hero-tile:has(input:checked) { outline: 3px solid Highlight; }
    .course-v2 .cv2-hero-tile.is-ask > :not(input) { opacity: 1; }
}
@media print {
    .course-v2 .cv2-hero .hv3-decor { display: none; }
    .course-v2 .cv2-hero-mcta, .course-v2 .cv2-hero-cta, .course-v2 .cv2-hero-links { display: none; }
}
