/*
 * Emily's TV pages: /menu and /logo.
 *
 * Plain CSS on purpose, written for the café TV: a 2020 Samsung on Tizen 5.5,
 * which is Chromium 69. Do NOT use clamp(), min(), max(), flex `gap`, :is(),
 * :where(), :has(), aspect-ratio, inset, @layer, color-mix() or svh/dvh. None
 * of them fail loudly there: they blank the screen or drop the whole sheet.
 * Grid and its gap are fine (Chrome 66). Custom properties are fine (49).
 *
 * Sizing: one unit, --u, is 1% of the screen height on a 16:9 (or wider)
 * screen and the equivalent width share on a narrower one, so the board
 * looks the same at 1080p and 4K. --scale is the "Text size" field.
 *
 * Colours: brand guide (Emilys_Website_Brand.pdf). Never put cobalt text on
 * navy, or butter text on cream: both are unreadable.
 */

@font-face {
	font-family: "Instrument Serif";
	font-weight: 400;
	font-display: block;
	src: url("fonts/InstrumentSerif-Regular-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Instrument Serif";
	font-weight: 400;
	font-display: block;
	src: url("fonts/InstrumentSerif-Regular-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Hubot Sans";
	font-weight: 300;
	font-display: block;
	src: url("fonts/HubotSans-Light.woff2") format("woff2");
}

@font-face {
	font-family: "Hubot Sans Condensed";
	font-weight: 200;
	font-display: block;
	src: url("fonts/HubotSansCondensed-ExtraLight.woff2") format("woff2");
}

/* ---------------------------------------------------------------- base */

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.tv {
	--u: 1vh;
	--scale: 1;
	background: var(--bg);
	color: var(--ink);
	font-family: "Hubot Sans", Arial, sans-serif;
	font-weight: 300;
	cursor: none;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Narrower than 16:9: size from the width instead, so nothing runs off the side. */
@media (max-aspect-ratio: 16/9) {
	.tv {
		--u: 0.5625vw;
	}
}

ul {
	list-style: none;
}

/* ---------------------------------------------------------------- schemes */

.scheme-navy {
	--bg: #131f39;
	--ink: #f5f1eb;
	--accent: #faf0a9;
	--muted: rgba(245, 241, 235, 0.62);
	--line: rgba(245, 241, 235, 0.22);
}

.scheme-cream {
	--bg: #f5f1eb;
	--ink: #131f39;
	--accent: #3f49cb;
	--muted: rgba(19, 31, 57, 0.66);
	--line: rgba(19, 31, 57, 0.2);
}

.scheme-cobalt {
	--bg: #3f49cb;
	--ink: #f5f1eb;
	--accent: #faf0a9;
	--muted: rgba(245, 241, 235, 0.78);
	--line: rgba(245, 241, 235, 0.3);
}

/* ---------------------------------------------------------------- /menu */

.tvm {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: calc(var(--u) * 5) calc(var(--u) * 6.5) calc(var(--u) * 4.5);
}

.tvm__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex: none;
	padding-bottom: calc(var(--u) * 2.2);
	border-bottom: calc(var(--u) * 0.12) solid var(--line);
}

.tvm__title {
	font-family: "Instrument Serif", Georgia, serif;
	font-weight: 400;
	font-size: calc(var(--u) * 10.5);
	line-height: 0.82;
	letter-spacing: -0.01em;
	color: var(--accent);
}

/* The drinks: rows spread evenly over the height left between the heading and
   the extras. Names in a row share a top line, even when one drink has fewer sizes. */
.tvm__grid {
	flex: 1 1 auto;
	min-height: 0;
	display: grid;
	grid-column-gap: calc(var(--u) * 7);
	align-content: space-evenly;
	padding: calc(var(--u) * 1.5) 0;
}

.tvm__grid--2 {
	grid-template-columns: 1fr 1fr;
}

.tvm__grid--3 {
	grid-template-columns: 1fr 1fr 1fr;
}

.tvm__grid--4 {
	grid-template-columns: 1fr 1fr 1fr 1fr;
	grid-column-gap: calc(var(--u) * 5);
}

.tvm__item {
	display: flex;
	flex-direction: column;
	padding: calc(var(--u) * 1.4) 0;
}

.tvm__name {
	font-family: "Instrument Serif", Georgia, serif;
	font-weight: 400;
	font-size: calc(var(--u) * 5 * var(--scale));
	line-height: 1;
	color: var(--accent);
	margin-bottom: calc(var(--u) * 1 * var(--scale));
}

.tvm__price-row {
	display: flex;
	align-items: baseline;
	margin-top: calc(var(--u) * 0.5 * var(--scale));
}

/* Sizes and prices sit well below the drink names (Gianluca, 2026-11-05). */
.tvm__size {
	font-size: calc(var(--u) * 2.6 * var(--scale));
	line-height: 1.15;
	color: var(--ink);
}

/* Dotted leader between the size and its price. Flex `gap` would be Chrome 84, so margins. */
.tvm__leader {
	flex: 1 1 auto;
	min-width: calc(var(--u) * 2);
	margin: 0 calc(var(--u) * 1.2);
	border-bottom: calc(var(--u) * 0.22) dotted var(--line);
	-webkit-transform: translateY(calc(var(--u) * -0.6));
	transform: translateY(calc(var(--u) * -0.6));
}

.tvm__price {
	font-family: "Instrument Serif", Georgia, serif;
	font-size: calc(var(--u) * 3.1 * var(--scale));
	line-height: 1;
	color: var(--ink);
	white-space: nowrap;
}

/* Extras: one line along the bottom, separated by the brand's four-point star. */
.tvm__extras {
	display: flex;
	align-items: center;
	flex: none;
	padding-top: calc(var(--u) * 2.4);
	border-top: calc(var(--u) * 0.12) solid var(--line);
}

/* Same size and case as the drink names. */
.tvm__extras-title {
	font-family: "Instrument Serif", Georgia, serif;
	font-size: calc(var(--u) * 5 * var(--scale));
	line-height: 1;
	color: var(--accent);
	margin-right: calc(var(--u) * 4);
}

.tvm__extras-list {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.tvm__extra {
	display: flex;
	align-items: baseline;
}

.tvm__extra .tvm__price {
	margin-left: calc(var(--u) * 1.4);
}

.tvm__star {
	margin: 0 calc(var(--u) * 2.6);
	line-height: 0;
}

.tvm__star svg {
	width: calc(var(--u) * 1.5);
	height: calc(var(--u) * 1.5);
	fill: var(--accent);
}

/* ---------------------------------------------------------------- /logo */

.tvl {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.tvl__logo {
	display: block;
	height: calc(var(--logo-size) * 1vh);
	max-width: 90vw;
	color: var(--accent);
}

img.tvl__logo {
	width: auto;
	object-fit: contain;
}

/* Width set explicitly from the artwork's ratio (1693 x 2054): older engines
   size an inline SVG with only a height at 300px wide. */
.tvl__logo--svg {
	width: calc(var(--logo-size) * 1vh * 0.8243);
}

.tvl__logo svg {
	display: block;
	width: 100%;
	height: 100%;
}
