/**
 * The lobby touchscreen.
 *
 * A screen nobody is holding: no site header, no footer, no scrollbar to
 * discover. It fills whatever it is mounted on — usually a portrait panel —
 * and the type is sized against the viewport so the same page is legible
 * from across a foyer and from arm's length at the glass.
 */
.cong-kiosk {
	display: flex;
	flex-direction: column;
	/* A fixed height, not a minimum: a wall panel has the height it has, and
	   anything that will not fit has to be dealt with inside, not by making
	   the page taller than the glass. */
	block-size: 100vh;
	block-size: 100dvh;
	/*
	 * Clipped, not just hidden. A hidden overflow can still be scrolled by
	 * script — and the campus map's search box takes focus when it loads,
	 * which scrolled the screen until the pictures were off the top of the
	 * glass. `clip` cannot be scrolled at all; `hidden` stays for a browser
	 * that does not know it.
	 *
	 * The plain `vh` line before `dvh` is for the same kind of browser: a
	 * signage player's older Chrome ignored `100dvh`, the panel had no height,
	 * the day's list grew to its full length and the page ran off the bottom.
	 */
	overflow: hidden;
	overflow: clip;
	background: var(--wp--preset--color--base, #fff);
}

html:has(.cong-kiosk),
body.page-kiosk {
	overflow: hidden;
	overflow: clip;
	block-size: 100%;
}

/*
 * The content wrapper has to be part of the flex column.
 *
 * The template puts `post-content` between the panel and its three sections,
 * so every `flex` below was talking to an ordinary flow container and did
 * nothing at all: the panel grew to whatever its contents wanted — 1,586px
 * on a 1,080px screen — and the bottom third of the campus map was simply
 * off the wall.
 */
.cong-kiosk > .wp-block-post-content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-block-size: 0;
	padding: 0;
	margin: 0;
}

.cong-kiosk > .wp-block-post-content > * {
	margin-block: 0;
}

/* The site chrome is for the website, not for a wall panel. */
.page-kiosk .cong-header,
.page-kiosk .cong-utility,
.page-kiosk .wp-block-template-part,
.page-kiosk footer {
	display: none;
}

/*
 * The pictures take a share of the height, set on the lobby settings screen.
 * They used to be sized by their own `short` minimum, which on a 1080px panel
 * left a 346px band — so a 1920 × 1080 notice shown whole came out 615px
 * wide, marooned in the middle of a very wide letterbox.
 */
.cong-kiosk__slides {
	/*
	 * Full width, and exactly as tall as a 16:9 notice at that width — the
	 * dots sit on the picture, not under it. A fixed share of the height was
	 * 960px on a 1920px portrait panel for a 607px picture: two navy bands,
	 * and the day's events cut off below. The share set on the settings
	 * screen is now only the most the pictures may take, which is what keeps
	 * them from filling a landscape screen.
	 */
	flex: 0 0 min(calc(100vw * 9 / 16), calc(var(--cong-slides-share, 50) * 1vh));
	flex: 0 0 min(calc(100vw * 9 / 16), calc(var(--cong-slides-share, 50) * 1dvh));
	min-block-size: 0;
}

/*
 * The slides fill the panel the flex row gave them.
 *
 * Everywhere else a slide is as tall as its own words, and min-block-size
 * keeps it from collapsing. On the kiosk the panel decides the height and
 * that minimum is dropped — but a *plain* slide has no words at all, so with
 * nothing to hold it open the track measured zero and four perfectly good
 * 1920×1080 notices were drawn into a strip of nothing.
 */
.cong-kiosk__slides .cong-slideshow__track,
.cong-kiosk__slides .cong-slide {
	min-block-size: 0;
	block-size: 100%;
}

/*
 * Still, and whole. The slow push the home page's slideshow gives a
 * photograph scales it past its edges, which crops a poster — and these are
 * notices designed to the pixel, where the cropped edge is the date or the
 * web address. No drift here, and every picture shown entire.
 */
.cong-kiosk__slides .cong-slide__img,
.cong-kiosk__slides[data-cong-ready] .cong-slide__img,
.cong-kiosk__slides[data-cong-ready] .cong-slide.is-current .cong-slide__img {
	transform: none;
	animation: none;
	object-fit: contain;
}

.cong-kiosk__body {
	flex: 1 1 auto;
	display: grid;
	/*
	 * An explicit row, not an automatic one.
	 *
	 * A grid row sizes itself to its tallest item, and the campus map frame
	 * has a height of its own — so the row became 827px inside a 602px panel
	 * and the bottom of both columns was clipped away. minmax(0, 1fr) makes
	 * the row exactly as tall as the space there is, and the two columns
	 * then have something definite to fill.
	 */
	grid-template-rows: minmax(0, 1fr);
	gap: clamp(0.75rem, 1.5vmin, 1.5rem);
	padding: clamp(0.75rem, 1.5vmin, 1.5rem);
	min-block-size: 0;
}

/*
 * Portrait panels are the common mounting, and there the map belongs under
 * the list. Given a landscape screen, the two sit side by side instead.
 */
@media (orientation: landscape) {
	.cong-kiosk__body { grid-template-columns: 1fr 1fr; }
}

/* Portrait stacks the two, so they share the height rather than each
   claiming all of it. */
@media (orientation: portrait) {
	.cong-kiosk__body { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
}

/* A few dots say where you are; twenty-six ran off the edge of a narrow
   panel and, wrapped, sat in two rows across the notice. Past ten they tell
   nobody anything, and on this screen the pictures move by themselves. */
.cong-kiosk__slides .cong-slideshow__dots:has(> :nth-child(11)),
.cong-kiosk__slides.has-many-slides .cong-slideshow__dots {
	display: none;
}

.cong-kiosk__map { min-block-size: 0; }

/*
 * The map is the frame, not a wrapper around one.
 *
 * `.cong-kiosk__map .cong-frame` is a descendant selector, and the embed
 * block puts both classes on the same element — so it matched nothing, the
 * frame kept its own 799px height, and it hung 240px off the bottom of the
 * panel.
 */
.cong-kiosk__map.cong-frame,
.cong-kiosk__map .cong-frame {
	block-size: 100%;
	min-block-size: 0;
}

/*
 * A busy Sunday has more events than the panel is tall. The list scrolls
 * inside its own half rather than pushing the map off the screen — there is
 * a finger in front of this one, so scrolling is a reasonable thing to ask.
 */
.cong-kiosk__body > * {
	min-block-size: 0;
	/* The global block gap lands between grid items too, and 28px of it was
	   enough to push the map past the bottom edge. */
	margin-block: 0;
}

.cong-kiosk .cong-day {
	display: flex;
	flex-direction: column;
	min-block-size: 0;
	overflow: hidden;
}

.cong-kiosk .cong-day__list {
	flex: 1 1 auto;
	min-block-size: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* ---------- Directions from the list ------------------------------------- */

/*
 * A room name that is also the way there.
 *
 * Underlined rather than buttoned: it sits inside a line of small grey
 * metadata, and a button there would outweigh the event's own name above it.
 * The dot is the only ornament, and it is what makes the line scan as
 * tappable on a screen nobody reads instructions for.
 */
.cong-day__where--map {
	color: inherit;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 0.2em;
}

.cong-day__pin {
	margin-inline-start: 0.35em;
	color: var(--wp--preset--color--lime);
	font-size: 0.7em;
	vertical-align: 0.15em;
}

.cong-day__where--map.is-showing {
	text-decoration-style: solid;
	font-weight: 600;
}

/*
 * While directions are showing, the map takes the screen.
 *
 * Not for effect: Mappedin hides its directions panel below about 500px wide,
 * so the column the map normally shares with the list is too narrow to show
 * the answer somebody just asked for. The list is still there, behind a tap.
 */
.cong-kiosk__body.is-showing-map {
	grid-template-columns: minmax(0, 1fr);
}

.cong-kiosk__body.is-showing-map > :not(.cong-kiosk__map):not(.cong-kiosk__back) {
	display: none;
}

.cong-kiosk__back {
	display: none;
}

.cong-kiosk__body.is-showing-map .cong-kiosk__back {
	display: block;
	position: absolute;
	/* Bottom right: Mappedin puts its own destination field top-left and its
	   share and zoom controls top-right and bottom-right respectively, so
	   this is the one corner a button of ours does not cover something of
	   theirs. */
	inset-block-end: var(--wp--preset--spacing--30);
	inset-inline-start: var(--wp--preset--spacing--30);
	z-index: 2;
	padding: 0.6em 1.2em;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	box-shadow: 0 2px 12px rgb(11 42 66 / 0.35);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.cong-kiosk__body {
	position: relative;
}

/* Scan to follow along: the service now, in the corner. */
.cong-kiosk__scan {
	position: fixed;
	right: clamp(16px, 2vw, 40px);
	bottom: clamp(16px, 2vw, 40px);
	z-index: 50;
	display: flex;
	gap: 16px;
	padding: 16px 16px 14px;
	border-radius: 18px;
	background: #fff;
	color: var(--wp--preset--color--ink);
	box-shadow: 0 12px 40px rgb(0 0 0 / .28);
	text-align: center;
}

.cong-kiosk__scan[hidden], .cong-kiosk__scan-item[hidden] { display: none; }
.cong-kiosk__scan-item { width: clamp(180px, 13vw, 250px); }
.cong-kiosk__scan-code svg { display: block; width: 100%; height: auto; }
.cong-kiosk__scan-say { margin: 10px 0 2px; font-family: var(--wp--preset--font-family--display); font-size: clamp(1.05rem, 1.3vw, 1.4rem); font-weight: 700; line-height: 1.15; }
.cong-kiosk__scan-what { margin: 0; font-size: clamp(.8rem, .95vw, 1rem); color: var(--wp--preset--color--ink-muted); }
