/*
 * Wandalands Events — component styles.
 *
 * Colours and type resolve through Blocksy's global tokens. The four brand
 * accents that Blocksy has no palette slot for are declared here inside :where()
 * so they carry zero specificity and the `wandalands-child` token layer wins
 * automatically once that theme is active.
 */

:where(:root) {
	--wl-pecan-leaf: #3e6749;
	--wl-pond-blue: #47727c;
	--wl-peach-clay: #b85a3c;
	--wl-straw-gold: #d4a342;
}

.wlev {
	--wlev-surface: var(--theme-palette-color-8, #fff);
	--wlev-ink: var(--theme-palette-color-3, #30342f);
	--wlev-plum: var(--theme-palette-color-1, #742f4f);
	--wlev-plum-deep: var(--theme-palette-color-2, #56203b);
	--wlev-rule: color-mix(in srgb, var(--theme-palette-color-5, #968e82) 45%, transparent);
	--wlev-radius: 3px;
}

/* ------------------------------------------------------------------ buttons */

.wlev .wlev-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 15px 24px;
	border: 1px solid var(--wlev-plum);
	border-radius: 2px;
	background: var(--wlev-plum);
	color: var(--theme-palette-color-8, #fff);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.wlev .wlev-btn:hover,
.wlev .wlev-btn:focus-visible {
	background: var(--wlev-plum-deep);
	border-color: var(--wlev-plum-deep);
	color: var(--theme-palette-color-8, #fff);
}

.wlev .wlev-btn--ghost {
	background: transparent;
	border-color: var(--wl-pecan-leaf, #3e6749);
	color: var(--wl-pecan-leaf, #3e6749);
}

.wlev .wlev-btn--ghost:hover,
.wlev .wlev-btn--ghost:focus-visible {
	background: var(--wl-pecan-leaf, #3e6749);
	border-color: var(--wl-pecan-leaf, #3e6749);
	color: var(--theme-palette-color-8, #fff);
}

.wlev .wlev-btn--sm {
	padding: 12px 18px;
	font-size: 12px;
}

.wlev .wlev-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 22px 0 0;
}

/* -------------------------------------------------------------------- flags */

.wlev-flag {
	display: inline-block;
	margin: 0 0 14px;
	padding: 6px 11px;
	border-radius: 2px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.wlev-flag--now {
	background: var(--wl-peach-clay, #b85a3c);
	color: #fff;
}

/* Straw Gold always takes Soil Ink, never white. */
.wlev-flag--postponed {
	background: var(--wl-straw-gold, #d4a342);
	color: var(--theme-palette-color-3, #30342f);
}

.wlev-flag--canceled {
	background: var(--theme-palette-color-3, #30342f);
	color: #fff;
}

.wlev-flag--full {
	background: var(--wl-pond-blue, #47727c);
	color: #fff;
}

/* -------------------------------------------------------------------- cards */

.wlev-card {
	position: relative;
	background: var(--wlev-surface);
	border: 1px solid var(--wlev-rule, rgba(150, 142, 130, 0.45));
	border-radius: var(--wlev-radius);
	overflow: hidden;
}

.wlev-card + .wlev-card {
	margin-top: 22px;
}

.wlev-card--wide {
	display: grid;
	grid-template-columns: minmax(0, 37%) minmax(0, 1fr);
	align-items: stretch;
}

.wlev-card__media {
	position: relative;
	margin: 0;
	background: var(--theme-palette-color-6, #eef1e8);
	min-height: 260px;
}

.wlev-card__medialink {
	display: block;
	height: 100%;
}

.wlev-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.wlev-card--grid .wlev-card__media {
	min-height: 0;
	aspect-ratio: 16 / 10;
}

/* A wide card's height must come from its body copy, not from the shape of the
   photograph. Fill the media cell instead of letting the image size the row —
   otherwise a portrait featured image stretches the card. */
.wlev-card--wide .wlev-card__media {
	position: relative;
}

.wlev-card--wide .wlev-card__medialink,
.wlev-card--wide .wlev-card__img {
	position: absolute;
	inset: 0;
}

.wlev-badge {
	z-index: 1;
}

.wlev-card__body {
	padding: 30px 34px 32px;
}

.wlev-card--grid .wlev-card__body {
	padding: 24px 24px 26px;
}

.wlev-card__title {
	margin: 0 0 16px;
	font-size: clamp(24px, 2.1vw, 30px);
	line-height: 1.15;
}

.wlev-card--grid .wlev-card__title {
	font-size: 22px;
	margin-bottom: 12px;
}

.wlev-card__title a {
	text-decoration: none;
}

.wlev-card__title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wlev-card__excerpt {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	color: color-mix(in srgb, var(--wlev-ink) 88%, transparent);
}

.wlev-card--grid .wlev-card__excerpt {
	font-size: 15px;
}

.wlev-card__note {
	margin: 12px 0 0;
	font-size: 14px;
	font-style: italic;
	line-height: 1.55;
	color: color-mix(in srgb, var(--wlev-ink) 72%, transparent);
}

/* --------------------------------------------------------------- date badge */

.wlev-badge {
	position: absolute;
	inset: 0 auto auto 0;
	margin: 0;
	padding: 11px 12px 12px;
	min-width: 74px;
	background: var(--wlev-plum);
	color: #fff;
	text-align: center;
	border-bottom-right-radius: var(--wlev-radius);
}

.wlev-badge span {
	display: block;
	line-height: 1;
}

.wlev-badge__mon {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.09em;
}

.wlev-badge__day {
	margin: 4px 0 3px;
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.wlev-badge__dow {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.09em;
	opacity: 0.85;
}

/* ------------------------------------------------------------------ meta rows */

.wlev-meta {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
	display: grid;
	gap: 9px;
}

.wlev-meta__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 15px;
	line-height: 1.45;
	color: var(--wlev-ink);
}

.wlev-meta__item .wlev-icon {
	flex: 0 0 auto;
	margin-top: 1px;
	color: var(--wlev-plum);
}

/* ------------------------------------------------------------------- grid */

.wlev-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin-top: 24px;
}

.wlev-grid .wlev-card + .wlev-card {
	margin-top: 0;
}

/* ------------------------------------------------------------ empty state */

.wlev-empty {
	max-width: 660px;
	margin: 0 auto;
	padding: 48px 36px 52px;
	background: var(--wlev-surface);
	border: 1px solid var(--wlev-rule, rgba(150, 142, 130, 0.45));
	border-radius: var(--wlev-radius);
	text-align: center;
}

.wlev-empty__title {
	margin: 0 0 14px;
	font-size: clamp(22px, 2vw, 28px);
}

.wlev-empty__body {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
}

.wlev-empty .wlev-actions {
	justify-content: center;
}

/* ---------------------------------------------------------- single event */

.wlev-single {
	margin: 0 0 32px;
}

.wlev-single__figure {
	margin: 0 0 30px;
	border-radius: var(--wlev-radius, 3px);
	overflow: hidden;
}

.wlev-single__figure img {
	display: block;
	width: 100%;
	max-height: 460px;
	object-fit: cover;
}

.wlev-facts {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--wlev-rule, rgba(150, 142, 130, 0.45));
}

.wlev-facts__row {
	display: grid;
	grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
	gap: 8px 24px;
	padding: 14px 0;
	border-bottom: 1px solid var(--wlev-rule, rgba(150, 142, 130, 0.45));
}

.wlev-facts dt {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.5;
	text-transform: uppercase;
	color: var(--wl-pecan-leaf, #3e6749);
}

.wlev-facts dd {
	margin: 0;
	font-size: 16px;
	line-height: 1.55;
}

.wlev-single__actions {
	margin-top: 30px;
}

.wlev-single__aside {
	margin: 14px 0 0;
	font-size: 14px;
	color: color-mix(in srgb, var(--wlev-ink) 75%, transparent);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1024px) {
	.wlev-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 860px) {
	.wlev-card--wide {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Stacked layout: the photo must be IN FLOW here. On desktop the media
	   cell is stretched by the body copy beside it and the image is absolutely
	   positioned to fill it; once stacked, nothing sizes the cell any more.
	   Relying on aspect-ratio alone for an element whose only children are
	   absolutely positioned collapses to 0px height in iOS Safari (stretched
	   grid item + aspect-ratio + no in-flow content), which hid the image and
	   dropped the date badge onto the title. Put the ratio on the <img>
	   itself so the box is sized by real content in every engine. */
	.wlev-card--wide .wlev-card__media {
		min-height: 0;
		aspect-ratio: auto;
		align-self: start;
	}

	.wlev-card--wide .wlev-card__medialink,
	.wlev-card--wide .wlev-card__img {
		position: static;
		inset: auto;
	}

	.wlev-card--wide .wlev-card__medialink {
		height: auto;
	}

	.wlev-card--wide .wlev-card__img {
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 10;
		object-fit: cover;
	}

	/* Belt and braces: an event with no photo still keeps the badge clear of
	   the title, and the badge always sits above the media, never the copy. */
	.wlev-card--wide .wlev-card__media .wlev-badge {
		position: absolute;
		top: 0;
		left: 0;
	}

	.wlev-card__body {
		padding: 26px 24px 28px;
	}

	.wlev-facts__row {
		grid-template-columns: minmax(0, 1fr);
		gap: 4px;
	}
}

@media (max-width: 600px) {
	.wlev-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.wlev .wlev-btn {
		width: 100%;
	}

	.wlev-card__title {
		font-size: 23px;
	}

	.wlev-badge {
		min-width: 64px;
		padding: 9px 10px 10px;
	}

	.wlev-badge__day {
		font-size: 25px;
	}
}

/* ------------------------------------------------- cross-page event promo */

.wlev--highlights {
	padding-block: clamp(48px, 6vw, 88px);
}

.wlev-hl__inner {
	max-width: 1180px;
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 32px);
}

.wlev-hl__title {
	margin: 0 0 12px;
	text-align: center;
}

.wlev-hl__intro {
	max-width: 62ch;
	margin: 0 auto clamp(26px, 3vw, 40px);
	text-align: center;
	color: color-mix(in srgb, var(--wlev-ink) 88%, transparent);
}

.wlev-card--compact {
	grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
}

/* An event with no featured image gets the full card width rather than a
   squeezed body beside an empty media column. */
.wlev-card--nomedia {
	grid-template-columns: minmax(0, 1fr);
}

.wlev-card--compact .wlev-card__body {
	padding: 26px 30px 28px;
}

.wlev-card--compact .wlev-card__title {
	margin-bottom: 12px;
	font-size: clamp(22px, 1.8vw, 26px);
}

.wlev-hl__more {
	margin: 22px 0 0;
	text-align: right;
}

.wlev-hl__more a {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wl-pecan-leaf, #3e6749);
}

.wlev-hl__more a::after {
	content: " \2192";
}

.wlev-hl__more a:hover {
	text-decoration: underline;
}

@media (max-width: 860px) {
	.wlev-card--compact {
		grid-template-columns: minmax(0, 1fr);
	}

	.wlev-hl__more {
		text-align: left;
	}
}
