/**
 * TV Display — 1920×1080 kiosk layout (white background)
 */

:root {
	--tv-bg: #ffffff;
	--tv-surface: #f7f7f7;
	--tv-surface-border: #e0e0e0;
	--tv-text: #1a1a1a;
	--tv-muted: #555555;
	--tv-accent: #8b4513;
	--tv-accent-secondary: #b8860b;
	--tv-header-h: 20vh;
	--tv-gap: 2vmin;
	--tv-header-body-gap: 2.5vmin;
	--tv-header-line-gap: 1.25vmin;
	--tv-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	height: 100%;
}

html,
body.tv-display-kiosk {
	margin: 0;
	padding: 0;
	min-height: 100%;
	height: 100%;
	overflow: hidden;
	background: var(--tv-bg);
	color: var(--tv-text);
	font-family: var(--tv-font);
	font-size: clamp(14px, 1.6vmin, 22px);
	line-height: 1.4;
	cursor: none;
}

.tv-layout {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	min-height: 100vh;
	min-height: 100dvh;
	height: 100vh;
	height: 100dvh;
	padding: 0 0 var(--tv-gap);
	background: var(--tv-bg);
}

/* Header — logo and accent line share the same width (no box border) */
.tv-header {
	display: block;
	width: auto;
	flex: 0 0 auto;
	flex-shrink: 0;
	margin: 0 var(--tv-gap) var(--tv-header-body-gap);
	padding: 0;
	border: 0;
	background: transparent;
}

.tv-header__band {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
}

.tv-header__logo {
	display: block;
	width: 100%;
	height: var(--tv-header-h);
	max-height: var(--tv-header-h);
	margin: 0;
	padding: 0;
	border: 0;
	object-fit: contain;
	object-position: center center;
	background: var(--tv-bg);
	-webkit-user-select: none;
	user-select: none;
}

.tv-header__line {
	display: block;
	width: 100%;
	height: 3px;
	margin: var(--tv-header-line-gap) 0 0;
	padding: 0;
	border: 0;
	background-color: var(--tv-accent);
	flex-shrink: 0;
}

/* Two-column body — horizontal inset matches .tv-header margins */
.tv-body--two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--tv-gap);
	flex: 1 1 auto;
	flex-grow: 1;
	min-height: 0;
	margin: 0 var(--tv-gap);
	padding: 0;
	padding-top: 0;
	width: auto;
}


.tv-col {
	background: var(--tv-surface);
	border: 1px solid var(--tv-surface-border);
	border-radius: 8px;
	padding: 2vmin;
	overflow: hidden;
	min-height: 0;
}

body.tv-display-special .tv-col {
	display: flex;
	flex-direction: column;
}

body.tv-display-special .tv-col--media {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

body.tv-display-special .tv-col--media .tv-carousel {
	flex: 1 1 auto;
	min-height: 0;
	height: 100%;
}

body.tv-display-special .tv-carousel__slide.is-active {
	height: 100%;
}

/* Carousel */
.tv-carousel {
	position: relative;
	height: 100%;
}

.tv-carousel__slide {
	display: none;
	height: 100%;
}

.tv-carousel__slide.is-active {
	display: block;
}

/* Media */
.tv-media {
	position: relative;
	height: 100%;
	width: 100%;
	background: #000;
}

.tv-media--image,
.tv-media--slideshow {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.tv-media img {
	max-width: 100%;
	max-height: 100%;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border: 0;
}

/* YouTube / video: cover the panel and crop player chrome (title bar, “Watch on YouTube”, etc.) */
.tv-media--youtube {
	overflow: hidden;
}

.tv-media__embed {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.tv-media__embed iframe,
.tv-media__embed .tv-media__video {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 177.78vh;
	height: 56.25vw;
	min-width: 100%;
	min-height: 100%;
	max-width: none;
	max-height: none;
	border: 0;
	transform: translate(-50%, -50%) scale(1.12);
	transform-origin: center center;
	object-fit: cover;
}

.tv-media--pdf {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.tv-media--pdf iframe {
	width: 100%;
	height: 100%;
	min-height: 60vh;
	border: 0;
}

/* Special event: auto-advance playlist (images, video, YouTube, PDF) */
.tv-media-playlist {
	position: relative;
	width: 100%;
	height: 100%;
	background: #000;
}

.tv-media-playlist__item {
	display: none;
	width: 100%;
	height: 100%;
}

.tv-media-playlist__item.is-active {
	display: block;
}

.tv-media-playlist__item .tv-media {
	height: 100%;
}

.tv-media--slideshow {
	position: relative;
	width: 100%;
	height: 100%;
	background: #fff;
}

.tv-slideshow__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.8s ease;
}

.tv-slideshow__image.is-active {
	opacity: 1;
}

/* Special event info */
.tv-event-info__title {
	margin: 0 0 0.5em;
	font-size: 2.2em;
	color: var(--tv-accent);
	line-height: 1.15;
}

.tv-event-info__dates {
	color: var(--tv-muted);
	font-size: 1.15em;
	margin: 0 0 1em;
}

body.tv-display-special .tv-col--info {
	overflow-y: auto;
}

.tv-event-info__content {
	margin-top: 0.25em;
	font-size: 1.05em;
	line-height: 1.45;
	color: var(--tv-text);
}

.tv-rich-text > :first-child {
	margin-top: 0;
}

.tv-rich-text > :last-child {
	margin-bottom: 0;
}

.tv-rich-text h2,
.tv-rich-text h3,
.tv-rich-text h4 {
	color: var(--tv-accent);
	margin: 1em 0 0.4em;
	line-height: 1.2;
}

.tv-rich-text h2 {
	font-size: 1.35em;
}

.tv-rich-text h3 {
	font-size: 1.2em;
}

.tv-rich-text p {
	margin: 0 0 0.75em;
}

.tv-rich-text ul,
.tv-rich-text ol {
	margin: 0 0 0.75em;
	padding-left: 1.4em;
}

.tv-rich-text table {
	width: 100%;
	border-collapse: collapse;
	margin: 0.5em 0 1em;
	font-size: 0.95em;
}

.tv-rich-text th,
.tv-rich-text td {
	border: 1px solid var(--tv-surface-border);
	padding: 0.45em 0.65em;
	text-align: left;
	vertical-align: top;
}

.tv-rich-text th {
	background: var(--tv-surface);
	font-weight: 700;
	color: var(--tv-text);
}

.tv-rich-text tr:nth-child(even) td {
	background: rgba(0, 0, 0, 0.03);
}

.tv-rich-text a {
	color: var(--tv-accent);
	font-weight: 600;
}

/* Schedule page — columns fill height; lists auto-scroll when overflowing */
body.tv-display-schedule .tv-col {
	display: flex;
	flex-direction: column;
}

body.tv-display-schedule .tv-schedule-panel {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

body.tv-display-schedule .tv-schedule-panel__title {
	flex-shrink: 0;
}

body.tv-display-schedule .tv-schedule-panel__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	position: relative;
}

body.tv-display-schedule .tv-schedule-panel__scroll.is-scrolling .tv-schedule-panel__scroll-track {
	animation: tv-schedule-scroll linear infinite;
	will-change: transform;
}

.tv-schedule-list--clone {
	margin-top: var(--tv-scroll-gap, 1.5rem);
}

@keyframes tv-schedule-scroll {
	from {
		transform: translate3d(0, 0, 0);
	}
	to {
		transform: translate3d(0, calc(-1 * var(--tv-scroll-distance, 0px)), 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	body.tv-display-schedule .tv-schedule-panel__scroll.is-scrolling .tv-schedule-panel__scroll-track {
		animation: none;
	}
}

/* Schedule panels */
.tv-schedule-panel__title {
	margin: 0 0 0.75em;
	font-size: 1.8em;
	color: var(--tv-accent);
	border-bottom: 2px solid var(--tv-accent-secondary);
	padding-bottom: 0.3em;
}

.tv-schedule-panel__date {
	display: block;
	font-size: 0.65em;
	color: var(--tv-muted);
	font-weight: normal;
	margin-top: 0.25em;
}

.tv-schedule-day {
	margin-bottom: 1em;
}

.tv-schedule-day__name {
	margin: 0 0 0.35em;
	font-size: 1.2em;
	color: var(--tv-text);
}

.tv-schedule-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tv-schedule-list__item {
	display: grid;
	grid-template-columns: 5.5em 1fr;
	gap: 0.5em 1em;
	padding: 0.45em 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tv-schedule-list__item--rich {
	display: block;
	padding: 0.75em 0;
}

/* Line 1: date or range, and time when set */
.tv-schedule-list__when {
	margin: 0 0 0.35em;
	font-size: 0.95em;
	font-weight: 600;
	color: var(--tv-accent-secondary);
	line-height: 1.35;
}

/* Line 2: event name */
.tv-schedule-list__title {
	margin: 0 0 0.25em;
	font-weight: 700;
	font-size: 1.05em;
	color: var(--tv-text);
	line-height: 1.3;
}

/* Line 3: summary */
.tv-schedule-list__summary {
	margin: 0;
	font-size: 0.92em;
	color: var(--tv-muted);
	line-height: 1.35;
}

/* Daily event whose time (or end time) has passed today — Eastern */
.tv-schedule-list__item--elapsed {
	background-color: #e8e8e8;
	opacity: 0.72;
}

.tv-schedule-list__item--elapsed .tv-schedule-list__when,
.tv-schedule-list__item--elapsed .tv-schedule-list__title,
.tv-schedule-list__item--elapsed .tv-schedule-list__summary {
	color: var(--tv-muted);
}

.tv-schedule-list__note {
	grid-column: 2;
	font-size: 0.9em;
	color: var(--tv-muted);
}

.tv-empty {
	color: var(--tv-muted);
	font-style: italic;
	text-align: center;
	margin-top: 20vh;
}

.tv-fallback {
	max-width: 40rem;
	margin: 4rem auto;
	padding: 2rem var(--tv-gap);
	font-size: 1.1rem;
}

.tv-fallback__links {
	line-height: 2;
}

.tv-fallback__links a {
	color: var(--tv-accent);
	font-weight: 600;
}

.tv-fallback__hint {
	color: var(--tv-muted);
	font-size: 0.95rem;
}
