/*
 * Event Platform — front-end styles for [epc_events] and [epc_checkout].
 *
 * This is the same editorial system as the hosted marketplace: typographic date
 * stamps, month rules, Raleway for structure, Source Sans for prose, one red
 * accent. The events section is meant to read as a deliberate, branded block —
 * not as generic plugin output.
 *
 * It still has to be a good guest in someone else's theme, so:
 * - every selector is scoped under `.epc-*`; no element or global selectors
 * - every value comes from an `--epc-*` custom property, so a child theme can
 *   restyle the whole block by redefining a handful of tokens
 * - no `!important`, and the page frame (header, nav, footer, width) is left
 *   entirely to the theme
 */

.epc-events,
.epc-checkout-wrap {
	--epc-accent: #d91d1d;
	--epc-ink: #1c1f24;
	--epc-body: #2a2d32;
	--epc-muted: #6b6f76;
	--epc-dim: #9ca0a8;
	--epc-rule: #e5e2dc;
	--epc-tint: #f8f5f1;
	--epc-radius: 5px;
	--epc-head: "Raleway", ui-sans-serif, system-ui, sans-serif;
	--epc-text: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
}

/* --- Month sections ------------------------------------------------------- */

.epc-events {
	margin: 0 0 2.5rem;
	font-family: var(--epc-text);
	color: var(--epc-body);
}

.epc-month + .epc-month {
	margin-top: 2.75rem;
}

.epc-month__label {
	font-family: var(--epc-head);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--epc-dim);
	margin: 0 0 0.65rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--epc-rule);
}

.epc-month__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* --- Event row ------------------------------------------------------------ */

.epc-event {
	margin: 0;
	padding: 0;
}

.epc-event + .epc-event {
	border-top: 1px solid var(--epc-rule);
}

.epc-event__link {
	display: grid;
	grid-template-columns: 3.5rem minmax(0, 1fr) auto;
	align-items: start;
	gap: 1.35rem;
	padding: 1.35rem 0.75rem 1.35rem 0;
	margin-right: -0.75rem;
	border-radius: var(--epc-radius);
	text-decoration: none;
	color: inherit;
	transition: background 0.12s ease;
}

.epc-event__link:hover,
.epc-event__link:focus {
	background: var(--epc-tint);
	text-decoration: none;
	color: inherit;
}

.epc-event__link:focus-visible {
	outline: 2px solid var(--epc-accent);
	outline-offset: 2px;
}

/* Typographic date stamp — the visual anchor, standing in for artwork. */
.epc-event__stamp {
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: var(--epc-head);
	line-height: 1;
	padding-top: 0.15rem;
}

.epc-event__weekday {
	font-size: 0.5625rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--epc-dim);
}

.epc-event__day {
	margin-top: 0.25rem;
	font-size: 2rem;
	font-weight: 300;
	color: var(--epc-ink);
	font-variant-numeric: tabular-nums;
}

.epc-event__month {
	margin-top: 0.2rem;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--epc-accent);
}

.epc-event__body {
	display: block;
	min-width: 0;
}

.epc-event__title {
	display: block;
	font-family: var(--epc-head);
	font-size: 1.1875rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--epc-ink);
}

.epc-event__meta {
	/* Block, not inline: the whole row is one <a>, so these are spans rather
	   than paragraphs — left inline, the venue and the excerpt collide. */
	display: block;
	margin: 0.4rem 0 0;
	font-size: 0.8125rem;
	color: var(--epc-muted);
}

.epc-event__sep {
	padding: 0 0.45rem;
	color: var(--epc-dim);
}

.epc-event__excerpt {
	display: block;
	margin: 0.6rem 0 0;
	max-width: 62ch;
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.5;
	color: var(--epc-muted);
}

.epc-event__cta {
	display: inline-block;
	align-self: center;
	font-family: var(--epc-head);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--epc-accent);
	border: 1px solid var(--epc-rule);
	border-radius: var(--epc-radius);
	padding: 0.45rem 0.85rem;
	white-space: nowrap;
	transition: border-color 0.12s ease, background 0.12s ease;
}

.epc-event__link:hover .epc-event__cta,
.epc-event__link:focus .epc-event__cta {
	border-color: var(--epc-accent);
	background: #fff;
}

@media (max-width: 600px) {
	.epc-event__link {
		grid-template-columns: 2.75rem minmax(0, 1fr);
		row-gap: 0.75rem;
		gap: 1rem;
	}
	.epc-event__cta {
		grid-column: 2;
		justify-self: start;
	}
	.epc-event__day {
		font-size: 1.5rem;
	}
}

/* --- Grid variant --------------------------------------------------------- */

.epc-events--grid .epc-month__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 1rem;
}

.epc-events--grid .epc-event + .epc-event {
	border-top: 0;
}

.epc-events--grid .epc-event__link {
	grid-template-columns: minmax(0, 1fr);
	gap: 0.6rem;
	padding: 1.1rem;
	margin: 0;
	border: 1px solid var(--epc-rule);
	height: 100%;
}

.epc-events--grid .epc-event__stamp {
	flex-direction: row;
	align-items: baseline;
	gap: 0.4rem;
	padding-top: 0;
}

.epc-events--grid .epc-event__day {
	margin-top: 0;
	font-size: 1.35rem;
}

.epc-events--grid .epc-event__cta {
	align-self: start;
}

/* --- Empty state ---------------------------------------------------------- */

.epc-events-empty {
	margin: 0 0 1.5rem;
	padding: 2.5rem 1.5rem;
	border: 1px solid var(--epc-rule);
	border-radius: var(--epc-radius);
	text-align: center;
	color: var(--epc-muted);
	font-family: var(--epc-text);
}

/* --- Checkout iframe ------------------------------------------------------ */

.epc-checkout-wrap {
	margin: 2rem 0;
	padding-top: 1.75rem;
	border-top: 1px solid var(--epc-rule);
}

.epc-checkout-wrap__label {
	font-family: var(--epc-head);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--epc-dim);
	margin: 0 0 0.75rem;
}

.epc-checkout {
	display: block;
	width: 100%;
	border: 0;
	/* Height is driven by the ep:resize postMessage (assets/embed.js); this is
	   only the pre-message fallback — tall enough to avoid a visible jump, short
	   enough not to leave a gap if the message is blocked. */
	min-height: 420px;
	transition: height 0.15s ease-out;
}

.epc-checkout-noscript {
	font-size: 0.9rem;
	color: var(--epc-muted);
}

/* --- Single event header -------------------------------------------------- */

.epc-event-header {
	--epc-accent: #d91d1d;
	--epc-ink: #1c1f24;
	--epc-muted: #6b6f76;
	--epc-rule: #e5e2dc;
	--epc-head: "Raleway", ui-sans-serif, system-ui, sans-serif;
	margin: 0 0 1.75rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--epc-rule);
}

.epc-event-header__when {
	margin: 0;
	font-family: var(--epc-head);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--epc-accent);
}

.epc-event-header__venue {
	margin: 0.6rem 0 0;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: var(--epc-muted);
}

/* --- Event artwork -------------------------------------------------------- */

/* Only events that actually have artwork get an image column. Half the imported
   catalogue has none, and a row of empty placeholder boxes looks more broken
   than a clean typographic row — the date stamp is the anchor either way. */
.epc-event--has-image .epc-event__link {
	grid-template-columns: 3.5rem 8.5rem minmax(0, 1fr) auto;
}

.epc-event__thumb {
	display: block;
	overflow: hidden;
	border-radius: var(--epc-radius);
	background: var(--epc-tint);
	aspect-ratio: 4 / 3;
}

.epc-event__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
}

.epc-events--grid .epc-event--has-image .epc-event__link,
.epc-events--grid .epc-event__link {
	grid-template-columns: minmax(0, 1fr);
}

.epc-events--grid .epc-event__thumb {
	aspect-ratio: 16 / 10;
	margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
	.epc-event--has-image .epc-event__link {
		grid-template-columns: 2.75rem minmax(0, 1fr);
	}
	.epc-event__thumb {
		grid-column: 2;
		max-width: 12rem;
	}
}


/* --- Calendar -------------------------------------------------------------
 *
 * A month grid for a ticketing calendar, which is a different object from a
 * month grid for a diary: every cell is a thing someone might buy, so the two
 * facts that decide whether they click — when it is, and what it costs — have
 * to survive at 12px inside a 150px column.
 *
 * Three rules hold the whole thing together.
 *
 * 1. **The gaps are the rules.** The grid sits on a rule-coloured background
 *    with `gap: 1px` and opaque cells, so the hairlines are the gaps showing
 *    through. Bordering each cell instead is what produced doubled 2px seams
 *    and the ragged black lattice this replaces — with `gap` there is exactly
 *    one line between two cells and it cannot misalign.
 *
 * 2. **Every week row is the same height.** `grid-auto-rows: 1fr` over a
 *    min-height, and anything that does not fit becomes a count. A grid whose
 *    rows breathe with their content is not a grid, it is a stack of lists,
 *    and that is what made the old one look uneven.
 *
 * 3. **Runs are bars, not repetition.** A seven-week exhibit is one band
 *    threaded across the weeks, drawn in an overlay that shares the day grid's
 *    exact geometry so a bar spanning Monday to Thursday lands on Monday and
 *    Thursday. See Calendar_Layout for the lane arithmetic.
 *
 * Every token is declared here on `.epc-calendar` rather than inherited from
 * `.epc-events`. It used to read `--epc-ink` and friends, which are only
 * declared on the other two blocks — so inside a calendar those resolved to
 * nothing, and `background: var(--epc-ink)` on the active filter chip silently
 * became no background at all, leaving white text on white. Anything the
 * calendar uses, the calendar defines.
 */

.epc-calendar {
	--epc-cal-ink: #1b1917;
	--epc-cal-body: #35312c;
	--epc-cal-muted: #6f6a62;
	/* Darkened from #a8a196, which was 2.3:1 on white — under the 4.5:1 that
	   text has to clear. It is still the quietest thing on the calendar. */
	--epc-cal-dim: #857e72;
	--epc-cal-rule: #e6e1d8;
	--epc-cal-hair: #eeeae3;
	--epc-cal-cell: #fff;
	--epc-cal-off: #faf8f5;
	--epc-cal-accent: #c2321f;
	--epc-cal-radius: 10px;

	/* The four calendars VAC actually files events under. The palette is
	   Kīlauea's — lehua blossom, wet basalt, koa canopy, and the sulfur that
	   stains the vents — rather than a generic category ramp. An unknown type
	   stays neutral instead of being handed a colour that means nothing. */
	--epc-type-workshops: #c2321f;
	--epc-type-exhibits: #2f4858;
	--epc-type-hula-arts: #3f6b47;
	--epc-type-concerts: #9a6a12;
	/* Warm graphite, not beige. Only twenty-nine of forty-one events carry a
	   type, so the fallback is on screen as often as the palette is — it has to
	   read as a deliberate neutral rather than as a colour that failed. */
	--epc-type-default: #7a7267;

	/* Vertical rhythm. Bars and event lines share a step so a cell with two
	   bars and two events reads as four evenly spaced things, not as two
	   systems fighting. */
	/* 24px is the floor WCAG 2.5.8 sets for a target, and a run bar is a real
	   link — on a tablet the month grid is what renders, not the agenda. */
	--epc-cal-bar-h: 24px;
	--epc-cal-bar-step: 26px;
	--epc-cal-date-h: 25px;

	/* The peek card is positioned against this box, so it can never be clipped
	   by a cell's overflow or escape the calendar's own width. */
	position: relative;
	margin: 0 0 2rem;
	font-family: var(--epc-text, ui-sans-serif, system-ui, sans-serif);
	color: var(--epc-cal-body);
	-webkit-font-smoothing: antialiased;
}

/* Assistive-only text.
 *
 * The plugin used WordPress's `.screen-reader-text`, which is defined by the
 * *theme*, not by core — so on a theme that omits it, and in the Next.js
 * mirror where no theme exists at all, every hidden string painted on screen.
 * That is what turned "Sunday, August 2" plus the date into "August 22", and
 * welded the type name onto the end of each title. The calendar ships its own.
 */
.epc-calendar .epc-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* --- Header -------------------------------------------------------------- */

.epc-cal__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin: 0 0 0.9rem;
}

.epc-cal__month {
	margin: 0;
	font-family: var(--epc-head, inherit);
	font-size: clamp(1.5rem, 3.4vw, 2rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.05;
	color: var(--epc-cal-ink);
}

.epc-cal__count {
	margin: 0.3rem 0 0;
	font-size: 0.8125rem;
	color: var(--epc-cal-muted);
}

/* One control, three targets — the shape reads as a single month stepper
   rather than three unrelated links wandering across the header. */
.epc-cal__nav {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--epc-cal-rule);
	border-radius: 8px;
	overflow: hidden;
	background: var(--epc-cal-cell);
}

.epc-cal__step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	padding: 0.45rem 0.7rem;
	font-family: var(--epc-head, inherit);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1;
	color: var(--epc-cal-muted);
	text-decoration: none;
	background: none;
	border: 0;
	cursor: pointer;
	transition: background-color 120ms ease, color 120ms ease;
}

.epc-cal__step + .epc-cal__step {
	border-left: 1px solid var(--epc-cal-rule);
}

.epc-cal__step:hover,
.epc-cal__step:focus-visible {
	background: var(--epc-cal-off);
	color: var(--epc-cal-ink);
}

.epc-cal__step:focus-visible {
	outline: 2px solid var(--epc-cal-accent);
	outline-offset: -2px;
}

/* --- Standing runs --------------------------------------------------------
 *
 * A show open every single day of the month is a constant, not a shape. Left
 * in the grid it would hold a lane in all six rows to say one thing; up here
 * it says it once, and gives back the lane to events that actually start this
 * month. Calendar_Layout decides what qualifies.
 */

.epc-cal__running {
	list-style: none;
	margin: 0 0 0.9rem;
	padding: 0;
	display: grid;
	gap: 1px;
	background: var(--epc-cal-rule);
	border: 1px solid var(--epc-cal-rule);
	border-radius: 8px;
	overflow: hidden;
}

.epc-cal__runlink {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	padding: 0.6rem 0.85rem;
	background: var(--epc-cal-cell);
	text-decoration: none;
	color: var(--epc-cal-ink);
	border-left: 3px solid var(--epc-type-default);
	transition: background-color 120ms ease;
}

.epc-cal__runlink:hover,
.epc-cal__runlink:focus-visible {
	background: var(--epc-cal-off);
}

.epc-cal__runlink:focus-visible {
	outline: 2px solid var(--epc-cal-accent);
	outline-offset: -2px;
}

.epc-cal__runwhen {
	font-family: var(--epc-head, inherit);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--epc-cal-muted);
	white-space: nowrap;
}

.epc-cal__runname {
	flex: 1;
	min-width: 0;
	font-size: 0.875rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.epc-cal__runmeta {
	font-size: 0.75rem;
	color: var(--epc-cal-muted);
	white-space: nowrap;
}

/* --- Filters ------------------------------------------------------------- */

.epc-cal__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 0.75rem;
}

.epc-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--epc-head, inherit);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1;
	color: var(--epc-cal-muted);
	background: var(--epc-cal-cell);
	border: 1px solid var(--epc-cal-rule);
	border-radius: 999px;
	padding: 7px 12px;
	cursor: pointer;
	/* Colour only, no transform. A row of chips that jump on hover turns a
	   filter into a fidget toy. */
	transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.epc-chip__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}

.epc-chip:hover {
	color: var(--epc-cal-ink);
	border-color: var(--epc-cal-dim);
}

.epc-chip:focus-visible {
	outline: 2px solid var(--epc-cal-accent);
	outline-offset: 2px;
}

.epc-chip[aria-pressed="true"] {
	color: #fff;
	background: var(--epc-cal-ink);
	border-color: var(--epc-cal-ink);
}

/* An active type chip wears its own colour, so the filter and the grid's dots
   are visibly one system rather than two unrelated codings. */
.epc-chip[aria-pressed="true"][data-epc-type="workshops"] { background: var(--epc-type-workshops); border-color: var(--epc-type-workshops); }
.epc-chip[aria-pressed="true"][data-epc-type="exhibits"]  { background: var(--epc-type-exhibits);  border-color: var(--epc-type-exhibits); }
.epc-chip[aria-pressed="true"][data-epc-type="hula-arts"] { background: var(--epc-type-hula-arts); border-color: var(--epc-type-hula-arts); }
.epc-chip[aria-pressed="true"][data-epc-type="concerts"]  { background: var(--epc-type-concerts);  border-color: var(--epc-type-concerts); }

/* --- The grid ------------------------------------------------------------ */

.epc-cal__frame {
	border: 1px solid var(--epc-cal-rule);
	border-radius: var(--epc-cal-radius);
	overflow: hidden;
	background: var(--epc-cal-rule);
}

.epc-cal__weekdays {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 1px;
	background: var(--epc-cal-rule);
}

.epc-cal__weekday {
	background: var(--epc-cal-cell);
	padding: 0.55rem 0.25rem;
	text-align: center;
	font-family: var(--epc-head, inherit);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	/* muted, not dim: at 11px this is real text and has to clear 4.5:1. */
	color: var(--epc-cal-muted);
}

/* Rows are equal by construction: `1fr` over a floor, never sized by content.
   This is the single line that fixes "uneven". */
.epc-cal__grid {
	display: grid;
	grid-auto-rows: minmax(var(--epc-cal-row, 7.25rem), 1fr);
	gap: 1px;
	background: var(--epc-cal-rule);
	border-top: 1px solid var(--epc-cal-rule);
}

/* A week is its own positioning context so the bar overlay can share the day
   grid's geometry exactly. */
.epc-cal__week {
	position: relative;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 1px;
	background: var(--epc-cal-rule);
}

.epc-cal__day {
	position: relative;
	min-width: 0;
	background: var(--epc-cal-cell);
	padding: 0.4rem 0.5rem 0.5rem;
	/* Room for however many bar lanes this week uses. The row sets --epc-lanes;
	   the cell reserves exactly that much and no more, so a week with no runs
	   is not padded for runs it does not have. */
	padding-top: calc(var(--epc-cal-date-h) + (var(--epc-lanes, 0) * var(--epc-cal-bar-step)) + 0.35rem);
}

.epc-cal__day--out {
	background: var(--epc-cal-off);
}

.epc-cal__date {
	position: absolute;
	top: 0.35rem;
	left: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	height: 1.5rem;
	padding: 0 0.3rem;
	font-size: 0.8125rem;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	/* The date is the cell's anchor, so it carries body weight rather than the
	   muted tone it had — and the out-of-month tone below is the contrast, which
	   at 3.8:1 on the tinted cell it previously was not. */
	color: var(--epc-cal-body);
	border-radius: 6px;
}

.epc-cal__day--out .epc-cal__date {
	color: var(--epc-cal-muted);
}

.epc-cal__day--today .epc-cal__date {
	background: var(--epc-cal-accent);
	color: #fff;
	font-weight: 700;
}

/* --- Run bars ------------------------------------------------------------
 *
 * An overlay grid with the day grid's exact column template, so `span N` lands
 * on the same pixels the day cells do. It ignores pointer events except on the
 * bars themselves, otherwise it would swallow every click meant for a cell.
 */

.epc-cal__bars {
	position: absolute;
	inset: var(--epc-cal-date-h) 0 auto 0;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	grid-auto-rows: var(--epc-cal-bar-step);
	gap: 0 1px;
	padding: 0 0 0 0;
	pointer-events: none;
	z-index: 2;
}

/* Tinted, not filled.
 *
 * Solid saturated bands were the first attempt and they took the calendar over:
 * five runs across six week rows is thirty blocks of colour, and the events
 * that actually start on a given day — the ones a reader can still buy a ticket
 * to — became the quietest thing on the page. A 14% wash with the type colour
 * as text keeps a run legible and identifiable while leaving the days on top.
 *
 * Each colour property is declared twice: the plain value is the fallback for
 * anything without `color-mix`, which resolves the whole declaration to
 * invalid and falls back rather than half-applying.
 */
.epc-cal__bar {
	pointer-events: auto;
	grid-row: var(--epc-lane);
	grid-column: var(--epc-col) / span var(--epc-span);
	display: flex;
	align-items: center;
	gap: 5px;
	height: var(--epc-cal-bar-h);
	margin: 0 2px;
	padding: 0 7px;
	border-radius: 4px;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	color: var(--epc-cal-body);
	color: color-mix(in oklab, var(--epc-bar-color, var(--epc-type-default)) 74%, #16130f);
	background: #f1efeb;
	background: color-mix(in oklab, var(--epc-bar-color, var(--epc-type-default)) 13%, #fff);
	overflow: hidden;
	white-space: nowrap;
	transition: background-color 120ms ease;
}

/* The cap is an inset shadow rather than a border so adding it cannot change
   the box's width, which would knock the bar off the column it spans. */
.epc-cal__bar--opens {
	box-shadow: inset 3px 0 0 var(--epc-bar-color, var(--epc-type-default));
	padding-left: 10px;
}

.epc-cal__bar:hover,
.epc-cal__bar:focus-visible {
	background: #e8e4dd;
	background: color-mix(in oklab, var(--epc-bar-color, var(--epc-type-default)) 22%, #fff);
}

/* Price rides the far end of the segment that opens the run — the only one
   where "from $220" is answering a question the reader just asked. */
.epc-cal__barcost {
	margin-left: auto;
	padding-left: 8px;
	font-variant-numeric: tabular-nums;
}

.epc-cal__bar:focus-visible {
	outline: 2px solid var(--epc-cal-ink);
	outline-offset: 1px;
}

.epc-cal__bar[data-epc-type="workshops"] { --epc-bar-color: var(--epc-type-workshops); }
.epc-cal__bar[data-epc-type="exhibits"]  { --epc-bar-color: var(--epc-type-exhibits); }
.epc-cal__bar[data-epc-type="hula-arts"] { --epc-bar-color: var(--epc-type-hula-arts); }
.epc-cal__bar[data-epc-type="concerts"]  { --epc-bar-color: var(--epc-type-concerts); }

/* Caps are honest about the run, not about the week. A bar cut off by Saturday
   keeps a square edge and an arrow; only a bar that genuinely ends draws a
   finished one. */
.epc-cal__bar:not(.epc-cal__bar--opens) {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
	margin-left: 0;
}

.epc-cal__bar:not(.epc-cal__bar--ends) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
	margin-right: 0;
}

.epc-cal__bartitle {
	overflow: hidden;
	text-overflow: ellipsis;
}

.epc-cal__barcont {
	opacity: 0.5;
	font-weight: 400;
}

/* --- Events in a day ------------------------------------------------------
 *
 * One line each, one height each, a hairline between. Uniformity is the whole
 * point: a reader scanning a month is comparing rows, and rows that vary in
 * height by their content cannot be compared.
 */

.epc-cal__events {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.epc-cal__event + .epc-cal__event {
	border-top: 1px solid var(--epc-cal-hair);
}

.epc-cal__link {
	display: grid;
	grid-template-columns: 7px minmax(0, 1fr) auto;
	align-items: baseline;
	gap: 0 6px;
	padding: 4px 2px;
	text-decoration: none;
	color: var(--epc-cal-ink);
	border-radius: 4px;
	transition: background-color 110ms ease;
}

.epc-cal__link:hover,
.epc-cal__link:focus-visible {
	background: var(--epc-cal-off);
}

.epc-cal__link:focus-visible {
	outline: 2px solid var(--epc-cal-accent);
	outline-offset: -1px;
}

/* The type, as a 7px dot. A dot costs one glyph-width and colour-codes the
   whole grid; the alternative — printing "Workshops" after every title — is
   what the old grid did, and it made every entry read as a duplicate. */
.epc-cal__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--epc-type-default);
	transform: translateY(-1px);
}

/* Scoped to the type attribute rather than to the grid's own row class, so the
   agenda's rows colour identically. Keying on `.epc-cal__event` left every dot
   on a phone grey — the one screen where the dot is the only type cue there is. */
.epc-calendar [data-epc-type="workshops"] .epc-cal__dot { background: var(--epc-type-workshops); }
.epc-calendar [data-epc-type="exhibits"]  .epc-cal__dot { background: var(--epc-type-exhibits); }
.epc-calendar [data-epc-type="hula-arts"] .epc-cal__dot { background: var(--epc-type-hula-arts); }
.epc-calendar [data-epc-type="concerts"]  .epc-cal__dot { background: var(--epc-type-concerts); }

.epc-cal__when {
	font-size: 0.6875rem;
	font-variant-numeric: tabular-nums;
	color: var(--epc-cal-muted);
	white-space: nowrap;
}

.epc-cal__title {
	grid-column: 2 / span 2;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Price is the other half of the decision, so it gets the corner rather than
   a click. Tabular so a column of prices lines up on the decimal. */
.epc-cal__cost {
	font-size: 0.6875rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--epc-cal-body);
	white-space: nowrap;
}

.epc-cal__cost--free {
	color: #2f6b3f;
}

.epc-cal__more {
	display: inline-block;
	margin-top: 3px;
	padding: 1px 4px;
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--epc-cal-muted);
	background: none;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
}

.epc-cal__more:hover {
	color: var(--epc-cal-ink);
	background: var(--epc-cal-off);
}

.epc-cal__badge {
	font-size: 0.5625rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--epc-cal-dim);
}

.epc-cal__event.is-draft .epc-cal__title {
	font-style: italic;
	color: var(--epc-cal-muted);
}

/* Filtering hides events, never day cells: a month that loses its 14th when
   you tap "Concerts" has stopped being a calendar. */
.epc-cal__event[hidden],
.epc-cal__bar[hidden],
.epc-cal__running li[hidden] {
	display: none;
}

/* --- Peek -----------------------------------------------------------------
 *
 * The month grid can carry when-and-what-it-costs and nothing more. Everything
 * else a person wants before committing — what it looks like, where it is, how
 * long the run is — lives here, one hover or one focus away, so the decision
 * does not cost a page load. Enhancement only: with no JavaScript every entry
 * is still an ordinary link to the event.
 */

.epc-cal__peek {
	position: absolute;
	z-index: 40;
	width: min(23rem, calc(100vw - 2rem));
	background: var(--epc-cal-cell);
	border: 1px solid var(--epc-cal-rule);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(28, 24, 20, 0.14), 0 2px 6px rgba(28, 24, 20, 0.06);
	overflow: hidden;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 140ms ease, transform 140ms ease;
	pointer-events: none;
}

.epc-cal__peek[data-open] {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

/* Capped rather than free: with a full 16:9 the card ran past 500px and could
   not fit beside an entry in the first or last week without being clamped. */
.epc-cal__peekfig {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: 9.5rem;
	object-fit: cover;
	background: var(--epc-cal-off);
	border-bottom: 1px solid var(--epc-cal-hair);
}

.epc-cal__peekbody {
	padding: 0.9rem 1rem 1rem;
}

.epc-cal__peektype {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-family: var(--epc-head, inherit);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--epc-cal-muted);
}

.epc-cal__peektitle {
	margin: 0.4rem 0 0.5rem;
	font-family: var(--epc-head, inherit);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--epc-cal-ink);
}

.epc-cal__peekrow {
	display: flex;
	gap: 0.5rem;
	font-size: 0.8125rem;
	color: var(--epc-cal-muted);
	margin-top: 0.2rem;
}

.epc-cal__peekrow dt {
	flex: none;
	width: 3.6rem;
	color: var(--epc-cal-dim);
}

.epc-cal__peekrow dd {
	margin: 0;
	color: var(--epc-cal-body);
}

.epc-cal__peekdesc {
	margin: 0.7rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--epc-cal-muted);
}

.epc-cal__peekcta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.9rem;
	padding: 0.55rem 0.95rem;
	font-family: var(--epc-head, inherit);
	font-size: 0.8125rem;
	font-weight: 700;
	color: #fff;
	background: var(--epc-cal-accent);
	border-radius: 6px;
	text-decoration: none;
}

.epc-cal__peekcta:hover {
	filter: brightness(1.08);
}

.epc-cal__peekcta:focus-visible {
	outline: 2px solid var(--epc-cal-ink);
	outline-offset: 2px;
}

/* Escape closes it and so does clicking away, but neither is discoverable, and
   on a touch screen "click away" competes with scrolling. */
.epc-cal__peekclose {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	width: 1.75rem;
	height: 1.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.05rem;
	line-height: 1;
	color: var(--epc-cal-ink);
	background: rgba(255, 255, 255, 0.86);
	border: 1px solid var(--epc-cal-rule);
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
}

.epc-cal__peekclose:hover {
	background: #fff;
	border-color: var(--epc-cal-dim);
}

.epc-cal__peekclose:focus-visible {
	outline: 2px solid var(--epc-cal-accent);
	outline-offset: 1px;
}

/* --- Agenda ---------------------------------------------------------------
 *
 * Below 768px a seven-column grid gives each day about 45px, which cannot hold
 * a title, let alone a price. The month becomes a day-by-day agenda — the same
 * events, ordered the way someone on a phone reads them. Empty days are simply
 * absent: a phone screen of blank cells is not information.
 */

.epc-cal__agendawrap {
	display: none;
}

.epc-cal__agenda {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--epc-cal-rule);
	border-radius: var(--epc-cal-radius);
	overflow: hidden;
}

.epc-cal__agendaday {
	display: grid;
	grid-template-columns: 3.25rem minmax(0, 1fr);
	gap: 0 0.75rem;
	padding: 0.7rem 0.85rem;
	background: var(--epc-cal-cell);
}

.epc-cal__agendaday + .epc-cal__agendaday {
	border-top: 1px solid var(--epc-cal-hair);
}

.epc-cal__agendaday--today {
	background: #fdf6f4;
}

.epc-cal__agendadate {
	text-align: center;
	padding-top: 0.15rem;
}

.epc-cal__agendadow {
	display: block;
	font-family: var(--epc-head, inherit);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--epc-cal-dim);
}

.epc-cal__agendanum {
	display: block;
	font-family: var(--epc-head, inherit);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	color: var(--epc-cal-ink);
}

.epc-cal__agendaday--today .epc-cal__agendanum {
	color: var(--epc-cal-accent);
}

.epc-cal__agendalist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.epc-cal__agendalist li + li {
	margin-top: 0.45rem;
	padding-top: 0.45rem;
	border-top: 1px solid var(--epc-cal-hair);
}

.epc-cal__agendalink {
	display: grid;
	grid-template-columns: 8px minmax(0, 1fr) auto;
	gap: 0 0.5rem;
	align-items: baseline;
	text-decoration: none;
	color: var(--epc-cal-ink);
}

.epc-cal__agendalink .epc-cal__title {
	white-space: normal;
	font-size: 0.875rem;
	grid-column: 2;
}

.epc-cal__agendalink .epc-cal__when {
	grid-column: 2;
	font-size: 0.75rem;
}

.epc-cal__agendalink .epc-cal__cost {
	grid-row: 1;
	grid-column: 3;
	font-size: 0.75rem;
}

@media (max-width: 767px) {
	.epc-cal__frame,
	.epc-cal__filters {
		display: none;
	}

	.epc-cal__agendawrap {
		display: block;
	}

	.epc-cal__head {
		align-items: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.epc-calendar *,
	.epc-cal__peek {
		transition: none !important;
	}
}
