/**
 * TripLead: the funnel guide video (decision #86 addition, PLAN-organic-search-video.md §2, §7, §9c, §9d).
 * Owner: css-check. Loaded ONLY when a guide video renders (includes/funnels.php,
 * triplead_funnel_guide_video_enqueue(), after triplead-traveller), so no other page and no paid
 * visit (no guide) ever gets it. Every rule is under .tl-guide. marketing.css doesn't load on
 * funnel pages, so the homepage player (marketing.css M6p) is restated here for this player only.
 *
 * Markup (templates/funnel-guide.php, core-dev; controls built by assets/how-video.js). With the
 * video only (§9d, Daniel 29 Oct: the sticky video beside ALL the sections), one DOM order, which is
 * also the phone order:
 *   section.tl-guide
 *     div.tl-guide__top.tl-guide__top--video            the top row (exists only with the video)
 *       nav.tl-funnel-crumbs                            the breadcrumb (traveller.css D2)
 *       div.tl-guide__head                              h2 + p.tl-guide__lead (D3)
 *       div.tl-guide__video
 *         div.tl-how-player.tl-how-player--guide[data-tl-how-player]   state classes as M6p
 *           video.tl-how-video.tl-guide__video-media (720 x 900, 4:5; no poster attribute)
 *           noscript > picture.tl-guide__video-poster > img.tl-guide__video-poster-img   (no-JS poster)
 *           (JS) button.tl-how-play, span.tl-how-spinner, div.tl-how-controls, div.tl-how-progress
 *       div.tl-guide__sections.tl-guide__sections--stack   ALL the sections, one column (absent with none)
 *     div.tl-guide__steps                               D5 unchanged: 3 steps across from 1024, no player
 * With the video off the markup is 0.24.153's (D4's two-column .tl-guide__sections, no top row) and
 * this file doesn't load. (Up to 0.24.153 the player sat in the steps panel; up to 0.24.156 only
 * the first section sat beside it and sections 2..n followed in D4's grid; both retired 29 Oct.)
 *
 * G1 layout, G2 player (the homepage M6p, same values, sized for a player of at most 400px),
 * G3 states, G4 touch / mouse (G4f: the 70% bar from 1024 only, not in full screen) / phones /
 * motion, G5 full screen. Under 1024 (§9d phones): the video is the column, capped at the intro's 36em, normal bar. Tokens: the site's (triplead.css :root).
 * The two glass colours are the player's own component tokens, set once on the player exactly as
 * M6p does. No !important.
 */

/* ---- G1. Layout: the top row (§9d) --------------------------------------------------------
   Under 1024 (phones and the 680px tablet card): the DOM order, stacked. The breadcrumb keeps
   D2's 16px to the H2 (D2's rule is .tl-guide > .tl-funnel-crumbs; the crumbs sit one level
   down). The video comes 20px under the intro (D4's intro -> content) at the intro's width: the
   column, capped at the intro's 36em measure (Daniel 29 Oct; the two-thirds, 216-320px, centred, is
   retired), so at 768 it stops where the text does. 4:5: about 288 x 360 at 320, 358 x 448 at
   390 (the column, under 540), 540 x 675 at 768. From 1024 the grid column (at most 400px) is
   narrower than the cap, so it has no effect there. The stack follows 28px
   under it (D4's row gap under 1024).
   G1s, the stack: every section in ONE column at every width, cancelling D4's two columns from
   768 (traveller.css D4 sets the columns and gaps on .tl-guide__sections), with D4's row gaps:
   28px under 1024, 32px from 1024. Each section keeps the intro's 36em measure (540px at 15px),
   so its lines stop where the intro's do (the column is 600px at 768-1023).
   From 1024: two columns, 48px apart (D4's column gap from 1024). Left (1fr): crumbs / head /
   stack in rows 1-3, the stack 20px under the intro (D4). Right: the video, clamp(340px, 40%,
   400px) of the card content: 345px at 1024 (863px content, left 470), 398px once the card is at
   its 1092px max (996px content, left 550, so the 540px intro and sections fit whole). Rows 2 to
   -1: it starts on the head's row, so at rest its top is the H2's top (Daniel 29 Oct; row 1 is
   the crumbs' own height plus their 16px margin, so a wrapped breadcrumb moves both down
   together). Row 3 is 1fr: a video taller than head + stack puts the spare height under the
   stack (align-items: start keeps every item at its own height).
   G1v, sticky: the video is position: sticky inside its grid area (row 2 to the end of the top
   row), so it stays in view while the sections scroll and stops when its bottom meets the top
   row's bottom, before "How TripLead works" (48px under, D5's margin). top: 24px, as the about
   page's contact card (traveller.css .tl-about-contact): nothing on funnel pages is sticky or
   fixed (the slim header scrolls away), and logged-out visitors have no admin bar.
   Only in a window at least 560px tall (the 398 x 498 video + 24px above + 38px under): in a
   shorter one a stuck video would hold its own control bar below the fold for as long as the
   sections scroll, so there it stays a plain grid item and scrolls with the page.
   Why 1024, not 768: from 768 to 1023 the guide card's column is 600px, which would leave the
   text about 210px beside the video. 1024 is also where D5's steps go three across. */
.tl-guide .tl-guide__top--video > .tl-funnel-crumbs { margin: 0 0 16px; }
.tl-guide .tl-guide__top--video > .tl-guide__video { max-width: 36em; margin: 20px 0 0; } /* 36em = the intro's measure (both at .tl-guide's 15px) */
.tl-guide .tl-guide__top--video > .tl-guide__sections--stack { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.tl-guide .tl-guide__sections--stack > .tl-guide__section { max-width: 36em; }

@media (min-width: 1024px) {
	.tl-guide .tl-guide__top--video {
		display: grid;
		grid-template-columns: minmax(0, 1fr) clamp(340px, 40%, 400px);
		grid-template-rows: auto auto 1fr;
		column-gap: 48px;
		align-items: start;
	}
	.tl-guide .tl-guide__top--video > .tl-funnel-crumbs { grid-column: 1; grid-row: 1; }
	.tl-guide .tl-guide__top--video > .tl-guide__head { grid-column: 1; grid-row: 2; }
	.tl-guide .tl-guide__top--video > .tl-guide__sections--stack { grid-column: 1; grid-row: 3; gap: 32px; margin-top: 20px; }
	.tl-guide .tl-guide__top--video > .tl-guide__video { grid-column: 2; grid-row: 2 / -1; align-self: start; margin: 0; }
}
@media (min-width: 1024px) and (min-height: 560px) {
	.tl-guide .tl-guide__top--video > .tl-guide__video { position: sticky; top: 24px; }
}

/* ---- G2. The player: marketing.css M6p, same values --------------------------------------
   Frame 16px radius (14 on phones, the card radius), wash under the CSS poster (--tl-how-poster,
   set by funnel.js when the guide nears the viewport). The video's aspect-ratio and its width /
   height attributes reserve the 4:5 box before anything loads, so the poster arriving moves
   nothing. Frame line: the poster's edge is the wash, which all but vanishes on the white guide
   card (and the white phone page), so the player has a 1px --tl-line ring at every width: the
   guide's flat box treatment (the steps panel's and the related chips' 1px line; no shadow card
   in the guide) and the mock's thin grey edge. Full screen drops it (G5).
   The play button and spinner are 56px and the captions 14px at every width: M6p's phone sizes
   (the player is 345-398px wide from 1024; under 1024 it is the column capped at the intro's 36em, about 288-540px). */
.tl-guide .tl-how-player--guide {
	--tl-how-glass: rgba(255, 255, 255, 0.9);
	--tl-how-track: rgba(255, 255, 255, 0.6);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	border-radius: 16px;
	background-color: var(--tl-wash);
	background-image: var(--tl-how-poster, none);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	box-shadow: 0 0 0 1px var(--tl-line);
	-webkit-tap-highlight-color: transparent;
}
.tl-guide .tl-how-player--guide .tl-how-video {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 720 / 900;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: inherit;
	background: transparent; /* the poster shows through until the first frame */
	box-shadow: none;
	object-fit: cover;
}
.tl-guide .tl-how-player--guide.is-enhanced .tl-how-video { cursor: pointer; }
/* No JS: the <noscript> picture is the poster, laid under the video (which stays transparent and
   keeps its native controls on top). isolation on the player keeps z-index -1 inside it. */
.tl-guide .tl-how-player--guide .tl-guide__video-poster { position: absolute; z-index: -1; inset: 0; display: block; margin: 0; }
.tl-guide .tl-how-player--guide .tl-guide__video-poster-img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 0; object-fit: cover; }
/* Focus. No JS: the ring on the player (not clipped by its overflow). */
.tl-guide .tl-how-player--guide .tl-how-video:focus { outline: 0; }
.tl-guide .tl-how-player--guide:has(> .tl-how-video:focus-visible) { outline: 2px solid var(--tl-teal); outline-offset: 2px; }
/* Enhanced: no native chrome (one rule each: an unknown ::-webkit pseudo drops a whole list in Firefox). */
.tl-guide .tl-how-player--guide.is-enhanced .tl-how-video::-webkit-media-controls { display: none; }
.tl-guide .tl-how-player--guide.is-enhanced .tl-how-video::-webkit-media-controls-overlay-play-button { display: none; }
.tl-guide .tl-how-player--guide.is-enhanced .tl-how-video::-webkit-media-controls-start-playback-button { display: none; }
.tl-guide .tl-how-player--guide.is-enhanced .tl-how-video::-webkit-media-controls-panel { display: none; }
/* Captions: navy on white 90%, the site font, 14px (G2). */
.tl-guide .tl-how-player--guide .tl-how-video::cue {
	color: var(--tl-navy);
	background-color: var(--tl-how-glass);
	text-shadow: none;
	font-family: var(--tl-font);
	font-size: 14px;
	line-height: 1.4;
}
/* Once started, cues rise above the pill (12px inset + 48px pill + 4px), as on the homepage. */
.tl-guide .tl-how-player--guide.is-enhanced.is-started:not(.is-ended) .tl-how-video::-webkit-media-text-track-container { transform: translateY(-64px); }
/* No JS: Chrome's native control layer is dark grey until a frame loads; transparent shows the poster. */
.tl-guide .tl-how-player--guide:not(.is-enhanced) .tl-how-video::-webkit-media-controls { background: transparent; }
.tl-guide .tl-how-player--guide:not(.is-enhanced) :is(.tl-how-play, .tl-how-controls, .tl-how-progress, .tl-how-spinner) { display: none; }

/* Big play / replay: 56px teal circle (G2), white triangle, the pop shadow. */
.tl-guide .tl-how-player--guide .tl-how-play {
	position: absolute;
	z-index: 2;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--tl-teal);
	box-shadow: var(--tl-shadow-pop);
	color: var(--tl-white);
	line-height: 1;
	cursor: pointer;
	transform: translate(-50%, -50%);
	transition: background-color 0.15s ease;
}
.tl-guide .tl-how-player--guide .tl-how-play:is(:hover, :focus, :active) { background: var(--tl-teal-hover); color: var(--tl-white); }
.tl-guide .tl-how-player--guide .tl-how-play:focus:not(:focus-visible) { outline: 0; }
/* V2 (ux-review, 29 Oct): the button sits on the poster's saturated teal sea, where a bare teal
   ring is ~2:1 (measured median). Guide player only (the homepage M6p ring is Daniel's call): the 2px teal ring at
   a 4px offset with white on both sides (the 8px white spread fills 0-4px inside the ring and
   6-8px outside it; the outline paints over it), so the ring is teal on white both ways (4.9:1)
   whatever the poster is under it. Outline kept (not a box-shadow ring) for forced colours. */
.tl-guide .tl-how-player--guide .tl-how-play:focus-visible { outline: 2px solid var(--tl-teal); outline-offset: 4px; box-shadow: 0 0 0 8px var(--tl-white), var(--tl-shadow-pop); }
.tl-guide .tl-how-player--guide .tl-how-play svg { display: block; flex: none; width: 22px; height: 22px; margin: 0; pointer-events: none; }

/* Spinner: a white-90% disc the size of the play button, a thin teal arc turning every 0.8s. */
.tl-guide .tl-how-player--guide .tl-how-spinner {
	position: absolute;
	z-index: 3;
	top: 50%;
	left: 50%;
	display: block;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	border-radius: 50%;
	background: var(--tl-how-glass);
	box-shadow: var(--tl-shadow-card);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}
.tl-guide .tl-how-player--guide .tl-how-spinner::before {
	content: "";
	position: absolute;
	inset: 17px;
	border: 3px solid var(--tl-teal-soft);
	border-top-color: var(--tl-teal);
	border-radius: 50%;
	animation: tl-guide-video-spin 0.8s linear infinite;
}
/* = marketing.css tl-ai-spin (not loaded here). */
@keyframes tl-guide-video-spin { to { transform: rotate(360deg); } }

/* The pill (white 90%, card shadow, 12px from the corner) and the 3px progress line. */
.tl-guide .tl-how-player--guide :is(.tl-how-controls, .tl-how-progress) {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.tl-guide .tl-how-player--guide .tl-how-controls {
	position: absolute;
	z-index: 2;
	right: 12px;
	bottom: 12px;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0;
	margin: 0;
	padding: 4px;
	border-radius: 999px;
	background: var(--tl-how-glass);
	box-shadow: var(--tl-shadow-card);
}
.tl-guide .tl-how-player--guide .tl-how-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: var(--tl-navy);
	line-height: 1;
	cursor: pointer;
}
.tl-guide .tl-how-player--guide .tl-how-btn:is(:hover, :focus, :active) { background: var(--tl-teal-soft); color: var(--tl-navy); }
.tl-guide .tl-how-player--guide .tl-how-btn[aria-pressed="true"] { background: var(--tl-teal-soft); }
.tl-guide .tl-how-player--guide .tl-how-btn:focus:not(:focus-visible) { outline: 0; }
.tl-guide .tl-how-player--guide .tl-how-btn:focus:not(:focus-visible):not(:hover):not([aria-pressed="true"]) { background: transparent; }
.tl-guide .tl-how-player--guide .tl-how-btn:focus-visible { outline: 2px solid var(--tl-teal); outline-offset: 2px; box-shadow: none; }
.tl-guide .tl-how-player--guide .tl-how-btn svg { display: block; flex: none; width: 20px; height: 20px; pointer-events: none; }
.tl-guide .tl-how-player--guide .tl-how-progress {
	position: absolute;
	z-index: 1;
	right: 0;
	bottom: 0;
	left: 0;
	height: 3px;
	margin: 0;
	padding: 0;
	background: var(--tl-how-track);
	cursor: pointer;
	touch-action: none;
}
/* A 20px invisible hit band above the line (under the pill). */
.tl-guide .tl-how-player--guide .tl-how-progress::before { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 20px; }
.tl-guide .tl-how-player--guide .tl-how-progress__fill {
	position: absolute;
	inset: 0;
	background: var(--tl-teal);
	transform: scaleX(var(--tl-how-progress, 0));
	transform-origin: left center;
	pointer-events: none;
}
.tl-guide .tl-how-player--guide .tl-how-progress:focus { outline: 0; }
.tl-guide .tl-how-player--guide .tl-how-progress:focus-visible { outline: 0; box-shadow: none; }
/* A drawn ring round the hit band: an outline on the bottom edge would be clipped by the player. */
.tl-guide .tl-how-player--guide .tl-how-progress:focus-visible::after {
	content: "";
	position: absolute;
	right: 4px;
	bottom: 4px;
	left: 4px;
	height: 12px;
	border: 2px solid var(--tl-teal);
	border-radius: 6px;
	box-shadow: 0 0 0 2px var(--tl-how-glass);
	pointer-events: none;
}

/* ---- G3. States (how-video.js classes on the player) -------------------------------------- */
/* Started and not ended / errored: the big button goes; .is-error brings it back as the retry. */
.tl-guide .tl-how-player--guide.is-started:not(.is-ended):not(.is-error) .tl-how-play { display: none; }
/* Loading before the first frame: the spinner takes the button's place. */
.tl-guide .tl-how-player--guide.is-loading .tl-how-play { visibility: hidden; }
.tl-guide .tl-how-player--guide.is-enhanced.is-loading .tl-how-spinner {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.15s ease, visibility 0s;
}
/* Pill + line: shown once started (playing or paused), hidden before Play and when ended. */
.tl-guide .tl-how-player--guide.is-enhanced.is-started:not(.is-ended) :is(.tl-how-controls, .tl-how-progress) {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.2s ease, visibility 0s;
}
/* Idle while playing: fade only (Tab still reaches them; keyboard focus keeps them up). */
.tl-guide .tl-how-player--guide.is-enhanced.is-started.is-idle:not(.is-ended):not(:has(:focus-visible)) :is(.tl-how-controls, .tl-how-progress) {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
/* [hidden] must keep winning over the flex displays above; icon pairs follow the state. */
.tl-guide .tl-how-player--guide :is(.tl-how-btn, .tl-how-play) svg[hidden],
.tl-guide .tl-how-player--guide :is(.tl-how-play, .tl-how-btn)[hidden] { display: none; }
.tl-guide .tl-how-player--guide.is-playing .tl-how-icon--play,
.tl-guide .tl-how-player--guide:not(.is-playing) .tl-how-icon--pause,
.tl-guide .tl-how-player--guide.is-muted .tl-how-icon--volume,
.tl-guide .tl-how-player--guide:not(.is-muted) .tl-how-icon--muted,
.tl-guide .tl-how-player--guide.is-fullscreen .tl-how-icon--fs,
.tl-guide .tl-how-player--guide:not(.is-fullscreen) .tl-how-icon--fs-exit { display: none; }

/* ---- G4. Touch, mouse, phones, reduced motion ---------------------------------------------- */
/* Touch: the site's 44px tap target (40px holds for a mouse), as M6p. Unchanged by G4f: a coarse
   pointer keeps the full-size pill (4 x 44 + 2px padding = 180 x 48, 12px insets) at every width. */
@media (pointer: coarse) {
	.tl-guide .tl-how-player--guide .tl-how-btn { width: 44px; height: 44px; }
	.tl-guide .tl-how-player--guide .tl-how-controls { padding: 2px; }
}
/* G4f. A fine pointer (mouse / trackpad) FROM 1024 ONLY: the control bar at about 70% (Daniel, 29 Oct:
   the full-size pill covered too much of the picture). Guide player only; the homepage M6p pill
   doesn't change. Buttons 40 -> 28px, icons 20 -> 14, pill padding 4 -> 3 (118 x 34 for the four
   buttons), insets 12 -> 8 so it sits tight to the bottom-right corner, progress line 3 -> 2px and
   its hit band 20 -> 14px (still under the pill). The cues rise above the smaller pill: 8 + 34 + 4.
   Touch screens keep G4's 44px targets (pointer: coarse); pointer: none keeps the G2 sizes. The
   player's box and its 4:5 aspect are untouched. A DELIBERATE EXCEPTION to "same component, same
   look" (§9d, docs/CSS.md G4f): the bar is scaled to this player (at most 400px wide), so a
   consistency pass must not put it back to M6p's 168 x 48. Full screen (.is-fullscreen, set by
   how-video.js on fullscreenchange) is excluded by :not(.is-fullscreen), so there the bar is the
   homepage's full size again (G2: 40px buttons, 20px icons, 4px padding, 12px insets, 3px line,
   cues raised 64px; Daniel 29 Oct). Under 1024 (§9d phones, Daniel 29 Oct) the player is the column (36em cap),
   so there a mouse gets the normal G2 bar (168 x 48, the homepage's) and touch G4's 44px. */
@media (min-width: 1024px) and (pointer: fine) {
	.tl-guide .tl-how-player--guide:not(.is-fullscreen) .tl-how-controls { right: 8px; bottom: 8px; padding: 3px; }
	.tl-guide .tl-how-player--guide:not(.is-fullscreen) .tl-how-btn { width: 28px; height: 28px; }
	.tl-guide .tl-how-player--guide:not(.is-fullscreen) .tl-how-btn svg { width: 14px; height: 14px; }
	.tl-guide .tl-how-player--guide:not(.is-fullscreen) .tl-how-progress { height: 2px; }
	.tl-guide .tl-how-player--guide:not(.is-fullscreen) .tl-how-progress::before { height: 14px; }
	.tl-guide .tl-how-player--guide:not(.is-fullscreen) .tl-how-progress:focus-visible::after { right: 3px; bottom: 3px; left: 3px; height: 9px; }
	.tl-guide .tl-how-player--guide.is-enhanced.is-started:not(.is-ended):not(.is-fullscreen) .tl-how-video::-webkit-media-text-track-container { transform: translateY(-46px); }
}
/* Phones: 14px radius (the card radius). */
@media (max-width: 767px) {
	.tl-guide .tl-how-player--guide { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.tl-guide .tl-how-player--guide :is(.tl-how-controls, .tl-how-progress),
	.tl-guide .tl-how-player--guide.is-enhanced.is-started:not(.is-ended) :is(.tl-how-controls, .tl-how-progress),
	.tl-guide .tl-how-player--guide.is-enhanced.is-started.is-idle:not(.is-ended):not(:has(:focus-visible)) :is(.tl-how-controls, .tl-how-progress),
	.tl-guide .tl-how-player--guide .tl-how-play,
	.tl-guide .tl-how-player--guide .tl-how-spinner,
	.tl-guide .tl-how-player--guide.is-enhanced.is-loading .tl-how-spinner { transition: none; }
	/* A still arc: no turning, still on screen while loading. */
	.tl-guide .tl-how-player--guide .tl-how-spinner::before { animation: none; }
}

/* ---- G5. Full screen (requestFullscreen on the player; iPhone uses the video's own) --------
   The whole 4:5 frame shows (contain) on the browser's dark backdrop. Separate rules: an
   unsupported :-webkit-full-screen would drop a whole list. Last, so they beat the phone radius
   and the G2 frame line (no frame in full screen). */
.tl-guide .tl-how-player--guide.is-fullscreen { width: 100%; height: 100%; border-radius: 0; background-image: none; box-shadow: none; }
.tl-guide .tl-how-player--guide:fullscreen { width: 100%; height: 100%; border-radius: 0; background-image: none; box-shadow: none; }
.tl-guide .tl-how-player--guide:-webkit-full-screen { width: 100%; height: 100%; border-radius: 0; background-image: none; box-shadow: none; }
.tl-guide .tl-how-player--guide.is-fullscreen .tl-how-video { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; object-fit: contain; }
.tl-guide .tl-how-player--guide:fullscreen .tl-how-video { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; object-fit: contain; }
.tl-guide .tl-how-player--guide:-webkit-full-screen .tl-how-video { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; object-fit: contain; }
