/* CV Mojo app: the dashboard tour video card and player (assets/site/app-tour.js), 2026-10-25.
   Works with the v3 app (the card and dialog get .tv-v3 when v3/app-v3.css is on the page) and the v2 opt-out.
   The poster's video cues match the homepage player (assets/site/v3/home-video.css): a big play button with a
   gentle pulse, a "Video 1:08" badge and a player bar. Sizes inside the poster use container units. */

/* 1. The card ================================================================== */
.tv-card { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; align-items: center; padding: 20px 28px 20px 20px; }
.tv-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; container-type: inline-size; color: #1E2A5A; text-decoration: none; background: #FFF6E0; border-radius: 16px; box-shadow: 0 12px 26px rgba(30, 42, 90, .2); cursor: pointer; }
.tv-thumb picture, .tv-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tv-thumb:focus-visible { outline: 4px solid #FFC93C; outline-offset: 3px; }
.tv-badge { position: absolute; top: 6%; right: 4%; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; font-size: 11px; font-size: max(10.5px, 3.4cqw); font-weight: 900; line-height: 1.1; letter-spacing: .06em; text-transform: uppercase; color: #FFF6E0; background: rgba(30, 42, 90, .92); border-radius: 999px; }
.tv-badge svg { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.tv-big { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); }
.tv-play { position: relative; isolation: isolate; display: grid; place-items: center; width: 64px; width: clamp(48px, 20cqw, 92px); aspect-ratio: 1; color: #1E2A5A; filter: drop-shadow(0 8px 16px rgba(30, 42, 90, .3)); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.tv-play::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #FFC93C; border-radius: 50%; }
.tv-play::after { content: ''; position: absolute; inset: -10%; z-index: -2; border: 3px solid #FFC93C; border-radius: 50%; opacity: 0; animation: tv-pulse 2.2s ease-out infinite; }
.tv-play svg { width: 40%; height: 40%; margin-left: 9%; fill: currentColor; }
@keyframes tv-pulse { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
.tv-thumb:hover .tv-play, .tv-thumb:focus-visible .tv-play { transform: rotate(-8deg) scale(1.08); }
.tv-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; gap: 2.4cqw; padding: 14px 10px 7px; padding: 6cqw 3.4cqw 2.6cqw; color: #FFF6E0; background: linear-gradient(to top, rgba(20, 26, 58, .82), rgba(20, 26, 58, 0)); }
.tv-bar svg { flex: none; width: 12px; width: max(11px, 3.6cqw); height: auto; aspect-ratio: 1; fill: currentColor; }
.tv-track { position: relative; flex: 1; height: 3px; height: max(3px, .9cqw); background: rgba(255, 246, 224, .35); border-radius: 999px; }
.tv-track i { position: absolute; left: 0; top: 50%; width: 9px; width: max(8px, 2.4cqw); aspect-ratio: 1; background: #FFC93C; border-radius: 50%; transform: translate(-30%, -50%); }
.tv-time { font-size: 10.5px; font-size: max(10px, 3.2cqw); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-cc { padding: 1px 4px; font-size: 9.5px; font-size: max(9px, 2.8cqw); font-weight: 900; line-height: 1.2; border: 1.5px solid currentColor; border-radius: 4px; }

.tv-text { min-width: 0; }
.tv-text .db-label { margin-bottom: 8px; }
.tv-text h2 { margin: 0; font-size: 22px; line-height: 1.15; }
.tv-lead { max-width: 560px; margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--c-text-light, #5D5869); }
.tv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 16px; }
.tv-watch svg { width: 14px; height: 14px; fill: currentColor; }
.tv-hide { padding: 6px 2px; font: inherit; font-size: 14px; font-weight: 800; color: var(--c-text-light, #5D5869); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; }
.tv-hide:hover { color: var(--c-dark, #1E2A5A); }

/* The link that stays once the card is hidden (under the greeting's pills) */
.tv-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; padding: 4px 0; font: inherit; font-size: 14.5px; font-weight: 800; color: var(--c-dark, #1E2A5A); text-decoration: underline; text-decoration-color: #FFC93C; text-decoration-thickness: 3px; text-underline-offset: 4px; background: none; border: 0; cursor: pointer; }
.tv-link svg { width: 13px; height: 13px; fill: currentColor; }
.tv-link:hover { text-decoration-color: currentColor; }
.tv-link:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 6px; }

@media (max-width: 760px) {
  .tv-card { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px 14px 18px; }
  .tv-text { padding: 0 6px; }
  .tv-play { width: clamp(56px, 17cqw, 84px); }
}

/* 2. The player dialog ========================================================== */
/* margin: auto centres the modal (the SPA's "* { margin: 0 }" reset would pin it to the top left). The width
   keeps a 16:9 video plus its header inside the screen, also on a phone held sideways. */
.tv-dlg { width: min(1040px, calc(100vw - 24px), calc((100vh - 140px) * 1.7778)); max-width: none; max-height: calc(100% - 24px); margin: auto; padding: 0; overflow: auto; color: #1D1A26; background: #FFFDF8; border: 0; border-radius: 22px; box-shadow: 0 30px 70px rgba(10, 14, 40, .4); }
@supports (height: 100dvh) { .tv-dlg { width: min(1040px, calc(100vw - 24px), calc((100dvh - 140px) * 1.7778)); } }
.tv-dlg { min-width: min(300px, calc(100vw - 24px)); }
.tv-dlg::backdrop { background: rgba(14, 19, 44, .74); }
.tv-dlg.is-fallback { position: fixed; inset: 0; z-index: 500; height: fit-content; box-shadow: 0 0 0 100vmax rgba(14, 19, 44, .74); }
.tv-dlg[open] { animation: tv-pop .2s ease; }
@keyframes tv-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.tv-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 10px 20px; }
.tv-dlg h2 { margin: 0; font-size: 18px !important; line-height: 1.2; color: #1E2A5A; } /* !important: the SPA's mobile CSS sets every h2 to 1.15rem !important */
.tv-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: #5D5869; background: transparent; border: 0; border-radius: 12px; cursor: pointer; }
.tv-x:hover { color: #1E2A5A; background: #F7EEDA; }
.tv-x:focus-visible { outline: 3px solid #1E2A5A; outline-offset: 1px; }
.tv-frame { position: relative; aspect-ratio: 16 / 9; background: #1E2A5A; }
.tv-frame video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; background: #1E2A5A; }
.tv-frame video:focus-visible { outline: 4px solid #FFC93C; outline-offset: -4px; }
.tv-frame video::cue { font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 700; color: #FFF6E0; background: rgba(20, 26, 58, .86); }
.tv-note { margin: 0; padding: 10px 20px 14px; font-size: 13.5px; font-weight: 700; line-height: 1.4; color: #5D5869; }

/* 3. The v3 look ================================================================ */
.tv-v3.tv-card { background: var(--paper, #FFFDF8); }
.tv-v3 .tv-play::before { border-radius: 0; background: var(--sun, #FFC93C); -webkit-mask: var(--v-blob-e) center / 100% 100% no-repeat; mask: var(--v-blob-e) center / 100% 100% no-repeat; }
.tv-v3 .tv-badge { font-family: var(--v-body, inherit); }
.tv-v3 .tv-text h2, .tv-dlg.tv-v3 h2 { font-family: var(--v-display, inherit); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; color: var(--navy, #1E2A5A); -webkit-text-stroke: .02em currentColor; }
#app .tv-v3 .tv-text h2 { font-size: 40px !important; line-height: .9; }
.tv-dlg.tv-v3 h2 { font-size: 30px !important; line-height: .95; padding-top: 4px; }
.tv-v3 .tv-lead { color: var(--text, #1D1A26); font-weight: 600; }
.tv-v3 .tv-hide { color: var(--muted, #5D5869); }
.tv-v3 .tv-link { color: var(--navy, #1E2A5A); text-decoration-color: var(--sun, #FFC93C); }
@media (max-width: 760px) { #app .tv-v3 .tv-text h2 { font-size: 34px !important; } .tv-dlg.tv-v3 h2 { font-size: 24px !important; } }

@media (prefers-reduced-motion: reduce) {
  .tv-play::after { animation: none; opacity: .5; }
  .tv-play, .tv-dlg[open] { transition: none; animation: none; }
}
