/**
 * Bayle Restaurant — Cloud Kitchen · Dispatch signature layer (2.5).
 * Loaded only while the Dispatch style is active. The kitchen as a dispatch
 * desk: a navy bar with an orange rule, a split-flap departures board of
 * orders leaving the kitchen, a photo tagged like a parcel, the route from
 * order to door drawn on a pale street map and delivery zones as rings.
 * Barlow Condensed for the board, Barlow for reading.
 * Motion is transit: the flaps flip in row by row, the route draws itself
 * as you scroll, the ring pulses outwards and couriers move along it.
 */

.bayle-v-cloud-kitchen-dispatch {
	--kd-navy: var(--wp--preset--color--contrast);
	--kd-orange: var(--wp--preset--color--primary);
	--kd-blue: var(--wp--preset--color--accent);
	--kd-amber: #FBBF24;
	--kd-cond: "Barlow Condensed", "Arial Narrow", sans-serif;
	--kd-map:
		linear-gradient(90deg, rgba(17, 24, 39, 0.06) 1px, transparent 1px) 0 0 / 48px 48px,
		linear-gradient(0deg, rgba(17, 24, 39, 0.06) 1px, transparent 1px) 0 0 / 48px 48px,
		linear-gradient(32deg, transparent 48.5%, rgba(255, 255, 255, 0.75) 48.5% 51.5%, transparent 51.5%) 0 0 / 260px 180px,
		var(--wp--preset--color--base);
}

.bayle-v-cloud-kitchen-dispatch .bayle-main {
	overflow-x: clip;
}

/* ---- Header: navy bar with an orange rule ---- */
.bayle-hdr--kd {
	box-shadow: inset 0 -3px 0 var(--kd-orange);
}

.bayle-hdr--kd .bayle-hdr__grid {
	display: grid;
	grid-template-columns: minmax(min-content, 1fr) auto auto;
	align-items: center;
	gap: 1.5rem;
}

.bayle-hdr--kd .bayle-hdr__grid > * {
	margin: 0 !important;
}

.bayle-hdr--kd .wp-block-site-title {
	font-family: var(--kd-cond);
	font-weight: 700;
	font-size: clamp(1.3rem, 1.8vw, 1.6rem) !important;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.bayle-kd-status {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0.3rem 0.65rem;
	background: #000000;
	color: var(--kd-amber);
	border-radius: 2px;
	font-family: var(--kd-cond);
	font-weight: 600;
	font-size: 0.9375rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.bayle-kd-status__dot {
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: #34D399;
}

@media (max-width: 1279px) {
	.bayle-hdr--kd .bayle-hdr__grid {
		gap: 0.75rem;
	}

	.bayle-hdr--kd .bayle-hdr__nav {
		order: 2;
	}
}

@media (max-width: 781px) {
	.bayle-kd-status {
		display: none;
	}
}

@media (max-width: 599px) {
	.bayle-hdr--kd .wp-block-site-title {
		font-size: 1.15rem !important;
		white-space: normal;
	}
}

/* ---- Hero ---- */
.bayle-kd-hero {
	padding-top: calc(var(--bayle-header-total) + clamp(1.5rem, 4vw, 3.5rem));
	padding-bottom: clamp(3rem, 6vw, 5rem);
	background:
		linear-gradient(90deg, rgba(243, 241, 236, 0.05) 1px, transparent 1px) 0 0 / 48px 48px,
		linear-gradient(0deg, rgba(243, 241, 236, 0.05) 1px, transparent 1px) 0 0 / 48px 48px,
		var(--kd-navy);
	background-color: var(--kd-navy);
	color: var(--wp--preset--color--base);
}

.bayle-kd-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
	gap: clamp(1.5rem, 4vw, 4rem);
	align-items: center;
}

.bayle-kd-hero__grid > * {
	margin: 0 !important;
}

.bayle-kd-hero__main > * + * {
	margin-block-start: var(--wp--preset--spacing--40) !important;
}

.bayle-kd-label {
	display: inline-block;
	margin: 0;
	padding: 0.2rem 0.6rem;
	background: var(--kd-orange);
	color: var(--kd-navy);
	font-family: var(--kd-cond);
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.bayle-kd-hero__title {
	font-family: var(--kd-cond) !important;
	font-weight: 700;
	font-size: clamp(3rem, 7vw, 6.5rem) !important;
	line-height: 0.9 !important;
	text-transform: uppercase;
	color: #FFFFFF;
}

.bayle-kd-hero__lede {
	max-width: 34rem;
	font-size: var(--wp--preset--font-size--medium);
	color: #D5D9E0;
}

.bayle-kd-hero .wp-block-button.is-style-outline .wp-block-button__link {
	color: #FFFFFF;
	border-color: #FFFFFF;
	background: transparent;
}

/* The photo, tagged like a parcel. */
.bayle-kd-parcel {
	position: relative;
	margin: 0;
	justify-self: end;
	width: min(100%, 26rem);
}

.bayle-kd-parcel img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 4.4;
	object-fit: cover;
	border: 3px solid #FFFFFF;
	box-shadow: 10px 10px 0 var(--kd-orange);
}

.bayle-kd-parcel__tag {
	position: absolute;
	left: -1.5rem;
	bottom: 1.5rem;
	display: grid;
	gap: 0.1rem;
	padding: 0.6rem 0.9rem 0.6rem 1.6rem;
	background: #FFFFFF;
	color: var(--kd-navy);
	font-family: var(--kd-cond);
	text-transform: uppercase;
	clip-path: polygon(0.9rem 0, 100% 0, 100% 100%, 0.9rem 100%, 0 50%);
	rotate: -4deg;
}

.bayle-kd-parcel__tag span {
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.08em;
}

.bayle-kd-parcel__tag b {
	font-size: 1.5rem;
	letter-spacing: 0.04em;
}

/* The split-flap board. */
.bayle-kd-board {
	margin-top: clamp(2rem, 5vw, 3.5rem) !important;
	padding: clamp(0.75rem, 1.6vw, 1.25rem);
	background: #000000;
	border: 3px solid #2B3344;
	border-radius: 6px;
	box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.9);
	color: var(--kd-amber);
	font-family: var(--kd-cond);
}

.bayle-kd-board__title {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 0 0 0.75rem;
	padding: 0 0.25rem;
	font-weight: 700;
	font-size: clamp(1.25rem, 2vw, 1.75rem);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #FFFFFF;
}

.bayle-kd-board__live {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: #9CA3AF;
}

.bayle-kd-board__live::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: #34D399;
}

.bayle-kd-board table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 6px;
	table-layout: fixed;
}

.bayle-kd-board th {
	padding: 0 0.5rem 0.25rem;
	text-align: left;
	font-weight: 600;
	font-size: 0.8125rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #9CA3AF;
}

.bayle-kd-board th:nth-child(1) {
	width: 14%;
}

.bayle-kd-board th:nth-child(2) {
	width: 40%;
}

.bayle-kd-board td {
	padding: 0 3px;
}

.bayle-kd-flap {
	position: relative;
	display: block;
	padding: 0.45rem 0.6rem;
	background: linear-gradient(180deg, #1C2230 0 49%, #000000 49% 51%, #161B26 51% 100%);
	background-color: #1A1F2B;
	border-radius: 3px;
	font-weight: 600;
	font-size: clamp(1rem, 1.7vw, 1.5rem);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
	transform-origin: 50% 50%;
}

.bayle-kd-status-cell.is-ready {
	color: #6EE7B7;
}

.bayle-kd-status-cell.is-packed {
	color: #FFFFFF;
}

.bayle-kd-status-cell.is-cooking {
	color: #FDBA74;
}

.bayle-kd-status-cell.is-next {
	color: #C7CEDB;
}

@media (max-width: 899px) {
	.bayle-kd-hero__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.bayle-kd-parcel {
		justify-self: start;
		width: min(100%, 22rem);
		margin-left: 1.5rem;
	}
}

@media (max-width: 599px) {
	.bayle-kd-board th:nth-child(3),
	.bayle-kd-board td:nth-child(3) {
		display: none;
	}

	.bayle-kd-board th:nth-child(1) {
		width: 22%;
	}

	.bayle-kd-board th:nth-child(2) {
		width: 44%;
	}

	.bayle-kd-flap {
		font-size: 0.9375rem;
		padding: 0.4rem 0.4rem;
		letter-spacing: 0.02em;
		white-space: normal;
		text-overflow: clip;
		overflow-wrap: anywhere;
		hyphens: auto;
	}
}

/* ---- Route ---- */
.bayle-kd-route {
	background: var(--kd-map);
	background-color: var(--wp--preset--color--base);
}

.bayle-kd-route h2,
.bayle-kd-zones h2,
.bayle-v-cloud-kitchen-dispatch :where(.bayle-section-rescue, .bayle-section-hours, .bayle-section-location, .bayle-section-order) h2 {
	font-family: var(--kd-cond) !important;
	font-weight: 700;
	text-transform: uppercase;
	line-height: 0.95;
	font-size: clamp(2.25rem, 5vw, 4rem);
}

.bayle-kd-map {
	position: relative;
	margin-top: var(--wp--preset--spacing--60) !important;
}

.bayle-kd-map__line {
	position: absolute;
	inset: 0 0 auto;
	width: 100%;
	height: 240px;
	overflow: visible;
}

.bayle-kd-map__line path {
	fill: none;
	stroke: var(--kd-blue);
	stroke-width: 6;
	stroke-linecap: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 0;
}

.bayle-kd-stops {
	position: relative;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1rem, 3vw, 2.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.bayle-kd-stop {
	display: grid;
	align-content: start;
	gap: 0.6rem;
	padding: 1.5rem;
	background: #FFFFFF;
	border: 2px solid var(--kd-navy);
	box-shadow: 6px 6px 0 var(--kd-orange);
}

.bayle-kd-stop:nth-child(1) {
	margin-top: 9rem;
}

.bayle-kd-stop:nth-child(2) {
	margin-top: 1rem;
}

.bayle-kd-stop:nth-child(3) {
	margin-top: 6rem;
}

.bayle-kd-stop__pin {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	position: relative;
	border-radius: 50%;
	background: var(--kd-navy);
	color: #FFFFFF;
	font-family: var(--kd-cond);
	font-weight: 700;
	font-size: 1.35rem;
}

.bayle-kd-stop__pin::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -0.55rem;
	margin-left: -0.5rem;
	border: 0.5rem solid transparent;
	border-bottom: 0;
	border-top: 0.7rem solid var(--kd-navy);
}

.bayle-kd-stop h3 {
	margin: 0;
	font-family: var(--kd-cond);
	font-weight: 700;
	font-size: 1.6rem;
	text-transform: uppercase;
	line-height: 1;
}

.bayle-kd-stop p {
	margin: 0;
	color: var(--wp--preset--color--contrast-2);
}

@media (max-width: 899px) {
	.bayle-kd-map__line {
		display: none;
	}

	.bayle-kd-stops {
		grid-template-columns: minmax(0, 1fr);
		padding-left: 1.5rem;
		border-left: 6px solid var(--kd-blue);
	}

	.bayle-kd-stop:nth-child(n) {
		margin-top: 0;
	}
}

/* ---- Zones ---- */
.bayle-kd-zones {
	background: var(--wp--preset--color--base-2);
	border-top: 2px solid var(--kd-navy);
}

.bayle-kd-zones__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 5rem);
	align-items: center;
}

.bayle-kd-zones__grid > * {
	margin: 0 !important;
}

.bayle-kd-zones__list {
	display: grid;
	margin: var(--wp--preset--spacing--50) 0 0;
	padding: 0;
	list-style: none;
	border-top: 2px solid var(--kd-navy);
}

.bayle-kd-zone {
	display: grid;
	grid-template-columns: 1.25rem minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 1rem;
	padding: 1rem 0;
	border-bottom: 2px solid var(--kd-navy);
	font-size: var(--wp--preset--font-size--medium);
}

.bayle-kd-zone::before {
	content: "";
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	border: 3px solid var(--kd-navy);
}

.bayle-kd-zone--0::before {
	background: var(--kd-orange);
}

.bayle-kd-zone--1::before {
	background: #FDD9B5;
}

.bayle-kd-zone--2::before {
	background: #FFFFFF;
}

.bayle-kd-zone__name {
	font-family: var(--kd-cond);
	font-weight: 700;
	font-size: 1.4rem;
	text-transform: uppercase;
}

.bayle-kd-zone__time {
	color: var(--wp--preset--color--contrast-2);
	white-space: nowrap;
}

.bayle-kd-zone b {
	font-family: var(--kd-cond);
	font-size: 1.4rem;
	white-space: nowrap;
}

.bayle-kd-rings {
	position: relative;
	width: min(100%, 30rem);
	aspect-ratio: 1;
	justify-self: center;
	background: var(--kd-map);
	border-radius: 50%;
	border: 2px solid var(--kd-navy);
	overflow: hidden;
}

.bayle-kd-rings__ring {
	position: absolute;
	border-radius: 50%;
	border: 3px solid var(--kd-navy);
	translate: -50% -50%;
	left: 50%;
	top: 50%;
}

.bayle-kd-rings__ring--2 {
	width: 92%;
	height: 92%;
	background: rgba(255, 255, 255, 0.55);
	border-style: dashed;
}

.bayle-kd-rings__ring--1 {
	width: 62%;
	height: 62%;
	background: rgba(253, 217, 181, 0.85);
}

.bayle-kd-rings__ring--0 {
	width: 26%;
	height: 26%;
	background: var(--kd-orange);
}

.bayle-kd-rings__pin {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 2.25rem;
	height: 2.25rem;
	translate: -50% -80%;
	rotate: -45deg;
	border-radius: 50% 50% 50% 0;
	background: var(--kd-navy);
	box-shadow: inset 0 0 0 0.6rem var(--kd-navy), inset 0 0 0 2rem #FFFFFF;
}

.bayle-kd-rings__dot {
	position: absolute;
	width: 0.9rem;
	height: 0.9rem;
	border-radius: 50%;
	background: var(--kd-blue);
	border: 2px solid #FFFFFF;
}

.bayle-kd-rings__dot--a {
	left: 72%;
	top: 26%;
}

.bayle-kd-rings__dot--b {
	left: 22%;
	top: 70%;
}

@media (max-width: 899px) {
	.bayle-kd-zones__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.bayle-kd-rings {
		width: min(100%, 20rem);
	}
}

@media (max-width: 420px) {
	.bayle-kd-zone {
		grid-template-columns: 1.25rem minmax(0, 1fr) auto;
	}

	.bayle-kd-zone__time {
		grid-column: 2;
		grid-row: 2;
	}
}

/* ---- Shared sections ---- */
.bayle-v-cloud-kitchen-dispatch .bayle-section-rescue .wp-block-image img,
.bayle-v-cloud-kitchen-dispatch .bayle-section-location .wp-block-image img {
	border: 2px solid var(--kd-navy);
	border-radius: 2px !important;
	box-shadow: 8px 8px 0 var(--kd-orange);
}

.bayle-v-cloud-kitchen-dispatch .bayle-section-location a:not(.wp-element-button) {
	color: var(--kd-navy);
}

.bayle-v-cloud-kitchen-dispatch .bayle-section-order {
	box-shadow: inset 0 3px 0 var(--kd-orange);
}

.bayle-v-cloud-kitchen-dispatch :is(.bayle-page-title, .bayle-main > .wp-block-group:first-child:has(> .wp-block-post-title)) {
	background: var(--kd-map);
	border-bottom: 3px solid var(--kd-orange);
	margin-bottom: var(--wp--preset--spacing--50);
}

.bayle-v-cloud-kitchen-dispatch :is(.bayle-page-title, .bayle-main > .wp-block-group:first-child:has(> .wp-block-post-title)) .wp-block-post-title {
	font-family: var(--kd-cond) !important;
	font-weight: 700;
	font-size: clamp(2.75rem, 7vw, 5.5rem) !important;
	text-transform: uppercase;
	line-height: 0.95;
}

/* ---- Footer: the board signs off ---- */
.bayle-footer--kd {
	border-top: 3px solid var(--kd-orange);
}

.bayle-footer--kd .bayle-footer__sign {
	margin: 0;
	padding: 0.4rem 0.8rem;
	width: fit-content;
	max-width: 100%;
	background: #000000;
	color: var(--kd-amber);
	border-radius: 4px;
	font-family: var(--kd-cond);
	font-weight: 700;
	font-size: clamp(1.75rem, 5vw, 3.75rem);
	line-height: 1.05;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.bayle-footer--kd .bayle-footer__label {
	margin: 0 0 0.75rem;
	font-family: var(--kd-cond);
	font-weight: 700;
	font-size: 0.9375rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--kd-amber);
}

.bayle-footer--kd a {
	color: var(--wp--preset--color--on-band);
}

.bayle-footer--kd .bayle-footer__bottom {
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid rgba(243, 241, 236, 0.2);
}

/* ---- Motion: transit ---- */
@media (prefers-reduced-motion: no-preference) {
	.bayle-kd-flap {
		animation: bayle-kd-flip 0.5s cubic-bezier(0.7, 0, 0.3, 1) both;
		animation-delay: calc(0.2s + var(--i, 0) * 0.12s);
	}

	.bayle-kd-status__dot,
	.bayle-kd-board__live::before {
		animation: bayle-kd-blink 1.6s steps(2, jump-none) infinite;
	}

	.bayle-kd-rings__ring--0 {
		animation: bayle-kd-pulse 3s ease-out infinite;
	}

	@supports (animation-timeline: view()) {
		.bayle-kd-map__line path {
			animation: bayle-kd-draw linear both;
			animation-timeline: view();
			animation-range: entry 10% cover 55%;
		}

		.bayle-kd-rings__dot--a {
			animation: bayle-kd-courier-a linear both;
			animation-timeline: view();
			animation-range: entry 0% exit 30%;
		}

		.bayle-kd-rings__dot--b {
			animation: bayle-kd-courier-b linear both;
			animation-timeline: view();
			animation-range: entry 0% exit 30%;
		}

		.bayle-kd-stop__pin {
			animation: bayle-kd-drop linear both;
			animation-timeline: view();
			animation-range: entry 20% entry 100%;
		}
	}
}

@keyframes bayle-kd-flip {
	0% {
		transform: scaleY(0.08);
	}

	45% {
		transform: scaleY(1);
	}

	65% {
		transform: scaleY(0.6);
	}

	100% {
		transform: none;
	}
}

@keyframes bayle-kd-blink {
	50% {
		background: #065F46;
	}
}

@keyframes bayle-kd-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(247, 107, 21, 0.5);
	}

	100% {
		box-shadow: 0 0 0 2.5rem rgba(247, 107, 21, 0);
	}
}

@keyframes bayle-kd-draw {
	from {
		stroke-dashoffset: 1;
	}

	to {
		stroke-dashoffset: 0;
	}
}

@keyframes bayle-kd-courier-a {
	from {
		left: 50%;
		top: 50%;
	}

	to {
		left: 72%;
		top: 26%;
	}
}

@keyframes bayle-kd-courier-b {
	from {
		left: 50%;
		top: 50%;
	}

	to {
		left: 22%;
		top: 70%;
	}
}

@keyframes bayle-kd-drop {
	from {
		translate: 0 -1rem;
	}

	to {
		translate: 0 0;
	}
}
