/* ==========================================================================
   Programa — Lineupr-style schedule
   Markup contract: see inc/schedule-markup.php
   Base styles (no JS / editor) → list of days stacked.
   .is-enhanced (added by programa.js) → tabs, filters, side detail panel.
   ========================================================================== */

:where(.remoa-schedule, .remoa-day, .editor-styles-wrapper) {
	--rs-bg: #050508;
	--rs-row: #0e0e15;
	--rs-row-hover: #15151f;
	--rs-line: rgba(255, 255, 255, 0.07);
	--rs-bar: var(--wp--preset--color--surface, #1e0a2a);
	--rs-bar-strong: #2b0f3d;
	--rs-text: #fff;
	--rs-text-mid: rgba(255, 255, 255, 0.72);
	--rs-text-low: rgba(255, 255, 255, 0.5);
	--rs-accent: var(--wp--preset--color--primary, #e8d000);
	--rs-active: var(--wp--preset--color--highlight, #00d8f0);
	--rs-font: "Inter", system-ui, sans-serif;
	--rs-font-ui: "Barlow Semi Condensed", "Inter", sans-serif;
	--rs-top: var(--wp-admin--admin-bar--height, 0px);
	--rs-offset: 0px; /* site nav height, set by programa.js */
	--rs-sticky: calc(var(--rs-top) + var(--rs-offset));
	--rs-icon: 48px;
	--rs-gutter: 16px;
}

/* ── Day / slot / session (base) ─────────────────────────────────────────── */

.remoa-day {
	background: var(--rs-bg);
	color: var(--rs-text);
	font-family: var(--rs-font);
	font-size: 0.95rem;
	line-height: 1.4;
}
.remoa-day + .remoa-day { margin-top: 2rem; }

.remoa-day .remoa-day__label {
	margin: 0;
	padding: 1.25rem var(--rs-gutter) 0.75rem;
	font-family: var(--rs-font-ui);
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--rs-accent);
}

.remoa-slot { margin: 0; }

.remoa-slot .remoa-slot__time {
	margin: 0;
	padding: 0.7rem var(--rs-gutter);
	font-family: var(--rs-font-ui);
	font-weight: 600;
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
	color: var(--rs-text);
	border-top: 1px solid var(--rs-line);
}

.remoa-session {
	position: relative;
	display: grid;
	grid-template-columns: var(--rs-icon) minmax(0, 1fr) auto;
	column-gap: 16px;
	row-gap: 2px;
	align-items: start;
	margin: 0;
	padding: 14px var(--rs-gutter);
	background: var(--rs-row);
	border-left: 3px solid transparent;
	border-top: 1px solid var(--rs-line);
	transition: background-color 0.15s ease;
}

/* Icon: first core/image, or a neutral placeholder when there is none */
.remoa-session > .wp-block-image,
.remoa-session::before {
	grid-column: 1;
	grid-row: 1 / span 3;
	width: var(--rs-icon);
	height: var(--rs-icon);
	margin: 0;
}
.remoa-session > .wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 6px;
}
.remoa-session::before {
	content: "";
	background: var(--rs-text-low);
	opacity: 0.45;
	-webkit-mask: var(--rs-placeholder) center / 60% no-repeat;
	mask: var(--rs-placeholder) center / 60% no-repeat;
	--rs-placeholder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='1.5'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3Ccircle cx='9' cy='10' r='1.2'/%3E%3Ccircle cx='15' cy='10' r='1.2'/%3E%3C/svg%3E");
}
.remoa-session:has(> .wp-block-image)::before { content: none; }
.remoa-session > .wp-block-image figcaption { display: none; }

.remoa-session > :not(.wp-block-image):not(.remoa-fav) {
	grid-column: 2;
	margin: 0;
}

.remoa-session .remoa-session__title {
	font-family: var(--rs-font);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.35;
	color: var(--rs-text);
	text-wrap: pretty;
}
.remoa-session .remoa-session__room {
	font-size: 0.875rem;
	color: var(--rs-text-mid);
}
.remoa-session .remoa-session__track,
.rs-detail__meta .remoa-session__track {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-self: start;
	margin-top: 4px;
	font-size: 0.78rem;
	color: var(--rs-text-mid);
}
.remoa-session .remoa-session__track::before,
.rs-detail__meta .remoa-session__track::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--rs-track, var(--rs-active));
	flex-shrink: 0;
}

.remoa-session__details {
	margin-top: 10px !important;
	font-size: 0.875rem;
	color: var(--rs-text-mid);
}
.remoa-session__details > * { margin: 0 0 0.5rem; }
.remoa-session__details .remoa-session__when { color: var(--rs-text); }

/* ── Links (core/buttons) as list rows ──────────────────────────────────── */

.remoa-session__details .wp-block-buttons {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
}
.remoa-session__details .wp-block-button { width: 100%; }
.remoa-session__details .wp-block-button__link {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	column-gap: 16px;
	align-items: center;
	width: 100%;
	padding: 10px 0;
	background: none;
	border: 0;
	border-radius: 0;
	color: var(--rs-text);
	font-family: var(--rs-font);
	font-size: 1rem;
	text-align: left;
	text-decoration: none;
}
.remoa-session__details .wp-block-button__link::before {
	content: "";
	grid-row: 1 / span 2;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 17H7A5 5 0 0 1 7 7h2M15 7h2a5 5 0 1 1 0 10h-2M8 12h8'/%3E%3C/svg%3E") center / 20px no-repeat,
		var(--rs-bar-strong);
	transition: background-color 0.15s ease;
}
.remoa-session__details .wp-block-button__link[data-host]::after {
	content: attr(data-host);
	grid-column: 2;
	font-size: 0.85rem;
	color: var(--rs-text-low);
}
.remoa-session__details .wp-block-button__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.remoa-session__details .wp-block-button__link:hover::before { background-color: #4a1a66; }

/* ==========================================================================
   Page template
   ========================================================================== */

.remoa-schedule {
	background: var(--rs-bg);
	color: var(--rs-text);
	font-family: var(--rs-font);
	min-height: 100vh;
}
.remoa-schedule .remoa-schedule__detail { display: none; }

.remoa-schedule__bar {
	gap: 12px;
	min-height: 64px;
	padding: 0 8px 0 var(--rs-gutter);
	background: var(--rs-bar);
}
.remoa-schedule .remoa-schedule__title {
	flex: 1;
	min-width: 0;
	margin: 0;
	font-family: var(--rs-font-ui);
	font-size: 1.35rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--rs-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Enhanced layout ─────────────────────────────────────────────────────── */

.remoa-schedule.is-enhanced {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr);
	align-items: start;
}
.remoa-schedule.is-enhanced .remoa-schedule__main {
	min-width: 0;
	min-height: calc(100vh - var(--rs-sticky));
	border-right: 1px solid var(--rs-line);
}

.remoa-schedule__head {
	position: sticky;
	top: var(--rs-sticky);
	z-index: 20;
	background: var(--rs-bar);
}

/* Bar action buttons (favourites filter, search) */
.remoa-schedule__actions { display: flex; gap: 4px; }
/* Stays right even without a page title (beats core's `.is-layout-flex > :is(*, div) { margin: 0 }`) */
.remoa-schedule__bar > .remoa-schedule__actions { margin-left: auto; }
.rs-iconbtn {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--rs-text);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.rs-iconbtn:hover { background: rgba(255, 255, 255, 0.08); }
.rs-iconbtn svg { width: 22px; height: 22px; }
.rs-iconbtn[aria-pressed="true"] { color: var(--rs-accent); }
.rs-iconbtn[aria-pressed="true"] .rs-heart { fill: currentColor; }

/* Search row */
.remoa-schedule__search {
	padding: 0 var(--rs-gutter) 12px;
}
.remoa-schedule__search[hidden] { display: none; }
.remoa-schedule__search input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 14px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.3);
	color: var(--rs-text);
	font: inherit;
	font-size: 0.95rem;
}
.remoa-schedule__search input::placeholder { color: var(--rs-text-low); }

/* Day tabs */
.remoa-schedule__tabs {
	display: flex;
	overflow-x: auto;
	scrollbar-width: none;
}
.remoa-schedule__tabs::-webkit-scrollbar { display: none; }
.remoa-schedule__tab {
	flex: 1 0 auto;
	min-width: 120px;
	padding: 14px 16px 12px;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	color: var(--rs-text-mid);
	font-family: var(--rs-font-ui);
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.remoa-schedule__tab:hover { color: var(--rs-text); }
.remoa-schedule__tab[aria-selected="true"] {
	color: var(--rs-text);
	border-bottom-color: var(--rs-accent);
}

/* Filter row */
.remoa-schedule__filter {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 8px 0 var(--rs-gutter);
	min-height: 48px;
	background: #0a0a10;
	border-bottom: 1px solid var(--rs-line);
}
.remoa-schedule__filter label {
	font-size: 0.875rem;
	color: var(--rs-text-mid);
}
.remoa-schedule__filter select {
	flex: 1;
	min-width: 0;
	padding: 8px 32px 8px 0;
	border: 0;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M7 12h10M10 17h4'/%3E%3C/svg%3E") right 8px center / 20px no-repeat;
	color: var(--rs-text);
	font: inherit;
	font-size: 0.875rem;
	appearance: none;
	cursor: pointer;
}
.remoa-schedule__filter select option { background: #111; color: #fff; }

/* Enhanced list */
.remoa-schedule.is-enhanced .remoa-schedule__content > *:not(.remoa-day) { margin: 0; }
.remoa-schedule.is-enhanced .remoa-day + .remoa-day { margin-top: 0; }
.remoa-schedule.is-enhanced .remoa-day[hidden],
.remoa-schedule.is-enhanced .remoa-slot[hidden],
.remoa-schedule.is-enhanced .remoa-session[hidden] { display: none; }
.remoa-schedule.is-enhanced .remoa-day__label { display: none; }
.remoa-schedule.is-enhanced .remoa-session .remoa-session__details { display: none; }
.remoa-schedule.is-enhanced .remoa-slot__time { background: var(--rs-bg); }

.remoa-schedule.is-enhanced .remoa-session { cursor: pointer; scroll-margin-top: calc(var(--rs-sticky) + 160px); }
.remoa-schedule.is-enhanced .remoa-session:hover { background: var(--rs-row-hover); }
.remoa-schedule.is-enhanced .remoa-session.is-selected {
	background: color-mix(in srgb, var(--rs-active) 8%, var(--rs-row));
	border-left-color: var(--rs-active);
}

/* Stretched button over the whole row (title) */
.remoa-session__open {
	all: unset;
	cursor: pointer;
	text-wrap: pretty;
}
.remoa-session__open::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.remoa-session__open:focus-visible { outline: none; }
.remoa-session:has(.remoa-session__open:focus-visible) {
	outline: 2px solid var(--rs-accent);
	outline-offset: -2px;
}

/* Favourite toggle */
.remoa-fav {
	position: relative;
	z-index: 2;
	grid-column: 3;
	grid-row: 1 / span 3;
	align-self: center;
}
.rs-heart { transition: fill 0.15s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.3, 1.4); }
.remoa-fav[aria-pressed="true"] { color: var(--rs-accent); }
.remoa-fav[aria-pressed="true"] .rs-heart { fill: currentColor; transform: scale(1.1); }
.remoa-fav:focus-visible,
.rs-iconbtn:focus-visible,
.remoa-schedule__tab:focus-visible,
.remoa-schedule__filter select:focus-visible,
.remoa-schedule__search input:focus-visible {
	outline: 2px solid var(--rs-accent);
	outline-offset: -2px;
}

.remoa-day__empty {
	margin: 0;
	padding: 3rem var(--rs-gutter);
	text-align: center;
	color: var(--rs-text-low);
}

/* ── Detail panel ────────────────────────────────────────────────────────── */

.remoa-schedule.is-enhanced .remoa-schedule__detail {
	display: flex;
	flex-direction: column;
	position: sticky;
	top: var(--rs-sticky);
	height: calc(100vh - var(--rs-sticky));
	overflow: hidden; /* the bar stays put; only the body below scrolls */
	background: var(--rs-bg);
}
.remoa-schedule.is-enhanced .remoa-schedule__detail-body {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.remoa-schedule__detail-bar {
	gap: 8px;
	min-height: 64px;
	padding: 0 var(--rs-gutter);
	background: var(--rs-bar);
	flex-shrink: 0;
}
.remoa-schedule .remoa-schedule__detail-heading {
	margin: 0;
	font-family: var(--rs-font-ui);
	font-size: 1.35rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}
.remoa-schedule__back { display: none; margin-left: -12px; }

.remoa-schedule .remoa-schedule__empty {
	margin: 0;
	padding: 3rem var(--rs-gutter);
	color: var(--rs-text-low);
	text-align: center;
}

.rs-detail__hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	padding: 16px var(--rs-gutter) 0;
	background: linear-gradient(var(--rs-bar) 60px, transparent 60px);
}
.rs-detail__icon {
	display: grid;
	place-items: center;
	width: 120px;
	height: 120px;
	border-radius: 8px;
	background: var(--rs-row);
	box-shadow: 0 0 0 1px var(--rs-line);
	overflow: hidden;
}
.rs-detail__icon img { width: 100%; height: 100%; object-fit: cover; }
.rs-detail__icon svg { width: 48px; height: 48px; color: var(--rs-text-low); }
.rs-detail__hero .remoa-fav { grid-column: auto; grid-row: auto; align-self: auto; }

.rs-detail__meta {
	padding: 20px var(--rs-gutter) 20px;
	border-bottom: 1px solid var(--rs-line);
}
.rs-detail__title {
	margin: 0 0 4px;
	font-family: var(--rs-font);
	font-size: 1.35rem;
	font-weight: 500;
	line-height: 1.3;
	text-wrap: balance;
}
.rs-detail__when {
	margin: 0 0 12px;
	color: var(--rs-text-mid);
	font-variant-numeric: tabular-nums;
}
.rs-detail__room {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 6px 14px 6px 10px;
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 999px;
	font-size: 0.95rem;
}
.rs-detail__room svg { width: 18px; height: 18px; flex-shrink: 0; }
.rs-detail__meta .remoa-session__track { display: flex; margin-top: 12px; }

.rs-detail__body {
	padding: 16px var(--rs-gutter) 32px;
	color: var(--rs-text-mid);
	line-height: 1.55;
}
.rs-detail__body > * { margin: 0 0 1rem; }
.rs-detail__body .remoa-session__when { display: none; }
.rs-detail__body .remoa-session__details { margin: 0 !important; font-size: 0.95rem; }

/* ── Mobile: list full width, detail as full-screen sheet ───────────────── */

@media (max-width: 899px) {
	.remoa-schedule.is-enhanced { display: block; }
	.remoa-schedule.is-enhanced .remoa-schedule__main { border-right: 0; }
	.remoa-schedule.is-enhanced .remoa-session.is-selected {
		background: var(--rs-row);
		border-left-color: transparent;
	}

	.remoa-schedule.is-enhanced .remoa-schedule__detail {
		position: fixed;
		inset: var(--rs-top) 0 0 0;
		z-index: 1100;
		height: auto;
		transform: translateX(100%);
		visibility: hidden;
		transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.28s;
	}
	.remoa-schedule.is-enhanced .remoa-schedule__detail.is-open {
		transform: none;
		visibility: visible;
		transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
	}
	.remoa-schedule__back { display: inline-grid; }
	.remoa-schedule__tab { min-width: 0; flex: 1 0 auto; padding-inline: 12px; }
}

body.remoa-schedule-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.remoa-schedule *,
	.remoa-schedule *::before,
	.remoa-schedule *::after { transition: none !important; }
}

/* ── Shell built by JS (page not using the "Programa" template) ─────────── */

.remoa-schedule__bar,
.remoa-schedule__detail-bar {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
}
.remoa-schedule--embedded {
	min-height: 0;
	border: 1px solid var(--rs-line);
	border-radius: 8px;
	overflow: clip;
}
.remoa-schedule--embedded.is-enhanced .remoa-schedule__main,
.remoa-schedule--embedded.is-enhanced .remoa-schedule__detail {
	min-height: 0;
	max-height: calc(100vh - var(--rs-top));
}
.remoa-schedule--embedded.is-enhanced .remoa-schedule__main { overflow-y: auto; }
.remoa-schedule--embedded .remoa-schedule__head { top: 0; }

/* ── Empty detail state (Lineupr-like) ──────────────────────────────────── */

.remoa-schedule.is-enhanced .remoa-schedule__detail-body {
	display: flex;
	flex-direction: column;
	flex: 1;
}
.rs-detail__empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 3rem var(--rs-gutter);
	text-align: center;
	color: var(--rs-text-mid);
}
.rs-detail__empty p { margin: 0; font-size: 0.95rem; }
.rs-detail__empty-icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.07);
	color: var(--rs-text-mid);
}
.rs-detail__empty-icon svg { width: 22px; height: 22px; }

/* ── Venue pill → full address ──────────────────────────────────────────── */

button.rs-detail__room {
	background: none;
	color: var(--rs-text);
	font: inherit;
	font-size: 0.95rem;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
button.rs-detail__room:hover { background: rgba(255, 255, 255, 0.06); }
button.rs-detail__room:focus-visible { outline: 2px solid var(--rs-accent); outline-offset: 2px; }
.rs-detail__chevron { display: inline-grid; margin-left: 2px; transition: transform 0.2s ease; }
.rs-detail__chevron svg { width: 16px; height: 16px; }
button.rs-detail__room[aria-expanded="true"] .rs-detail__chevron { transform: rotate(180deg); }

.rs-detail__address {
	margin-top: 12px;
	padding: 14px 16px;
	border-left: 2px solid var(--rs-accent);
	background: var(--rs-row);
	border-radius: 0 6px 6px 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--rs-text-mid);
}
.rs-detail__address[hidden] { display: none; }
.rs-detail__address p { margin: 0 0 8px; color: var(--rs-text); }
.rs-detail__address a {
	color: var(--rs-accent);
	font-size: 0.875rem;
	text-underline-offset: 3px;
}

/* Address paragraph as authored (editor / no-JS); hidden in the enhanced list */
.remoa-session .is-style-remoa-address,
.remoa-session .remoa-session__address {
	padding-left: 22px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8d000'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") left 2px / 16px no-repeat;
}

.remoa-schedule.is-enhanced .remoa-session > .is-style-remoa-address,
.remoa-schedule.is-enhanced .remoa-session > .remoa-session__address { display: none; }

/* Optional fields left empty: hide on the front end (the editor shows their placeholder) */
.remoa-session p:empty:not([contenteditable]) { display: none; }
