/*
 * Light — its own stylesheet.
 *
 * Loaded after the shared `events.css`, only while Light draws the page. The
 * forms have stylesheets of their own beside this file (`*.form.css`, which
 * become each form's `custom_css`); this file draws the page around them. The
 * passes and sponsorships are the registration form's own questions here.
 *
 * Glass, made plain and small: a white page, sections without a frame — each
 * title underlined instead — the accent flat rather than a gradient with a
 * glow, and every size a step down — type, gaps, radii, buttons. One column
 * at every width, up to 1000px; the registration form narrower inside it.
 *
 * Contents
 *   1. Tokens       5. The column    9. Less motion
 *   2. The page     6. Sections     10. The feedback modal
 *   3. White        7. Borrowed pieces
 *   4. The banner   8. Phones
 */

/* -- 1. Tokens --------------------------------------------------------------- */

/* Everything a site is likely to change, in one place. */
.event-page--light {
	--light-font: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

	--light-page: #fff;
	--light-ink: #0f172a;
	--light-soft: rgb(15 23 42 / 0.64);
	--light-faint: rgb(15 23 42 / 0.45);
	--light-line: #e8ebf0;
	--light-line-strong: #d7dce4;
	--light-danger: #be123c;

	--light-accent: #356fbc;
	--light-accent-deep: #2a5a9a;
	--light-accent-soft: #f1f5fb;
	--light-accent-ring: 0 0 0 3px rgb(53 111 188 / 0.14);

	/* A card: white, a hairline, and only just lifted off the page. */
	--light-card: #fff;
	--light-shadow: 0 1px 2px rgb(15 23 42 / 0.04);

	--light-radius: 12px;
	--light-radius-sm: 8px;

	/* The column: one, centred, every section the same width, up to 800px —
	   the banner, the text and the registration form edge to edge. The
	   feedback modal is narrower. */
	--light-width: 800px;
	--light-narrow: 32rem;
	--light-gap: 0.875rem;
	--light-pad: 1em;

	/* Where a section stops when a link jumps to it: under the admin bar. A
	   theme with a fixed header adds its height here. */
	--light-sticky-top: calc(var(--wp-admin--admin-bar--height, 0px) + 1rem);
}

/* -- 2. The page ------------------------------------------------------------- */

/* White behind the theme's header and footer too, not only behind the column. */
body:has(.event-page--light) {
	background: var(--light-page, #fff);
}

.event-page--light {
	max-width: none;
	margin: 0;
	padding: clamp(0.75rem, 2.5vw, 2rem) 1rem clamp(2.5rem, 6vw, 4rem);
	background: var(--light-page);
	color: var(--light-ink);
	font-family: var(--light-font);
	font-size: 0.9375rem;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.event-page--light *,
.event-page--light *::before,
.event-page--light *::after {
	box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
	html:has(.event-page--light) {
		scroll-behavior: smooth;
	}
}

/* -- 3. White ---------------------------------------------------------------- */

/* A section has no frame: white on white, set apart by the line under its title. */
.light-card,
.event-page--light .event-plan,
.event-page--light .event-reviews {
	background: var(--light-card);
	border: 0;
	box-shadow: none;
}

/* -- 4. The banner ----------------------------------------------------------- */

/* The picture, then the title on a white strip under it — one card. */
.light-hero {
	max-width: var(--light-width);
	margin: 0 auto;
	overflow: hidden;
	border: 1px solid var(--light-line);
	border-radius: var(--light-radius);
	background: var(--light-card);
	box-shadow: var(--light-shadow);
}

/* The photo is the image block's background, covering it; the block takes
   the desktop photo's shape, 1600 × 900. */
.light-hero .light-hero__image {
	display: block;
	width: 100%;
	margin: 0;
	aspect-ratio: 1600 / 900;
	background-color: #f1f3f6;
	background-image: var(--light-hero-desktop);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

.light-hero__pane {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	padding: 0.9rem var(--light-pad) 1rem;
}

.light-hero__heading {
	flex: 1 1 14rem;
	min-width: 0;
}

.light-hero .event-hero + .light-hero__pane {
	border-top: 1px solid var(--light-line);
}

.light-hero__title {
	margin: 0;
	color: var(--light-ink);
	font-family: inherit;
	font-size: clamp(1.25rem, 3vw, 1.5rem);
	font-weight: 650;
	line-height: 1.2;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

/* Ended, or sold out. */
.light-status {
	display: inline-block;
	margin: 0 0 0.5rem;
	padding: 0.2em 0.65em;
	border-radius: 999px;
	background: #f1f3f6;
	color: var(--light-soft);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
}

.light-status--sold-out {
	background: #fdecef;
	color: var(--light-danger);
}

/* When and where: centred, semi-bold, an icon before each. */
.light-facts {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem 1.5rem;
	max-width: var(--light-width);
	margin: var(--light-gap) auto 0;
	padding: 0;
	list-style: none;
	color: var(--light-ink);
	font-weight: 600;
	text-align: center;
}

.light-fact {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
}

.light-fact__icon {
	flex: none;
	width: 1.15em;
	height: 1.15em;
	fill: none;
	stroke: var(--light-accent);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.light-fact a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--light-line-strong);
	text-underline-offset: 0.2em;
}

.light-fact a:hover {
	text-decoration-color: currentColor;
}

/* -- 5. The column ------------------------------------------------------------- */

/*
 * Register | Send feedback, on the right of the title: one pill on one line at
 * every width, halved by a hairline. Either half is there only when its form
 * is. Too narrow for both beside the title, it goes under it, on the right.
 */
.light-actions {
	display: flex;
	flex: none;
	width: fit-content;
	margin: 0 0 0 auto;
	overflow: hidden;
	border: 1px solid var(--light-line-strong);
	border-radius: 999px;
	background: #fff;
}

.event-page--light .light-actions__link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 8.5rem;
	min-height: 2.5rem;
	padding: 0.55rem 1.25rem;
	color: var(--light-accent);
	font-size: 0.9375rem;
	font-weight: 620;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.event-page--light .light-actions__link + .light-actions__link {
	border-left: 1px solid var(--light-line-strong);
}

.event-page--light .light-actions__link:hover {
	background: var(--light-accent-soft);
	color: var(--light-accent-deep);
}

.event-page--light .light-actions__link:focus-visible {
	outline: 2px solid var(--light-accent);
	outline-offset: -3px;
}

/*
 * ONE column at every width: nothing sits beside anything else. Every section
 * is as wide as the banner, centred; the registration form inside its section
 * keeps a measure of its own.
 */
.light-column {
	display: grid;
	gap: var(--light-gap);
	margin: var(--light-gap) 0 0;
}

.light-column > * {
	justify-self: center;
	width: 100%;
	max-width: var(--light-width);
}

/*
 * Register pressed: the form glows softly, twice, over two seconds — a shadow
 * in the accent that swells and fades (`template.js` adds the class). Less
 * motion asked for: none (section 9).
 */
.light-column > #register > .form-wrap {
	padding: 0.5em;
	border-radius: var(--light-radius);
}

.light-column > #register > .form-wrap.light-pulse {
	animation: light-pulse 2s ease-in-out;
}

@keyframes light-pulse {
	0%,
	100% {
		box-shadow: 0 0 0 0 rgb(53 111 188 / 0);
	}

	25%,
	75% {
		box-shadow: 0 0 0 6px rgb(53 111 188 / 0.12), 0 6px 28px rgb(53 111 188 / 0.22);
	}

	50% {
		box-shadow: 0 0 0 2px rgb(53 111 188 / 0.05), 0 4px 16px rgb(53 111 188 / 0.08);
	}
}

/* The registration form: no wider than 600px, in the middle of its section. */
.light-column > #register > .form-wrap {
	max-width: 600px;
	margin: 0 auto;
}

/* What people said, before it arrives — or when there is nothing to say. */
.light-column > .ax-live:empty {
	display: none;
}

/* -- 6. Sections ------------------------------------------------------------- */

.light-card {
	min-width: 0;
	padding: var(--light-pad) 0;
	scroll-margin-top: var(--light-sticky-top);
}

/* Every section's title, with a line under it from edge to edge. */
.light-card__title,
.event-page--light .event-section__title {
	margin: 0 0 0.85rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--light-line);
	color: var(--light-ink);
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: 680;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

/* Not shown: the sections speak for themselves. Still each section's name —
   `aria-labelledby` reads a hidden heading. */
.light-card__title,
.event-page--light .event-section__title,
.event-page--light .event-reviews .event-section__title {
	display: none;
}

.light-card__lead {
	margin: 0 0 1.1rem;
	color: var(--light-soft);
	font-size: 0.9rem;
}

.light-card__lead:last-child {
	margin-bottom: 0;
}

/* The author's words. */
.light-card .event-description {
	color: rgb(15 23 42 / 0.84);
	font-size: 0.9375rem;
	line-height: 1.65;
}

.light-card .event-description :is(h2, h3, h4) {
	margin: 1.5em 0 0.4em;
	color: var(--light-ink);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 680;
}

.light-card .event-description a {
	color: var(--light-accent);
}

/* -- 6b. One pass per registration: the passes as buttons ------------------- */

/*
 * When the event takes ONE pass per registration, Forms draws each pass as a
 * radio (a `pick` group). Here they are buttons, as the name-your-price
 * amounts are — the pass's name, its price under it — two to a row; anything
 * else in the section (a name-your-price pass) keeps a row of its own. The
 * radio is still the control: hidden from sight, not from the keyboard or a
 * screen reader, and the whole button is its label.
 *
 * In this file rather than in `registration.form.css`, so a form built before
 * it is drawn the same way; `#register` outranks the form's own scoped CSS.
 */
.event-page--light #register .section__body:has(> .field .payment--pick) {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: stretch;
	gap: 0.5em;
}

/* Forms' own grid spans every question across both columns on a wide form. */
.event-page--light #register .section__body:has(> .field .payment--pick) > .field:has(.payment--pick) {
	grid-column: auto;
}

.event-page--light #register .section__body:has(> .field .payment--pick) > .field:not(:has(.payment--pick)) {
	grid-column: 1 / -1;
}

.event-page--light #register .field--payment:has(.payment--pick) {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.15em;
	margin: 0;
	padding: 0.7em 1em;
	border: 1px solid var(--light-line-strong);
	border-radius: var(--light-radius-sm);
	background: #fff;
	text-align: center;
	line-height: 1.25;
	cursor: pointer;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

.event-page--light #register .field--payment:has(.payment--pick):hover {
	background: #f8f9fb;
}

.event-page--light #register .field--payment:has(.payment__pick-input:checked) {
	border-color: var(--light-accent);
	background: color-mix(in srgb, var(--light-accent) 12%, #fff);
	box-shadow: inset 0 0 0 1px var(--light-accent);
}

.event-page--light #register .field--payment:has(.payment__pick-input:focus-visible) {
	outline: 3px solid rgb(53 111 188 / 0.35);
	outline-offset: 2px;
}

.event-page--light #register .field--payment:has(.payment--pick) > .field__label {
	margin: 0;
	font-size: 1em;
	font-weight: 640;
	cursor: pointer;
}

.event-page--light #register .field--payment:has(.payment--pick) > .field__hint {
	margin: 0;
	font-size: 0.82em;
}

.event-page--light #register .payment--pick,
.event-page--light #register .payment--pick:has(.payment__pick-input:checked) {
	display: block;
	padding: 0;
	border: 0;
	background: none;
}

/* The label stretched over the whole button: a press anywhere chooses it. */
.event-page--light #register .payment__pick {
	display: block;
	padding: 0;
	cursor: pointer;
}

.event-page--light #register .payment__pick::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.event-page--light #register .payment__pick-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.event-page--light #register .payment--pick .payment__price {
	margin: 0;
	color: var(--light-soft);
	font-size: 0.9em;
	font-weight: 600;
}

.event-page--light #register .field--payment:has(.payment__pick-input:checked) .payment__price {
	color: inherit;
}

/* On the narrowest phones, one to a row. */
@media (max-width: 359px) {
	.event-page--light #register .section__body:has(> .field .payment--pick) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* -- 7. Borrowed pieces: the room, and what people said ------------------------ */

.event-page--light :is(.event-plan, .event-reviews) {
	min-width: 0;
	margin: 0;
	padding: var(--light-pad) 0;
}

/*
 * What people said: as wide as every other section, the cards in a row
 * with an arrow either side of them. Its markup is the Events plugin's — a
 * head (title, summary, the two buttons) and the track — so the head and the
 * buttons' box are dissolved (`display: contents`) and their pieces laid on
 * one grid: the title and the summary across the top, then ‹ cards ›.
 */
.event-page--light .event-reviews {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
}

.event-page--light :is(.event-reviews__head, .event-reviews__nav) {
	display: contents;
}

/* Nothing to scroll — every card already fits — and the arrows go. */
.event-page--light .event-reviews__nav[hidden] {
	display: none;
}

.event-page--light .event-reviews .event-section__title,
.event-page--light .event-reviews__summary {
	grid-column: 1 / -1;
}

.event-page--light .event-reviews .event-section__title {
	margin: 0 0 0.6rem;
}

.event-page--light .event-reviews__summary {
	margin: 0 0 1.1rem;
	color: var(--light-soft);
	font-size: 0.875rem;
}

.event-page--light .event-reviews__average {
	color: var(--light-ink);
}

.event-page--light .event-reviews__count {
	color: var(--light-faint);
}

.event-page--light .event-reviews__track {
	grid-column: 2;
	grid-row: 3;
	grid-auto-columns: calc((100% - 2rem) / 3);
	gap: 1rem;
	padding: 0;
}

/* The arrows do the scrolling once the script has wired them: no bar under the cards. */
.event-page--light .event-reviews[data-wired] .event-reviews__track {
	scrollbar-width: none;
}

.event-page--light .event-reviews[data-wired] .event-reviews__track::-webkit-scrollbar {
	display: none;
}

/* ‹ and ›: a plain circle each side, a drawn chevron in place of the glyph. */
.event-page--light .event-reviews__button {
	grid-row: 3;
	width: 36px;
	height: 36px;
	border: 1px solid var(--light-line);
	background: #fff;
	color: var(--light-ink);
	font-size: 0;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.event-page--light .event-reviews__button[data-scroll='-1'] {
	grid-column: 1;
	margin-inline-end: 0.75rem;
}

.event-page--light .event-reviews__button[data-scroll='1'] {
	grid-column: 3;
	margin-inline-start: 0.75rem;
}

.event-page--light .event-reviews__button::before {
	content: '';
	width: 7px;
	height: 7px;
	margin-inline-start: -3px;
	border: solid currentColor;
	border-width: 0 1.6px 1.6px 0;
	transform: rotate(-45deg);
}

.event-page--light .event-reviews__button[data-scroll='-1']::before {
	margin-inline-start: 3px;
	transform: rotate(135deg);
}

.event-page--light .event-reviews__button:hover:not(:disabled) {
	border-color: var(--light-ink);
	background: var(--light-ink);
	color: #fff;
}

.event-page--light .event-reviews__button:focus-visible {
	outline: 2px solid var(--light-accent);
	outline-offset: 2px;
}

.event-page--light .event-reviews__button:disabled {
	opacity: 0.3;
}

/* A card: no tile and no edge — the stars, the words, who said them. */
.event-page--light .event-review {
	gap: 0.7rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
}

.event-page--light .event-review__stars {
	font-size: 0.875rem;
}

.event-page--light .event-review__star {
	color: rgb(15 23 42 / 0.14);
}

.event-page--light .event-review__star.is-on {
	color: #f59e0b;
}

.event-page--light .event-review__text {
	color: rgb(15 23 42 / 0.84);
	font-size: 0.9375rem;
	line-height: 1.6;
}

.event-page--light .event-review__by {
	padding-top: 0;
	color: var(--light-faint);
	font-size: 0.8125rem;
}

.event-page--light .event-review__who {
	color: var(--light-ink);
}

/* Narrower: two cards in view. */
@media (max-width: 900px) {
	.event-page--light .event-reviews__track {
		grid-auto-columns: calc((100% - 1rem) / 2);
	}
}

/* A phone: one card in view, the arrows closer to it. */
@media (max-width: 640px) {
	.event-page--light .event-reviews__track {
		grid-auto-columns: 100%;
	}

	.event-page--light .event-reviews__button[data-scroll='-1'] {
		margin-inline-end: 0.5rem;
	}

	.event-page--light .event-reviews__button[data-scroll='1'] {
		margin-inline-start: 0.5rem;
	}
}

/* -- 8. Phones -------------------------------------------------------------- */

@media (max-width: 782px) {
	/* 1em between the screen's edge and every section. */
	.event-page--light {
		--light-radius: 10px;
		--light-gap: 0.75rem;

		padding-inline: 1em;
	}

	/* The narrow crop, whole: the mobile photo's own shape, 1086 × 1448. */
	.light-hero .light-hero__image {
		aspect-ratio: 1086 / 1448;
		background-image: var(--light-hero-mobile);
	}

	/* Register | Send feedback under the title, in the middle of the strip. */
	.light-hero__pane {
		flex-direction: column;
		align-items: stretch;
	}

	.light-hero__heading {
		flex: none;
		text-align: center;
	}

	.light-actions {
		margin: 0 auto;
	}
}

/* -- 9. Less motion --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.event-page--light *,
	.event-page--light *::before {
		transition: none !important;
		animation: none !important;
	}
}

/* -- 10. The feedback modal ------------------------------------------------- */

/*
 * The feedback form in a `<dialog>`, opened by Feedback (`template.js`): a
 * white box in the middle of a dimmed page, its title and ✕ on top, and the
 * form scrolling under them when it is taller than the screen. On a phone it
 * is a sheet rising from the bottom edge.
 */
.light-modal {
	width: min(var(--light-narrow), calc(100% - 2rem));
	max-width: none;
	max-height: min(90dvh, 52rem);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 16px;
	background: var(--light-card);
	color: var(--light-ink);
	box-shadow: 0 24px 64px rgb(15 23 42 / 0.22), 0 2px 6px rgb(15 23 42 / 0.08);
}

.light-modal[open] {
	display: flex;
	flex-direction: column;
	animation: light-modal-in 0.2s ease-out;
}

.light-modal::backdrop {
	background: rgb(15 23 42 / 0.45);
	backdrop-filter: blur(2px);
}

/* The page under it stays where it is. */
html:has(.light-modal[open]) {
	overflow: hidden;
}

.light-modal__head {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1rem 0.9rem var(--light-pad);
	border-bottom: 1px solid var(--light-line);
}

.light-modal__title {
	flex: 1;
	margin: 0;
	color: var(--light-ink);
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: 680;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.event-page--light .light-modal__close {
	display: grid;
	place-items: center;
	flex: none;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #f1f3f6;
	color: var(--light-soft);
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.event-page--light .light-modal__close:hover {
	background: #e6e9ee;
	color: var(--light-ink);
}

.event-page--light .light-modal__close:focus-visible {
	outline: 2px solid var(--light-accent);
	outline-offset: 2px;
}

.light-modal__close svg {
	width: 1.1rem;
	height: 1.1rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.light-modal__body {
	padding: 1rem var(--light-pad) calc(var(--light-pad) + 0.75rem + env(safe-area-inset-bottom, 0px));
	overflow-y: auto;
	overscroll-behavior: contain;
}

@keyframes light-modal-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
}

/* A phone: a sheet from the bottom, the full width. */
@media (max-width: 640px) {
	.light-modal {
		width: 100%;
		max-height: 92dvh;
		margin: auto 0 0;
		border-radius: 16px 16px 0 0;
	}
}

/* Without a script nothing opens it: drawn in the page, under the column. */
html:not(.light-js) .light-modal {
	position: static;
	display: block;
	width: auto;
	max-width: var(--light-width);
	max-height: none;
	margin: var(--light-gap) auto 0;
	border-radius: 0;
	box-shadow: none;
}

html:not(.light-js) .light-modal__close {
	display: none;
}
