/*
 * YouTube Funnel — template shell
 * Loaded only on page-templates/youtube-funnel.php (see inc/enqueue.php),
 * after css/reset.css. Vanilla CSS, mobile-first, 10px rem base.
 *
 * Holds: design tokens, the centered page container, the minimal nav/footer,
 * and the desktop-only static promo rail. Each yt-* block ships its own CSS.
 */

.ytf-page {
	/* Palette */
	--ytf-black: #141414;
	--ytf-orange: #fe6c3b;
	--ytf-navy: #0e2c47;
	--ytf-cream: #f6f3ee;
	--ytf-ink-muted: #4a4a4a;
	--ytf-line: #ececec;

	/* Layout */
	--ytf-max: 144rem;          /* 1440px content cap */
	--ytf-pad: 2.2rem;          /* mobile gutter (Figma 22px) */
	--ytf-rail-w: 28.4rem;      /* 284px static rail */
	--ytf-rail-gap: 12.1rem;    /* 121px gap between main content and rail */
	--ytf-section-gap: 6rem;    /* vertical rhythm between blocks (mobile) */

	background: #fff;
	color: var(--ytf-black);
	font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Shared button ─────────────────────────────────────────── */
.yt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	height: 4rem;
	padding: 0 1.8rem;
	border-radius: 0.6rem;
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 200ms ease;
}

/* Trailing arrow icon (img/icons/arrow-btn.svg), tinted to the button text
   color via mask. Hidden when .yt-btn--no-arrow is set. */
.yt-btn::after {
	content: "";
	flex: 0 0 auto;
	width: 1.5rem;
	height: 1.4rem;
	background-color: currentColor;
	-webkit-mask: url("../img/icons/arrow-btn.svg") no-repeat center / contain;
	mask: url("../img/icons/arrow-btn.svg") no-repeat center / contain;
}

.yt-btn--no-arrow::after {
	content: none;
}

.yt-btn--primary {
	background: var(--ytf-orange);
}

.yt-btn--primary:hover,
.yt-btn--primary:focus-visible {
	background: #e85a2b;
	color: #fff;
}

.yt-btn--navy {
	background: var(--ytf-navy);
}

.yt-btn--navy:hover,
.yt-btn--navy:focus-visible {
	background: #1a3a59;
	color: #fff;
}

/* ── Shared section title ──────────────────────────────────── */
.yt-section-title {
	font-weight: 600;
	font-size: 2.4rem;
	line-height: 1.2;
	letter-spacing: -0.072rem;
	color: var(--ytf-black);
}

@media screen and (min-width: 1024px) {
	.yt-section-title {
		font-size: 4.2rem;
		line-height: 4.8rem;
		letter-spacing: -0.126rem;
	}
}

/* ── Minimal nav ───────────────────────────────────────────── */
.ytf-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 5.9rem;
	background: #fff;
	border-bottom: 1px solid var(--ytf-line);
}

.ytf-nav__logo {
	display: inline-flex;
}

.ytf-nav__logo img {
	display: block;
	width: auto;
	height: 1.8rem;
}

/* ── Page container ────────────────────────────────────────── */
.ytf__inner {
	position: relative;
	max-width: var(--ytf-max);
	margin: 0 auto;
	padding-inline: var(--ytf-pad);
}

.ytf {
	/* Contain full-bleed section bands without spawning a horizontal scrollbar. */
	overflow-x: clip;
	/* Light-blue wash behind the top region, fading to white by the hero card. */
	background-color: #fff;
	background-image: linear-gradient(180deg, #cfeafa 0, rgba(207, 234, 250, 0) 38rem);
	background-repeat: no-repeat;
}

.ytf__main {
	display: flow-root;
}

/* Vertical rhythm between stacked blocks. */
.ytf__main > * + * {
	margin-top: var(--ytf-section-gap);
}

/* ── Mobile end-of-content banner (hidden on desktop; rail used instead) ── */
.ytf-mobile-banner {
	position: relative;
	width: 100%;
	min-width: 30rem;
	max-width: 40rem;
	margin-inline: auto;
	aspect-ratio: 1 / 1; /* reserved box (prevents CLS); JS sets the exact ratio */
	overflow: hidden;
	border-radius: 1.2rem;
	background: #eef1f4;
}

.ytf-mobile-banner::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, #e9edf1 25%, #f6f8fa 50%, #e9edf1 75%);
	background-size: 200% 100%;
	animation: ytf-rail-shimmer 1.5s linear infinite;
}

.ytf-mobile-banner .banner-injection,
.ytf-mobile-banner img,
.ytf-mobile-banner iframe {
	position: relative;
	z-index: 1;
	max-width: 100%;
	height: auto;
}

/* ── Static promo rail (desktop only) ──────────────────────── */
.ytf-rail {
	display: none;
}

/* ── Footer (minimal — template ships no chrome) ───────────── */

/* ── Desktop ───────────────────────────────────────────────── */
@media screen and (min-width: 768px) {
	.ytf-page {
		--ytf-pad: 4rem;
		--ytf-section-gap: 8rem;
	}
}

@media screen and (min-width: 1024px) {
	.ytf-nav {
		height: 7rem;
	}

	.ytf-nav__logo img {
		height: 2.4rem;
	}
}

@media screen and (min-width: 1200px) {
	/* Desktop uses the rail, not the in-content mobile banner. */
	.ytf-mobile-banner {
		display: none;
	}

	/* Keep the top-region blocks clear of the floating rail. The hero is full
	   width (its eyebrow spans the page); only the hero CARD is constrained
	   (see yt-hero/style.css). */
	.ytf__main > .yt-content-cards,
	.ytf__main > .yt-topics {
		max-width: calc(100% - var(--ytf-rail-w) - var(--ytf-rail-gap));
	}

	.ytf-rail {
		position: absolute;
		/* Start beside the hero card, below the full-width eyebrow. */
		top: 26rem;
		right: var(--ytf-pad);
		display: flex;
		flex-direction: column;
		gap: 5rem;
		width: var(--ytf-rail-w);
	}

	/* Slots reserve the 284x568 banner box (prevents CLS) and show a loading
	   skeleton until WisePops paints the creative over it. */
	.ytf-rail__slot {
		position: relative;
		min-width: 28.4rem;
		min-height: 56.8rem;
		overflow: hidden;
		border-radius: 1.2rem;
		background: #eef1f4;
	}

	.ytf-rail__slot::before {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(100deg, #e9edf1 25%, #f6f8fa 50%, #e9edf1 75%);
		background-size: 200% 100%;
		animation: ytf-rail-shimmer 1.5s linear infinite;
	}

	.ytf-rail__slot .banner-injection,
	.ytf-rail__slot img,
	.ytf-rail__slot iframe {
		position: relative;
		z-index: 1;
		max-width: 100%;
		height: auto;
	}
}

/* Rail loading skeleton (auto-disabled under prefers-reduced-motion by reset.css). */
@keyframes ytf-rail-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}
