/* Metrics match the web fonts so text keeps its line breaks when they swap in. */
@font-face {
	font-family: "Source Sans 3 Fallback";
	src: local("Arial"), local("ArialMT"), local("Arimo"), local("Liberation Sans");
	font-weight: 400;
	size-adjust: 93.05%;
	ascent-override: 110.05%;
	descent-override: 42.99%;
	line-gap-override: 0%;
}

@font-face {
	font-family: "Source Sans 3 Fallback";
	src: local("Arial Bold"), local("Arial-BoldMT"), local("Arimo Bold"), local("Liberation Sans Bold");
	font-weight: 600;
	size-adjust: 88.76%;
	ascent-override: 115.37%;
	descent-override: 45.06%;
	line-gap-override: 0%;
}

@font-face {
	font-family: "Source Serif 4 Fallback";
	src: local("Georgia"), local("Gelasio");
	font-weight: 300;
	size-adjust: 107.19%;
	ascent-override: 96.65%;
	descent-override: 31.25%;
	line-gap-override: 0%;
}

:root {
	--dz-green: var(--wp--preset--color--green);
	--dz-tab-height: var(--wp--custom--tab-bar--height);
	--dz-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--dz-dur-press: 90ms;
	--dz-dur-hover: 120ms;
	--dz-dur-link: 220ms;
	--dz-focus-offset: 2px;
	--dz-header-row: 80px;
	--dz-header-row-small: 64px;
}

html {
	scrollbar-color: var(--wp--preset--color--sage) var(--wp--preset--color--panel-warm);
}

body {
	caret-color: var(--dz-green);
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--wp--preset--color--sage-soft);
	color: var(--wp--preset--color--text);
}

:where(h1, h2, h3, h4) {
	text-wrap: balance;
}

:where(a) {
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

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

.wp-element-button,
.wp-block-button__link {
	min-height: 48px;
	transition:
		background-color var(--dz-dur-hover) var(--dz-ease-out),
		color var(--dz-dur-hover) var(--dz-ease-out),
		transform var(--dz-dur-press) var(--dz-ease-out);
}

.wp-element-button:active:not(:disabled),
.wp-block-button__link:active {
	transform: scale(0.97);
}

.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid var(--dz-green);
	outline-offset: var(--dz-focus-offset);
	border-radius: var(--wp--custom--radius--medium);
}

/* Text links keep a quiet resting underline; a darker one draws in from the left. */
.dz-link a,
.wp-block-post-content :is(p, li) > a:not(.wp-element-button, .wp-block-button__link) {
	text-decoration: none;
	background:
		linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat,
		linear-gradient(var(--wp--preset--color--sage), var(--wp--preset--color--sage)) 0 100% / 100% 1px no-repeat;
	padding-bottom: 2px;
	transition: background-size var(--dz-dur-link) var(--dz-ease-out), color var(--dz-dur-hover) var(--dz-ease-out);
}

.dz-link a {
	background-position: 0 calc(50% + 0.75em), 0 calc(50% + 0.75em);
	padding-bottom: 0;
}

.dz-link a:hover,
.dz-link a:focus-visible,
.wp-block-post-content :is(p, li) > a:not(.wp-element-button, .wp-block-button__link):hover,
.wp-block-post-content :is(p, li) > a:not(.wp-element-button, .wp-block-button__link):focus-visible {
	background-size: 100% 1px, 100% 1px;
}

.wp-element-button:disabled,
.wp-element-button[aria-disabled="true"] {
	background-color: var(--wp--preset--color--sage-soft);
	color: var(--wp--preset--color--text-muted);
	cursor: not-allowed;
}

.wp-block-search__input:focus-visible {
	outline: 2px solid var(--dz-green);
	outline-offset: 2px;
}

.is-style-dz-card {
	border-radius: var(--wp--custom--radius--large);
	padding: var(--wp--preset--spacing--40);
	height: 100%;
}

/* Signature element: section headings sit on a thin shelf line. */
.dz-shelf {
	border-bottom: 1px solid var(--wp--preset--color--sage-soft);
	padding-bottom: var(--wp--preset--spacing--20);
	margin-bottom: var(--wp--preset--spacing--40);
}

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.wp-site-blocks > * {
	box-sizing: border-box;
	width: 100%;
	margin-block-start: 0;
}

.wp-site-blocks > footer {
	margin-top: auto;
}

.dz-concept-notice {
	padding-block: var(--wp--preset--spacing--10);
}

/* The usual green-hover link colour is below 4.5:1 on the sage panel. */
.dz-concept-notice a:hover {
	color: var(--wp--preset--color--text);
}

.dz-header__row {
	gap: var(--wp--preset--spacing--40);
}

.dz-header .wp-block-site-logo {
	flex: none;
	line-height: 0;
}

.dz-main-nav {
	flex: 1 1 auto;
}

.dz-header-search {
	flex: 0 1 240px;
	min-width: 140px;
}

.dz-header-search .wp-block-search__inside-wrapper {
	border: 1px solid var(--wp--preset--color--green-hover);
	border-radius: var(--wp--custom--radius--medium);
	padding: 0;
	background: var(--wp--preset--color--page);
}

.wp-block-search__input {
	min-height: 44px;
	border-radius: var(--wp--custom--radius--medium);
	color: var(--wp--preset--color--text);
}

.wp-block-search__input::placeholder {
	color: var(--wp--preset--color--text-muted);
	opacity: 1;
}

.dz-header-search .wp-block-search__input {
	border: 0;
	padding-left: 12px;
	background: transparent;
}

.dz-header-search .wp-block-search__button {
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 10px;
	background: transparent;
	color: var(--dz-green);
}

.wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	min-width: 44px;
	min-height: 44px;
}

.wp-site-blocks .wp-block-site-logo a,
.wp-block-post-title a {
	display: inline-flex;
	align-items: center;
	min-width: 44px;
	min-height: 44px;
}

.dz-link a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.dz-main-nav .wp-block-navigation__container {
	align-items: center;
}

.dz-header .wc-block-customer-account__link,
.dz-header .dz-cart-link {
	min-width: 44px;
	min-height: 44px;
	justify-content: center;
	color: var(--wp--preset--color--text);
}

.wp-block-navigation a {
	text-decoration: none;
}

.wp-block-navigation a:hover {
	color: var(--wp--preset--color--green-hover);
	text-decoration: underline;
}

.wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--sage-soft);
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--page);
	min-width: 240px;
}

.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container {
	border: 0;
	min-width: 0;
	padding-left: var(--wp--preset--spacing--20);
	padding-right: 0;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
}

.dz-footer-nav {
	gap: 0;
}

/* The closed drawer stays in the page; without this, Tab lands inside it off-screen. */
.wc-block-components-drawer__screen-overlay--is-hidden {
	visibility: hidden;
}

.dz-tab-bar {
	display: none;
}

@media (max-width: 781px) {
	body {
		padding-bottom: calc(var(--dz-tab-height) + env(safe-area-inset-bottom));
	}

	:root {
		--dz-header-row: 64px;
		--dz-header-row-small: 56px;
	}

	.dz-header__row {
		min-height: var(--dz-header-row);
	}

	.dz-header .wp-block-site-logo img {
		width: 110px;
		height: auto;
	}

	.dz-main-nav {
		flex: none;
	}

	.dz-header-search,
	.dz-header .wp-block-woocommerce-customer-account,
	.dz-header .dz-cart-link {
		display: none;
	}

	.dz-tab-bar {
		display: block;
		position: fixed;
		inset: auto 0 0;
		z-index: 50;
		padding-bottom: env(safe-area-inset-bottom);
		border-top: 1px solid var(--wp--preset--color--sage-soft);
	}

	.dz-tabs .wp-block-navigation__container {
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		gap: 0;
		width: 100%;
	}

	.dz-tab .wp-block-navigation-item__content.wp-block-navigation-item__content {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 2px;
		width: 100%;
		min-height: var(--dz-tab-height);
		font-size: var(--wp--preset--font-size--size-14);
		line-height: 1.2;
		color: var(--wp--preset--color--text);
	}

	.dz-tab .wp-block-navigation-item__content.wp-block-navigation-item__content:active {
		background-color: var(--wp--preset--color--panel-sage);
		color: var(--dz-green);
	}

	.dz-tab .wp-block-navigation-item__content.wp-block-navigation-item__content::before {
		content: "";
		width: 24px;
		height: 24px;
		background-color: currentcolor;
		mask: var(--dz-icon) center / contain no-repeat;
	}

	.dz-tab-home { --dz-icon: url("../icons/home.svg"); }
	.dz-tab-shop { --dz-icon: url("../icons/shop.svg"); }
	.dz-tab-search { --dz-icon: url("../icons/search.svg"); }
	.dz-tab-cart { --dz-icon: url("../icons/cart.svg"); }
	.dz-tab-account { --dz-icon: url("../icons/account.svg"); }
}

/* Header sits on top while scrolling and condenses over the first 24px. */
.wp-site-blocks > header {
	display: contents;
}

.wp-site-blocks .dz-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background: var(--wp--preset--color--page);
}

.dz-header__row {
	min-height: var(--dz-header-row);
}

@keyframes dz-header-lift {
	to {
		box-shadow: 0 8px 24px color-mix(in srgb, var(--wp--preset--color--text) 9%, transparent);
	}
}

@keyframes dz-header-condense {
	to {
		min-height: var(--dz-header-row-small);
	}
}

@supports (animation-timeline: scroll()) {
	.wp-site-blocks .dz-header {
		animation: dz-header-lift linear both;
		animation-timeline: scroll(root);
		animation-range: 0 24px;
	}

	.dz-header__row {
		animation: dz-header-condense linear both;
		animation-timeline: scroll(root);
		animation-range: 0 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-element-button,
	.wp-block-button__link {
		transition: background-color var(--dz-dur-hover) linear, color var(--dz-dur-hover) linear;
	}

	.wp-element-button:active,
	.wp-block-button__link:active {
		transform: none;
	}

	.dz-link a,
	.wp-block-post-content :is(p, li) > a:not(.wp-element-button, .wp-block-button__link) {
		background-size: 0 1px, 100% 1px;
		text-decoration: none;
		transition: color var(--dz-dur-hover) linear, text-decoration-color var(--dz-dur-hover) linear;
	}

	.dz-link a:hover,
	.dz-link a:focus-visible,
	.wp-block-post-content :is(p, li) > a:not(.wp-element-button, .wp-block-button__link):hover,
	.wp-block-post-content :is(p, li) > a:not(.wp-element-button, .wp-block-button__link):focus-visible {
		background-size: 100% 1px, 100% 1px;
		transition: none;
	}

	.dz-header__row {
		animation: none;
	}
}

.dz-section {
	padding-block: var(--wp--preset--spacing--section);
	padding-inline: var(--wp--style--root--padding-left, 16px) var(--wp--style--root--padding-right, 16px);
}

/* Sections butt up against each other; the block gap would show as a white stripe between panels. */
.wp-block-post-content > .dz-section {
	margin-block: 0;
}

/* Two white sections in a row share one gap instead of doubling it. */
.dz-products + .dz-products,
.dz-picks + .dz-picks {
	padding-block-start: 0;
}

.dz-hero {
	padding-block: clamp(24px, 3vw, 40px) clamp(40px, 4vw, 56px);
}

.dz-aisles {
	background: var(--wp--preset--color--panel-warm);
}

.dz-section__inner {
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
}

.dz-section .dz-shelf {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: var(--wp--preset--spacing--20);
}

.dz-section .dz-shelf > * {
	margin-block: 0;
}

.dz-split {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	align-items: center;
}

.dz-split__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--large);
}

.dz-split__text > * {
	margin-block: 0;
}

.dz-split__text > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

@media (min-width: 782px) {
	.dz-split {
		grid-template-columns: 1fr 1fr;
		gap: var(--wp--preset--spacing--60);
	}

	.dz-split--photo-right .dz-split__photo {
		order: 2;
	}
}

.wp-block-post-content a {
	overflow-wrap: anywhere;
}

.wp-block-post-content iframe {
	max-width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
}

.dz-products .wp-block-woocommerce-product-template {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40);
}

.dz-products .wp-block-woocommerce-product-template > li {
	width: auto;
	margin: 0;
}

.dz-products .wc-block-components-product-image img {
	border-radius: var(--wp--custom--radius--large);
	aspect-ratio: 1;
	object-fit: cover;
	background: var(--wp--preset--color--panel-warm);
}

.dz-products .wp-block-post-title {
	margin-block: var(--wp--preset--spacing--20) 0;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	line-height: 1.3;
}

.dz-products .wp-block-post-title a {
	text-decoration: none;
}

.dz-products .wc-block-components-product-price {
	font-variant-numeric: tabular-nums;
}

@media (max-width: 781px) {
	.dz-products .wp-block-woocommerce-product-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--20);
	}
}
