/*
Theme Name: EDZNET Bakery
Theme URI: https://proof.edznet.dev/bakery/
Author: EDZNET
Author URI: https://edznet.io/
Description: A one-of-a-kind block theme for a village bakery, shown as Kettlesike Bakehouse in North Yorkshire. The homepage is the day's bake sheet: what comes out of the oven when, with each bake marked due, out now or sold out as the day goes on. Includes a menu with UK allergen labelling, click-and-collect ordering, opening hours with an early-closing day, seasonal news and a UK GDPR privacy notice. Fonts are bundled; no third-party requests.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: edznet-bakery
Tags: block-patterns, block-styles, full-site-editing, custom-colors, editor-style, food-and-drink, one-column, template-editing, translation-ready, wide-blocks
*/

/* Tokens: aliases of theme.json presets */
:root {
	--eb-base: var(--wp--preset--color--base);
	--eb-panel: var(--wp--preset--color--panel);
	--eb-sheet: var(--wp--preset--color--sheet);
	--eb-ink: var(--wp--preset--color--ink);
	--eb-ink-soft: var(--wp--preset--color--ink-soft);
	--eb-accent: var(--wp--preset--color--accent);
	--eb-fresh: var(--wp--preset--color--fresh);
	--eb-butter: var(--wp--preset--color--butter);
	--eb-night: var(--wp--preset--color--night);
	--eb-night-ink: var(--wp--preset--color--night-ink);
	--eb-display: var(--wp--preset--font-family--display);
	--eb-body: var(--wp--preset--font-family--body);
	--eb-line: color-mix(in srgb, var(--eb-ink) 18%, transparent);
	--eb-crimp: 10px;
	--eb-focus: var(--eb-accent);
}

/* Night bake: dark scheme re-points the presets so every block follows */
@media (prefers-color-scheme: dark) {

	:root:root {
		--wp--preset--color--base: #1c130d;
		--wp--preset--color--panel: #2a1d14;
		--wp--preset--color--sheet: #261a12;
		--wp--preset--color--ink: #f2e8d8;
		--wp--preset--color--ink-soft: #cdb8a0;
		--wp--preset--color--accent: #f39066;
		--wp--preset--color--fresh: #a4c896;
		--wp--preset--color--butter: #e7b54a;
		--wp--preset--color--night: #0e0805;
		--wp--preset--color--night-ink: #f5eee1;
		--eb-focus: #ffc58f;
		color-scheme: dark;
	}

	.eb-sheet {
		--eb-sheet-rule: rgba(245, 238, 225, 0.1);
		--eb-sheet-margin: rgba(243, 144, 102, 0.4);
	}
}

/* Base */
body {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizelegibility;
}

:where(a) {
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--eb-focus);
	outline-offset: 3px;
	border-radius: 2px;
}

::selection {
	color: var(--eb-night);
	background: var(--eb-butter);
}

h1,
h2,
h3 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

/* Small furniture */
.eb-eyebrow {
	margin-bottom: 0.5rem;
	color: var(--eb-accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.eb-lede {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

.eb-muted {
	color: var(--eb-ink-soft);
}

.eb-editor-note {
	display: none;
}

.editor-styles-wrapper .eb-editor-note {
	display: block;
	padding: 0.75rem 1rem;
	font-size: 0.9rem;
	color: #1e1e1e;
	background: #fff6c8;
	border: 2px dashed #8a6d00;
}

/* Header */
.eb-topline {
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

.eb-topline a {
	color: inherit;
	font-weight: 700;
}

.eb-brand {
	gap: 0.85rem;
}

.eb-brand .wp-block-site-title {
	margin: 0;
}

.eb-brand .wp-block-site-tagline {
	margin: 0.2rem 0 0;
	color: var(--eb-ink-soft);
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.eb-mark {
	display: block;
	flex: none;
	width: 3.1rem;
	height: 3.1rem;
	color: var(--eb-accent);
}

.eb-header {
	border-bottom: 1px solid var(--eb-line);
}

.eb-header .wp-block-navigation {
	gap: 0.25rem 1.4rem;
}

.eb-header .wp-block-navigation .wp-block-navigation-item__content {
	padding: 0.35rem 0;
	text-decoration: none;
}

.eb-header .wp-block-navigation a:hover,
.eb-header .wp-block-navigation .current-menu-item > a,
.eb-header .wp-block-navigation a[aria-current="page"] {
	text-decoration: underline wavy var(--eb-accent) 1.5px;
	text-underline-offset: 0.4em;
}

.eb-header .wp-block-navigation .eb-nav-cta a {
	padding: 0.4rem 0.9rem;
	color: var(--eb-base);
	background: var(--eb-accent);
	border-radius: 0.3rem;
}

.eb-header .wp-block-navigation .eb-nav-cta a:hover {
	color: var(--eb-base);
	background: var(--eb-ink);
	text-decoration: none;
}

@media (max-width: 781px) {

	.eb-header .wp-block-navigation {
		justify-content: flex-start;
		font-size: 0.95rem;
	}
}

/* Pie-crust crimp edges */
.eb-crimp-bottom {
	padding-bottom: calc(var(--eb-crimp) + var(--wp--preset--spacing--50));
	mask: radial-gradient(var(--eb-crimp) at 50% 100%, transparent 97%, #000) 50% / calc(var(--eb-crimp) * 2) 100%;
}

.eb-crimp-top {
	padding-top: calc(var(--eb-crimp) + var(--wp--preset--spacing--50));
	mask: radial-gradient(var(--eb-crimp) at 50% 0, transparent 97%, #000) 50% / calc(var(--eb-crimp) * 2) 100%;
}

.eb-crimp-both {
	mask:
		radial-gradient(var(--eb-crimp) at 50% 0, transparent 97%, #000) 50% 0 / calc(var(--eb-crimp) * 2) 51% repeat-x,
		radial-gradient(var(--eb-crimp) at 50% 100%, transparent 97%, #000) 50% 100% / calc(var(--eb-crimp) * 2) 51% repeat-x;
}

/* Masthead for inner pages */
.eb-masthead {
	position: relative;
	border-bottom: 2px solid var(--eb-ink);
}

.eb-masthead::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -8px;
	left: 0;
	height: 2px;
	background: var(--eb-ink);
}

/* Hero */
.eb-hero .eb-hero__copy {
	position: sticky;
	top: 2rem;
}

.eb-hero h1 {
	margin-top: 0;
}

.eb-hero h1 em {
	color: var(--eb-accent);
	font-style: normal;
}

/* Stamp roundel */
.eb-stamp {
	display: inline-grid;
	place-items: center;
	width: 7.5rem;
	aspect-ratio: 1;
	padding: 0.5rem;
	color: var(--eb-accent);
	font-family: var(--eb-display);
	font-size: 0.95rem;
	line-height: 1.15;
	text-align: center;
	border: 2px solid currentcolor;
	border-radius: 50%;
	outline: 1px solid currentcolor;
	outline-offset: -7px;
	rotate: -8deg;
}

/* Specials: paper bags with a folded top */
.eb-cards {
	gap: var(--wp--preset--spacing--40);
}

.eb-card {
	position: relative;
	height: 100%;
	padding: 2.4rem 1.4rem 1.4rem;
	background: var(--eb-sheet);
	border: 1px solid var(--eb-line);
	box-shadow: var(--wp--preset--shadow--pinned);
}

.eb-card::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 1.1rem;
	background: repeating-linear-gradient(135deg, var(--eb-panel) 0 6px, transparent 6px 12px);
	border-bottom: 1px dashed var(--eb-line);
}

.eb-card h3 {
	margin-top: 0;
}

.eb-tag {
	display: inline-block;
	position: relative;
	margin: 0;
	padding: 0.2rem 0.75rem 0.2rem 1.4rem;
	color: var(--eb-night);
	background: var(--eb-butter);
	font-family: var(--eb-display);
	font-size: 1.15rem;
	clip-path: polygon(0.7rem 0, 100% 0, 100% 100%, 0.7rem 100%, 0 50%);
}

.eb-tag::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0.65rem;
	width: 0.35rem;
	height: 0.35rem;
	translate: 0 -50%;
	background: var(--eb-sheet);
	border-radius: 50%;
}

/* Allergen chips */
.eb-allergens {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.82rem;
	font-weight: 700;
}

.eb-allergens li {
	padding: 0.1rem 0.55rem;
	color: var(--eb-ink);
	border: 1.5px solid var(--eb-ink-soft);
	border-radius: 999px;
}

.eb-allergens li::before {
	content: "";
	display: inline-block;
	width: 0.4rem;
	height: 0.4rem;
	margin-right: 0.35rem;
	vertical-align: 0.1rem;
	background: var(--eb-accent);
	rotate: 45deg;
}

.eb-allergens.is-free li::before {
	background: var(--eb-fresh);
	border-radius: 50%;
}

.eb-key {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 0.5rem 1.5rem;
	padding: 0;
	list-style: none;
}

.eb-key li {
	padding: 0.5rem 0;
	border-bottom: 1px dashed var(--eb-line);
}

.eb-key strong {
	display: block;
}

/* Menu */
.eb-menu-item {
	padding: 1rem 0;
	border-bottom: 1px dashed var(--eb-line);
}

.eb-menu-item > .wp-block-group:first-child {
	gap: 1rem;
}

.eb-menu-item h3 {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.eb-menu-item .eb-price {
	margin: 0;
	font-family: var(--eb-display);
	font-size: 1.2rem;
	white-space: nowrap;
}

.eb-menu-item p {
	margin-block: 0.25rem 0;
}

.eb-menu-item .eb-ingredients {
	font-size: var(--wp--preset--font-size--small);
}

.eb-section-label {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.eb-section-label::after {
	content: "";
	flex: 1;
	height: 2px;
	background: repeating-linear-gradient(90deg, var(--eb-ink) 0 8px, transparent 8px 14px);
}

/* Boxes */
.eb-notice {
	padding: 1.25rem 1.4rem;
	background: var(--eb-panel);
	border-left: 6px solid var(--eb-accent);
}

.eb-notice > :first-child {
	margin-top: 0;
}

.eb-ticket {
	padding: 1.5rem;
	background: var(--eb-sheet);
	border: 2px dashed var(--eb-ink-soft);
	border-radius: 0.4rem;
}

/* Numbered tickets for steps */
.eb-steps {
	counter-reset: eb-step;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 1rem;
	padding: 0;
	list-style: none;
}

.eb-steps li {
	counter-increment: eb-step;
	position: relative;
	padding: 3.2rem 1.2rem 1.2rem;
	background: var(--eb-sheet);
	border: 1px solid var(--eb-line);
}

.eb-steps li::before {
	content: counter(eb-step);
	position: absolute;
	top: 0.8rem;
	left: 1.2rem;
	color: var(--eb-accent);
	font-family: var(--eb-display);
	font-size: 2rem;
	line-height: 1;
}

/* Photo placeholders, sized for the real photo so nothing shifts */
.eb-photo {
	display: grid;
	place-items: end start;
	aspect-ratio: 4 / 3;
	padding: 1rem;
	color: var(--eb-ink-soft);
	background:
		radial-gradient(circle at 30% 35%, color-mix(in srgb, var(--eb-butter) 35%, transparent) 0 18%, transparent 19%),
		radial-gradient(circle at 62% 58%, color-mix(in srgb, var(--eb-accent) 22%, transparent) 0 24%, transparent 25%),
		repeating-linear-gradient(45deg, var(--eb-panel) 0 14px, var(--eb-sheet) 14px 28px);
	border: 1px solid var(--eb-line);
}

.eb-photo.is-tall {
	aspect-ratio: 4 / 5;
	max-height: 34rem;
}

.eb-photo.is-wide {
	aspect-ratio: 16 / 9;
}

.eb-photo p {
	margin: 0;
	padding: 0.2rem 0.6rem;
	font-size: 0.8rem;
	background: var(--eb-sheet);
}

/* Opening hours */
.eb-hours table {
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.eb-hours td,
.eb-hours th {
	padding: 0.55rem 0.25rem;
	border: 0;
	border-bottom: 1px dashed var(--eb-line);
}

.eb-hours td:last-child {
	font-family: var(--eb-display);
	text-align: right;
}

.eb-hours strong {
	color: var(--eb-accent);
}

/* Night band */
.eb-night a,
.eb-footer a {
	color: var(--eb-butter);
}

.eb-night .eb-eyebrow {
	color: var(--eb-butter);
}

.eb-night .eb-key li {
	border-color: color-mix(in srgb, var(--eb-night-ink) 25%, transparent);
}

.eb-night .wp-block-heading,
.eb-footer .wp-block-heading {
	color: var(--eb-night-ink);
}

.eb-night .wp-block-button__link {
	color: var(--eb-night);
	background: var(--eb-butter);
}

.eb-night .wp-block-button__link:hover {
	color: var(--eb-night);
	background: var(--eb-night-ink);
}

/* Illustrated village map */
.eb-map svg {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	background: var(--eb-sheet);
	border: 1px solid var(--eb-line);
}

/* Buttons: outline variation */
.wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--eb-ink);
	background: transparent;
	border: 2px solid currentcolor;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	color: var(--eb-accent);
}

/* News */
.eb-post-card {
	height: 100%;
	padding: 1.4rem;
	background: var(--eb-sheet);
	border-top: 4px solid var(--eb-accent);
}

.eb-post-card .wp-block-post-title {
	margin-block: 0.4rem;
}

.eb-post-card .wp-block-post-excerpt__more-link {
	font-weight: 700;
}

.wp-block-query-pagination {
	font-weight: 700;
}

.wp-block-post-content > .wp-block-quote,
.wp-block-quote {
	padding-left: 1.4rem;
	border-left: 4px solid var(--eb-butter);
}

.wp-block-quote cite {
	font-family: var(--eb-body);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	color: var(--eb-ink-soft);
}

/* Footer */
.eb-footer {
	font-size: var(--wp--preset--font-size--small);
}

.eb-footer h2 {
	margin-bottom: 0.6rem;
	font-size: var(--wp--preset--font-size--large);
}

.eb-footer p {
	margin-block: 0.25rem;
}

.eb-footer .eb-footer__legal {
	padding-top: 1rem;
	border-top: 1px solid color-mix(in srgb, var(--eb-night-ink) 22%, transparent);
	opacity: 0.85;
}

/* 404 */
.eb-empty-tray {
	display: block;
	width: min(18rem, 70%);
	margin-inline: auto;
	color: var(--eb-ink-soft);
}

/* Print: the bake sheet and menu print cleanly for the shop window */
@media print {

	body {
		background: #fff;
	}

	.eb-header nav,
	.eb-footer,
	.eb-topline {
		display: none;
	}

	.eb-sheet {
		rotate: none;
		box-shadow: none;
	}
}

/* FAQ */
.wp-block-details {
	padding: 0.9rem 0;
	border-bottom: 1px dashed var(--eb-line);
}

.wp-block-details summary {
	font-weight: 700;
	cursor: pointer;
}

.wp-block-details summary::marker {
	color: var(--eb-accent);
}

/* Story timeline */
.eb-timeline {
	position: relative;
	padding: 0 0 0 1.75rem;
	list-style: none;
}

.eb-timeline::before {
	content: "";
	position: absolute;
	top: 0.5rem;
	bottom: 0.5rem;
	left: 0.35rem;
	border-left: 2px dashed var(--eb-accent);
}

.eb-timeline li {
	position: relative;
	padding: 0 0 1.25rem;
}

.eb-timeline li::before {
	content: "";
	position: absolute;
	top: 0.45rem;
	left: -1.75rem;
	width: 0.85rem;
	height: 0.85rem;
	background: var(--eb-panel);
	border: 3px solid var(--eb-accent);
	border-radius: 50%;
}

.eb-timeline strong {
	display: block;
	font-family: var(--eb-display);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 400;
	line-height: 1.2;
}
