/* Tide — YouTube episodes: the click-to-play player, episode cards, in-page features, the home "screening room",
   the video hub and the episode watch page. Classes are prefixed .t-video- and .t-episode-. Loaded once per page by
   the video templates (@pushOnce 'tide-video-css'). */

/* ---- Player ---------------------------------------------------------------------------------- */
.t-video { position: relative; }
/* Fixed 16:9 box that never changes size when the poster is swapped for the iframe. The 200px floor is YouTube's
   minimum player viewport; below that ratio the poster crops (object-fit) and YouTube letterboxes. The width must stay
   explicit: with width:auto, aspect-ratio turns the height floor into a ~356px minimum width on 320px phones. */
.t-video__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; background: #0b1220; }
.t-video__poster,
.t-video__iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.t-video__poster { display: block; cursor: pointer; }
.tide .t-video__image { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.t-video__iframe { display: block; border: 0; }
.t-video__play {
    position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; transform: translate(-50%, -50%);
    filter: drop-shadow(0 6px 18px rgba(8, 14, 26, .45)); transition: transform .2s ease;
}
.t-video__play svg { display: block; width: 100%; height: 100%; }
.t-video__play circle { fill: var(--ink); transition: fill .2s ease; }
.t-video__play path { fill: #fff; }
.t-video__poster:hover .t-video__play { transform: translate(-50%, -50%) scale(1.06); }
.t-video__poster:hover .t-video__play circle { fill: #28344f; }
.t-video__duration,
.t-video-card__duration {
    position: absolute; right: 12px; bottom: 12px; padding: 4px 8px; background: rgba(11, 18, 32, .88); color: #fff;
    font-family: var(--mono); font-size: 12px; line-height: 1.3; letter-spacing: .06em;
}
/* Two-tone ring on an overlay above the image (an outline on the link itself would paint under its positioned
   children): visible over any thumbnail and never clipped at the viewport edge. */
.t-video__poster::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.t-video__poster:focus-visible { outline: none; }
.t-video__poster:focus-visible::after { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px var(--ink); }
.t-video__poster:focus-visible .t-video__play circle { fill: #28344f; }
/* The live player gets the same two-tone ring on a frame overlay (painted after the iframe, so above it): an outline on
   the iframe would sit on its own, often black, pixels. */
.t-video__frame::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.t-video__iframe:focus-visible { outline: none; }
.t-video__frame:has(.t-video__iframe:focus-visible)::after { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 7px var(--ink); }

.t-video-badge {
    position: absolute; right: 12px; top: 12px; z-index: 2; padding: 4px 8px; background: var(--gold); color: var(--ink);
    pointer-events: none;
    font-family: var(--mono); font-size: 11px; font-weight: 600; line-height: 1.3; letter-spacing: .14em; text-transform: uppercase;
}
.t-video-badge--inline { position: static; display: inline-block; margin: 0 6px 0 4px; vertical-align: 1px; }

/* ---- Episode cards --------------------------------------------------------------------------- */
.t-video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 28px; }
.t-video-card { position: relative; display: flex; flex-direction: column; }
.t-video-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0b1220; }
.tide .t-video-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.t-video-card:hover .t-video-card__media img { transform: scale(1.03); }
.t-video-card__meta {
    margin: 16px 0 6px; color: var(--body); font-family: var(--mono); font-size: 12px; line-height: 1.5;
    letter-spacing: .08em; text-transform: uppercase;
}
.t-video-card .t-video-card__title { margin: 0 0 10px; font-size: clamp(1.25rem, 1.7vw, 1.5rem); line-height: 1.22; }
.t-video-card__link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.t-video-card__link:focus-visible { outline: none; }
.t-video-card__link:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 6px; }
.t-video-card__teaser { margin: 0 0 16px; color: var(--body); font-size: 15px; line-height: 1.65; }
.t-video-card__cta { margin-top: auto; color: var(--ink); font-family: var(--ui); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.t-video-card--dark .t-video-card__meta { color: var(--gold); }
.t-video-card--dark .t-video-card__title,
.t-video-card--dark .t-video-card__cta { color: var(--cream-2); }
.t-video-card--dark .t-video-card__teaser { color: var(--foot); }
.t-video-card--dark .t-video-card__link:focus-visible::after { outline-color: var(--gold); }

/* ---- In-page feature (mine / production / authenticity / product pages / CMS lessons) ---------- */
.t-video-feature { padding: 76px var(--gutter); background: var(--paper); border-top: 1px solid var(--sand-line); border-bottom: 1px solid var(--sand-line); }
.t-video-feature__inner {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center;
    max-width: var(--maxw); margin: 0 auto;
}
.t-video-feature .t-video-feature__title { margin: 14px 0 16px; font-size: clamp(1.75rem, 3vw, 2.6rem); line-height: 1.12; }
.t-video-feature__teaser { max-width: 46ch; margin: 0 0 22px; color: var(--body); }
.t-video-feature--compact { margin: 44px 0; padding: 0; background: transparent; border: 0; }
.t-video-feature--compact .t-video-feature__inner { display: block; max-width: none; }
.t-video-feature--compact .t-video-feature__title { margin: 10px 0 18px; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.t-video-feature__after { margin-top: 18px; }

/* ---- Home "screening room" and Learn "shelf" ------------------------------------------------- */
.t-video-band { padding: 84px var(--gutter); }
.t-video-band--screening { background: var(--ink); color: var(--foot); }
.t-video-band--shelf { margin-top: 56px; padding: 44px 36px; background: var(--sand); }
.t-video-band__inner { max-width: var(--maxw); margin: 0 auto; }
.t-video-band__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; margin-bottom: 40px; }
.t-video-band__eyebrow { margin: 0 0 10px; color: var(--gold-deep); font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.t-video-band .t-video-band__title { margin: 0; font-size: clamp(2rem, 3.6vw, 44px); line-height: 1.1; }
.t-video-band__all { padding-bottom: 4px; border-bottom: 1px solid var(--gold); color: var(--ink); font-family: var(--ui); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.t-video-band__feature { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; align-items: center; margin-bottom: 64px; }
.t-video-band__meta { margin: 0 0 12px; color: var(--gold); font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.t-video-band .t-video-band__episode { margin: 0 0 14px; color: var(--cream-2); font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.18; }
.t-video-band__teaser { margin: 0 0 22px; color: var(--foot); }
.t-video-band--screening .t-video-band__eyebrow { color: var(--gold); }
.t-video-band--screening .t-video-band__title { color: var(--cream-2); }
.t-video-band--screening .t-video-band__all,
.t-video-band--screening .link-underline { color: var(--cream-2); }
.t-video-band--screening :focus-visible { outline-color: var(--gold); }
.t-video-band--shelf .t-video-band__head { margin-bottom: 28px; }
.t-video-band--shelf .t-video-band__eyebrow { color: var(--body); }
.t-video-band--shelf .t-video-band__title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
/* Inside the Learn article column the shelf lists episodes as rows (poster beside text), which keeps titles at a
   readable measure however many episodes there are. */
.t-video-band--shelf .t-video-grid { grid-template-columns: 1fr; gap: 28px; }
.t-video-band--shelf .t-video-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 22px; align-content: start; }
.t-video-band--shelf .t-video-card__media { grid-row: 1 / span 4; align-self: start; }
.t-video-band--shelf .t-video-card__meta { margin-top: 0; }
.t-video-band--shelf .t-video-card .t-video-card__title { font-size: 1.25rem; }
.t-video-band--shelf .t-video-card__teaser { margin-bottom: 10px; font-size: 14px; }

/* ---- Hub ------------------------------------------------------------------------------------- */
.t-video-hub { padding: 88px var(--gutter) 44px; }
.t-video-hub__head { max-width: var(--maxw); margin: 0 auto; }
.t-video-hub .t-video-hub__title { max-width: 16em; margin: 14px 0 18px; font-size: clamp(2.4rem, 5vw, 64px); line-height: 1.05; }
.t-video-hub__lede { max-width: 62ch; margin: 0 0 26px; color: var(--body); font-size: 17px; }
.t-video-library { padding: 72px var(--gutter) 96px; }
.t-video-library__head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
    max-width: var(--maxw); margin: 0 auto 36px;
}
.t-video-library .t-video-library__title { max-width: none; margin: 0; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.12; }
.t-video-library .t-video-grid { max-width: var(--maxw); margin: 0 auto; }
.t-video-library--next { background: var(--sand); }
.t-video-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.t-video-topics a {
    padding: 7px 14px; border: 1px solid var(--card-border); color: var(--body-subtle);
    font-family: var(--ui); font-size: 13px; letter-spacing: .04em;
}
.t-video-topics a:hover { border-color: var(--ink); color: var(--ink); }
.t-video-topics a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---- Episode watch page ---------------------------------------------------------------------- */
.t-episode { padding: 56px var(--gutter) 72px; }
.t-episode__head,
.t-episode__player,
.t-episode__body { max-width: 1100px; margin-inline: auto; }
.t-episode__back { display: inline-block; margin-bottom: 28px; color: var(--body); font-family: var(--ui); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.t-episode__back:hover { color: var(--ink); }
.t-episode__eyebrow { margin: 0 0 12px; color: var(--body); }
.t-episode .t-episode__title { max-width: 22em; margin: 0 0 14px; font-size: clamp(1.9rem, 4.4vw, 52px); line-height: 1.08; }
.t-episode__original { margin: 0 0 6px; color: var(--body); font-size: 15px; }
.t-episode__meta { margin: 0 0 28px; color: var(--body); font-family: var(--ui); font-size: 14px; }
.t-episode__player { margin-bottom: 52px; }
.t-episode__body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 64px; }
.t-episode__summary { max-width: 64ch; margin: 0 0 18px; color: var(--body-subtle); font-size: 17px; }
.t-episode__article { margin: 26px 0 0; }
.t-episode__section { margin-top: 44px; }
.t-episode__aside > .t-episode__section:first-child { margin-top: 0; }
.t-episode__heading { margin: 0 0 8px; color: var(--ink); font-family: var(--display); font-size: 1.5rem; font-weight: 500; line-height: 1.2; }
.t-episode__hint { margin: 0 0 14px; color: var(--body); font-size: 14px; }
.t-video-chapters { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--sand-line); }
.t-video-chapters li { border-bottom: 1px solid var(--sand-line); }
.t-video-chapters a { display: flex; align-items: baseline; gap: 18px; padding: 11px 4px; }
.t-video-chapters a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.t-video-chapters time { min-width: 3.4em; color: var(--body); font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.t-episode__note { margin: 36px 0 0; padding-left: 14px; border-left: 2px solid var(--gold); color: var(--body); font-size: 14px; }
.t-episode__sources { margin: 0; padding-left: 1.2em; color: var(--body); font-size: 14px; line-height: 1.6; }
.t-episode__sources li + li { margin-top: 10px; }
.t-episode__sources a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.t-episode__links { margin: 0; padding: 0; list-style: none; }
.t-episode__links a { display: inline-block; padding: 6px 0; font-family: var(--ui); }
.t-episode__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.t-episode__subscribe { margin: 36px 0 0; }

/* ---- Responsive ------------------------------------------------------------------------------ */
@media (max-width: 1040px) {
    .t-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .t-video-band__feature { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 900px) {
    /* minmax(0, …): a bare 1fr track would grow to the player's min-content width on small phones. */
    .t-video-feature__inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .t-episode__body { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .t-episode__aside { margin-top: 44px; }
    .t-video-band--screening,
    .t-video-feature:not(.t-video-feature--compact) { padding-block: 60px; }
    .t-video-hub { padding-top: 60px; }
}
@media (max-width: 640px) {
    .t-video-grid { grid-template-columns: 1fr; gap: 40px; }
    .t-video-band--shelf { padding: 32px 20px; }
    .t-video-band--shelf .t-video-card { display: flex; }
    .t-video-band--shelf .t-video-card__media { align-self: stretch; }
    .t-video-band--shelf .t-video-card__meta { margin-top: 16px; }
}
@media (max-width: 560px) {
    /* Full-bleed on phones: every host pads by var(--gutter), so pull the frame out by exactly that (no 100vw, which
       would include a classic scrollbar). */
    .t-video__frame { width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); }
    .t-video__play { width: 60px; height: 60px; }
}
