/*
 * GTFB — Home hero (gtfb-hero.php)
 *
 * Two units, both from the hero's width (it is a size container):
 *
 *   --v  one pixel of the handoff's 1920 × 800 canvas. The box's proportions,
 *        the figures and the glow are drawn in it, so the picture scales with
 *        the window as designed — up to a height of 650px, reached at 1560px
 *        wide. Past that the box only gets wider, and --v stops growing with
 *        it, so the figures stay the size of the box they stand in.
 *   --u  one pixel of the content column. The text and the controls sit in
 *        the same column as the header and the rest of the page — Divi's rows,
 *        80% of the width up to 1080px — and are sized in it: at full size
 *        --u is 1px, below 1350px it shrinks with the column.
 *
 * Floors (max(…px, …)) keep text and buttons usable on a small laptop; the
 * 12:5 box grows rather than clip if they need the room.
 *
 * Every rule starts with .gtfb-hero, one class more than Divi's own element
 * rules (h1, p, a, button), which would otherwise win.
 */

.gtfb-hero {
	--v: min(calc(100cqw / 1920), calc(650px / 800));
	--u: min(calc(80cqw / 1080), 1px);
	--col: min(80cqw, 1080px);
	--pad-x: calc((100cqw - var(--col)) / 2);
	--ink: #0b0b0c;
	--paper: #e9e6df;
	--text: #fff;
	--blue: #0041fa; /* the festival's brand blue */
	--font: 'Montserrat', Helvetica, Arial, Lucida, sans-serif;
	/* The controls' row: offset from the bottom, and its height. */
	--nav-bottom: max(20px, calc(48 * var(--v)));
	--nav-size: max(44px, calc(48 * var(--u)));
	--nav-room: calc(var(--nav-bottom) + var(--nav-size) + max(16px, calc(24 * var(--u))));

	container-type: inline-size;
	position: relative;
	overflow: hidden;
	background: var(--ink);
	color: var(--text);
	font-family: var(--font);
}

.gtfb-hero *,
.gtfb-hero *::before,
.gtfb-hero *::after {
	box-sizing: border-box;
}

.gtfb-hero__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---- Slides: stacked in one grid cell, crossfading ---------------------- */

.gtfb-hero .gtfb-hero__slides {
	display: grid;
	/* 12:5 up to 650px tall. A min-height rather than aspect-ratio with a
	   max-height: that pair also caps the width (650 × 12/5), and the box
	   stopped at 1560px wide. */
	min-height: min(calc(100cqw * 5 / 12), 650px);
}

.gtfb-hero .gtfb-hero__slide {
	grid-area: 1 / 1;
	position: relative;
	/* clip, not hidden: a slide that is a scroll container would have no
	   minimum height, and the 12:5 box would cut its text off instead of
	   growing to fit it. hidden stays as the fallback for older Safari. */
	overflow: hidden;
	overflow: clip;
	display: flex;
	align-items: center;
	padding: var(--nav-room) var(--pad-x);
	background: var(--ink);
	color: var(--text);
	--focus: var(--text);
	opacity: 0;
	visibility: hidden;
	/* Visibility flips after the fade, so the outgoing slide stays visible
	   while it fades, and is out of the tab order and the a11y tree after. */
	transition: opacity 900ms ease, visibility 0s linear 900ms;
}

.gtfb-hero .gtfb-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 900ms ease, visibility 0s;
}

.gtfb-hero .gtfb-hero__slide[data-tone="light"] {
	background: var(--paper);
	color: var(--ink);
	--focus: var(--ink);
}

.gtfb-hero .gtfb-hero__figure {
	position: absolute;
	width: auto;
	max-width: none;
	pointer-events: none;
}

.gtfb-hero .gtfb-hero__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: calc(28 * var(--u));
}

/* ---- Type --------------------------------------------------------------- */

.gtfb-hero .gtfb-hero__eyebrow {
	display: flex;
	align-items: center;
	gap: calc(14 * var(--u));
	margin: 0;
	padding: 0;
	font-size: max(13px, calc(16 * var(--u)));
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: inherit;
}

.gtfb-hero .gtfb-hero__dot {
	flex: none;
	width: max(9px, calc(11 * var(--u)));
	height: max(9px, calc(11 * var(--u)));
	border-radius: 50%;
	background: var(--blue);
}

.gtfb-hero .gtfb-hero__title {
	margin: 0;
	padding: 0;
	font-family: var(--font);
	font-size: calc(72 * var(--u));
	font-weight: 800;
	line-height: 0.98;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: inherit;
}

.gtfb-hero .gtfb-hero__meta,
.gtfb-hero .gtfb-hero__text {
	margin: 0;
	padding: 0;
	font-size: max(16px, calc(22 * var(--u)));
	font-weight: 400;
	line-height: 1.4;
	color: inherit;
}

.gtfb-hero .gtfb-hero__meta {
	display: flex;
	flex-direction: column;
	gap: calc(4 * var(--u));
}

.gtfb-hero .gtfb-hero__meta strong {
	font-weight: 600;
}

/* ---- Buttons: pills, like the site's other buttons ----------------------- */

.gtfb-hero .gtfb-hero__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: max(12px, calc(14 * var(--u)));
	margin: calc(6 * var(--u)) 0 0;
	padding: 0;
}

.gtfb-hero .gtfb-hero__button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: max(12px, calc(18 * var(--u))) max(22px, calc(32 * var(--u)));
	border: 2px solid transparent;
	border-radius: 999px;
	font-size: max(14px, calc(16 * var(--u)));
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.gtfb-hero .gtfb-hero__button--primary {
	background: var(--blue);
	border-color: var(--blue);
	color: #fff;
}

.gtfb-hero .gtfb-hero__button--secondary {
	background: transparent;
	border-color: var(--text);
	color: var(--text);
}

.gtfb-hero .gtfb-hero__button:hover {
	background: var(--text);
	border-color: var(--text);
	color: var(--ink);
}

.gtfb-hero a:focus-visible,
.gtfb-hero button:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
}

/* ---- Slide 1: tickets --------------------------------------------------- */

.gtfb-hero .gtfb-hero__slide--tickets .gtfb-hero__figure {
	right: calc(120 * var(--v));
	top: calc(-40 * var(--v));
	height: calc(900 * var(--v));
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 80%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 80%, transparent 100%);
}

.gtfb-hero .gtfb-hero__slide--tickets::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 60% 90% at 72% 50%, rgba(0, 65, 250, 0.28), transparent 70%);
	pointer-events: none;
}

.gtfb-hero .gtfb-hero__slide--tickets .gtfb-hero__body {
	width: calc(680 * var(--u));
	min-width: min(100%, 400px);
}

/* ---- Slide 2: accessibility --------------------------------------------- */

/* Centred above the controls rather than in the whole height, as designed. */
.gtfb-hero .gtfb-hero__slide--access {
	justify-content: space-between;
	gap: calc(72 * var(--u));
	padding-top: 24px;
}

.gtfb-hero .gtfb-hero__slide--access .gtfb-hero__eyebrow {
	color: var(--blue);
}

.gtfb-hero .gtfb-hero__slide--access .gtfb-hero__body {
	flex: 0 1 calc(560 * var(--u));
	gap: calc(24 * var(--u));
}

.gtfb-hero .gtfb-hero__slide--access .gtfb-hero__title {
	font-size: calc(54 * var(--u));
}

.gtfb-hero .gtfb-hero__slide--access .gtfb-hero__text {
	font-size: max(16px, calc(20 * var(--u)));
	text-wrap: pretty;
}

.gtfb-hero .gtfb-hero__list {
	flex: 0 1 calc(448 * var(--u));
	margin: 0;
	padding: 0;
	border-bottom: 2px solid var(--ink);
}

/* Service and value on one line, the plays that offer it under the service. */
.gtfb-hero .gtfb-hero__row {
	display: grid;
	grid-template-columns: 1fr auto;
	column-gap: 1em;
	align-items: baseline;
	padding: calc(14 * var(--u)) 0;
	border-top: 2px solid var(--ink);
	font-size: max(15px, calc(19 * var(--u)));
	line-height: 1.35;
}

.gtfb-hero .gtfb-hero__row dt,
.gtfb-hero .gtfb-hero__row dd {
	margin: 0;
	padding: 0;
}

.gtfb-hero .gtfb-hero__row dt {
	grid-area: 1 / 1;
	font-weight: 600;
}

.gtfb-hero .gtfb-hero__row .gtfb-hero__value {
	grid-area: 1 / 2;
}

.gtfb-hero .gtfb-hero__row .gtfb-hero__plays {
	grid-area: 2 / 1 / 3 / 3;
	margin-top: calc(2 * var(--u));
	font-size: max(13px, calc(15 * var(--u)));
	color: #4a4842;
}

.gtfb-hero .gtfb-hero__plays a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color 0.2s ease;
}

.gtfb-hero .gtfb-hero__plays a:hover {
	color: var(--blue);
}

/* ---- Slide 3: welcome --------------------------------------------------- */

.gtfb-hero .gtfb-hero__slide--welcome {
	justify-content: center;
	text-align: center;
}

.gtfb-hero .gtfb-hero__slide--welcome .gtfb-hero__figure {
	left: 50%;
	top: calc(-160 * var(--v));
	height: calc(1240 * var(--v));
	transform: translateX(-50%);
	opacity: 0.55;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent);
}

.gtfb-hero .gtfb-hero__slide--welcome .gtfb-hero__body {
	align-items: center;
	max-width: var(--col);
}

.gtfb-hero .gtfb-hero__slide--welcome .gtfb-hero__title {
	font-size: calc(78 * var(--u));
}

.gtfb-hero .gtfb-hero__slide--welcome .gtfb-hero__buttons {
	justify-content: center;
}

/* ---- Controls ----------------------------------------------------------- */

.gtfb-hero .gtfb-hero__nav {
	--nav-on: var(--blue);
	--nav-off: rgba(255, 255, 255, 0.3);
	--nav-fg: #fff;
	--focus: var(--nav-fg);
	position: absolute;
	z-index: 2;
	left: var(--pad-x);
	right: var(--pad-x);
	bottom: var(--nav-bottom);
	display: flex;
	align-items: center;
	gap: max(8px, calc(10 * var(--u)));
}

.gtfb-hero .gtfb-hero__nav[hidden] {
	display: none;
}

.gtfb-hero[data-tone="light"] .gtfb-hero__nav {
	--nav-off: rgba(11, 11, 12, 0.25);
	--nav-fg: var(--ink);
}

.gtfb-hero .gtfb-hero__dots {
	display: flex;
	gap: max(8px, calc(10 * var(--u)));
	margin-right: auto;
}

.gtfb-hero .gtfb-hero__dot-button {
	display: flex;
	align-items: center;
	width: max(40px, calc(52 * var(--u)));
	height: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: pointer;
}

.gtfb-hero .gtfb-hero__dot-button span {
	display: block;
	width: 100%;
	height: 4px;
	background: var(--nav-off);
	transition: background-color 0.3s ease;
}

.gtfb-hero .gtfb-hero__dot-button[aria-current="true"] span {
	background: var(--nav-on);
}

.gtfb-hero .gtfb-hero__control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--nav-size);
	height: var(--nav-size);
	margin: 0;
	padding: 0;
	border: 2px solid var(--nav-fg);
	border-radius: 0;
	background: transparent;
	color: var(--nav-fg);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.3s ease;
}

.gtfb-hero .gtfb-hero__control:hover {
	background: var(--nav-fg);
	color: var(--ink);
}

.gtfb-hero[data-tone="light"] .gtfb-hero__control:hover {
	color: var(--paper);
}

.gtfb-hero .gtfb-hero__control svg {
	width: max(18px, calc(22 * var(--u)));
	height: max(18px, calc(22 * var(--u)));
}

.gtfb-hero .gtfb-hero__icon-play,
.gtfb-hero.is-paused .gtfb-hero__icon-pause {
	display: none;
}

.gtfb-hero.is-paused .gtfb-hero__icon-play {
	display: block;
}

/* ---- Phones and small tablets: stacked ---------------------------------- */

@media (max-width: 980px) {
	.gtfb-hero {
		--nav-bottom: 24px;
		--nav-size: 44px;
		--nav-room: calc(24px + 44px + 32px);
	}

	.gtfb-hero .gtfb-hero__slides {
		min-height: 0;
	}

	.gtfb-hero .gtfb-hero__slide {
		align-items: flex-end;
		padding: 48px var(--pad-x) var(--nav-room);
	}

	.gtfb-hero .gtfb-hero__body {
		gap: 20px;
	}

	.gtfb-hero .gtfb-hero__eyebrow {
		gap: 12px;
	}

	/* The column is 80cqw; the longest title line is about 10.5em. */
	.gtfb-hero .gtfb-hero__title {
		font-size: clamp(26px, 7.4cqw, 60px);
	}

	.gtfb-hero .gtfb-hero__buttons {
		margin-top: 4px;
	}

	/* Slide 1: the figure on top, the text over a fade to black below it. */
	.gtfb-hero .gtfb-hero__slide--tickets {
		padding-top: min(72cqw, 480px);
	}

	.gtfb-hero .gtfb-hero__slide--tickets .gtfb-hero__figure {
		right: 50%;
		top: -2cqw;
		height: min(100cqw, 640px);
		transform: translateX(50%);
		-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 25%, #000 75%, transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0%, #000 25%, #000 75%, transparent 100%);
	}

	.gtfb-hero .gtfb-hero__slide--tickets::before {
		background:
			linear-gradient(to bottom, transparent 0, transparent min(42cqw, 300px), var(--ink) min(78cqw, 520px)),
			radial-gradient(ellipse 90% 50% at 50% 25%, rgba(0, 65, 250, 0.28), transparent 70%);
	}

	.gtfb-hero .gtfb-hero__slide--tickets .gtfb-hero__body {
		width: 100%;
		min-width: 0;
	}

	/* Slide 2: the paragraph, then the list. */
	.gtfb-hero .gtfb-hero__slide--access {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-end;
		gap: 32px;
	}

	.gtfb-hero .gtfb-hero__slide--access .gtfb-hero__body {
		flex: none;
		gap: 20px;
	}

	.gtfb-hero .gtfb-hero__slide--access .gtfb-hero__title {
		font-size: clamp(24px, 6.8cqw, 52px);
	}

	.gtfb-hero .gtfb-hero__slide--access .gtfb-hero__text {
		max-width: 40em;
	}

	.gtfb-hero .gtfb-hero__list {
		flex: none;
	}

	.gtfb-hero .gtfb-hero__row {
		padding: 12px 0;
	}

	/* Slide 3: the figure behind, the text centred. */
	.gtfb-hero .gtfb-hero__slide--welcome {
		align-items: center;
	}

	.gtfb-hero .gtfb-hero__slide--welcome .gtfb-hero__figure {
		top: 0;
		height: 100%;
		opacity: 0.45;
	}

	.gtfb-hero .gtfb-hero__slide--welcome .gtfb-hero__title {
		font-size: clamp(22px, 6cqw, 52px);
	}
}

/* Phones: the text centred, as slide 3 already is. The list stays a table —
   it spans the column, so it is centred already, and its two columns read
   as label and value. */
@media (max-width: 767px) {
	.gtfb-hero .gtfb-hero__body {
		align-items: center;
		text-align: center;
	}

	.gtfb-hero .gtfb-hero__eyebrow,
	.gtfb-hero .gtfb-hero__buttons {
		justify-content: center;
	}

	.gtfb-hero .gtfb-hero__meta {
		align-items: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gtfb-hero .gtfb-hero__slide,
	.gtfb-hero .gtfb-hero__slide.is-active {
		transition: none;
	}
}
