/**
 * Murrlichtspiele Programm — block styles: featured film hero + upcoming grid.
 *
 * Consumes the theme's shared design tokens via var(--ml-*), with fallbacks
 * so the block still renders correctly outside the Murrlichtspiele theme.
 * Apart from those tokens, every rule is scoped under .ml-programme so nothing
 * leaks to the theme.
 *
 * Fonts come from the page (no webfonts are loaded): titles are real headings
 * and take the theme's heading font and weight; text takes its body font
 * unless the theme sets --ml-font-body. Only the UI labels name a stack
 * (Archivo, then system-ui).
 */

/* Fallback tokens. :where() gives them zero specificity, so a theme's own
 * :root { --ml-* } values always win. */
:where(:root) {
	--ml-ink: #06070d;
	--ml-navy: #194561;
	--ml-blue: #96c2e2;
	--ml-mist: #ecebf0;
	--ml-grey: #87868b;
	--ml-orange: #d4512e;
	--ml-font-ui: "Archivo", system-ui, sans-serif;
	--ml-pad-x: 56px;
	--ml-radius: 2px;
}

.ml-programme {
	/* No fallback on purpose: without the token this inherits the page's font. */
	font-family: var(--ml-font-body);
	/* Explicit, so a theme's fixed body line-height (e.g. 25px) can't inflate chips and buttons. */
	line-height: 1.3;
	color: var(--ml-ink);
}

/* Titles keep the theme's heading font and weight, but not the case or
 * tracking themes add to h2–h4; pin what the design leaves implicit. */
.ml-programme .ml-film__title,
.ml-programme .ml-section__title,
.ml-programme .ml-card__title,
.ml-programme .ml-single__title {
	text-transform: none;
	letter-spacing: normal;
}

.ml-programme * {
	box-sizing: border-box;
}

/* Featured film hero (on the blue band). */
/* Wrapping flex rather than a fixed grid: the film column drops below the
 * poster whenever the block itself is too narrow for both (e.g. in a narrow
 * theme or page-builder column), whatever the viewport width. */
.ml-programme .ml-hero {
	display: flex;
	flex-wrap: wrap;
	gap: 28px 52px;
	align-items: flex-start;
	padding: 44px var(--ml-pad-x) 48px;
	background: var(--ml-blue);
}

.ml-programme .ml-poster {
	position: relative;
	flex: 0 0 360px;
	max-width: 100%;
}

.ml-programme .ml-poster__badge {
	position: absolute;
	top: -14px;
	left: -14px;
	z-index: 2;
	padding: 8px 14px;
	background: var(--ml-orange);
	color: #fff;
	font-family: var(--ml-font-ui);
	font-weight: 700;
	font-size: 11px;
	letter-spacing: .18em;
	text-transform: uppercase;
	border-radius: var(--ml-radius);
	box-shadow: 0 8px 18px -8px rgba(6, 7, 13, .5);
}

.ml-programme .ml-poster__frame {
	padding: 8px;
	background: var(--ml-navy);
	border: 1px solid rgba(25, 69, 97, .25);
	box-shadow: 0 22px 44px -22px rgba(6, 7, 13, .45);
}

.ml-programme .ml-poster__frame img {
	display: block;
	width: 344px;
	max-width: 100%;
	height: 496px;
	object-fit: cover;
	border-radius: var(--ml-radius);
}

.ml-programme .ml-film__event {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 14px;
	font-family: var(--ml-font-ui);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--ml-orange);
}

/* Long one-word titles must never widen the column (horizontal overflow). */
.ml-programme .ml-film {
	flex: 1 1 340px;
	min-width: 0;
}

.ml-programme .ml-film__title {
	margin: 0 0 12px;
	font-size: 52px;
	line-height: .98;
	color: var(--ml-navy);
	overflow-wrap: break-word;
	hyphens: auto;
}

.ml-programme .ml-film__meta {
	margin-bottom: 6px;
	font-family: var(--ml-font-ui);
	font-size: 13px;
	letter-spacing: .05em;
	color: var(--ml-navy);
}

.ml-programme .ml-film__cast {
	margin-bottom: 22px;
	font-size: 16px;
	font-style: italic;
	color: #3a4a54;
}

/* pre-line keeps the paragraph breaks entered in Cinetixx. */
.ml-programme .ml-film__quote {
	white-space: pre-line;
	max-width: 560px;
	margin: 0 0 26px;
	padding-left: 18px;
	border-left: 3px solid var(--ml-orange);
	font-size: 18px;
	line-height: 1.45;
	color: #2a3942;
}

/* Expandable synopsis — CSS-only disclosure (no JavaScript). */
.ml-programme .ml-film__synopsis {
	position: relative;
	max-width: 560px;
	margin: 0 0 26px;
}

.ml-programme .ml-film__synopsis .ml-film__quote {
	max-width: none;
	margin: 0;
}

.ml-programme .ml-film__toggle {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

/* Collapsed, paragraphs run together, so the clamp never ends on the blank
 * line between them; expanding restores the breaks. */
.ml-programme .ml-film__synopsis--collapsible .ml-film__quote {
	white-space: normal;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow: hidden;
}

.ml-programme .ml-film__toggle:checked ~ .ml-film__quote {
	white-space: pre-line;
	display: block;
	-webkit-line-clamp: none;
	line-clamp: none;
	overflow: visible;
}

.ml-programme .ml-film__more {
	display: inline-block;
	margin-top: 10px;
	font-family: var(--ml-font-ui);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ml-orange);
	cursor: pointer;
}

.ml-programme .ml-film__more--less {
	display: none;
}

.ml-programme .ml-film__toggle:checked ~ .ml-film__more .ml-film__more--more {
	display: none;
}

.ml-programme .ml-film__toggle:checked ~ .ml-film__more .ml-film__more--less {
	display: inline;
}

.ml-programme .ml-film__toggle:focus-visible ~ .ml-film__more {
	outline: 2px solid var(--ml-orange);
	outline-offset: 3px;
}

.ml-programme .ml-label {
	margin-bottom: 10px;
	font-family: var(--ml-font-ui);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--ml-grey);
}

/* Showtime chips. */
.ml-programme .ml-times {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-bottom: 28px;
}

.ml-programme .ml-time {
	padding: 9px 13px;
	background: #fff;
	color: var(--ml-navy);
	font-family: var(--ml-font-ui);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-decoration: none;
	border-radius: var(--ml-radius);
}

.ml-programme .ml-time--next {
	background: var(--ml-orange);
	color: #fff;
}

.ml-programme .ml-time--soldout {
	opacity: .45;
	text-decoration: line-through;
	pointer-events: none;
}

.ml-programme .ml-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}

/* Buttons — scoped so they never touch theme buttons. */
.ml-programme .ml-btn {
	display: inline-block;
	font-family: var(--ml-font-ui);
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: var(--ml-radius);
	transition: background .15s, color .15s;
}

.ml-programme .ml-btn--primary {
	padding: 15px 28px;
	background: var(--ml-navy);
	color: #fff;
	font-size: 13px;
}

.ml-programme .ml-btn--primary:hover,
.ml-programme .ml-btn--primary:focus {
	background: #123449;
}

.ml-programme .ml-btn--ghost {
	padding: 14px 26px;
	background: transparent;
	border: 1.5px solid var(--ml-navy);
	color: var(--ml-navy);
	font-weight: 600;
	font-size: 13px;
}

.ml-programme .ml-btn--ghost:hover,
.ml-programme .ml-btn--ghost:focus {
	background: var(--ml-navy);
	color: var(--ml-mist);
}

/* Upcoming grid. */
.ml-programme .ml-section {
	padding: 40px var(--ml-pad-x) 42px;
	background: var(--ml-mist);
}

.ml-programme .ml-section__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding-top: 28px;
	margin-bottom: 24px;
	border-top: 1px solid rgba(25, 69, 97, .18);
}

.ml-programme .ml-section__title {
	margin: 0;
	font-size: 30px;
	line-height: 1.15;
	color: var(--ml-navy);
}

.ml-programme .ml-link {
	font-family: var(--ml-font-ui);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ml-orange);
}

/* Two columns when each gets at least 300px, else one; sized from the block's
 * own width, so it also works in narrow columns. */
.ml-programme .ml-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, max(300px, calc((100% - 36px) / 2))), 1fr));
	gap: 26px 36px;
}

/* Compact media-object card: small poster left, text and showtimes right. */
.ml-programme .ml-card {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}

.ml-programme .ml-card__poster {
	display: block;
	width: 92px;
	height: 138px;
	object-fit: cover;
	border: 1px solid rgba(25, 69, 97, .2);
	border-radius: var(--ml-radius);
}

.ml-programme .ml-card__title {
	margin: 0 0 3px;
	font-size: 20px;
	line-height: 1.1;
	color: var(--ml-navy);
	overflow-wrap: break-word;
	hyphens: auto;
}

.ml-programme .ml-card__meta {
	font-family: var(--ml-font-ui);
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ml-grey);
}

/* Smaller chips inside the card grid; chips sit on the mist band. */
.ml-programme .ml-times--compact {
	gap: 6px;
	margin: 10px 0 0;
}

.ml-programme .ml-times--compact .ml-time {
	padding: 5px 9px;
	font-size: 11px;
	letter-spacing: .04em;
	border: 1px solid rgba(25, 69, 97, .15);
}

/* Single film ([murrlichtspiele_film]): framed poster beside title, date and
 * tickets button; the text wraps below the poster when the block is narrow. */
.ml-programme .ml-single {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 22px 44px;
}

.ml-programme .ml-single .ml-poster__frame {
	flex: 0 1 300px;
}

.ml-programme .ml-single__body {
	display: flex;
	flex: 1 1 300px;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

/* Fluid poster: fills the frame instead of the hero's fixed 344×496. */
.ml-programme .ml-single .ml-poster__frame img {
	width: 100%;
	height: auto;
	aspect-ratio: 344 / 496;
}

/* No auto-hyphenation: titles break at spaces; overflow-wrap only catches
 * single words too long for the line. */
.ml-programme .ml-single__title {
	margin: 0 0 18px;
	font-size: 36px;
	line-height: 1.05;
	color: var(--ml-navy);
	overflow-wrap: break-word;
	hyphens: manual;
}

/* Spelled-out date above the title: the key fact for a single event. UI font
 * and orange, as the design's date lines, but large. */
.ml-programme .ml-single__date {
	margin-bottom: 10px;
	font-family: var(--ml-font-ui);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: .01em;
	color: var(--ml-orange);
}

/* Responsive. Viewport queries, not container queries: size containment would
 * collapse the block to zero width where a page builder sizes widgets to their
 * content (Elementor row containers). Narrow columns are handled by the
 * wrapping layouts above. */
@media (max-width: 900px) {
	.ml-programme .ml-hero,
	.ml-programme .ml-section {
		padding-left: 24px;
		padding-right: 24px;
	}

	.ml-programme .ml-hero {
		gap: 28px;
	}

	.ml-programme .ml-film {
		flex-basis: 100%;
	}

	/* Keep the poster a modest thumbnail, never a screen-filling image. */
	.ml-programme .ml-poster {
		max-width: 190px;
	}

	.ml-programme .ml-poster__badge {
		top: -10px;
		left: -10px;
		padding: 6px 10px;
		font-size: 10px;
	}

	.ml-programme .ml-poster__frame {
		padding: 5px;
	}

	.ml-programme .ml-poster__frame img {
		width: 100%;
		height: auto;
	}

	.ml-programme .ml-film__title {
		font-size: 40px;
	}
}

@media (max-width: 640px) {
	.ml-programme .ml-film__title {
		font-size: 32px;
	}

	.ml-programme .ml-single__title {
		font-size: 28px;
	}

	.ml-programme .ml-single__date {
		font-size: 18px;
	}
}
