/*
 * Food and drink ordering (Part B, B3): "Snacks for the night?", the food
 * order page and the food parts of Manage Booking. Light by default
 * (docs/DESIGN-SYSTEM.md): white cards with a 1px navy outline, navy words,
 * red highlights, ticket-shaped buttons and badges. Five colours only, read
 * from the palette (the real values light.css keeps as --tdic-c-*). Each
 * item card is the shared ticket (.tdic-ticket in theme.css); its slots
 * keep their place, so nothing moves as numbers change.
 */

.tfo,
.tfo-ticket {
	--tfo-navy: var(--tdic-c-navy, var(--wp--preset--color--navy));
	--tfo-red: var(--tdic-c-red, var(--wp--preset--color--red));
	--tfo-cream: var(--tdic-c-cream, var(--wp--preset--color--cream));
	--tfo-white: var(--tdic-c-white, var(--wp--preset--color--white));
	--tfo-black: var(--wp--preset--color--black);
	--tfo-pad: var(--wp--preset--spacing--40, 24px);
	--tfo-gap: var(--wp--preset--spacing--40, 24px);
	/* Menu items sit closer together (round 31 October, 3d): 16px apart,
	 * 20px inside (the notch, 12px, plus 8px), the same on every side. */
	--tfo-item-gap: 16px;
	--tfo-item-pad: 20px;
}

.tfo {
	display: grid;
	gap: var(--tfo-gap);
	inline-size: 100%;
	max-inline-size: 1200px;
	margin-inline: auto;
	color: var(--tfo-navy);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.5;
}

.tfo-card {
	margin: 0;
	padding: var(--tfo-pad);
	border: 1px solid var(--tfo-navy);
	background: var(--tfo-white);
	color: var(--tfo-navy);
}

.tfo-h2 {
	margin: 0 0 8px;
	color: var(--tfo-navy);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1;
	text-transform: uppercase;
}

.tfo-label,
.tfo-small {
	margin: 0;
	font-family: var(--wp--preset--font-family--subheading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tfo-label {
	color: var(--tfo-red);
}

.tfo-small {
	color: var(--tfo-navy);
}

.tfo-lead {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.tfo-film,
.tfo-car {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin: 12px 0 0;
}

.tfo-film strong {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	text-transform: uppercase;
}

.tfo-actions {
	margin: 16px 0 0;
}

.tfo-msg {
	margin: 0;
	padding: 16px var(--tfo-pad);
	border: 1px solid var(--tfo-navy);
	background: var(--tfo-white);
	font-weight: 700;
}

.tfo-msg--error {
	border-color: var(--tfo-red);
	color: var(--tfo-red);
}

.tfo-list {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tfo-line {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 16px;
	align-items: baseline;
	padding-block: 8px;
	border-block-end: 1px solid var(--tfo-navy);
}

.tfo-line:last-child {
	border-block-end: 0;
}

.tfo-line__for {
	grid-column: 1;
	font-size: var(--wp--preset--font-size--small);
}

.tfo-line__sum {
	grid-row: 1;
	grid-column: 2;
	font-variant-numeric: tabular-nums;
	text-align: end;
}

.tfo-line__remove {
	grid-column: 2;
	margin: 0;
	text-align: end;
}

.tfo-line.is-off .tfo-line__what {
	text-decoration: line-through;
}

.tfo-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--tfo-red);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.tfo a:not(.tdic-btn),
.tfo-ticket a:not(.tdic-btn) {
	color: var(--tfo-red);
	text-decoration: underline;
}

/* How each car collects: two choices side by side. The heading sits
 * inside the card, never on its outline as a line through the words
 * (round 31 October, 3d). */
.tfo-collect {
	display: grid;
	gap: 12px;
	min-inline-size: 0;
}

.tfo-collect > legend.tfo-h2 {
	float: left;
	font-weight: 700;
	inline-size: 100%;
	margin: 0;
	padding: 0;
}

.tfo-collect > legend.tfo-h2 + * {
	clear: both;
}

.tfo-collect__name {
	margin: 0 0 8px;
	font-weight: 700;
}

.tfo-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	border: 0;
}

.tfo-choices legend {
	margin: 0 0 8px;
	padding: 0;
}

.tfo-choices--two {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
}

/* Stall, car and the goodie bag at the gate (F1). */
.tfo-choices--three {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 0;
}

.tfo-choice {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	min-block-size: 44px;
	padding: 8px 12px;
	border: 1px solid var(--tfo-navy);
	background: var(--tfo-white);
	cursor: pointer;
}

.tfo-choice input {
	accent-color: var(--tfo-red);
	margin: 0;
}

.tfo-choice span {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.tfo-choice small {
	font-size: var(--wp--preset--font-size--small);
	font-variant-numeric: tabular-nums;
}

.tfo-choice:has(input:checked) {
	border-color: var(--tfo-red);
	box-shadow: inset 0 0 0 1px var(--tfo-red);
}

/* Vendors and their items: 1 a row on phones, 2 from 600px, 3 from 1024px. */
.tfo-vendor {
	display: grid;
	gap: 12px;
	scroll-margin-block-start: calc(var(--tdic-header-h, 88px) + 16px);
}

.tfo-vendor__head .tfo-h2 {
	margin-block-end: 4px;
}

/* A vendor at its most orders for the screening (F1). */
.tfo-full {
	margin: 8px 0 0;
}

/* Member prices (food-F2): the normal price struck through, the member's
 * in red, and a red "Member price" badge in its own row. */
.tfo-item__price--member {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	white-space: nowrap;
}

.tfo-was {
	color: var(--tfo-navy);
	font-weight: 400;
	text-decoration-thickness: 1px;
}

.tfo-member {
	margin: 4px 0 0;
}

/* "Ready by": the vendor's slot (food-F2), under last orders. A fixed-size
 * box, so a longer time or "(full)" moves nothing. */
.tfo-slot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-block-start: 12px;
}

.tfo-slot__label {
	color: var(--tfo-navy);
	font-family: var(--wp--preset--font-family--subheading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tfo-slot__select {
	box-sizing: border-box;
	inline-size: 9.5em;
	block-size: 44px;
	padding-inline: 12px;
	border: 1px solid var(--tfo-navy);
	border-radius: 0;
	background: var(--tfo-white);
	color: var(--tfo-navy);
	font: inherit;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}

.tfo-slot__select:hover,
.tfo-slot__select:focus-visible {
	border-color: var(--tfo-red);
	outline: 1px solid var(--tfo-red);
	outline-offset: 0;
}

.tfo-slot__help {
	flex-basis: 100%;
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
}

/* A goodie bag at the gate (F1) is ready when the gates open, so a car
 * ordering after booking that chooses it has no ready-by slot to pick. */
.tfo-form:has(input[name="collect"][value="gate"]:checked) .tfo-slot {
	display: none;
}

.tfo-items {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--tfo-item-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.tfo-items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.tfo-items {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* The grid stretches each card to its row; a height of 100% plus the
 * padding ran each card into the next. */
.tfo .tfo-item.tdic-ticket {
	--t-line: var(--tfo-navy);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: var(--tfo-item-pad);
	scroll-margin-block-start: calc(var(--tdic-header-h, 88px) + 16px);
	border: 1px solid var(--tfo-navy);
	background: var(--tfo-white);
	color: var(--tfo-navy);
}

.tfo .tfo-item.is-off {
	opacity: 0.6;
}

.tfo-item__photo {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--tfo-cream);
}

.tfo-item__photo img {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.tfo-item__photo .tfo-badge {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-start: 12px;
}

.tfo-item__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 6px;
}

.tfo-item__top {
	display: flex;
	gap: 12px;
	align-items: baseline;
	justify-content: space-between;
}

.tfo-item__name {
	margin: 0;
	color: var(--tfo-navy);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1;
	text-transform: uppercase;
}

.tfo-item__price {
	flex: none;
	color: var(--tfo-red);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tfo-item__desc,
.tfo-allergens,
.tfo-why {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
}

.tfo-why {
	color: var(--tfo-red);
	font-weight: 700;
}

/* Badges are small tickets: notches left and right. */
.tfo-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tfo-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	block-size: 26px;
	padding: 0 12px;
	border: 1px solid var(--tfo-navy);
	background: var(--tfo-white);
	color: var(--tfo-navy);
	font-family: var(--wp--preset--font-family--subheading);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	-webkit-mask: radial-gradient(circle at 0 50%, transparent 5px, var(--tfo-black) 5.5px), radial-gradient(circle at 100% 50%, transparent 5px, var(--tfo-black) 5.5px);
	-webkit-mask-composite: source-in;
	mask: radial-gradient(circle at 0 50%, transparent 5px, var(--tfo-black) 5.5px), radial-gradient(circle at 100% 50%, transparent 5px, var(--tfo-black) 5.5px);
	mask-composite: intersect;
}

.tfo-badge--red {
	border-color: var(--tfo-red);
	background: var(--tfo-red);
	color: var(--tfo-cream);
}

/* How many: a number with − and + either side, one row per car. */
.tfo-qty {
	display: grid;
	gap: 6px;
	margin-block-start: auto;
	padding-block-start: 4px;
}

.tfo-qty__row {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
}

.tfo-qty__label {
	font-weight: 700;
}

.tfo-stepper {
	display: inline-flex;
	align-items: stretch;
}

.tfo-stepper__btn,
.tfo-stepper__input {
	box-sizing: border-box;
	block-size: 44px;
	border: 1px solid var(--tfo-navy);
	background: var(--tfo-white);
	color: var(--tfo-navy);
	font: inherit;
	font-weight: 700;
}

.tfo-stepper__btn {
	inline-size: 44px;
	cursor: pointer;
}

.tfo-stepper__btn:hover,
.tfo-stepper__btn:focus-visible {
	border-color: var(--tfo-red);
	color: var(--tfo-red);
}

.tfo-stepper__input {
	inline-size: 3.5em;
	border-inline: 0;
	font-variant-numeric: tabular-nums;
	text-align: center;
	appearance: textfield;
}

.tfo-stepper__input::-webkit-outer-spin-button,
.tfo-stepper__input::-webkit-inner-spin-button {
	margin: 0;
	appearance: none;
}

.tfo-every {
	inline-size: 100%;
}

/* The total and the buttons, in reach on a phone. */
.tfo-form {
	display: grid;
	gap: var(--tfo-gap);
}

.tfo-bar {
	position: sticky;
	inset-block-end: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	align-items: center;
	justify-content: space-between;
	padding: 12px var(--tfo-pad);
	border: 1px solid var(--tfo-navy);
	background: var(--tfo-white);
}

.tfo-total {
	display: flex;
	gap: 8px;
	align-items: baseline;
	margin: 0;
}

.tfo-total strong {
	min-inline-size: 5.5ch;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xx-large);
	font-variant-numeric: tabular-nums;
}

.tfo-bar__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

@media (max-width: 599px) {
	.tfo {
		--tfo-pad: 16px;
		--tfo-gap: 16px;
		--tfo-item-gap: 12px;
	}

	.tfo-bar__buttons,
	.tfo-bar__buttons .tdic-btn {
		inline-size: 100%;
	}

	.tfo-choices--two,
	.tfo-choices--three {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* The night's vendors, one tap each (round 31 October, 3d): the site's
 * small ticket buttons (theme.css draws the notches), white with a red
 * outline; the one showing is red. */
.tfo-chooser ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tfo .tfo-chooser a.tfo-chip {
	--t-line: var(--tfo-red);
	box-sizing: border-box;
	min-block-size: 44px;
	padding: 0 16px;
	border-color: var(--tfo-red);
	background-color: var(--tfo-white);
	color: var(--tfo-red);
	font-size: 0.75rem;
	text-decoration: none;
	white-space: nowrap;
}

.tfo .tfo-chooser a.tfo-chip.is-current,
.tfo .tfo-chooser a.tfo-chip:focus-visible {
	background-color: var(--tfo-red);
	color: var(--tfo-cream);
}

@media (hover: hover) and (pointer: fine) {
	.tfo .tfo-chooser a.tfo-chip:hover {
		background-color: var(--tfo-red);
		color: var(--tfo-cream);
	}
}

/* The food order page: the QR code beside the cars on a computer. */
.tfo-receipt {
	display: grid;
	gap: var(--tfo-gap);
}

.tfo-receipt__qr {
	text-align: center;
}

.tfo-qr {
	display: block;
	inline-size: 100%;
	max-inline-size: 240px;
	block-size: auto;
	margin: 16px auto;
	background: var(--tfo-white);
}

.tfo-receipt__cars {
	display: grid;
	gap: var(--tfo-gap);
	align-content: start;
}

.tfo-receipt__vendor {
	margin: 16px 0 4px;
	font-family: var(--wp--preset--font-family--subheading);
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
}

.tfo-totals p {
	display: flex;
	justify-content: space-between;
	margin: 0 0 8px;
	font-variant-numeric: tabular-nums;
}

.tfo-totals__all {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

@media (min-width: 1024px) {
	.tfo-receipt {
		grid-template-columns: 340px minmax(0, 1fr);
		align-items: start;
	}

	.tfo-receipt__qr {
		position: sticky;
		inset-block-start: calc(var(--tdic-header-h, 88px) + 24px);
	}
}

/* On a ticket in Manage Booking and Your tickets. */
.tfo-ticket {
	display: grid;
	gap: 8px;
	margin: 0 0 16px;
	padding: 16px;
	border: 1px solid var(--tfo-navy);
	background: var(--tfo-white);
	color: var(--tfo-navy);
}

.tfo-ticket p {
	margin: 0;
}

/* In the ticket's two-column actions, the food panel takes a whole row. */
.tdic-cine__actions > .tfo-ticket {
	grid-column: 1 / -1;
	inline-size: 100%;
	box-sizing: border-box;
}

.tfo-ticket__add .tdic-btn {
	box-sizing: border-box;
	inline-size: 100%;
}

.tfo-ticket__add .tdic-btn--red,
.tfo-ticket__add .tdic-btn--red:hover {
	color: var(--tfo-cream);
}

@media (prefers-reduced-motion: reduce) {
	.tfo * {
		transition: none !important;
	}
}
