/* ==========================================================================
   Primal Sports 2027: homepage sections (front-page.php only).
   Needs main.css first. Phone is the base; min-width queries only.
   ========================================================================== */

/* ---------- Hero with video background ----------------------------------- */
.hero {
	position: relative; isolation: isolate; overflow: hidden;
	display: grid; align-items: end;
	min-height: min(88svh, 760px);
	padding: 7rem 0 2.5rem;
	color: var(--white);
	background: var(--navy-deep);
}
/* Desktop: the still sits under the video. It shows before the video plays,
   under reduced motion, after an error, and when the browser blocks autoplay.
   Phones: this picture is the animated loop itself. */
.hero__poster img,
.hero__video {
	position: absolute; inset: 0; z-index: -3;
	width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%;
}
.hero__video { z-index: -2; transition: opacity 700ms var(--ease); }
.js .hero__video { opacity: 0; }
.js .hero.is-started .hero__video { opacity: 1; }
.hero.is-failed .hero__video { display: none; }
/* Phones show the animated image in .hero__poster instead of the video. */
@media (max-width: 767px) { .hero__video, .hero__toggle { display: none; } }
/* Darkening: heavier where the words sit, so the busy footage never fights the headline. */
.hero::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background:
		linear-gradient(180deg, rgba(8, 20, 52, 0.55) 0%, rgba(8, 20, 52, 0.72) 42%, rgba(8, 20, 52, 0.97) 100%);
}
.hero__inner { display: grid; gap: 1.25rem; justify-items: start; }
.hero h1 {
	color: var(--white); font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.015em; line-height: 1.02;
	text-shadow: 0 2px 24px rgba(8, 20, 52, 0.55);
}
.hero h1 span { color: var(--white); box-shadow: inset 0 -0.16em 0 var(--red); }
.hero__lead { font-size: var(--fs-lead); color: #eef2f8; max-width: 36rem; text-shadow: 0 1px 12px rgba(8, 20, 52, 0.6); }
.hero__ctas { display: grid; gap: 0.75rem; width: 100%; margin-top: 0.5rem; }

/* Pause / play: 48px, labelled, top right on phones (clear of the buttons) */
.hero__toggle {
	position: absolute; top: 1rem; right: var(--gutter); z-index: 2;
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	min-width: var(--tap); height: var(--tap); padding: 0 0.85rem;
	color: var(--white); font: 700 var(--fs-small)/1 var(--font-body);
	background: rgba(8, 20, 52, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 99px;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	cursor: pointer;
	transition: background-color var(--dur), border-color var(--dur), transform var(--dur) var(--ease);
}
.hero__toggle[hidden] { display: none; }
.hero__toggle:hover { background: rgba(8, 20, 52, 0.85); border-color: var(--white); }
.hero__toggle:active { transform: scale(0.95); }
.hero__toggle:focus-visible { outline-color: var(--white); }
.hero__toggle svg { width: 18px; height: 18px; }
.hero__toggle .icon-play { display: none; }
.hero__toggle[aria-pressed="true"] .icon-pause { display: none; }
.hero__toggle[aria-pressed="true"] .icon-play { display: block; }
.hero.is-failed .hero__toggle { display: none; }

/* ---------- Quick paths -------------------------------------------------- */
.paths { background: var(--white); border-bottom: 1px solid var(--line); }
.paths ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; }
.paths li { border-top: 1px solid var(--line); }
.paths li:nth-child(odd) { border-right: 1px solid var(--line); }
.paths a {
	display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
	min-height: 64px; padding: 0.75rem var(--gutter);
	font-weight: 700; font-size: var(--fs-small); color: var(--navy); text-decoration: none;
	transition: background-color var(--dur), color var(--dur);
}
.paths .chev {
	flex: none; display: grid; place-items: center;
	width: 30px; height: 30px; border-radius: 50%;
	border: 2px solid var(--navy);
	transition: background-color var(--dur), border-color var(--dur), transform var(--dur) var(--ease);
}
.paths .chev svg { width: 14px; height: 14px; }
.paths a:hover { background: var(--paper); color: var(--red); }
.paths a:hover .chev { background: var(--red); border-color: var(--red); color: var(--white); transform: translateX(2px); }
.paths a:active { background: var(--paper-press); }

/* ---------- Freedom Village ---------------------------------------------- */
.fv { position: relative; overflow: hidden; }
.fv::after {
	content: ""; position: absolute; right: -18%; top: -30%; width: 70%; aspect-ratio: 1;
	border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.12), transparent);
	pointer-events: none;
}
.fv__grid { position: relative; z-index: 1; display: grid; gap: 2.25rem; }
.fv__copy { display: grid; gap: 1.1rem; justify-items: start; }
.fv h2 { font-size: clamp(2.5rem, 1.8rem + 3.4vw, 4.5rem); font-weight: 800; letter-spacing: 0.01em; text-transform: uppercase; line-height: 1; }
.fv__tag { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem); color: var(--white); }
.fv__copy > p { color: #fff2f3; max-width: 38rem; }
.fv__media { margin: 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-3); border: 1px solid rgba(255, 255, 255, 0.35); }
.fv__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.fv__media figcaption { padding: 0.65rem 1rem; font-size: var(--fs-small); color: var(--navy); background: var(--white); }
.facts { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.75rem; width: 100%; }
.facts li { display: grid; gap: 0.15rem; padding: 1rem 1.15rem; background: rgba(8, 20, 52, 0.18); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--radius); }
.facts strong { font-family: var(--font-display); font-size: 1.375rem; color: var(--white); line-height: 1.2; }
.facts span { font-size: var(--fs-small); color: #ffe3e6; }

/* ---------- Stats -------------------------------------------------------- */
.stats { padding-block: clamp(3.5rem, 3rem + 3vw, 5.5rem); }
.stats__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem 1rem; }
.stat { display: grid; gap: 0.4rem; align-content: start; }
.stat__num { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-stat); color: var(--white); line-height: 1; }
/* No red text on navy: white numbers with a red bar. */
.stat__num::after { content: ""; display: block; width: 36px; height: 4px; margin-top: 0.7rem; border-radius: 2px; background: var(--red); }
.stat__label { font-size: var(--fs-small); color: var(--muted); line-height: 1.45; }

/* ---------- Programs ----------------------------------------------------- */
.programs__row {
	list-style: none; margin: 0; padding: 0 var(--gutter) 1rem;
	display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 1rem;
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
	overscroll-behavior-x: contain; scrollbar-width: thin;
}
.programs__item { display: contents; }
.program {
	position: relative; isolation: isolate; scroll-snap-align: start;
	display: flex; flex-direction: column; justify-content: flex-end;
	min-height: 25rem; padding: 1.4rem;
	color: var(--white); text-decoration: none;
	border-radius: var(--radius-lg); overflow: hidden;
	background: var(--navy); box-shadow: var(--shadow-2);
	transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.program img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.program::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 20, 52, 0.05) 20%, rgba(8, 20, 52, 0.92) 78%); }
.program--plain { background: linear-gradient(155deg, var(--navy-soft) 0%, var(--navy) 55%, var(--navy-deep) 100%); justify-content: space-between; }
.program--plain::before { background: radial-gradient(circle at 85% 12%, rgba(204, 17, 34, 0.45), transparent 55%); }
.program__icon { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: auto; border-radius: 50%; background: var(--red); color: var(--white); box-shadow: 0 12px 28px -10px rgba(204, 17, 34, 0.8); }
.program__icon svg { width: 36px; height: 36px; }
.program__num { font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.program h3 { margin: 0.35rem 0 0.5rem; color: var(--white); font-size: var(--fs-h3); }
.program p { color: #e4eaf4; font-size: var(--fs-small); line-height: 1.5; }
.program__more { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem; font-weight: 700; font-size: var(--fs-small); color: var(--white); }
.program__more svg { width: 18px; height: 18px; transition: transform var(--dur) var(--ease); }
.program:hover { transform: translateY(-6px); box-shadow: var(--shadow-3); }
.program:hover img { transform: scale(1.06); }
.program:hover .program__more svg { transform: translateX(4px); }
.program:active { transform: translateY(-2px) scale(0.99); }
.program:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.programs__hint { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; font-size: var(--fs-small); color: var(--ink-soft); }
.programs__hint svg { width: 20px; height: 20px; }
.programs__cta { margin-top: 2rem; }

/* ---------- Coming up ---------------------------------------------------- */
.events { background: var(--paper); }
.events__list { display: grid; gap: 1.5rem; }
.event {
	display: grid; overflow: hidden;
	background: var(--white);
	border: 1px solid var(--line); border-radius: var(--radius-lg);
	box-shadow: var(--shadow-2);
	transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.event:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); }
.event__media { position: relative; }
.event__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 35%; }
.event__date {
	position: absolute; left: 1rem; bottom: -1.5rem;
	display: grid; justify-items: center; gap: 0.1rem;
	min-width: 6.5rem; padding: 0.7rem 0.9rem;
	color: var(--white); background: var(--red);
	border: 4px solid var(--white); border-radius: 16px;
	box-shadow: var(--shadow-2);
	font-weight: 700; line-height: 1.05;
}
.event__date .m { font-size: var(--fs-small); letter-spacing: 0.1em; }
.event__date .d { font-family: var(--font-display); font-size: 2rem; font-weight: 800; }
.event__date .y { font-size: var(--fs-small); opacity: 0.9; }
.event__body { display: grid; gap: 0.9rem; padding: 2.75rem 1.25rem 1.5rem; }
.event__tag { justify-self: start; padding: 0.3rem 0.8rem; font-size: var(--fs-small); font-weight: 700; color: var(--red-dark); background: #fdebed; border-radius: 99px; }
.event__tag--full { color: var(--ink); background: var(--paper-press); }
.event h3 { font-size: clamp(1.625rem, 1.4rem + 1vw, 2.125rem); }
.event__meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.event__meta li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--ink); }
.event__meta svg { width: 22px; height: 22px; flex: none; margin-top: 0.2rem; color: var(--red); }
.event__actions { display: grid; gap: 0.75rem; margin-top: 0.5rem; }
.events__all {
	display: inline-flex; align-items: center; gap: 0.4rem; min-height: var(--tap); margin-top: 1.5rem;
	font-weight: 700; color: var(--navy);
	text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 5px;
	border-radius: 6px; transition: color var(--dur);
}
.events__all svg { width: 20px; height: 20px; }
.events__all:hover { color: var(--red); }
.events__all:active { color: var(--red-active); }

/* ---------- Mission ------------------------------------------------------ */
.mission__grid { display: grid; gap: 2.5rem; }
.mission__copy { display: grid; gap: 1.1rem; justify-items: start; }
.mission__copy h2 { font-size: var(--fs-h2); }
.mission__quote { font-family: var(--font-display); font-size: var(--fs-lead); font-weight: 600; color: var(--white); line-height: 1.45; padding-left: 1.1rem; border-left: 4px solid var(--red); }
/* Phone: a compact 2x2 of labels. The one-line descriptions return at 768px. */
.pillars { list-style: none; margin: 0.25rem 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; width: 100%; }
.pillars li {
	display: grid; gap: 0.6rem; align-content: start;
	padding: 0.9rem; border-radius: var(--radius);
	background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
	transition: background-color var(--dur), border-color var(--dur), transform var(--dur) var(--ease);
}
.pillars li:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); transform: translateX(3px); }
.pillars .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: var(--white); }
.pillars .ic svg { width: 22px; height: 22px; }
.pillars strong { display: block; font-family: var(--font-display); font-size: 1.1875rem; color: var(--white); }
.pillars span:not(.ic) { display: none; font-size: var(--fs-small); color: var(--muted); }
.mission__media { position: relative; margin: 0; }
.mission__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-3); }
.mission__badge {
	position: absolute; left: 1rem; right: 1rem; bottom: 1rem;
	padding: 1rem 1.1rem; border-radius: var(--radius);
	background: rgba(8, 20, 52, 0.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.18);
	font-size: var(--fs-small); color: #dce4f0; line-height: 1.5;
}
.mission__badge strong { display: block; font-family: var(--font-display); font-size: 1.1875rem; color: var(--white); }

/* ---------- CTA band ----------------------------------------------------- */
.cta { position: relative; overflow: hidden; }
.cta::before {
	content: ""; position: absolute; inset: auto -10% -60% auto; width: 80%; aspect-ratio: 1;
	border-radius: 50%; border: 60px solid rgba(255, 255, 255, 0.07); pointer-events: none;
}
.cta__inner { position: relative; display: grid; gap: 1.25rem; justify-items: start; }
.cta h2 { font-size: var(--fs-h2); }
.cta p { font-size: var(--fs-lead); color: #fff2f3; max-width: 38rem; }
.cta__actions { display: grid; gap: 0.75rem; width: 100%; margin-top: 0.5rem; }

/* ---------- 600px+ ------------------------------------------------------- */
@media (min-width: 600px) {
	.hero__ctas, .cta__actions, .event__actions { grid-template-columns: auto auto; justify-content: start; width: auto; }
	.facts { grid-template-columns: repeat(3, 1fr); }
	.programs__row { grid-auto-columns: 46%; }
	.stats__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 768px+ ------------------------------------------------------- */
@media (min-width: 768px) {
	.hero__toggle { top: auto; bottom: 1.5rem; }
	.paths ul { grid-template-columns: repeat(4, 1fr); }
	.paths li { border-top: 0; border-right: 1px solid var(--line); }
	.paths li:last-child { border-right: 0; }
	.paths a { min-height: 76px; padding-inline: 1.5rem; font-size: var(--fs-body); }
	.event { grid-template-columns: 1.05fr 1fr; }
	.event__media img { height: 100%; aspect-ratio: auto; min-height: 22rem; }
	.event__date { left: 1.25rem; bottom: 1.25rem; }
	.event__body { padding: 2.25rem; align-content: center; }
	.pillars li { grid-template-columns: 48px 1fr; gap: 0.9rem; align-items: start; padding: 1rem; }
	.pillars .ic { width: 48px; height: 48px; }
	.pillars strong { font-size: 1.25rem; }
	.pillars span:not(.ic) { display: block; }
}

/* ---------- 1024px+ ------------------------------------------------------ */
@media (min-width: 1024px) {
	.hero { min-height: min(92vh, 860px); padding: 9rem 0 5rem; align-items: center; }
	.hero::before {
		background:
			linear-gradient(270deg, rgba(8, 20, 52, 0.95) 0%, rgba(8, 20, 52, 0.84) 45%, rgba(8, 20, 52, 0.4) 80%, rgba(8, 20, 52, 0.3) 100%);
	}
	.hero__poster img, .hero__video { object-position: 30% 50%; }
	.hero__inner { padding-left: 50%; }
	.hero__inner > * { max-width: 40rem; }
	.hero__toggle { right: max(var(--gutter), calc((100% - var(--max)) / 2)); }

	.fv__grid { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 4rem; }
	.mission__grid { grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 4.5rem; }

	.programs__row {
		grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); grid-auto-columns: auto;
		overflow: visible; padding: 0; scroll-snap-type: none;
		width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto;
	}
	.program { grid-column: span 2; min-height: 26rem; }
	.programs__item:nth-child(-n+2) > .program { grid-column: span 3; min-height: 30rem; }
	.programs__hint { display: none; }
	.cta__inner { grid-template-columns: 1fr auto; align-items: center; gap: 2.5rem; }
	.cta__actions { grid-row: span 2; grid-column: 2; }
}
