/*
Theme Name: Hartley's Recipe Book
Theme URI: https://cyonagency.com
Author: Cyon
Author URI: https://cyonagency.com
Description: Hartley's digital brand guidelines. A block theme with a colour-themed section per chapter, a fixed chapter sidebar, and pattern libraries for the colours and type pages.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 3.35.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hartleys
Tags: full-site-editing, block-styles, block-patterns, editor-style, custom-colors, left-sidebar
*/

/* ==========================================================================
   Tokens
   Colours, type and spacing live in theme.json. These are the layout tokens
   and the pattern shapes (used as masks so any colour can fill them).
   The --section-* and --hero-* values are set per page by inc/sections.php;
   the ones here are only fallbacks.
   ========================================================================== */

:root {
	--sidebar-w: 16rem;
	--gutter: clamp(1.25rem, 4.5vw, 4rem);
	--sheet-radius: clamp(1.5rem, 4vw, 4rem);
	--admin-offset: var(--wp-admin--admin-bar--height, 0px);

	--section-ripe: var(--wp--preset--color--orange-ripe);
	--section-bright: var(--wp--preset--color--orange-bright);
	--section-zest: var(--wp--preset--color--orange-zest);
	--hero-bg: var(--section-bright);
	--hero-ink: var(--section-ripe);
	--hero-mask: var(--mask-dots);
	--hero-tilt: 0deg;

	/* Type sizes, clamped between phone and desktop. */
	--hartleys-nav-label: clamp(0.875rem, 0.75rem + 0.4vw, 1.125rem);  /* up to 18px */
	--hartleys-toc-size: clamp(0.8rem, 0.7rem + 0.25vw, 0.875rem);     /* up to 14px */
	--hartleys-paragraph: clamp(1rem, 0.8rem + 0.6vw, 1.25rem);        /* 16px to 20px */

	/* Patterns. The shapes are SVG files in assets/patterns/ (see
	   inc/pattern-files.php); these set how each one is laid out. Repeating
	   tiles give their tile size; single artworks fill the space. The
	   fallback draws nothing if a file is missing. */
	--mask-dots: var(--mask-dots-image, linear-gradient(transparent, transparent)) 0 0 / 4.5rem 4.5rem repeat;
	--mask-waves: var(--mask-waves-image, linear-gradient(transparent, transparent)) 0 0 / 91rem 26.133rem repeat;
	--mask-rings: var(--mask-rings-image, linear-gradient(transparent, transparent)) center / cover no-repeat;
	--mask-squiggles: var(--mask-squiggles-image, linear-gradient(transparent, transparent)) 0 0 / 26rem 26rem repeat;
	--mask-hearts: var(--mask-hearts-image, linear-gradient(transparent, transparent)) center / cover no-repeat;
}

/* ==========================================================================
   Base
   ========================================================================== */

body {
	font-synthesis: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

@view-transition {
	navigation: auto;
}

img {
	max-width: 100%;
	height: auto;
}

:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--pickle-bright);
	outline-offset: 3px;
	border-radius: 2px;
}

:where(.hartleys-sidebar, .hartleys-hero, .hartleys-visual) :focus-visible {
	outline-color: var(--wp--preset--color--pickle-zest);
}

/* ---- Body type ----
   Paragraph blocks run 16px on phones to 20px on wide screens. Zero
   specificity, so any paragraph with its own designed size keeps it. */

:where(p) {
	font-size: var(--hartleys-paragraph);
}

/* These take their size from their container, not the rule above. */
:is(.hartleys-hero__intro, .wp-block-quote, .wp-block-pullquote, .wp-block-cover__inner-container) :where(p:not([class*="-font-size"])) {
	font-size: inherit;
}

/* Nothing in the main body below 16px, even text set to Small. The
   footer's small print is the one exception. */
:is(.hartleys-sheet, .editor-styles-wrapper) :is(.has-small-font-size, .has-x-small-font-size):not(.hartleys-footer *) {
	font-size: max(1rem, var(--wp--preset--font-size--small)) !important;
}

h1, h2, h3, h4, h5, h6 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

/* ==========================================================================
   Shell: sidebar + main column
   ========================================================================== */

.hartleys-shell {
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
	min-height: calc(100vh - var(--admin-offset));
	margin: 0;
	/* Keeps the sidebar column green all the way down, whatever the page length. */
	background: linear-gradient(to right, var(--wp--preset--color--pickle-ripe) var(--sidebar-w), transparent 0);
}

.hartleys-shell > * {
	margin: 0 !important;
}

.hartleys-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.hartleys-main > * {
	margin: 0;
}

/* ---- Sidebar ---- */

.hartleys-sidebar {
	position: sticky;
	top: var(--admin-offset);
	height: calc(100vh - var(--admin-offset));
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--wp--preset--color--pickle-ripe);
	color: var(--wp--preset--color--elderflower);
	scrollbar-width: thin;
	scrollbar-color: rgb(255 251 246 / 0.25) transparent;
}

.hartleys-sidebar__inner > * {
	margin: 0;
}

.hartleys-brand {
	gap: 1rem;
	padding: 1.6rem 1.5rem 1.5rem 2rem;
	border-bottom: 1px solid rgb(255 251 246 / 0.12);
}

.hartleys-brand > * {
	margin: 0;
}

.hartleys-brand .wp-block-site-logo img {
	display: block;
}

/* Show the site title only when no logo has been set. */
.hartleys-brand:has(.wp-block-site-logo img) .hartleys-brand__title {
	display: none;
}

.hartleys-brand__title {
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: 1.375rem;
	line-height: 1;
}

.hartleys-brand__title a,
.hartleys-sidebar a {
	color: inherit;
	text-decoration: none;
}

.hartleys-brand__name {
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1;
	text-align: center;
}

/* ---- Chapter navigation ---- */

.hartleys-nav {
	padding: 2rem 1.5rem 3rem 2rem;
	font-size: var(--wp--preset--font-size--small);
	counter-reset: chapter;
	--navigation-layout-direction: column;
}

.hartleys-nav :is(.wp-block-navigation__container, .wp-block-page-list) {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 1.4rem;
	width: 100%;
}

.hartleys-nav .wp-block-navigation-item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	position: relative;
}

.hartleys-nav .wp-block-navigation-item__content {
	padding: 0.15rem 0 !important;
	color: var(--wp--preset--color--elderflower);
	letter-spacing: 0.01em;
	line-height: 1.3;
}

.hartleys-nav .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--pickle-zest);
}

/* Top-level items are chapters: numbered 01, 02… in Barricada. */
.hartleys-nav :is(.wp-block-navigation__container, .wp-block-page-list) > .wp-block-navigation-item {
	counter-increment: chapter;
	padding-left: 2.3rem;
}

.hartleys-nav :is(.wp-block-navigation__container, .wp-block-page-list) > .wp-block-navigation-item::before {
	content: counter(chapter, decimal-leading-zero);
	position: absolute;
	left: 0;
	top: 0.2rem;
	font-family: var(--bgl-font-number, var(--wp--preset--font-family--barricada-pro));
	font-weight: 700;
	font-size: min(var(--bgl-font-number-size, var(--hartleys-nav-label)), 1.125rem);
	line-height: 1.3;
	color: var(--wp--preset--color--pickle-zest);
}

.hartleys-nav :is(.wp-block-navigation__container, .wp-block-page-list) > .wp-block-navigation-item > .wp-block-navigation-item__content {
	font-weight: 500;
	font-family: var(--bgl-font-main, inherit);
	font-size: min(var(--bgl-font-main-size, var(--hartleys-nav-label)), 1.125rem);
}

.hartleys-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	font-family: var(--bgl-font-child, inherit);
	font-size: var(--bgl-font-child-size, inherit);
}

/* Sub-pages always open, as a plain list under their chapter. */
.hartleys-nav .wp-block-navigation__submenu-container {
	position: static !important;
	visibility: visible !important;
	opacity: 1 !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	overflow: visible !important;
	display: flex !important;
	flex-direction: column;
	gap: 0.35rem;
	margin-top: 0.6rem;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: inherit !important;
	box-shadow: none !important;
	transform: none !important;
}

.hartleys-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	font-weight: 400;
	color: rgb(255 251 246 / 0.82);
}

.hartleys-nav .wp-block-navigation__submenu-icon {
	display: none !important;
}

/* You are here. */
.hartleys-nav .current-menu-item > .wp-block-navigation-item__content,
.hartleys-nav [aria-current="page"] {
	color: var(--wp--preset--color--pickle-zest) !important;
}

.hartleys-nav .wp-block-navigation__submenu-container .current-menu-item::before {
	content: "→";
	position: absolute;
	left: -1.5rem;
	top: 0.12rem;
	color: var(--wp--preset--color--pickle-zest);
	font-size: 0.85rem;
}

/* The sidebar handles mobile itself (see "Mobile rail and drawer" below), so
   the Navigation block always shows its full list, never its own burger. This
   also covers headers saved in the Site Editor with the block's overlay on. */
.hartleys-nav .wp-block-navigation__responsive-container-open,
.hartleys-nav .wp-block-navigation__responsive-container-close {
	display: none !important;
}

.hartleys-nav .wp-block-navigation__responsive-container {
	display: block !important;
	position: static !important;
	padding: 0 !important;
	background: transparent !important;
	color: inherit !important;
}

.hartleys-nav .wp-block-navigation__responsive-container-content {
	display: block !important;
	padding: 0 !important;
}

/* ---- Mobile rail and drawer ----
   Below 860px the sidebar folds down to a slim green rail holding the burger.
   The burger slides the full sidebar – logo, numbered chapters, pages – back
   out over the content as a drawer. Built by assets/js/hartleys.js; without
   JavaScript the sidebar simply stays open. */

.hartleys-burger,
.hartleys-drawer-close {
	display: none;
	place-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--elderflower);
	cursor: pointer;
}

.hartleys-burger {
	width: 3rem;
	height: 3rem;
	margin: 0.75rem auto 0;
	border-radius: 0.75rem;
}

.hartleys-burger span {
	display: block;
	width: 1.5rem;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
}

.hartleys-burger:hover,
.hartleys-drawer-close:hover {
	color: var(--wp--preset--color--pickle-zest);
}

.hartleys-drawer-close {
	width: 2.5rem;
	height: 2.5rem;
	margin-left: auto !important;
	font-size: 1.75rem;
	line-height: 1;
	border-radius: 0.6rem;
}

.hartleys-overlay {
	position: fixed;
	inset: 0;
	z-index: 999;
	background: rgb(0 20 5 / 0.55);
	opacity: 0;
	pointer-events: none;
}

.hartleys-drawer-ready .hartleys-overlay {
	transition: opacity 0.3s ease;
}

@media (max-width: 860px) {
	html.hartleys-js {
		--sidebar-w: 60px;
	}

	.hartleys-js .hartleys-sidebar {
		overflow: visible;
		z-index: 1000;
	}

	.hartleys-js .hartleys-burger {
		display: grid;
	}

	.hartleys-js .hartleys-drawer-close {
		display: grid;
	}

	.hartleys-js .hartleys-sidebar__inner {
		position: fixed;
		top: var(--admin-offset);
		bottom: 0;
		left: 0;
		z-index: 1000;
		width: min(18rem, 86vw);
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--wp--preset--color--pickle-ripe);
		box-shadow: 0 0 2.5rem rgb(0 20 5 / 0.35);
		transform: translateX(-100%);
		visibility: hidden;
	}

	/* The slide only switches on once the drawer's built (hartleys.js adds
	   .hartleys-drawer-ready), so it never animates shut as the page loads. */
	.hartleys-drawer-ready .hartleys-sidebar__inner {
		transition: transform 0.3s ease, visibility 0s linear 0.3s;
	}

	.hartleys-nav-open .hartleys-sidebar__inner {
		transform: none;
		visibility: visible;
	}

	.hartleys-drawer-ready.hartleys-nav-open .hartleys-sidebar__inner {
		transition: transform 0.3s ease;
	}

	.hartleys-nav-open .hartleys-overlay {
		opacity: 1;
		pointer-events: auto;
	}

	.hartleys-nav-open {
		overflow: hidden;
	}

	.hartleys-js .hartleys-brand {
		padding-right: 0.75rem;
	}
}

/* ==========================================================================
   Hero: flavour colour, pattern, title and intro
   ========================================================================== */

.hartleys-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: grid;
	gap: clamp(1.5rem, 4vw, 3.5rem);
	padding: clamp(3rem, 8vw, 7.5rem) var(--gutter) calc(var(--sheet-radius) + clamp(3rem, 7vw, 7.5rem));
	background: var(--hero-bg);
	color: var(--wp--preset--color--elderflower);
}

.hartleys-hero::before {
	content: "";
	position: absolute;
	inset: var(--hero-inset, -60%);
	z-index: -1;
	background: var(--hero-ink);
	-webkit-mask: var(--hero-mask);
	mask: var(--hero-mask);
	transform: rotate(var(--hero-tilt));
	pointer-events: none;
}

.hartleys-hero > * {
	margin: 0 !important;
}

.hartleys-hero__title,
.hartleys-hero .wp-block-query-title {
	max-width: 15ch;
	color: var(--wp--preset--color--elderflower);
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-size: var(--wp--preset--font-size--display);
	font-weight: 700;
	line-height: 0.9;
	letter-spacing: -0.035em;
}

.hartleys-hero__intro {
	justify-self: end;
	max-width: 36rem;
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: clamp(1.125rem, 1.15rem + 0.6vw, 1.75rem);
	line-height: 1.25;
	letter-spacing: -0.005em;
}

.hartleys-hero__intro p {
	margin: 0;
}

/* When a featured image or type band closes the hero, it runs under the sheet. */
.hartleys-hero:has(> .hartleys-hero__media, > .hartleys-band) {
	padding-bottom: 0;
}

.hartleys-hero__media,
.hartleys-band {
	margin-inline: calc(var(--gutter) * -1) !important;
	margin-top: clamp(0.5rem, 3vw, 2rem) !important;
	border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
	overflow: hidden;
	background: var(--section-zest);
}

.hartleys-hero__media img {
	display: block;
	width: 100%;
	height: clamp(18rem, 44vw, 40rem) !important;
	object-fit: cover;
	padding-bottom: var(--sheet-radius);
}

/* ---- Type band (alphabet / fruit names) ---- */

.hartleys-band {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	min-height: calc(var(--band-height, 0px) + var(--sheet-radius));
	padding: 0 0 var(--sheet-radius);
	color: color-mix(in srgb, var(--section-ripe) 55%, var(--section-zest));
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: clamp(4rem, 10vw, 9rem);
	line-height: 0.86;
	letter-spacing: -0.02em;
	white-space: nowrap;
	user-select: none;
}

/* An image band with no height set gets a sensible one. */
.hartleys-band.has-image:not(.has-height):not(.has-fit) {
	--band-height: clamp(14rem, 32vw, 30rem);
}

.hartleys-band__image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	object-position: var(--band-focal, 50% 50%);
}

/* Automatic height: the band takes the image's or video's own shape. The
   media sits in the flow at its natural ratio and runs on under the content
   panel's curved top, like every band, so nothing is stretched or cropped. */
.hartleys-band.has-fit {
	min-height: 0;
	height: auto;
}

.hartleys-band.has-fit .hartleys-band__image {
	position: relative;
	inset: auto;
	display: block;
	width: 100%;
	height: auto !important;
	aspect-ratio: var(--band-ratio, auto);
	object-fit: cover;
	margin-bottom: calc(-1 * var(--sheet-radius));
}

.hartleys-band.has-fit .hartleys-band__type {
	position: absolute;
	inset: 0 0 var(--sheet-radius) 0;
	overflow: hidden;
	align-content: start;
}

/* Pause/play for background videos (added by hartleys.js). */
.hartleys-band__toggle {
	position: absolute;
	right: var(--gutter);
	bottom: calc(var(--sheet-radius) + 0.75rem);
	z-index: 1;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(0 20 5 / 0.45);
	color: var(--wp--preset--color--elderflower);
	cursor: pointer;
	backdrop-filter: blur(4px);
}

.hartleys-band__toggle:hover {
	background: rgb(0 20 5 / 0.7);
}

.hartleys-band__toggle svg {
	width: 1.1rem;
	height: 1.1rem;
}

/* Optional tint in the section's ripe shade, for legibility over photos. */
.hartleys-band.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--section-ripe);
	opacity: var(--band-overlay, 0);
	pointer-events: none;
}

.hartleys-band__type {
	display: grid;
	padding-top: 1.5rem;
}

/* With a fixed height, the type fills it and anything extra is cropped. */
.hartleys-band.has-height .hartleys-band__type {
	flex: 1;
	overflow: hidden;
	align-content: start;
}

.hartleys-band.has-height {
	height: calc(var(--band-height) + var(--sheet-radius));
}

.hartleys-band--alphabet {
	font-family: var(--wp--preset--font-family--giulia-plain);
	letter-spacing: 0;
}

.hartleys-band__row {
	display: flex;
	gap: 0.5em;
	width: max-content;
	transform: translateX(calc(var(--row) * -0.6em));
}

@media (prefers-reduced-motion: no-preference) {
	.hartleys-band__row {
		animation: hartleys-drift 90s linear infinite;
		animation-delay: calc(var(--row) * -11s);
	}

	.hartleys-band__row:nth-child(even) {
		animation-direction: reverse;
	}
}

@keyframes hartleys-drift {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(calc(-50% - 0.25em));
	}
}

/* ==========================================================================
   Sheet: the elderflower panel that holds the content
   ========================================================================== */

.hartleys-sheet {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	flex-direction: column;
	margin-top: calc(var(--sheet-radius) * -1) !important;
	padding: clamp(3rem, 7vw, 6.5rem) var(--gutter) 2rem;
	border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
	background: var(--wp--preset--color--elderflower);
}

.hartleys-sheet > * {
	margin-block: 0;
}

.hartleys-sheet > * + * {
	margin-top: clamp(2rem, 4vw, 3.5rem);
}

.hartleys-sheet__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 12.5rem;
	gap: clamp(3rem, 6vw, 6rem);
	align-items: start;
}

.hartleys-sheet__grid > * {
	margin: 0 !important;
	min-width: 0;
}

.hartleys-sheet__grid:has(> .hartleys-toc[hidden]) {
	grid-template-columns: minmax(0, 1fr);
}

/* ---- Content rhythm ---- */

.hartleys-content > :first-child {
	margin-top: 0 !important;
}

.hartleys-content > h2 {
	margin-top: clamp(4rem, 8vw, 7rem);
	scroll-margin-top: calc(var(--admin-offset) + 2rem);
}

.hartleys-content > h2 + *,
.hartleys-content > h3 + * {
	margin-top: 1rem;
}

.hartleys-content > h3 {
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

.hartleys-content > :is(p, ul, ol) + .alignwide,
.hartleys-content > .alignwide + .alignwide {
	margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

.hartleys-content > .alignwide + h3 {
	margin-top: clamp(3rem, 6vw, 4.5rem);
}

.is-style-hartleys-intro {
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
	color: var(--wp--preset--color--bramble);
}

/* ---- Pattern wrappers ----
   Every pattern arrives wrapped in a named Group (.hartleys-pattern), so a
   section moves, duplicates or deletes as one item in List View. These rules
   give the sections their rhythm wherever they're placed, including inside
   the Guidelines Sections block. */

.hartleys-pattern {
	margin-block: 0;
}

* + .hartleys-pattern {
	margin-top: clamp(4rem, 8vw, 7rem) !important;
}

.hartleys-pattern > :first-child {
	margin-top: 0 !important;
}

.hartleys-pattern > h2 {
	scroll-margin-top: calc(var(--admin-offset) + 2rem);
}

.hartleys-pattern > :is(h2, h3) + * {
	margin-top: 1rem;
}

.hartleys-pattern > h3 {
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

/* Keep running text to a comfortable line length; visuals use the full width. */
.hartleys-pattern > :is(p, ul, ol) {
	max-width: var(--wp--style--global--content-size, 40rem);
}

.hartleys-pattern > :is(p, ul, ol) + .alignwide,
.hartleys-pattern > .alignwide + .alignwide {
	margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

.hartleys-pattern > .alignwide + h3 {
	margin-top: clamp(3rem, 6vw, 4.5rem);
}

/* ---- On this page ---- */

.hartleys-toc {
	padding-inline-start: 1.5rem;
	position: sticky;
	top: calc(var(--admin-offset) + 2rem);
	font-size: var(--hartleys-toc-size);
	line-height: 1.35;
}

.hartleys-toc__title {
	margin: 0 0 1rem;
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--bramble);
}

.hartleys-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.35rem;
}

.hartleys-toc__list a {
	position: relative;
	display: block;
	color: var(--wp--preset--color--damson);
	text-decoration: none;
}

.hartleys-toc__list a:hover {
	color: var(--wp--preset--color--pickle-bright);
}

.hartleys-toc__list a[aria-current="true"] {
	color: var(--wp--preset--color--pickle-bright);
}

.hartleys-toc__list a[aria-current="true"]::before {
	content: "→";
	position: absolute;
	left: -1.25rem;
}

/* ---- Footer ---- */

.hartleys-footer {
	margin-top: auto !important;
	padding-top: clamp(4rem, 8vw, 7rem);
}

.hartleys-footer__inner p {
	margin: 0;
	color: color-mix(in srgb, var(--wp--preset--color--damson) 72%, transparent);
}

.hartleys-footer__inner a {
	color: inherit;
}

/* ==========================================================================
   Guidelines Sections block (bgl/sections)
   Content on the left, a sticky "On this page" list on the right. Spacing
   defaults sit in :where() so the block's own Dimensions controls win.
   ========================================================================== */

.bgl-sections {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--bgl-toc-width, 13.5rem);
	align-items: start;
	/* Max width, centred in whatever holds it. Comes from (most specific
	   first): the block's own "Content width" setting, the Customizer's
	   site-wide value, then theme.json (settings.custom.sectionsMaxWidth). */
	max-width: var(--bgl-sections-max, var(--wp--custom--sections-max-width, 1280px)) !important;
	margin-inline: auto !important;
}

.bgl-sections.is-bgl-width-left {
	margin-inline: 0 auto !important;
}

:where(.bgl-sections) {
	/* Not the site-wide block gap (1.25rem), which was squeezing the columns
	   together; set this in Customize → Guidelines Sections → Column gap. */
	gap: var(--bgl-sections-gap, clamp(3rem, 6vw, 6rem));
	padding-block: var(--bgl-sections-pad, 0);
	margin-block: var(--bgl-sections-margin, 0);
}

.bgl-sections.has-no-toc {
	grid-template-columns: minmax(0, 1fr);
}

.bgl-sections__main {
	min-width: 0;
}

.bgl-sections__main > :first-child {
	margin-top: 0;
}

.bgl-sections__main > h2 {
	margin-top: clamp(4rem, 8vw, 7rem);
	scroll-margin-top: calc(var(--admin-offset) + 2rem);
}

.bgl-sections__main > h2 + * {
	margin-top: 1rem;
}

.bgl-sections__main > :is(p, ul, ol) {
	max-width: var(--wp--style--global--content-size, 40rem);
}

.bgl-sections__aside {
	/* Room for the "you are here" arrow inside the column, not in the gap. */
	padding-inline-start: 1.5rem;
	position: sticky;
	top: calc(var(--admin-offset) + var(--bgl-toc-top, 2rem));
	align-self: start;
}

.bgl-toc__title {
	margin: 0 0 1rem;
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--bramble);
}

.bgl-toc__list {
	display: grid;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--hartleys-toc-size);
	line-height: 1.35;
}

.bgl-toc__list a {
	position: relative;
	display: block;
	color: var(--wp--preset--color--damson);
	text-decoration: none;
}

.bgl-toc__list a:hover,
.bgl-toc__list a[aria-current="true"] {
	color: var(--wp--preset--color--pickle-bright);
}

.bgl-toc__list a[aria-current="true"]::before {
	content: "→";
	position: absolute;
	left: -1.4rem;
}

/* ---- Curved top overlap (block style on Group / Cover) ----
   The block's background rises over the block above with rounded top
   corners; its content stays put. Control the overlap with --bgl-curve and
   don't set a top margin on these blocks (an inline margin cancels the lift). */

:root {
	--bgl-curve: 48px;
}

:is(.is-style-bgl-curve-top, .bgl-curve-top):not(.wp-block-cover) {
	position: relative;
	margin-top: calc(-1 * var(--bgl-curve));
	border-top: var(--bgl-curve) solid transparent;
	border-top-left-radius: var(--bgl-curve);
	border-top-right-radius: var(--bgl-curve);
	background-clip: border-box;
}

:is(.is-style-bgl-curve-top, .bgl-curve-top).wp-block-cover {
	overflow: visible;
}

:is(.is-style-bgl-curve-top, .bgl-curve-top).wp-block-cover > :is(.wp-block-cover__image-background, .wp-block-cover__video-background, .wp-block-cover__background, .wp-block-cover__gradient-background) {
	top: calc(-1 * var(--bgl-curve));
	bottom: auto;
	height: calc(100% + var(--bgl-curve));
	border-top-left-radius: var(--bgl-curve);
	border-top-right-radius: var(--bgl-curve);
}

/* The block above gets room for the overlap, so it never covers content. */
:has(+ :is(.is-style-bgl-curve-top, .bgl-curve-top)) {
	border-bottom: var(--bgl-curve) solid transparent;
	background-clip: border-box;
}

.wp-block-cover:not(.is-style-bgl-curve-top, .bgl-curve-top):has(+ :is(.is-style-bgl-curve-top, .bgl-curve-top)) {
	overflow: visible;
}

.wp-block-cover:not(.is-style-bgl-curve-top, .bgl-curve-top):has(+ :is(.is-style-bgl-curve-top, .bgl-curve-top)) > :is(.wp-block-cover__image-background, .wp-block-cover__video-background, .wp-block-cover__background, .wp-block-cover__gradient-background) {
	bottom: auto;
	height: calc(100% + var(--bgl-curve));
}

/* ==========================================================================
   Homepage: the sidebar plus a full-screen Cover
   ========================================================================== */

.hartleys-home__content > * {
	margin-block: 0 !important;
}

/* Covers on the homepage fill the screen beside the sidebar, whatever
   height is set in the editor (the admin bar is allowed for). */
.hartleys-home__content > .wp-block-cover {
	min-height: calc(100vh - var(--admin-offset)) !important;
	min-height: calc(100dvh - var(--admin-offset)) !important;
	padding: clamp(2rem, 6vw, 6rem) var(--gutter);
}

.hartleys-home-cover__title {
	max-width: 12ch;
	font-size: var(--wp--preset--font-size--display);
	line-height: 0.9;
	letter-spacing: -0.035em;
}

.hartleys-home-cover__intro {
	max-width: 34rem;
	margin-top: clamp(1rem, 3vw, 2rem) !important;
	font-weight: 700;
	line-height: 1.25;
}

/* ==========================================================================
   Section overview + front page cards
   ========================================================================== */

/* Section overview and Chapters overview cards share the Guidelines
   Sections width (block-free here, so the Customizer or theme.json value),
   centred in the page. */
.hartleys-child-pages,
.hartleys-section-pages {
	width: 100%;
	max-width: var(--bgl-sections-max, var(--wp--custom--sections-max-width, 1280px)) !important;
	margin-inline: auto !important;
}

.hartleys-cards {
	gap: clamp(1.25rem, 2.2vw, 2rem) !important;
	margin: 0;
	padding: 0;
}

/* Three columns, stepping down to two on tablets and one on phones.
   Set here rather than only on the block, so templates saved in the
   Site Editor follow it too. */
:is(.hartleys-child-pages, .hartleys-section-pages) .hartleys-cards {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 760px) {
	:is(.hartleys-child-pages, .hartleys-section-pages) .hartleys-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 480px) {
	:is(.hartleys-child-pages, .hartleys-section-pages) .hartleys-cards {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

.hartleys-card > * {
	margin: 0;
}

.hartleys-card__media,
.hartleys-card__media img {
	border-radius: 1.5rem;
	overflow: hidden;
}

.hartleys-card__media img {
	display: block;
	width: 100%;
}

/* No featured image yet? The card fills with that page's own flavour,
   patterned with the same pattern files as everything else. */
.hartleys-card__placeholder {
	--card-bg: var(--section-bright);
	--card-ink: var(--section-ripe);
	--card-mask: none;
	--card-inset: 0;
	--card-tilt: 0deg;
	position: relative;
	isolation: isolate;
	display: block;
	overflow: hidden;
	aspect-ratio: 1;
	border-radius: 1.5rem;
	background: var(--card-bg);
}

.hartleys-card__placeholder::before {
	content: "";
	position: absolute;
	inset: var(--card-inset);
	z-index: -1;
	background: var(--card-ink);
	-webkit-mask: var(--card-mask);
	mask: var(--card-mask);
	transform: rotate(var(--card-tilt));
}

.hartleys-card__placeholder--plain::before,
.hartleys-card__placeholder--stripes::before {
	content: none;
}

/* Patterns, chosen per page in the Hero panel ("Card pattern"). */
.hartleys-card__placeholder--dots {
	--card-mask: var(--mask-dots);
}

.hartleys-card__placeholder--rings {
	--card-bg: var(--section-ripe);
	--card-ink: var(--section-zest);
	--card-mask: var(--mask-rings);
}

.hartleys-card__placeholder--waves {
	--card-bg: var(--section-ripe);
	--card-ink: var(--section-bright);
	--card-mask: var(--mask-waves);
}

.hartleys-card__placeholder--squiggles {
	--card-mask: var(--mask-squiggles);
}

.hartleys-card__placeholder--hearts {
	--card-bg: var(--section-ripe);
	--card-ink: var(--section-bright);
	--card-mask: var(--mask-hearts);
}

.hartleys-card__placeholder--stripes {
	background: linear-gradient(var(--section-ripe) 0 33.4%, var(--section-bright) 0 66.7%, var(--section-zest) 0);
}

/* Automatic: Dots, Wave and Stripes across a row of three. */
.hartleys-cards > li:nth-child(3n + 1) .hartleys-card__placeholder--auto {
	--card-mask: var(--mask-dots);
}

.hartleys-cards > li:nth-child(3n + 2) .hartleys-card__placeholder--auto {
	--card-bg: var(--section-ripe);
	--card-ink: var(--section-zest);
	--card-mask: var(--mask-rings);
}

.hartleys-cards > li:nth-child(3n) .hartleys-card__placeholder--auto {
	background: linear-gradient(var(--section-ripe) 0 33.4%, var(--section-bright) 0 66.7%, var(--section-zest) 0);
}

.hartleys-cards > li:nth-child(3n) .hartleys-card__placeholder--auto::before {
	content: none;
}

.hartleys-card__title {
	margin-top: 1rem !important;
	font-size: clamp(1.5rem, 1.2rem + 0.9vw, 2.1rem);
	line-height: 1;
	color: var(--wp--preset--color--pickle-ripe);
}

.hartleys-card__title a {
	color: inherit;
	text-decoration: none;
}

/* Hover (or tab onto) a card: the title turns green, the card tips and the
   picture gives a little jelly wobble. Alternate cards tip opposite ways. */
.hartleys-card__title a {
	transition: color 0.2s ease;
}

.hartleys-cards > li:is(:hover, :has(:focus-visible)) .hartleys-card__title a {
	color: var(--wp--preset--color--pickle-bright);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.hartleys-cards > li {
		--card-tip: -1.5deg;
		transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
	}

	.hartleys-cards > li:nth-child(even) {
		--card-tip: 1.5deg;
	}

	.hartleys-cards > li:is(:hover, :has(:focus-visible)) {
		transform: rotate(var(--card-tip)) translateY(-0.3rem);
	}

	.hartleys-cards > li:is(:hover, :has(:focus-visible)) :is(.hartleys-card__media, .hartleys-card__placeholder) {
		animation: hartleys-card-wobble 0.7s ease-out;
	}
}

@keyframes hartleys-card-wobble {
	0% { transform: scale(1, 1); }
	25% { transform: scale(1.05, 0.95); }
	45% { transform: scale(0.97, 1.03); }
	65% { transform: scale(1.015, 0.985); }
	100% { transform: scale(1, 1); }
}



.hartleys-card .wp-block-post-date {
	margin-top: 0.4rem;
	color: color-mix(in srgb, var(--wp--preset--color--damson) 72%, transparent);
}

/* ==========================================================================
   Guideline building blocks (used by the patterns)
   ========================================================================== */

/* ---- Pattern fills (block styles on Group) ---- */

:is(.is-style-hartleys-dots, .is-style-hartleys-waves, .is-style-hartleys-rings, .is-style-hartleys-hearts, .is-style-hartleys-squiggles) {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

:is(.is-style-hartleys-dots, .is-style-hartleys-waves, .is-style-hartleys-rings, .is-style-hartleys-hearts, .is-style-hartleys-squiggles)::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--pattern-ink, rgb(0 20 5 / 0.14));
	pointer-events: none;
}

.is-style-hartleys-dots::before {
	-webkit-mask: var(--mask-dots);
	mask: var(--mask-dots);
}

.is-style-hartleys-waves::before {
	-webkit-mask: var(--mask-waves);
	mask: var(--mask-waves);
}

.is-style-hartleys-rings::before {
	-webkit-mask: var(--mask-rings);
	mask: var(--mask-rings);
}

.is-style-hartleys-hearts::before {
	-webkit-mask: var(--mask-hearts);
	mask: var(--mask-hearts);
}

.is-style-hartleys-squiggles::before {
	-webkit-mask: var(--mask-squiggles);
	mask: var(--mask-squiggles);
}

.hartleys-ink-light {
	--pattern-ink: rgb(255 251 246 / 0.17);
}

.hartleys-ink-orange {
	--pattern-ink: var(--wp--preset--color--orange-bright);
}

/* ---- Card (block style on Group): a quince tray with a caption ---- */

.is-style-hartleys-card {
	padding: clamp(0.75rem, 1.5vw, 1.1rem) clamp(0.75rem, 1.5vw, 1.1rem) 1.5rem;
	border-radius: 1.5rem;
	background: var(--wp--preset--color--quince);
}

.is-style-hartleys-card > :first-child {
	margin-top: 0 !important;
}

.hartleys-caption__title {
	margin-top: 1.1rem !important;
	padding-inline: 0.35rem;
	font-size: 1.1rem;
	letter-spacing: -0.01em;
}

.hartleys-caption__text {
	margin-top: 0.4rem !important;
	padding-inline: 0.35rem;
	line-height: 1.45;
}

.hartleys-card--stacked > .hartleys-stack-item + .hartleys-stack-item {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgb(0 41 8 / 0.08);
}

.hartleys-stack-item > :first-child {
	margin-top: 0;
}

.hartleys-card--row {
	padding-bottom: clamp(0.75rem, 1.5vw, 1.1rem);
}

/* ---- Visual panels ---- */

.hartleys-visual {
	container-type: inline-size;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin: 0;
	padding: clamp(1.25rem, 3vw, 2.5rem);
	border-radius: 1rem;
}

.hartleys-visual > * {
	margin-block: 0;
}

.hartleys-visual--poster,
.hartleys-visual--tile,
.hartleys-specimen {
	/* Square-ish by default, but grows rather than clipping long words. */
	min-height: min-content;
}

.hartleys-visual--poster {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 1rem;
	aspect-ratio: 1;
}

.hartleys-visual--poster.hartleys-visual--centred {
	justify-content: center;
}

.hartleys-visual--centred {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.hartleys-visual--banner {
	min-height: clamp(10rem, 22vw, 15rem);
}

.hartleys-visual--tile {
	aspect-ratio: 4 / 3;
}

.hartleys-visual--wide {
	border-radius: 1.5rem;
}

.hartleys-visual--outlined,
.hartleys-swatch--outlined {
	box-shadow: inset 0 0 0 1px rgb(0 41 8 / 0.1);
}

.hartleys-visual--poster h3 {
	font-size: clamp(1.75rem, 11cqi, 3.5rem) !important;
	line-height: 0.95;
	letter-spacing: -0.025em;
}

.hartleys-shout {
	text-transform: uppercase;
	line-height: 0.88 !important;
	letter-spacing: -0.01em !important;
}

.hartleys-shout--big {
	font-size: clamp(2.5rem, 19cqi, 6rem) !important;
}

/* ---- Swatches ---- */

.hartleys-swatches {
	gap: 1rem !important;
}

.hartleys-swatch {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"name copy"
		"values labels";
	align-content: space-between;
	row-gap: 2.5rem;
	min-height: 10.5rem;
	margin: 0;
	padding: 1.25rem 1.25rem 1rem;
	border-radius: 1.25rem;
}

.hartleys-swatch > * {
	margin: 0 !important;
}

.hartleys-swatch__name {
	grid-area: name;
	color: inherit;
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: 1.1rem;
	line-height: 1.15;
	letter-spacing: 0;
}

.hartleys-swatch__values,
.hartleys-swatch__labels {
	font-size: 1rem;
	line-height: 1.5;
	letter-spacing: 0.03em;
	font-variant-numeric: tabular-nums;
}

.hartleys-swatch__values {
	grid-area: values;
	user-select: all;
}

.hartleys-swatch__labels {
	grid-area: labels;
	text-align: right;
	opacity: 0.8;
}

.hartleys-copy {
	grid-area: copy;
	/* Top-right of the swatch, however wide the labels under it are. */
	justify-self: end;
	align-self: start;
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 0.6rem;
	background: var(--wp--preset--color--elderflower);
	color: var(--wp--preset--color--pickle-bright);
	cursor: pointer;
	box-shadow: 0 0 0 1px rgb(0 41 8 / 0.08);
	transition: transform 0.15s ease;
}

.hartleys-copy:hover {
	transform: scale(1.08);
}

.hartleys-copy:active {
	transform: scale(0.94);
}

.hartleys-copy svg {
	width: 1rem;
	height: 1rem;
}

.hartleys-copy[data-copied] {
	background: var(--wp--preset--color--pickle-zest);
	color: var(--wp--preset--color--bramble);
}

/* ---- Products: flavour stripes ---- */

.hartleys-flavours {
	gap: 0 !important;
	overflow: hidden;
	border-radius: 1.5rem;
}

.hartleys-stripes {
	display: flex;
	align-items: flex-end;
	aspect-ratio: 16 / 10;
	margin: 0;
	padding: clamp(1rem, 2.5vw, 1.75rem);
	background: linear-gradient(var(--s1) 0 33.4%, var(--s2) 0 66.7%, var(--s3) 0);
}

.hartleys-stripes__label {
	margin: 0;
	color: var(--s1);
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: clamp(1.5rem, 3vw, 2.5rem);
	line-height: 1;
	letter-spacing: -0.02em;
}

.hartleys-stripes--orange { --s1: var(--wp--preset--color--orange-ripe); --s2: var(--wp--preset--color--orange-bright); --s3: var(--wp--preset--color--orange-zest); }
.hartleys-stripes--strawberry { --s1: var(--wp--preset--color--strawberry-ripe); --s2: var(--wp--preset--color--strawberry-bright); --s3: var(--wp--preset--color--strawberry-zest); }
.hartleys-stripes--raspberry { --s1: var(--wp--preset--color--raspberry-ripe); --s2: var(--wp--preset--color--raspberry-bright); --s3: var(--wp--preset--color--raspberry-zest); }
.hartleys-stripes--blackberry { --s1: var(--wp--preset--color--blackberry-ripe); --s2: var(--wp--preset--color--blackberry-bright); --s3: var(--wp--preset--color--blackberry-zest); }
.hartleys-stripes--pickle { --s1: var(--wp--preset--color--pickle-ripe); --s2: var(--wp--preset--color--pickle-bright); --s3: var(--wp--preset--color--pickle-zest); }

/* ---- Mixing ---- */

.hartleys-split {
	justify-content: flex-start !important;
	background-image: linear-gradient(168deg, transparent 0 56%, var(--wp--preset--color--blackberry-bright) 56.2%);
}

.hartleys-split p {
	max-width: 14em;
	margin-inline: auto;
	font-weight: 700;
	line-height: 1.1;
}

.hartleys-fruity {
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: clamp(2.5rem, 17cqi, 7.5rem);
	line-height: 0.82;
	letter-spacing: -0.02em;
	text-transform: uppercase;
}

/* ---- Type recipe ---- */

.hartleys-recipe {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: flex-start;
	gap: 2rem clamp(2.5rem, 5vw, 4rem);
	padding-block: clamp(3.5rem, 9vw, 8rem);
	text-align: center;
}

.hartleys-recipe__item {
	position: relative;
	margin: 0 !important;
}

.hartleys-recipe__item > * {
	margin: 0;
}

.hartleys-recipe__item + .hartleys-recipe__item::before {
	content: "+";
	position: absolute;
	left: calc(clamp(2.5rem, 5vw, 4rem) / -2);
	top: clamp(1rem, 2.4vw, 2rem);
	transform: translateX(-50%);
	color: var(--wp--preset--color--pickle-zest);
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: 1.75rem;
	line-height: 1;
}

.hartleys-recipe__word {
	font-size: clamp(2rem, 8.5cqi, 5.5rem);
	line-height: 1;
	white-space: nowrap;
}

.hartleys-recipe__item--joy .hartleys-recipe__word {
	font-family: var(--wp--preset--font-family--caraque);
	font-weight: 700;
	font-size: clamp(2.5rem, 11cqi, 7rem);
	line-height: 0.85;
}

.hartleys-recipe__item--chatter .hartleys-recipe__word {
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
}

.hartleys-recipe__item--function .hartleys-recipe__word {
	font-family: var(--wp--preset--font-family--gotham);
	font-weight: 300;
	letter-spacing: -0.01em;
}

.hartleys-recipe__means {
	margin-top: 1.25rem !important;
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-size: 1.05rem;
	line-height: 1.25;
}

/* ---- Specimens ---- */

.hartleys-specimen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	text-align: center;
}

.hartleys-specimen__name {
	font-size: clamp(2rem, 15cqi, 5rem);
	line-height: 1;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.hartleys-specimen.has-gotham-font-family .hartleys-specimen__name,
.hartleys-specimen .has-gotham-font-family.hartleys-specimen__name,
.hartleys-specimen .has-poppins-font-family.hartleys-specimen__name {
	font-weight: 400;
}

.hartleys-specimen__set {
	margin-top: 0.85rem !important;
	font-size: 1rem;
	line-height: 1.2;
	opacity: 0.85;
	letter-spacing: 0.02em;
}

.hartleys-specimen--hero {
	aspect-ratio: 16 / 8;
}

.hartleys-specimen--hero .hartleys-specimen__name {
	font-size: clamp(3rem, 19cqi, 9rem);
}

.hartleys-cards-row--single > .is-style-hartleys-card {
	margin: 0;
}

/* ---- Making it fun ---- */

.hartleys-spread {
	display: block;
	width: min(100%, 52rem);
	height: auto;
	margin-inline: auto;
	overflow: visible;
}

.hartleys-spread text {
	fill: currentColor;
	font-family: var(--wp--preset--font-family--caraque);
	font-weight: 700;
	font-size: 74px;
	letter-spacing: -1px;
}

.hartleys-stack {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding-inline: clamp(1.5rem, 6vw, 5rem);
}

.hartleys-stack__line {
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	line-height: 0.82;
	letter-spacing: -0.03em;
	text-transform: uppercase;
}

.hartleys-stack__line--1 { font-size: clamp(1.25rem, 6cqi, 2.75rem); }
.hartleys-stack__line--2 { font-size: clamp(2rem, 10cqi, 4.75rem); margin-left: 12% !important; }
.hartleys-stack__line--3 { font-size: clamp(3rem, 21cqi, 9.5rem); align-self: flex-end; }

.hartleys-wobble-lead {
	margin: 0 !important;
	font-weight: 700;
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	line-height: 0.9;
}

.is-style-wobble {
	margin: 0 !important;
	font-size: clamp(3.5rem, 20cqi, 8.5rem) !important;
	line-height: 0.85 !important;
	letter-spacing: -0.02em !important;
}

.is-style-wobble .hartleys-letter {
	display: inline-block;
	transform: rotate(calc(var(--tilt, 0) * 1deg)) translateY(calc(var(--lift, 0) * 1%));
}

/* Hover the heading and the letters wobble like jelly, a ripple running
   through them, for as long as the cursor stays. Each letter keeps its
   resting tilt and lift; the wobble is added on top, so nothing jumps.

   The wobble loops all the time at zero strength. Hovering eases
   --hartleys-wobble up from 0 to 1 and leaving eases it back down, so
   it fades in and settles out instead of starting or stopping abruptly. */
@property --hartleys-wobble {
	syntax: "<number>";
	inherits: true;
	initial-value: 0;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.is-style-wobble {
		--hartleys-wobble: 0;
		transition: --hartleys-wobble 0.45s ease-out;
	}

	.is-style-wobble:hover {
		--hartleys-wobble: 1;
	}

	.is-style-wobble .hartleys-letter {
		transform-origin: 50% 80%;
		animation: hartleys-letter-wobble 0.9s ease-in-out infinite alternate paused;
		/* Each letter a step behind the last, so the wobble ripples along. */
		animation-delay: calc(var(--i, 0) * -110ms);
	}

	.is-style-wobble:hover .hartleys-letter {
		animation-play-state: running;
	}
}

@keyframes hartleys-letter-wobble {
	from {
		rotate: calc(-5deg * var(--hartleys-wobble));
		scale: calc(1 + 0.06 * var(--hartleys-wobble)) calc(1 - 0.06 * var(--hartleys-wobble));
		translate: 0 calc(3% * var(--hartleys-wobble));
	}
	to {
		rotate: calc(5deg * var(--hartleys-wobble));
		scale: calc(1 - 0.04 * var(--hartleys-wobble)) calc(1 + 0.05 * var(--hartleys-wobble));
		translate: 0 calc(-4% * var(--hartleys-wobble));
	}
}

.is-style-repeat {
	margin: -0.3em 0 0 !important;
	font-size: clamp(2.5rem, 15cqi, 7rem) !important;
	line-height: 0.88 !important;
	letter-spacing: -0.02em !important;
	text-transform: uppercase;
	white-space: nowrap;
	text-shadow:
		0 0.88em currentColor,
		0 1.76em currentColor,
		0 2.64em currentColor;
}

/* ---- The finer details ---- */

.hartleys-gap {
	display: grid;
	gap: clamp(2rem, 4vw, 3rem);
	padding: clamp(1.75rem, 4.5vw, 4rem);
}

.hartleys-gap__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 13.5rem;
	align-items: center;
	gap: clamp(1.5rem, 4vw, 4rem);
	margin: 0 !important;
}

.hartleys-gap__row > * {
	margin: 0 !important;
}

.hartleys-gap__display {
	max-width: 12ch;
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: clamp(2.25rem, 5.5vw, 4.25rem);
	line-height: 1;
	letter-spacing: -0.02em;
}

.hartleys-gap__chatter {
	max-width: 26ch;
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: clamp(1.25rem, 2.4vw, 1.85rem);
	line-height: 1.1;
	letter-spacing: -0.005em;
}

.hartleys-gap__body {
	max-width: 44ch;
	font-size: clamp(1rem, 1.5vw, 1.3rem);
	line-height: 1.3;
	letter-spacing: -0.005em;
}

.hartleys-gap__chip {
	padding: 1rem;
	border-radius: 1rem;
	background: var(--wp--preset--color--pickle-ripe);
	font-size: 1rem;
	line-height: 1.4;
	text-align: center;
}

.hartleys-gap__chip strong {
	font-weight: 500;
	color: var(--wp--preset--color--pickle-zest);
}

.hartleys-case {
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: clamp(1.4rem, 13cqi, 2.6rem);
	line-height: 0.95;
	letter-spacing: -0.02em;
}

.hartleys-case.is-lower { text-transform: lowercase; }
.hartleys-case.is-upper { text-transform: uppercase; }

.hartleys-compare {
	gap: clamp(0.5rem, 2vw, 1.25rem) !important;
}

.hartleys-compare > * {
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	line-height: 1;
}

.hartleys-compare__glyph {
	font-size: clamp(3rem, 18cqi, 6rem);
}

.hartleys-compare__not {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	opacity: 0.75;
}

.hartleys-glyph-alt {
	font-feature-settings: "ss01" 1, "salt" 1;
}

.hartleys-liga-on {
	font-variant-ligatures: common-ligatures discretionary-ligatures;
}

.hartleys-liga-off {
	font-variant-ligatures: none;
	font-feature-settings: "liga" 0, "dlig" 0;
}

/* ---- Pattern ink that follows the panel's own flavour ----
   Add .hartleys-ink-zest to a patterned Group and the pattern takes a
   soft tint of the zest shade from the same family as its background, so
   it never breaks the mixing rule. */

.hartleys-ink-zest {
	--pattern-ink: color-mix(in srgb, var(--hartleys-zest, var(--section-zest)) var(--hartleys-ink-amount, 24%), transparent);
}

.hartleys-ink-zest:is(.has-pickle-ripe-background-color, .has-pickle-bright-background-color) { --hartleys-zest: var(--wp--preset--color--pickle-zest); }
.hartleys-ink-zest:is(.has-orange-ripe-background-color, .has-orange-bright-background-color) { --hartleys-zest: var(--wp--preset--color--orange-zest); }
.hartleys-ink-zest:is(.has-strawberry-ripe-background-color, .has-strawberry-bright-background-color) { --hartleys-zest: var(--wp--preset--color--strawberry-zest); }
.hartleys-ink-zest:is(.has-raspberry-ripe-background-color, .has-raspberry-bright-background-color) { --hartleys-zest: var(--wp--preset--color--raspberry-zest); }
.hartleys-ink-zest:is(.has-blackberry-ripe-background-color, .has-blackberry-bright-background-color) { --hartleys-zest: var(--wp--preset--color--blackberry-zest); }

/* ---- Sub-sections ----
   A pattern that opens with an H3 belongs to the H2 above it, so it sits
   closer, at the H3 rhythm. */

* + .hartleys-pattern:has(> h3:first-child) {
	margin-top: clamp(2.5rem, 5vw, 4rem) !important;
}

/* ---- Big statement ---- */

.hartleys-statement {
	padding: clamp(2rem, 8cqi, 5.5rem) clamp(1.75rem, 8cqi, 5.5rem);
}

.hartleys-statement__text {
	max-width: 18em;
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: clamp(1.6rem, 4.6cqi, 3rem);
	line-height: 1.02;
	letter-spacing: -0.02em;
	text-wrap: pretty;
}

/* ---- Traits with a TL;DR ---- */

.hartleys-traits {
	container-type: inline-size;
	display: grid;
	gap: clamp(1.25rem, 2.2vw, 1.75rem);
}

.hartleys-traits > * {
	margin: 0 !important;
}

.hartleys-trait {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(15rem, 38%);
	grid-template-areas:
		"kicker kicker"
		"word word"
		". tldr";
	align-items: end;
}

.hartleys-trait__kicker,
.hartleys-trait__word {
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	letter-spacing: -0.02em;
	text-transform: uppercase;
}

.hartleys-trait__kicker {
	grid-area: kicker;
	font-size: clamp(1.25rem, 5cqi, 2.6rem);
	line-height: 0.9;
}

.hartleys-trait__word {
	grid-area: word;
	font-size: clamp(2.75rem, 13cqi, 7rem);
	line-height: 0.82;
}

.hartleys-trait__tldr {
	grid-area: tldr;
	margin-top: clamp(1rem, 3cqi, 2rem) !important;
}

.hartleys-trait__tldr > * {
	margin: 0;
}

.hartleys-trait__tldr-title {
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1;
	text-transform: uppercase;
}

.hartleys-trait__tldr-text {
	margin-top: 0.3rem !important;
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: clamp(1rem, 2cqi, 1.125rem);
	line-height: 1.2;
}

@container (max-width: 34rem) {
	.hartleys-trait {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "kicker" "word" "tldr";
	}
}

/* ---- Rule tiles: the bit that matters, highlighted ----
   Bold the words that make the point; everything else fades back. */

.hartleys-rules {
	gap: clamp(1rem, 2vw, 1.5rem) !important;
}

/* No pattern to clip, so square tiles can grow if the words need room. */
.hartleys-rule,
.hartleys-saynot__tile {
	overflow: visible;
}

.hartleys-rule {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	text-align: center;
}

.hartleys-rule__example {
	max-width: 11em;
	color: color-mix(in srgb, var(--wp--preset--color--damson) 32%, var(--wp--preset--color--quince));
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: clamp(1.3rem, 11cqi, 1.9rem);
	line-height: 1.08;
	letter-spacing: -0.005em;
}

.hartleys-rule__example :is(strong, b) {
	color: var(--wp--preset--color--pickle-bright);
	font-weight: inherit;
}

/* ---- Say this, not that ---- */

:has(> .hartleys-saynot) {
	container-type: inline-size;
}

.hartleys-saynot {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding: 0;
}

.hartleys-saynot > * {
	margin: 0 !important;
	padding: clamp(0.75rem, 1.5vw, 1.1rem) clamp(0.75rem, 1.5vw, 1.1rem) 1.5rem;
}

.hartleys-saynot > :nth-child(even) {
	border-left: 1px solid rgb(0 41 8 / 0.08);
}

.hartleys-saynot > :nth-child(n + 3) {
	border-top: 1px solid rgb(0 41 8 / 0.08);
}

@container (max-width: 34rem) {
	.hartleys-saynot {
		grid-template-columns: minmax(0, 1fr);
	}

	.hartleys-saynot > :nth-child(even) {
		border-left: 0;
	}

	.hartleys-saynot > :nth-child(n + 2) {
		border-top: 1px solid rgb(0 41 8 / 0.08);
	}
}

.hartleys-saynot__tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	text-align: center;
}

.hartleys-saynot__tile > * {
	max-width: 12em;
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: clamp(1.3rem, 8cqi, 2.1rem);
	line-height: 1.08;
}

/* ---- Photos ---- */

.wp-block-image.is-style-hartleys-rounded img,
.wp-block-image.is-style-hartleys-rounded :is(.components-placeholder, .components-resizable-box__container) {
	border-radius: 1.5rem;
}

.wp-block-image.is-style-hartleys-rounded img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* ---- Value panels ---- */

.hartleys-values {
	container-type: inline-size;
	display: grid;
	gap: clamp(1.5rem, 3vw, 2.5rem);
}

.hartleys-values > * {
	margin: 0 !important;
}

.hartleys-value {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(1rem, 2.5cqi, 1.75rem);
	/* 16:9 on wide screens, but always tall enough for its words. */
	min-height: 56.25cqi;
	padding-block: clamp(2.5rem, 8cqi, 5rem);
	border-radius: 1.5rem;
	text-align: center;
}

.hartleys-value__title {
	max-width: 12.5ch;
	margin: 0 !important;
	color: inherit;
	font-size: clamp(2.5rem, 10cqi, 6rem) !important;
	line-height: 0.88;
	letter-spacing: -0.025em;
}

.hartleys-value__text {
	max-width: 30em;
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: clamp(1rem, 2.4cqi, 1.35rem);
	line-height: 1.25;
}

/* ---- Copy button on a panel ----
   Add .hartleys-copyable to a panel and hartleys.js adds a button that copies
   its words, so people can lift the exact wording. */

.hartleys-copyable {
	padding-top: clamp(3.25rem, 7cqi, 5rem);
}

.hartleys-copy--panel {
	position: absolute;
	top: clamp(0.75rem, 2cqi, 1.1rem);
	right: clamp(0.75rem, 2cqi, 1.1rem);
	z-index: 1;
}

/* ---- Centred statement ---- */

/* Sized with the padding included, so they keep the 16:9 shape. */
:is(.hartleys-statement--centred, .hartleys-placeholder, .hartleys-value) {
	box-sizing: border-box;
}

.hartleys-statement--centred {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: min(56.25cqi, 34rem);
	text-align: center;
}

.hartleys-statement--centred .hartleys-statement__text {
	max-width: 16em;
	margin-inline: auto;
	font-size: clamp(1.9rem, 6.4cqi, 4rem);
	line-height: 0.98;
	text-wrap: balance;
}

/* ---- Text panel: two columns of words, with an optional title ---- */

.hartleys-textpanel {
	/* Two columns where there's room, one on narrow screens. */
	columns: 2 16rem;
	column-gap: clamp(1.5rem, 4cqi, 3rem);
	padding-inline: clamp(1.5rem, 5cqi, 3.5rem);
	padding-bottom: clamp(1.75rem, 5cqi, 3.5rem);
}

.hartleys-textpanel > * {
	break-inside: avoid;
}

.hartleys-textpanel > p {
	margin-block: 0 1.1em !important;
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: clamp(1rem, 1.9cqi, 1.2rem);
	line-height: 1.25;
}

.hartleys-textpanel > p:last-child {
	margin-bottom: 0 !important;
}

.hartleys-textpanel__title {
	column-span: all;
	margin: 0 0 clamp(1.25rem, 3.5cqi, 2.25rem) !important;
	color: inherit;
	font-size: clamp(2rem, 7cqi, 4rem) !important;
	line-height: 0.95;
	letter-spacing: -0.025em;
}

/* Verse: a little bigger, with the space for line breaks. */
.hartleys-textpanel--verse {
	padding-bottom: clamp(2.5rem, 7cqi, 5rem);
}

.hartleys-textpanel--verse > p {
	font-size: clamp(1rem, 2.3cqi, 1.4rem);
	line-height: 1.2;
}

/* ---- Placeholder panel: marks a space for something still to come ---- */

.hartleys-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: min(56.25cqi, 34rem);
	text-align: center;
}

.hartleys-placeholder__note {
	max-width: 22em;
	color: var(--wp--preset--color--bramble);
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: clamp(1.1rem, 2.6cqi, 1.6rem);
	line-height: 1.15;
}

/* ---- Pattern ink: bright shade, and stronger zest ----
   .hartleys-ink-bright: on a ripe background, the pattern is drawn in the
   bright shade of the same fruit. Add .hartleys-ink-20 or .hartleys-ink-40
   to .hartleys-ink-zest for those exact opacities. */

.hartleys-ink-bright {
	--pattern-ink: color-mix(in srgb, var(--hartleys-bright, var(--section-bright)) var(--hartleys-ink-amount, 100%), transparent);
}

.hartleys-ink-bright.has-pickle-ripe-background-color { --hartleys-bright: var(--wp--preset--color--pickle-bright); }
.hartleys-ink-bright.has-orange-ripe-background-color { --hartleys-bright: var(--wp--preset--color--orange-bright); }
.hartleys-ink-bright.has-strawberry-ripe-background-color { --hartleys-bright: var(--wp--preset--color--strawberry-bright); }
.hartleys-ink-bright.has-raspberry-ripe-background-color { --hartleys-bright: var(--wp--preset--color--raspberry-bright); }
.hartleys-ink-bright.has-blackberry-ripe-background-color { --hartleys-bright: var(--wp--preset--color--blackberry-bright); }

.hartleys-ink-20 { --hartleys-ink-amount: 20%; }
.hartleys-ink-40 { --hartleys-ink-amount: 40%; }

/* ---- Image cards ---- */

.hartleys-image-card__image {
	margin: 0 !important;
}

.hartleys-image-card__image img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 1rem;
}

.hartleys-image-card--wide .hartleys-image-card__image img {
	aspect-ratio: 16 / 9;
}

.hartleys-image-card--wide {
	margin-top: clamp(1rem, 2vw, 1.5rem) !important;
}

.hartleys-image-cards + .hartleys-image-card--wide,
.hartleys-image-card--wide + .hartleys-image-cards {
	margin-top: clamp(1rem, 2vw, 1.5rem) !important;
}

/* ---- Download button ----
   Set per Image block under "Download button" in the editor sidebar, and
   added when the page renders (inc/downloads.php). The old
   .hartleys-downloadable class still works, built by hartleys.js. */

:is(.hartleys-downloadable .wp-block-image, .wp-block-image.hartleys-downloadable, .wp-block-image.has-hartleys-download) {
	position: relative;
}

/* WordPress styles every link in an Image block (inline-block, and full
   width on wide images), so this is specific enough to win. */
.wp-block-image > a.hartleys-copy.hartleys-download {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	line-height: 0;
	text-decoration: none;
}

.wp-block-image > a.hartleys-download svg {
	display: block;
}

/* In the editor: a badge where the button will be, so it's clear which
   images have one. The link icon marks a link to another site. */
.editor-styles-wrapper .wp-block-image.has-hartleys-download::after {
	content: "";
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 1;
	width: 2rem;
	height: 2rem;
	border-radius: 0.6rem;
	background-color: var(--wp--preset--color--elderflower);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301824A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11'/%3E%3Cpath d='M7 10.5l5 5 5-5'/%3E%3Cpath d='M5 19.5h14'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 1rem;
	box-shadow: 0 0 0 1px rgb(0 41 8 / 0.08);
	pointer-events: none;
}

.editor-styles-wrapper .wp-block-image.has-hartleys-download--external::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301824A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4l-9 9'/%3E%3Cpath d='M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E");
}

/* ---- In real life gallery ---- */

:has(> .hartleys-gallery) {
	container-type: inline-size;
}

.hartleys-gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(0.75rem, 1.6vw, 1.25rem);
}

.hartleys-gallery > * {
	margin: 0 !important;
	overflow: hidden;
	border-radius: 1.5rem;
}

.hartleys-gallery img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hartleys-gallery > :first-child {
	grid-row: span 2;
}

.hartleys-gallery > :is(:nth-child(2), :nth-child(3)) {
	aspect-ratio: 16 / 9;
}

.hartleys-gallery > :nth-child(n + 4) {
	grid-column: 1 / -1;
	aspect-ratio: 2 / 1;
}

@container (max-width: 34rem) {
	.hartleys-gallery {
		grid-template-columns: minmax(0, 1fr);
	}

	.hartleys-gallery > :first-child {
		grid-row: auto;
		aspect-ratio: 4 / 5;
	}
}

/* ---- Ticks (block style on List) ---- */

.is-style-hartleys-ticks {
	padding-left: 0;
	list-style: none;
}

.is-style-hartleys-ticks li {
	position: relative;
	padding-left: 1.35em;
}

.is-style-hartleys-ticks li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--wp--preset--color--pickle-bright);
	font-weight: 700;
}

/* ---- Pattern lineup ---- */

.hartleys-pattern-tile {
	aspect-ratio: 1;
	padding: 0;
}

.hartleys-caption__lead {
	margin-top: 1rem !important;
}

.hartleys-lineup .is-style-hartleys-ticks {
	margin-top: 0.25rem !important;
	margin-bottom: 0;
}

/* ---- Colour combos ---- */

.hartleys-combos {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
	gap: 2rem clamp(2rem, 5vw, 4rem);
	padding: clamp(1.25rem, 4vw, 2.5rem);
}

.hartleys-combos > *,
.hartleys-combos__set > * {
	margin: 0 !important;
}

.hartleys-combos__set {
	display: grid;
	gap: 0.6rem;
}

.hartleys-combos__label {
	margin-bottom: 0.4rem !important;
	color: var(--wp--preset--color--bramble);
	font-family: var(--wp--preset--font-family--giulia-plain);
	font-weight: 700;
	font-size: 1rem;
	text-align: center;
}

.hartleys-combo {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.6rem;
}

.hartleys-combo > * {
	position: relative;
	margin: 0 !important;
	aspect-ratio: 3 / 2;
	border-radius: 0.5rem;
}

/* The + and = between the blocks, drawn on the middle one. */
.hartleys-combo__chip--plus::before,
.hartleys-combo__chip--plus::after {
	position: absolute;
	top: 50%;
	color: var(--wp--preset--color--pickle-bright);
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1;
	transform: translate(-50%, -50%);
}

.hartleys-combo__chip--plus::before {
	content: "+";
	left: -0.8rem;
}

.hartleys-combo__chip--plus::after {
	content: "=";
	left: calc(100% + 0.8rem);
}

/* Smaller wiggles to suit the small tiles. */
.hartleys-combo__result::before {
	-webkit-mask-size: 36.4rem 10.453rem;
	mask-size: 36.4rem 10.453rem;
}

.hartleys-combo__name {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---- Joined cards ----
   Add .hartleys-cards-row--joined to a row of cards and they share one tray
   with thin dividers, however many columns fit. */

.hartleys-cards-row--joined {
	gap: 0 !important;
	overflow: hidden;
	border-radius: 1.5rem;
	background: var(--wp--preset--color--quince);
}

.hartleys-cards-row--joined > .is-style-hartleys-card {
	border-radius: 0;
	background: transparent;
	/* Lines on the left and top; the tray clips the ones on its outer edge. */
	box-shadow: -1px 0 0 rgb(0 41 8 / 0.08), 0 -1px 0 rgb(0 41 8 / 0.08);
}

/* A card with no caption keeps the same space all round. */
.hartleys-image-card:not(:has(> .hartleys-caption__title)) {
	padding-bottom: clamp(0.75rem, 1.5vw, 1.1rem);
}

/* ---- Gallery, flipped ----
   Add .hartleys-gallery--flipped to put the tall image on the right. */

.hartleys-gallery--flipped > :first-child {
	grid-column: 2;
	grid-row: 1 / span 2;
}

.hartleys-gallery--flipped > :nth-child(2) {
	grid-column: 1;
	grid-row: 1;
}

.hartleys-gallery--flipped > :nth-child(3) {
	grid-column: 1;
	grid-row: 2;
}

@container (max-width: 34rem) {
	.hartleys-gallery--flipped > * {
		grid-column: auto !important;
		grid-row: auto !important;
	}
}

/* ---- Essentials: colour + pattern + font ---- */

:has(> .hartleys-essentials) {
	container: hartleys-essentials / inline-size;
}

.hartleys-essentials {
	--essentials-gap: clamp(2.5rem, 5vw, 3.5rem);
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 13rem));
	justify-content: center;
	gap: 2rem var(--essentials-gap);
	padding: clamp(2.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 2.5rem) !important;
	text-align: center;
}

.hartleys-essentials__item {
	container-type: inline-size;
	position: relative;
	margin: 0 !important;
}

.hartleys-essentials__item > * {
	margin: 0 !important;
}

/* The + between tiles. */
.hartleys-essentials__item + .hartleys-essentials__item::before {
	content: "+";
	position: absolute;
	top: 50cqi; /* level with the middle of the tile */
	left: calc(var(--essentials-gap) / -2);
	color: var(--wp--preset--color--pickle-zest);
	font-family: var(--wp--preset--font-family--barricada-pro);
	font-weight: 700;
	font-size: 2rem;
	line-height: 1;
	transform: translate(-50%, -50%);
}

.hartleys-essentials__tile {
	aspect-ratio: 1;
	border-radius: 1rem;
}

.hartleys-essentials__tile img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 1rem;
}

.hartleys-essentials__fonts {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.hartleys-essentials__font {
	margin: 0 !important;
	font-size: clamp(1.15rem, 2.4vw, 1.45rem);
	line-height: 1.15;
}

.hartleys-essentials__font.has-barricada-pro-font-family,
.hartleys-essentials__font.has-caraque-font-family {
	font-weight: 700;
}

.hartleys-essentials__title {
	margin-top: 1rem !important;
	font-size: 1rem;
}

.hartleys-essentials__text {
	margin-top: 0.15rem !important;
	font-size: 1rem;
	line-height: 1.35;
}

/* Narrow: stack, with the + between rows. */
@container hartleys-essentials (max-width: 40rem) {
	.hartleys-essentials {
		grid-template-columns: minmax(0, 14rem);
		gap: var(--essentials-gap);
	}

	.hartleys-essentials__item + .hartleys-essentials__item::before {
		top: calc(var(--essentials-gap) / -2);
		left: 50%;
	}
}

/* WordPress sets wide images to height: auto; keep every gallery image
   filling its slot, whatever shape the photo is. */
.hartleys-gallery.hartleys-gallery > .wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- Inspiration gallery: rows of wide images and pairs ----
   Images pair up two to a row; an Image set to Wide width runs full width. */

.hartleys-gallery--rows > * {
	grid-row: auto !important;
	grid-column: auto !important;
	aspect-ratio: 1 !important;
}

.hartleys-gallery--rows > .wp-block-image:is(.alignwide, .alignfull) {
	grid-column: 1 / -1 !important;
	aspect-ratio: 16 / 9 !important;
}

@container (max-width: 34rem) {
	.hartleys-gallery--rows > .wp-block-image:not(.alignwide, .alignfull) {
		aspect-ratio: 4 / 5 !important;
	}
}

/* ==========================================================================
   Core block touches
   ========================================================================== */

.wp-block-search__inside-wrapper {
	max-width: 36rem;
	padding: 0.35rem !important;
	border: 0 !important;
	border-radius: 999px;
	background: var(--wp--preset--color--quince);
}

.wp-block-search__input {
	padding-inline: 1rem !important;
	border: 0 !important;
	background: transparent;
}

.wp-block-search__button {
	border-radius: 999px !important;
}

.wp-block-button__link:hover {
	animation: hopper 1s;
}

@keyframes hopper {
	0% { transform: scale(1, 1) translateY(0); }
	10% { transform: scale(1.07, 0.9) translateY(0); }
	30% { transform: scale(0.9, 1.1) translateY(-0.19em); }
	50% { transform: scale(1.05, 0.95) translateY(0); }
	57% { transform: scale(1, 1) translateY(-0.05em); }
	74% { transform: scale(1, 1) translateY(0); }
	100% { transform: scale(1, 1) translateY(0); }
}

.screen-reader-text:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
	.hartleys-sheet__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.bgl-sections {
		grid-template-columns: minmax(0, 1fr);
	}

	.bgl-sections__aside {
		display: none;
	}

	.hartleys-toc {
		display: none;
	}
}

@media (max-width: 900px) {
	:root {
		--sidebar-w: 13.5rem;
	}

	.hartleys-brand,
	.hartleys-nav {
		padding-left: 1.5rem;
	}

	.hartleys-hero__intro {
		justify-self: start;
	}
}

@media (max-width: 599px) {
	.hartleys-gap__row {
		grid-template-columns: minmax(0, 1fr);
	}

	.hartleys-gap__chip {
		justify-self: start;
		text-align: left;
	}

	.hartleys-recipe__item + .hartleys-recipe__item::before {
		display: none;
	}
}

/* ==========================================================================
   Motion preferences (keep last)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
