/*
 * Programma page (template-parts/page-programma.php) — the page's own rules.
 *
 * Loaded in the <head> for that template only (functions.php
 * mwf_enqueue_event_assets), after custom-css/mwf.css, whose .mwfe tokens
 * every colour here uses. Until 2026-09-10 these rules were an inline <style>
 * block at the end of the template.
 *
 * Styles the [wh_programma] markup contract:
 *   section.days#days > article.day[data-date] > .dayhead(h2 + .date)
 *     + .slot[data-type] > button.toggle(.time / .title / .chev) + .content
 * Slots are DIRECT children of .day (no wrapper) — a divider list.
 *
 * 2026-09-10 (owner): the colour scheme follows the 2026 identity — the wine
 * red of the year as the ground and as the timeline ball, cream text, gold
 * for the selected state, brass hairlines — matching the masterclass page's
 * approved treatment (css/masterclass.css) so the two schedule pages read as
 * one. The timeline rail was rebuilt: the line runs through the CENTRE of
 * the ball at every position, the end dots sit exactly on the line's ends,
 * one tick per day marks the stops, and the ball is dragged between them.
 */

.programma {
	--ink:    var(--mwfe-cream);
	--muted:  var(--mwfe-cream-dim);
	--accent: var(--mwfe-brass);
	--gold:   #a87c0b;                  /* the selected state (owner, 2026-09-06) */
	--wine:   var(--mwfe-wine-mid);     /* the red of the year, deep enough to read on the wave ground top and bottom */
	--line:   var(--mwfe-line);
	--glass:  var(--mwfe-glass);
	--container-w: min(71.875rem, 92vw);
	--timeline-w: 6.875rem;
	--ball: 5.5rem;
	--radius: 18px;
	font-family: var(--mwfe-serif);
	font-size: 1.0625rem;
	line-height: 1.5;
	color: var(--ink);
	padding-bottom: 10vh;
}
.programma * { box-sizing: border-box; }

/* ------------------------------------------------------------ filter bar */
.programma .filter-bar {
	display: flex;
	gap: .7rem;
	flex-wrap: wrap;
	justify-content: center;
	width: var(--container-w);
	margin: 0 auto;
	padding: 2.2rem 0 1.4rem;
}
.programma .filter-btn {
	font-family: var(--mwfe-sans);
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--ink);
	background: var(--glass);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: .85em 1.6em;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: background .3s, color .3s, transform .3s, border-color .3s;
}
.programma .filter-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.programma .filter-btn:focus-visible { outline: 2px solid var(--mwfe-gold-light); outline-offset: 3px; }
.programma .filter-btn.active {
	background: var(--gold);
	color: var(--mwfe-bg-deep);
	border-color: var(--mwfe-gold-light);
}

/* ------------------------------------------------------------- layout */
.programma .wrap {
	width: var(--container-w);
	margin: 0 auto;
	display: grid;
	grid-template-columns: var(--timeline-w) 1fr;
	column-gap: 36px;
}

/* ------------------------------------------------------------ timeline */
.programma .timeline {
	position: sticky;
	top: calc(var(--mwfe-header-h, 14vh) + 24px);
	height: calc(100vh - var(--mwfe-header-h, 14vh) - 48px);
	align-self: start;
	display: flex;
	align-items: center;
	justify-content: center;
}
/* The rail is as wide as the ball, so the ball is centred in it by
   construction and never leaves its grid column. The LINE is a centred
   pseudo-element: every dot, tick and the ball sit on the same 50% axis
   with translate(-50%), which is what keeps the line through the ball's
   centre at any position. */
.programma .track {
	position: relative;
	width: var(--ball);
	height: 88%;
	user-select: none;
	-webkit-user-select: none;
}
.programma .track::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 2px;
	translate: -50% 0;
	background: var(--line);
}
.programma .track .dot,
.programma .track .tick {
	position: absolute;
	left: 50%;
	translate: -50% -50%;
	border-radius: 50%;
	background: var(--accent);
	cursor: pointer;
}
/* Terminals: the first and last day, exactly on the line's ends. */
.programma .track .dot { width: .875rem; height: .875rem; }
.programma .track .dot.top { top: 0; }
.programma .track .dot.bottom { top: 100%; }
/* One tick per interior day; the ball snaps between these. */
.programma .track .tick { width: .5rem; height: .5rem; opacity: .6; }
.programma .track .tick::after,
.programma .track .dot::after { content: ""; position: absolute; inset: -.75rem; } /* a finger-sized hit area */
.programma .track .tick:hover,
.programma .track .dot:hover { background: var(--mwfe-gold-light); opacity: 1; }

.programma .ball {
	position: absolute;
	left: 50%;
	top: 0;                             /* JS moves this between the day stops */
	translate: -50% -50%;               /* so `top` addresses the ball's CENTRE */
	width: var(--ball);
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background: var(--wine);
	border: 1px solid var(--accent);
	color: var(--mwfe-gold-light);
	display: grid;
	place-items: center;
	font-weight: 700;
	letter-spacing: .02em;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .55), inset 0 -8px 18px rgba(0, 0, 0, .25), 0 0 0 6px rgba(var(--mwfe-ink-rgb), .35);
	transition: top .35s cubic-bezier(.2, .7, .2, 1), box-shadow .2s;
	touch-action: none;
	cursor: grab;
	z-index: 1;
}
.programma .ball.dragging { cursor: grabbing; transition: none; box-shadow: 0 14px 34px rgba(0, 0, 0, .65), inset 0 -8px 18px rgba(0, 0, 0, .25), 0 0 0 8px rgba(var(--mwfe-ink-rgb), .45); }
.programma .ball:focus-visible { outline: 2px solid var(--mwfe-gold-light); outline-offset: 4px; }
.programma .ball .date {
	font-size: 1.5rem;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- days */
.programma .days { display: grid; gap: 1.75rem; padding: .5rem 0 5rem; }
.programma .day { overflow: hidden; }
.programma .day:last-of-type { min-height: 50vh; } /* so the last day can become the current one */

.programma .day .dayhead,
.programma .programma-placeholder {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.125rem 1.375rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--glass);
	backdrop-filter: blur(6px);
}
.programma .programma-placeholder {
	margin-bottom: 25vh;
	text-align: center;
	justify-content: center;
	flex-direction: column;
	align-items: center;
}
.programma .day .dayhead h2,
.programma .programma-placeholder h2 {
	margin: 0;
	font-size: clamp(1.4rem, 2.6vw, 1.9rem);
	font-weight: 600;
	color: var(--mwfe-gold-light);
}
.programma .dayhead .date {
	font-variant-numeric: tabular-nums;
	color: var(--accent);
	font-weight: 700;
	font-size: clamp(1.2rem, 2.2vw, 1.7rem);
}

/* --------------------------------------------------------------- slots */
.programma .slot {
	border-bottom: 1px solid var(--line);
	overflow: hidden;
}
.programma .slot:last-child { border-bottom: 0; }
.programma .slot .toggle {
	display: grid;
	/* auto, not a fixed column: the time pill sizes itself (see the
	   masterclass page's overlap fix, 2026-09-08). */
	grid-template-columns: auto 1fr auto;
	gap: 1rem 1.25rem;
	width: 100%;
	border: 0;
	background: transparent;
	color: inherit;
	padding: 1rem .625rem;
	text-align: left;
	align-items: center;
	font: inherit;
	cursor: pointer;
}
.programma .slot .toggle:focus-visible { outline: 2px solid var(--mwfe-gold-light); outline-offset: -2px; border-radius: 12px; }
.programma .time {
	/* The one element in a slot read at a glance: a brass hairline pill with
	   light gold numerals, tabular so a stacked range aligns. */
	font-family: var(--mwfe-sans);
	font-weight: 700;
	font-size: .82rem;
	letter-spacing: .06em;
	color: var(--mwfe-gold-light);
	font-variant-numeric: tabular-nums;
	background: var(--glass);
	border: 1px solid var(--accent);
	text-align: center;
	padding: .75rem 1rem;
	border-radius: 25px;
	width: max-content;
	min-width: 5.25rem;
}
.programma .session {
	font-family: var(--mwfe-sans);
	font-size: .8rem;                   /* .66 → .8 (owner, 2026-09-12: larger throughout) */
	font-weight: 700;
	letter-spacing: .24em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: .25rem;
}
.programma .event-name {
	font-size: clamp(1.35rem, 2.3vw, 1.8rem); /* was 1.15/2vw/1.5 */
	font-weight: 600;
	color: var(--mwfe-gold-light);
	line-height: 1.25;
}
.programma .subtitle {
	font-style: italic;
	font-size: 1.15rem;                 /* was 1rem */
	color: var(--muted);
}
.programma .chev {
	color: var(--accent);
	font-size: 2rem;
	font-weight: 900;
	line-height: 1;
	transition: transform .25s ease;
}
.programma .slot.open .chev { transform: rotate(90deg); }

.programma .content {
	max-height: 0;
	overflow: hidden;
	padding: 0 .875rem;
	transition: max-height .3s ease, opacity .2s ease;
	opacity: .7;
	color: var(--muted);
}
.programma .content p { margin: .4em 0; }
.programma .slot.open .content { opacity: 1; padding-bottom: 18px; }

.programma .learnmore-button {
	display: inline-block;
	cursor: pointer;
	padding: 6px 16px;
	letter-spacing: .14em;
	font-family: var(--mwfe-sans);
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	border: 1px solid var(--accent);
	border-radius: 999px;
	color: var(--mwfe-gold-light);
	transition: background .3s, color .3s;
}
.programma .learnmore-button:hover { background: var(--accent); color: var(--mwfe-bg-deep); }

/* ------------------------------------------------------------- filters */
.programma .slot.filtered-out { display: none; }
.programma .empty-state { display: none; }
.programma .day.no-results .empty-state {
	display: block;
	padding: 40px 20px;
	text-align: center;
	color: var(--muted);
	font-style: italic;
}

/* -------------------------------------------------------------- mobile */
@media (max-width: 880px) {
	.programma { --timeline-w: 0px; }
	.programma .wrap { display: block; }
	.programma .timeline { display: none; }
	.programma .slot .toggle { grid-template-columns: 1fr auto; gap: 8px 12px; }
	.programma .time { grid-column: 1 / -1; width: max-content; padding: 8px 18px; }
	.programma .content { padding: 0 10px; }
	.programma .slot.open .content { padding-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.programma .ball,
	.programma .chev,
	.programma .content,
	.programma .filter-btn { transition: none; }
}
