/**
 * Styling for the ticket page's Elementor sections.
 *
 * The layout and the content are Elementor's — the client edits every
 * heading, image and column in the editor. The *look* is here, attached to
 * the CSS classes the sections carry, so a design change is a file change
 * and not forty clicks in a panel.
 *
 * Same two rules as shop.css: never rem (Twenty Twenty sets the root font
 * size to 62.5%), and set line-height explicitly wherever text lands,
 * because the kit's global value is `1px`.
 */

:root {
	/**
	 * The palette. Violet is the logo's own colour — #5D317B, read straight
	 * out of Ayurveda-Festival-Logo-outlines_violet.png — and the two dark
	 * shades are that same hue taken down to the exact contrast ratios the
	 * greens they replace had against cream (11.6:1 and 14.5:1). Matching
	 * the ratio rather than the lightness is the whole trick: violet carries
	 * far less luminance than green at equal lightness, so a straight
	 * hue swap would have quietly darkened every band on the page.
	 */
	--fs-violet-brand: #5D317B;
	--fs-violet: #431F5C;
	--fs-violet-deep: #2D133E;
	--fs-violet-night: #1A0C23;

	--fs-cream: #F4F0E7;
	--fs-sand: #E6E0D5;
	--fs-flame: #FB4F1E;

	/**
	 * One rounding scale, because "rounder" has to stay proportional: a
	 * 24px radius on a 420px tile and on a 32px pill are not the same
	 * gesture. Media sits a step tighter than the card it lives in, which
	 * is what keeps a rounded image inside a rounded card from reading as
	 * two competing curves.
	 */
	--fs-round-tile: 40px;
	--fs-round-card: 36px;
	--fs-round-media: 28px;
	--fs-round-inset: 20px;
	--fs-round-pill: 999px;
}

.festival-section,
.festival-hero {
	line-height: 1.5;
	letter-spacing: normal;
	font-weight: 400;
}

/* ---------------- hero ---------------- */

.festival-hero {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

/**
 * The wash over the hero photograph.
 *
 * `::before` has two jobs:
 *
 *  1. Darken the photograph so the cream type and the sun read over it.
 *  2. Hide the burnt-in watermarks along the photo's bottom edge. The 32%
 *     background origin crops them out on a landscape viewport, but a
 *     portrait one has no vertical overflow to crop, so on a phone this
 *     gradient is the only thing covering them — hence how heavy it is at
 *     the bottom, and why that is not negotiable.
 *
 * Deliberately NEUTRAL rather than violet: a purple film over a photograph
 * tints every skin tone in it, which was the "too purple" note.
 *
 * `::after` is the logo's sun. Both are CSS only, so the hero is whole with
 * no JavaScript.
 */
.festival-hero::before,
.festival-hero::after {
	content: '';
	position: absolute;
	pointer-events: none;
	z-index: 0;
}

.festival-hero::before {
	inset: 0;
	/**
	 * The concept filtered the photograph itself —
	 * `saturate(0.55) contrast(1.05) brightness(0.62)` — and gradients
	 * alone could not reproduce that: the first attempt left the hero far
	 * too bright, the headline fighting a lit wooden floor.
	 *
	 * `backdrop-filter` here does what the concept's `filter` did, because
	 * this element's backdrop *is* the section's background image. It
	 * cannot touch the type: it paints in the container
	 * above this pseudo-element, not below it.
	 *
	 * The gradients below are not a fallback for it — they are still doing
	 * the vignette and the watermark cover — but a browser without
	 * backdrop-filter gets a darkened, legible hero from them alone.
	 */
	backdrop-filter: saturate(0.6) contrast(1.05) brightness(0.66);
	-webkit-backdrop-filter: saturate(0.6) contrast(1.05) brightness(0.66);
	background:
		/* A flat base, standing in for the concept's brightness(). */
		linear-gradient(rgba(17, 15, 15, 0.42), rgba(17, 15, 15, 0.42)),
		/* Vignette: keeps the middle open for the sun and the type. */
		radial-gradient(82% 62% at 50% 36%, transparent 30%, rgba(18, 16, 16, 0.8) 100%),
		/* Top band for the header, and the heavy foot that covers the
		   watermarks and seats the headline. */
		linear-gradient(180deg,
			rgba(18, 16, 16, 0.5) 0%,
			rgba(18, 16, 16, 0.22) 28%,
			rgba(16, 14, 14, 0.82) 70%,
			rgba(13, 11, 11, 0.96) 100%);
	transition: opacity 1.2s ease;
}

.festival-hero::after {
	/* The logo's sun, breathing around the edition's name (--fc-breathe in
	   site.css). Centred with margins rather than a transform, because the
	   animation owns `scale` and `rotate`. Faint, so the cream headline
	   across it keeps its contrast. */
	--sun: min(86vh, 78vw, 860px);
	top: 50%;
	left: 50%;
	width: var(--sun);
	aspect-ratio: 1;
	margin: calc(var(--sun) / -2) 0 0 calc(var(--sun) / -2);
	background: url(/wp-content/uploads/2022/12/Stern.png) center / contain no-repeat;
	opacity: 0.3;
	animation: var(--fc-breathe);
}

.festival-hero > .elementor-container {
	position: relative;
	z-index: 1;
}

/* Measured, so a long headline stays inside the sun rather than running
   the full width of the band. */
.festival-hero__title .elementor-heading-title {
	max-width: 26ch;
	margin-inline: auto;
}

.festival-hero__title em {
	font-style: italic;
	color: #fb4f1e;
}

/* Centred under a centred headline, and still measured: 46ch is the line
   length, `auto` is what puts it in the middle of the band. */
.festival-hero__lede p {
	max-width: 52ch;
	margin-inline: auto;
}

/* 8px was right under a 128px claim with a 0.86 line-height, where the
   headline's own leading did half the work. The sentence that replaced it
   sits on a 1.04 line-height and its cap-line came up against the date. */
.festival-hero__meta {
	margin-bottom: 18px;
	justify-content: center;
}

/**
 * The hero's foot is a stack now — lede, then buttons, both centred.
 *
 * The layout says two columns at 100% each, which ought to be enough. It
 * is not: Elementor renders an inner section's container with
 * `flex-wrap: nowrap`, so two full-width columns share one line and shrink
 * to half each instead of wrapping. That is why the lede and the buttons
 * stayed side by side after the layout changed.
 */
.festival-hero__foot > .elementor-container {
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.festival-hero__foot > .elementor-container > .elementor-column {
	width: 100%;
}

/* Two buttons on one line, which Elementor's stacked widget column will
   not do on its own — centred, like everything else in this hero. */
.festival-actions > .elementor-widget-wrap {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	align-content: flex-end;
	justify-content: center;
	gap: 12px;
}

.festival-actions > .elementor-widget-wrap > .elementor-widget {
	width: auto;
	margin-bottom: 0;
}

@media (max-width: 767px) {
	.festival-actions > .elementor-widget-wrap > .elementor-widget,
	.festival-actions .elementor-button {
		width: 100%;
	}
}

/* ---------------- marquee ---------------- */

.festival-marquee {
	overflow: hidden;
}

.festival-marquee .festival-marquee__track {
	white-space: nowrap;
	will-change: transform;
	/**
	 * `max-content` is load-bearing, not tidying. The track is an Elementor
	 * widget wrapper, so by default it is a block at the container's width
	 * (~1140px) with the text overflowing it. `translateX(-50%)` would then
	 * be half the *container*, not half the *track* — so the loop would
	 * jump instead of meeting itself. Shrink-wrapping the element to its
	 * two runs of words is what makes -50% mean exactly one run.
	 */
	width: max-content;
}

/**
 * A constant, slow loop — explicitly NOT scroll-driven any more.
 *
 * It used to run on `animation-timeline: view()`, which ties the band's
 * position to the scroll position. That is the version that makes people
 * queasy: the movement inherits the *velocity* of the scroll, so a flick of
 * the wheel throws the text sideways, and two people on the same page never
 * see the same motion. Decoupling it from scroll is the fix — a steady
 * ~30px/s drift is calm, predictable, and reads as a ticker rather than as
 * the page reacting to you.
 *
 * Seamless because the track holds the same run of words twice, so -50% is
 * exactly one run; see marquee() in build-tickets-page.py.
 */
.festival-marquee .festival-marquee__track {
	animation: festival-marquee 45s linear infinite;
}

@keyframes festival-marquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

/* WCAG 2.2.2: moving content that starts on its own needs a way to stop.
   Hovering or tabbing to the band pauses it, which also just lets someone
   read the thing. */
.festival-marquee:hover .festival-marquee__track,
.festival-marquee:focus-within .festival-marquee__track {
	animation-play-state: paused;
}

/* ---------------- inclusion tiles ---------------- */

/* Elementor's column gap on this section computes to 0, so the four tiles
   were touching edge to edge. The gutter goes on the column, not the card,
   so the cards keep their full width and the rounding is unaffected. */
.festival-include {
	padding-inline: 12px;
}

@media (max-width: 1024px) {
	.festival-include {
		padding-inline: 0;
		margin-bottom: 24px;
	}
}

.festival-include > .elementor-widget-wrap {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	/* Title and copy were sitting flush against each other. */
	gap: 10px;
	min-height: 420px;
	/* NOTE: the padding is NOT set here. Elementor generates column padding
	   at a specificity this selector cannot reach, so any value here loses
	   to its 5px default without any warning. It is set on the column in
	   build-tickets-page.py instead (32px, clearing the 28px radius so copy
	   does not run into the corner's curve). Do not "restore" it here. */
	border-radius: var(--fs-round-tile);
	overflow: hidden;
	background-size: cover;
	background-position: center;
	transition: background-size 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.festival-include > .elementor-widget-wrap::before {
	content: '';
	position: absolute;
	inset: 0;
	/**
	 * Neutral, not violet. A purple scrim over a photograph tints every
	 * skin tone and every green in it, which is what made the page read as
	 * "too purple" — the solid violet surfaces were never the problem, the
	 * translucent ones over imagery were. #141212 is the same luminance as
	 * the violet it replaces (16.4:1 against cream, was 16.5:1), so the
	 * captions are exactly as legible and only the colour cast is gone.
	 */
	background: linear-gradient(180deg, transparent 35%, rgba(20, 18, 18, 0.9) 100%);
}

/* Event tiles carry four lines over the photograph, so the shade starts higher. */
.festival-events .festival-include > .elementor-widget-wrap::before {
	background: linear-gradient(180deg, transparent 12%, rgba(20, 18, 18, 0.62) 42%, rgba(20, 18, 18, 0.92) 100%);
}

/*
 * Each tile sits in an inner section under its month, so the row no longer
 * stretches it. Carry the height down so a tile with a longer name does not
 * leave its neighbours shorter on tablets.
 */
.festival-events.elementor-section > .elementor-container > .elementor-column > .elementor-widget-wrap {
	flex-direction: column;
	flex-wrap: nowrap;
}

.festival-events .elementor-inner-section {
	display: flex;
	flex: 1;
}

.festival-events .elementor-inner-section > .elementor-container {
	flex: 1;
	min-width: 0;
}

/* The tile's own gutter moves out to the column, so the month lines up with it. */
.festival-events .festival-include {
	padding-inline: 0;
}

@media (min-width: 1025px) {
	.festival-events .festival-event {
		padding-inline: 7px;
	}
}

.festival-include > .elementor-widget-wrap > .elementor-widget {
	position: relative;
	z-index: 1;
}

.festival-include:hover > .elementor-widget-wrap {
	background-size: 112%;
}

@media (max-width: 1024px) {
	.festival-include > .elementor-widget-wrap {
		min-height: 320px;
	}
}

/* ---------------- section openers ---------------- */

.festival-head__lede > .elementor-widget-wrap {
	justify-content: flex-end;
}

.festival-head__lede p {
	margin: 0;
}

/* ---------------- add-on cards ---------------- */

/**
 * The card itself.
 *
 * The selector is long for one reason, and it is not style. Elementor's
 * column-gap rule is
 *
 *   .elementor-column-gap-narrow > .elementor-container > .elementor-column
 *     > .elementor-element-populated { padding: 5px }
 *
 * — four classes, against the two this rule used to have, so it won, and
 * these cards shipped with their type five pixels from their own border and
 * no gutter at all between them. Five classes beats four without reaching
 * for `!important`. If this ever stops working, check that number first.
 */
.festival-addons > .elementor-container > .festival-addon > .elementor-widget-wrap.elementor-element-populated {
	gap: 14px;
	padding: clamp(24px, 3vw, 36px);
	border: 1px solid #d9d1c1;
	border-radius: var(--fs-round-card);
	background: #f4f0e7;
	align-content: start;
}

/**
 * The gutter between the cards, on the column rather than on the card: the
 * card carries the border and the background, so any space put on it lands
 * inside the border instead of between the cards. Equal on all three so the
 * cards stay the same width — the outer two give up 12px of a band that has
 * 50px of its own side padding to spare.
 */
.festival-addons > .elementor-container > .festival-addon {
	padding-inline: 12px;
}

@media (max-width: 767px) {
	/* Stacked now, so the gutter changes axis — and the card needs holding
	   off the edge of the screen, which a bordered box on a full-bleed band
	   does not do by itself. */
	.festival-addons > .elementor-container > .festival-addon {
		padding-inline: 16px;
	}

	.festival-addons > .elementor-container > .festival-addon + .festival-addon {
		margin-top: 16px;
	}
}

.festival-addon > .elementor-widget-wrap > .elementor-widget {
	margin-bottom: 0;
}

.festival-addon h3 {
	/* See shop.css: the kit's global h3 rule points at a font family that
	   does not exist on this site. */
	font-family: 'kaftan', 'Kaftan Serif', Georgia, serif;
	color: #141414;
}

/* The class lands on Elementor's widget wrapper, which is a block; the pill
   has to be the text element inside it or it stretches the full column. */
.festival-addon__tag .elementor-heading-title {
	display: inline-block;
	padding: 5px 12px;
	border-radius: var(--fs-round-pill);
	background: #e6e0d5;
}

.festival-addon__prices {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 9px;
}

.festival-addon__prices li {
	/* A hair of room on the right: without it the shortest values sit flush
	   against the card's inner edge and read as clipped. */
	padding-right: 2px;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 9px;
	border-bottom: 1px solid #d9d1c1;
	font-size: var(--fc-type-small);
	line-height: 1.4;
}

.festival-addon__prices li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.festival-addon__prices b {
	font-family: 'kaftan', 'Kaftan Serif', Georgia, serif;
	font-weight: 400;
	font-size: var(--fc-type-lead);
	line-height: 1;
	color: var(--fs-violet-brand);
	white-space: nowrap;
}

/* ---------------- photo strip ---------------- */

.festival-strip .festival-strip__track > .elementor-widget-wrap {
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	padding-bottom: 8px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.festival-strip .festival-strip__track > .elementor-widget-wrap::-webkit-scrollbar {
	display: none;
}

.festival-strip .festival-strip__track > .elementor-widget-wrap > .elementor-widget {
	flex: 0 0 auto;
	width: clamp(220px, 28vw, 420px);
	margin-bottom: 0;
	scroll-snap-align: start;
}

.festival-strip .festival-strip__track img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--fs-round-media);
	display: block;
}

/* ---------------- faq ---------------- */

/**
 * Each question becomes its own rounded card. Elementor's toggle draws
 * full-width rules between items, which is the one place on the page that
 * still read as a stack of rectangles once everything around it was
 * rounded — so the borders come off and the items get spacing instead.
 */
.festival-faq {
	/* Clear of the section heading above: the toggle is a sibling widget
	   and the cards' top edge was running through "Fragen"'s descender. */
	margin-top: 22px;
}

.festival-faq .elementor-toggle-item {
	margin-bottom: 10px;
	border: 1px solid #ddd5c6;
	border-radius: var(--fs-round-media);
	background: rgba(255, 255, 255, 0.5);
	overflow: hidden;
}

.festival-faq .elementor-tab-title,
.festival-faq .elementor-tab-content {
	border: 0 !important;
}

.festival-faq .elementor-tab-title {
	display: flex;
	align-items: center;
	padding: 18px 22px;
}

.festival-faq .elementor-tab-content {
	padding: 0 22px 20px;
}

.festival-faq .elementor-toggle-title {
	font-family: 'kaftan', 'Kaftan Serif', Georgia, serif;
}

/* Elementor renders the icon inline, hard against the first letter. */
.festival-faq .elementor-toggle-icon {
	margin-right: 14px;
	font-size: 0.72em;
	opacity: 0.55;
}

.festival-faq .elementor-tab-content p {
	margin: 0;
	max-width: 68ch;
}

/* ---------------- closing ---------------- */

/**
 * Inset and rounded, so the last band reads as one big card on the cream
 * rather than a full-bleed rectangle. This is the only *structural*
 * rounding on the page — everywhere else it is cards and media, which
 * round without changing the layout. Worth it here because the closing
 * band is the largest rectangle on the page and the most obviously square.
 */
.festival-section.festival-closing {
	/* max-width, not margin. Elementor sections are width:100%, so side
	   margins are *added* to that and the document ends up wider than the
	   viewport — a horizontal scrollbar on every page this section is on.
	   Insetting via max-width keeps the gap and the page's width. */
	max-width: calc(100% - 2 * clamp(14px, 4vw, 52px));
	margin-inline: auto;
	margin-top: clamp(14px, 4vw, 52px);
	margin-bottom: clamp(14px, 4vw, 52px);
	border-radius: clamp(var(--fs-round-card), 4vw, 48px);
	overflow: hidden;
	position: relative;
	isolation: isolate;
}

/* As in the hero: the content column makes its own stacking context, so the
   figure sits behind the type within it rather than on top of it. */
.festival-closing > .elementor-container {
	position: relative;
	z-index: 1;
}

.festival-closing__body > .elementor-widget-wrap {
	align-items: center;
	gap: 10px;
}

.festival-closing__lede {
	max-width: 720px;
	margin-inline: auto;
}

.festival-closing__cta {
	margin-top: 14px;
	/* The heading above it is centred by its own Elementor control; the
	   button widget has none set, and the flex centring on the wrapper
	   does not reach it because Elementor 4 renders that wrap as a block. */
	text-align: center;
}

/* ---------------- scroll reveals ---------------- */

/**
 * Visible first, animated second — still the rule, new mechanism.
 *
 * These used to live inside `@supports (animation-timeline: view())`.
 * Scroll-driven timelines are Chromium-only, so *every animation on this
 * page was absent in Safari and Firefox* — the content was correct, it just
 * arrived flat. That is not graceful degradation, it is most of the design
 * missing for a large share of the audience.
 *
 * Now `assets/js/reveal.js` adds `js-reveal` to <html> and toggles `is-in`
 * with an IntersectionObserver, which every browser has had since 2019. The
 * hiding is scoped to that class, so the guarantee is unchanged and
 * stronger: with no JavaScript — or if the script 404s, or Elementor's
 * bundle throws before it — nothing is ever hidden, because the rule that
 * hides it never applies. Elementor's own entrance animations are still not
 * used, for the reason in D-011.
 *
 * Transition rather than keyframes: it animates *to* the resting state, so
 * an element revealed mid-flight can never be left stranded part-way.
 */
.js-reveal .festival-reveal {
	opacity: 0;
	transform: translateY(20px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-reveal .festival-reveal.is-in {
	opacity: 1;
	transform: none;
}

/* A whole band fades its content, never its own background. Faded as one box,
   a band is see-through until it is revealed, and over the home page's pinned
   film that showed the film through the page on a fast scroll. */
.js-reveal .elementor-section.festival-reveal,
.js-reveal .elementor-section.festival-reveal.is-in {
	opacity: 1;
	transform: none;
	transition: none;
}

.js-reveal .elementor-section.festival-reveal > .elementor-container {
	opacity: 0;
	transform: translateY(20px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-reveal .elementor-section.festival-reveal.is-in > .elementor-container {
	opacity: 1;
	transform: none;
}

/* The stagger. Short enough that a group still reads as one gesture. */
.js-reveal .festival-reveal--1.is-in { transition-delay: 0.08s; }
.js-reveal .festival-reveal--2.is-in { transition-delay: 0.16s; }
.js-reveal .festival-reveal--3.is-in { transition-delay: 0.24s; }
.js-reveal .festival-reveal--4.is-in { transition-delay: 0.32s; }
.js-reveal .festival-reveal--1.is-in > .elementor-container { transition-delay: 0.08s; }
.js-reveal .festival-reveal--2.is-in > .elementor-container { transition-delay: 0.16s; }
.js-reveal .festival-reveal--3.is-in > .elementor-container { transition-delay: 0.24s; }
.js-reveal .festival-reveal--4.is-in > .elementor-container { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
	.festival-include > .elementor-widget-wrap,
	.festival-marquee .festival-marquee__track,
	.festival-reveal,
	.js-reveal .festival-reveal {
		transition: none !important;
		animation: none !important;
	}

	/* Belt and braces: reveal.js does not add `js-reveal` at all under a
	   reduced-motion preference, so this only matters if the preference
	   changes after load. */
	.js-reveal .festival-reveal,
	.js-reveal .elementor-section.festival-reveal > .elementor-container {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	/* The sun holds still. */
	.festival-hero::after {
		animation: none !important;
	}
}

/* ---------------- tickets not on sale yet ---------------- */

/* What every ticket shop shows until sales open: festival_core_tickets_soon(). */
.festival-tickets-soon {
	max-width: 640px;
	margin: 0 auto;
	padding: clamp(28px, 4vw, 48px);
	border-radius: var(--fs-round-tile);
	background: var(--fs-violet);
	color: var(--fs-cream);
	text-align: center;
	font: 400 var(--fc-type-body, 18px)/1.6 "Poppins", system-ui, sans-serif;
}

.festival-tickets-soon p { margin: 0 0 12px; }

.festival-tickets-soon .festival-tickets-soon__title {
	font: 400 var(--fc-type-h3, 40px)/1.1 "kaftan", Georgia, serif;
	margin-bottom: 14px;
}

.festival-tickets-soon a {
	display: inline-block;
	margin-top: 8px;
	padding: 14px 30px;
	border-radius: 999px;
	background: var(--fs-flame);
	color: #fff;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
}

.festival-tickets-soon a:hover,
.festival-tickets-soon a:focus-visible { filter: brightness(1.08); }
