/*
 * enamel-oven: only what theme.json and block attributes can't express.
 * Presets and custom tokens only. No hex. Accent (saffron) appears here once: the window glow.
 */

/* ---- Measure for leads that sit beside a heading ---- */
.pmo-measure,
.pmo-step-text {
	max-width: 46ch;
}

/* ---- The oven: wrapper is a centred column; the body is the enamel box ---- */
.pmo-oven > * {
	width: 100%;
	max-width: 35rem;
}

.pmo-oven-body {
	position: relative;
	box-sizing: border-box;
	margin-bottom: var(--wp--preset--spacing--40);
}

/* Feet: two inverse tabs under the body, decorative */
.pmo-oven-body::before,
.pmo-oven-body::after {
	content: "";
	position: absolute;
	bottom: -14px;
	width: 54px;
	height: 14px;
	border-radius: 0 0 10px 10px;
	background: var(--wp--preset--color--inverse);
}

.pmo-oven-body::before {
	left: 18%;
}

.pmo-oven-body::after {
	right: 18%;
}

/* Control row: two knobs then the display, which takes the rest */
.pmo-oven-controls > .pmo-display {
	flex: 1 1 auto;
	min-width: 0;
}

.pmo-display p {
	margin: 0;
}

/* The dish name wraps rather than truncating: at 390 "Baked kibbeh tray" was clipped mid-word. */
.pmo-display-name {
	min-width: 0;
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.pmo-display-price {
	flex-shrink: 0;
}

/* Knobs: lilac discs with an inverse tick; empty paragraphs, so reset core's has-background padding */
.pmo-knob {
	position: relative;
	flex-shrink: 0;
	box-sizing: border-box;
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0 !important;
	border-radius: 50%;
	box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
	transform: rotate(-40deg);
}

.pmo-knob + .pmo-knob {
	transform: rotate(20deg);
}

.pmo-knob::after {
	content: "";
	position: absolute;
	left: 21px;
	top: 6px;
	width: 4px;
	height: 14px;
	border-radius: 2px;
	background: var(--wp--preset--color--inverse);
}

/* Handle bar */
.pmo-handle {
	height: 12px;
	margin-inline: 40px;
	box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

/* Window: the shots stack in one grid cell; the oven light glows over them */
.pmo-window {
	overflow: hidden;
}

.pmo-oven-shots {
	position: relative;
	display: grid;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--sm);
}

.pmo-oven-shots > * {
	grid-area: 1 / 1;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--wp--custom--motion--duration-slow) var(--wp--custom--motion--easing), visibility 0s linear var(--wp--custom--motion--duration-slow);
}

.pmo-oven-shots > .is-active,
.pmo-oven-shots:not(:has(> .is-active)) > :first-child {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.pmo-oven-shots img {
	display: block;
	width: 100%;
}

.pmo-oven-shots::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	box-shadow: inset 0 0 70px 6px color-mix(in srgb, var(--wp--preset--color--accent) 55%, transparent);
}

/* ---- Dish chips: base pill with a line border; selected = inverse fill ---- */
.wp-block-button.pmo-chip > .wp-block-button__link {
	min-height: 44px;
	padding: 0.5rem 1rem;
	border: 2px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.wp-block-button.pmo-chip > .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--inverse);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
}

.wp-block-button.pmo-chip.is-active > .wp-block-button__link,
.pmo-chips:not(:has(.is-active)) > .pmo-chip:first-child > .wp-block-button__link {
	border-color: var(--wp--preset--color--inverse);
	background: var(--wp--preset--color--inverse);
	color: var(--wp--preset--color--on-inverse);
}

/* ---- Menu cards: image flush, foot on the bottom edge ---- */
.pmo-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

.pmo-card > .wp-block-image {
	margin: 0;
}

.pmo-card > .wp-block-image img {
	display: block;
	width: 100%;
}

/* The body is a flex column so the foot can sit on the bottom edge: every card's price row lines up
   across the grid whatever its description length (a block-flow group ignores margin-top: auto). */
.pmo-card-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

/* Two classes: core's block-gap rule (:root :where(.wp-container-…) > * + *) ties a single class and prints later. */
.pmo-card-body > .pmo-card-foot {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--40);
	align-items: center;
}

.pmo-card-foot .pmo-price {
	margin: 0;
	line-height: 1;
}

.pmo-card-foot .wp-block-buttons {
	margin: 0;
}

.wp-block-button.pmo-add > .wp-block-button__link {
	padding: 0.625rem 1.125rem;
	font-size: var(--wp--preset--font-size--small);
}

/* ---- How it works: inverse discs with tint numerals ---- */
.pmo-step-num {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin: 0;
	padding: 0 !important;
	border-radius: 50%;
	box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18);
	line-height: 1;
}

/* ---- FAQ rows ---- */
.pmo-faq .wp-block-details {
	margin: 0;
	padding-block: var(--wp--preset--spacing--40);
	border-bottom: 2px solid var(--wp--preset--color--line);
}

.pmo-faq summary {
	font-weight: 700;
	cursor: pointer;
}

/* ---- Focus rings on dark and lilac grounds ---- */
.pmo-band-dark :focus-visible,
.pmo-display :focus-visible {
	outline-color: var(--wp--preset--color--tint);
}

.pmo-panel :focus-visible,
.has-tint-background-color:focus-visible {
	outline-color: var(--wp--preset--color--ink);
}

/* ---- Knob turn: a small spring, as on the prototype ---- */
@media (prefers-reduced-motion: no-preference) {
	.pmo-knob {
		transition: transform var(--wp--custom--motion--duration-slow) var(--wp--custom--motion--easing-spring);
	}
}

/* ---- Page illustrations: a slow float; the oven light breathes. Both stop for reduced motion. ---- */
.pmo-illustration {
	margin: 0;
}

.pmo-illustration img {
	display: block;
	width: 100%;
	max-width: 560px;
	height: auto;
	margin-inline: auto;
}

@media (prefers-reduced-motion: no-preference) {
	.pmo-illustration img {
		animation: pmo-float 6s ease-in-out infinite;
	}

	.pmo-oven-shots::after {
		animation: pmo-glow 4s ease-in-out infinite;
	}
}

@keyframes pmo-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-14px); }
}

@keyframes pmo-glow {
	0%, 100% { opacity: 0.75; }
	50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.pmo-knob,
	.pmo-oven-shots > * {
		transition: none;
	}

	.pmo-illustration img,
	.pmo-oven-shots::after {
		animation: none;
	}
}

/* Header band: one row at every width. The logo caps at 42vw on phones and the basket pill tightens,
   so logo + menu toggle + basket fit in 342px. WooCommerce's hooked account and mini-cart icons are
   switched off on the navigation block (ignoredHookedBlocks): the basket pill already links to the cart. */
header .pmo-band-dark > .alignwide {
	flex-wrap: nowrap;
}

header .pmo-band-dark .itxi-brand .wp-block-site-logo img {
	max-width: 42vw;
	height: auto;
}

@media (max-width: 600px) {
	.pmo-basket > .wp-block-button__link {
		padding: 0.625rem 1rem;
	}
}

/* Footer band: brand, menu, copyright wrap at tablet and stack left-aligned on phones.
   (The header's nowrap rule is scoped to header: unscoped, it squeezed these three into one row.) */
@media (max-width: 600px) {
	footer .pmo-band-dark > .alignwide {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* Mobile menu overlay speaks in the display face, like the headings */
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--heading);
	line-height: 1.15;
}
