/*
 * Base styles the theme.json can't express. Kept small: tokens live in theme.json
 * and arrive here as --wp--preset--* and --wp--custom--* properties.
 */

html {
	scroll-padding-top: var(--wp--custom--header-height);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Fraunces picks its optical size from the font size. */
h1, h2, h3, h4, .has-fraunces-font-family {
	font-optical-sizing: auto;
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

img {
	border-radius: var(--wp--custom--radius--image);
}

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

/* Skip link that WordPress adds for block themes. */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--maroon);
	color: var(--wp--preset--color--cream);
	font-family: var(--wp--preset--font-family--figtree);
	font-weight: 600;
	padding: 12px 20px;
	border-radius: 4px;
	clip-path: none;
	top: 12px;
	left: 12px;
	z-index: 100000;
}

/* Header logo */
.bd-logo {
	display: inline-flex;
	line-height: 0;
}
.bd-logo img {
	width: clamp(200px, 22vw, 260px);
	height: auto;
	border-radius: 0;
}

/* Footer logo: the mono SVG drawn in currentColor (cream) through a mask. */
.bd-logo-mono {
	display: block;
	width: clamp(220px, 26vw, 300px);
	aspect-ratio: 668 / 120;
	background-color: currentColor;
	-webkit-mask: var(--bd-logo-mono) no-repeat center / contain;
	mask: var(--bd-logo-mono) no-repeat center / contain;
}

/* Small uppercase label above headings. */
.is-style-eyebrow,
.bd-eyebrow {
	font-family: var(--wp--preset--font-family--figtree);
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}

/* Labels sit close to the heading they introduce. */
:is(.is-style-eyebrow, .bd-eyebrow, .is-style-year-label) + * {
	margin-block-start: 0.75rem;
}

/* Year labels in the story chapters. */
.is-style-year-label {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: var(--wp--preset--font-size--year-label);
	color: var(--wp--preset--color--maroon);
	line-height: 1.2;
}

/* Sections butt up against each other; spacing comes from section padding. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}


/* ==========================================================================
   Layout helpers
   ========================================================================== */

/* Readable line length for running text. */
.bd-chapter__text > p,
.bd-intro p,
.bd-hero__intro {
	max-width: 34em;
}

/* ==========================================================================
   Header
   ========================================================================== */

.bd-header {
	background: var(--wp--preset--color--milk);
}

.bd-nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

/* Core switches to the menu button below 600px; the brief wants 900px. */
@media (min-width: 600px) and (max-width: 899.98px) {
	.bd-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	.bd-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

.bd-nav .wp-block-navigation__responsive-container-open,
.bd-nav .wp-block-navigation__responsive-container-close {
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
}
.bd-nav .wp-block-navigation__responsive-container-open svg,
.bd-nav .wp-block-navigation__responsive-container-close svg {
	width: 28px;
	height: 28px;
}

/* Full-screen menu panel */
.bd-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1rem var(--wp--custom--gutter) 2rem;
}
.bd-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: calc(var(--wp--custom--header-height) + 1rem);
	align-items: flex-start;
}
.bd-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 1.25rem;
	align-items: flex-start;
}
.bd-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(2rem, 8vw, 3rem);
	font-weight: 400;
	line-height: 1.1;
}

/* ==========================================================================
   Hero and band (cover blocks)
   ========================================================================== */

.bd-hero,
.bd-band {
	padding-left: var(--wp--custom--gutter) !important;
	padding-right: var(--wp--custom--gutter) !important;
}
.bd-hero .wp-block-cover__inner-container,
.bd-band .wp-block-cover__inner-container {
	width: 100% !important;
	max-width: 1200px;
	margin-inline: auto !important;
	padding-inline: 0 !important;
}
.bd-hero .wp-block-cover__image-background,
.bd-band .wp-block-cover__image-background {
	border-radius: 0;
}
.bd-hero h1 {
	max-width: 14em;
}
.bd-hero .is-style-eyebrow + h1 {
	margin-block-start: 1rem;
}

@media (max-width: 899.98px) {
	.bd-hero {
		min-height: 80svh !important;
	}
	.bd-band {
		min-height: 420px !important;
	}
}

/* ==========================================================================
   Story chapters: two columns, stacking below 900px with the photo first
   ========================================================================== */

@media (max-width: 899.98px) {
	.wp-block-columns.bd-chapter {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch !important;
	}
	.wp-block-columns.bd-chapter > .wp-block-column {
		flex-basis: auto !important;
		width: 100%;
	}
	.wp-block-columns.bd-chapter--media-right > .bd-chapter__media {
		order: -1;
	}
}

.bd-chapter__media .wp-block-image {
	margin: 0;
}

/* ==========================================================================
   New arrivals and The herd today
   ========================================================================== */

/* Heading and intro sit side by side down to 782px (core columns), then stack. */
.bd-intro {
	align-items: flex-end;
}
.bd-intro h2,
.bd-intro p {
	margin: 0;
}

.bd-photo-grid .wp-block-image {
	margin: 0;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--image);
}
.bd-photo-grid .wp-block-image img {
	width: 100%;
	height: 100%;
}

/* Two by two on phones. */
@media (max-width: 599.98px) {
	.bd-photo-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	.bd-photo-grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	.bd-photo-grid--3 > :first-child {
		grid-column: 1 / -1;
	}
	.bd-photo-grid--3 > :first-child img {
		aspect-ratio: 4 / 3 !important;
	}
}

/* ==========================================================================
   Mozzarella and the signup form
   ========================================================================== */

.bd-mozzarella .bd-chapter__text > * + * {
	margin-block-start: 1.25rem;
}
.bd-mozzarella .is-style-eyebrow + h2 {
	margin-block-start: 0.75rem;
}

.bd-signup {
	margin-block-start: 2rem !important;
}
.bd-signup__label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
	font-size: 1rem;
}
.bd-signup__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}
.bd-signup__input {
	flex: 1 1 16rem;
	min-width: 0;
	min-height: 52px;
	padding: 0.75rem 1rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--cream) 55%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--cream) 8%, transparent);
	color: var(--wp--preset--color--cream);
	font: inherit;
	font-size: 1rem;
}
.bd-signup__input::placeholder {
	color: color-mix(in srgb, var(--wp--preset--color--cream) 70%, transparent);
}
.bd-signup__input:focus-visible {
	outline: 2px solid var(--wp--preset--color--cream);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--cream);
}
.bd-signup__input[aria-invalid="true"] {
	border-color: var(--wp--preset--color--blush);
}
.bd-signup__button {
	min-height: 52px;
	border: 0;
	cursor: pointer;
	background: var(--wp--preset--color--cream) !important;
	color: var(--wp--preset--color--maroon) !important;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}
.bd-signup__button:focus-visible {
	outline: 2px solid var(--wp--preset--color--cream);
	outline-offset: 3px;
}
.bd-signup__spinner {
	display: none;
}
.bd-signup__message:empty {
	display: none;
}
.bd-signup__message {
	margin: 0.75rem 0 0;
	color: var(--wp--preset--color--blush);
	font-size: 0.9375rem;
	font-weight: 500;
}
.bd-signup__success {
	margin: 0;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: var(--wp--preset--font-size--year-label);
}
.bd-signup.is-success .bd-signup__form {
	display: none;
}

/* Honeypot: off-screen for people, still in the form for bots. */
.bd-signup__hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bd-small-print {
	color: color-mix(in srgb, var(--wp--preset--color--cream) 88%, var(--wp--preset--color--maroon));
}

/* ==========================================================================
   Footer
   ========================================================================== */

.bd-footer__logo {
	display: inline-block;
	color: var(--wp--preset--color--cream);
	line-height: 0;
}
.bd-footer .is-style-eyebrow {
	margin-bottom: 0.75rem;
	font-size: var(--wp--preset--font-size--eyebrow);
}
.bd-footer__columns p {
	margin: 0 0 0.75rem;
	font-size: 1rem;
	line-height: 1.7;
}
.bd-footer__legal {
	margin-block-start: var(--wp--preset--spacing--50) !important;
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--cream) 18%, transparent);
	color: color-mix(in srgb, var(--wp--preset--color--cream) 85%, var(--wp--preset--color--ink));
}

/* ==========================================================================
   Plain pages (privacy policy)
   ========================================================================== */

.bd-page h1 {
	margin-bottom: var(--wp--preset--spacing--40);
}
.bd-page .wp-block-post-content h2 {
	font-size: var(--wp--preset--font-size--chapter-heading);
	margin-top: var(--wp--preset--spacing--50);
}

.bd-band__line {
	line-height: 1.15;
	max-width: 22em;
}

/* ==========================================================================
   Motion and microinteractions
   Easing: --wp--custom--ease--enter for anything entering, ease-out for hovers.
   Only transform, opacity and clip-path animate. Everything here is off with
   prefers-reduced-motion (see the end of this section).
   ========================================================================== */

:root {
	--bd-ease-enter: var(--wp--custom--ease--enter);
	--bd-ease-hover: var(--wp--custom--ease--hover);
	--bd-hover: var(--wp--custom--duration--hover);
}

@media (prefers-reduced-motion: no-preference) {
	html:not(.lenis) {
		scroll-behavior: smooth;
	}
}

/* Lenis base styles */
html.lenis,
html.lenis body {
	height: auto;
}
.lenis:not(.lenis-autoToggle).lenis-stopped {
	overflow: clip;
}
.lenis [data-lenis-prevent] {
	overscroll-behavior: contain;
}

/* --- Sticky header -------------------------------------------------------- */

.bd-site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	transition: transform var(--wp--custom--duration--header) var(--bd-ease-enter);
}
.bd-site-header.is-hidden {
	transform: translateY(-100%);
}
/* The frosted background sits on a pseudo-element: putting backdrop-filter on the
   header itself would trap the full-screen menu inside the header's box. */
.bd-site-header .bd-header {
	position: relative;
	background: transparent;
}
.bd-site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--milk);
	border-bottom: 1px solid transparent;
	transition: opacity var(--bd-hover) var(--bd-ease-hover);
}
.bd-site-header.is-scrolled::before {
	background: color-mix(in srgb, var(--wp--preset--color--milk) 92%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom-color: color-mix(in srgb, var(--wp--preset--color--earth) 10%, transparent);
}
.bd-progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: var(--wp--preset--color--maroon);
	transform: scaleX(0);
	transform-origin: left center;
	pointer-events: none;
}

/* --- Back to top ------------------------------------------------------------ */

.bd-to-top {
	position: fixed;
	right: clamp(16px, 3vw, 32px);
	bottom: clamp(16px, 3vw, 32px);
	z-index: 40;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--maroon);
	color: var(--wp--preset--color--cream);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition:
		opacity 400ms var(--bd-ease-enter),
		transform 400ms var(--bd-ease-enter),
		visibility 0s linear 400ms;
}
.bd-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition:
		opacity 400ms var(--bd-ease-enter),
		transform 400ms var(--bd-ease-enter),
		visibility 0s;
}
.bd-to-top > svg {
	grid-area: 1 / 1;
}
.bd-to-top__ring {
	width: 48px;
	height: 48px;
	transform: rotate(-90deg);
}
.bd-to-top__ring circle {
	fill: none;
	stroke-width: 1.5;
}
.bd-to-top__ring-track {
	stroke: color-mix(in srgb, var(--wp--preset--color--cream) 22%, transparent);
}
.bd-to-top__ring-fill {
	stroke: var(--wp--preset--color--cream);
}
.bd-to-top__arrow {
	width: 20px;
	height: 20px;
	transition: transform var(--bd-hover) var(--bd-ease-hover);
}
@media (hover: hover) {
	.bd-to-top.is-visible:hover {
		transform: translateY(-2px);
		transition-duration: var(--bd-hover);
		transition-timing-function: var(--bd-ease-hover);
	}
	.bd-to-top:hover .bd-to-top__arrow {
		transform: translateY(-2px);
	}
}
.bd-to-top:focus-visible {
	outline: 2px solid var(--wp--preset--color--maroon);
	outline-offset: 3px;
}

/* --- Hero ------------------------------------------------------------------- */

.bd-hero {
	overflow: hidden;
}
.bd-hero .wp-block-cover__image-background {
	will-change: transform;
}
@keyframes bd-hero-settle {
	from { scale: 1.06; }
	to { scale: 1; }
}
@keyframes bd-rise-in {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}
html.bd-motion .bd-hero .wp-block-cover__image-background {
	animation: bd-hero-settle 1.6s var(--bd-ease-enter) both;
}
html.bd-motion .bd-hero__text > * {
	animation: bd-rise-in 0.8s var(--bd-ease-enter) both;
}
html.bd-motion .bd-hero__text > :nth-child(1) { animation-delay: 0.15s; }
html.bd-motion .bd-hero__text > :nth-child(2) { animation-delay: 0.23s; }
html.bd-motion .bd-hero__text > :nth-child(3) { animation-delay: 0.31s; }

.bd-scroll-cue {
	position: absolute;
	left: 50%;
	bottom: 20px;
	z-index: 2;
	display: grid;
	justify-items: center;
	gap: 8px;
	color: var(--wp--preset--color--white);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	transform: translateX(-50%);
	transition: opacity 500ms var(--bd-ease-hover);
	pointer-events: none;
}
.bd-scroll-cue.is-gone {
	opacity: 0;
}
.bd-scroll-cue__line {
	position: relative;
	width: 1px;
	height: 36px;
	overflow: hidden;
	background: rgb(255 255 255 / 0.3);
}
.bd-scroll-cue__line::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--wp--preset--color--white);
	transform: translateY(-100%);
	animation: bd-cue 2.2s var(--bd-ease-enter) 1.2s infinite;
}
@keyframes bd-cue {
	0% { transform: translateY(-100%); }
	55% { transform: translateY(0); }
	100% { transform: translateY(100%); }
}
@media (max-width: 899.98px) {
	.bd-scroll-cue {
		display: none;
	}
}

/* --- Story timeline thread ----------------------------------------------------- */

.bd-story {
	position: relative;
}
.bd-thread {
	display: none;
}
@media (min-width: 900px) {
	.bd-thread {
		position: absolute;
		top: var(--wp--preset--spacing--section);
		bottom: var(--wp--preset--spacing--section);
		display: block;
		width: 1px;
		margin: 0 !important;
		pointer-events: none;
	}
	.bd-thread__line {
		position: absolute;
		inset: 0;
		background: color-mix(in srgb, var(--wp--preset--color--maroon) 35%, transparent);
		transform: scaleY(0);
		transform-origin: top center;
	}
	.bd-thread__dot {
		position: absolute;
		left: 50%;
		width: 9px;
		height: 9px;
		margin: -4.5px 0 0 -4.5px;
		border: 1px solid var(--wp--preset--color--maroon);
		border-radius: 50%;
		background: var(--wp--preset--color--milk);
		transition: background-color 400ms var(--bd-ease-hover), transform 400ms var(--bd-ease-enter);
	}
	.bd-thread__dot.is-filled {
		background: var(--wp--preset--color--maroon);
		transform: scale(1.15);
	}
	/* The dots sit relative to the story section, not the thread's inset box. */
	.bd-thread {
		top: 0;
		bottom: 0;
	}
	.bd-thread__line {
		top: var(--wp--preset--spacing--section);
		bottom: var(--wp--preset--spacing--section);
	}
}

/* --- Photo grids: hover zoom ------------------------------------------------- */

.bd-zoom img {
	transition: transform var(--wp--custom--duration--image-zoom) var(--bd-ease-hover);
}
@media (hover: hover) {
	.bd-zoom:hover img {
		transform: scale(1.04);
	}
}

.bd-band {
	overflow: hidden;
}

/* --- Links: underline draws in from the left, retracts to the right ----------- */

/* Links in running text keep a faint resting underline, so they're never
   identified by colour alone; the full-colour line draws over it on hover. */
:where(.wp-site-blocks) :where(p, li) a:not(.wp-element-button),
.bd-nav .wp-block-navigation-item__content {
	text-decoration: none;
	background-image:
		linear-gradient(currentColor, currentColor),
		linear-gradient(color-mix(in srgb, currentColor 35%, transparent), color-mix(in srgb, currentColor 35%, transparent));
	background-repeat: no-repeat;
	background-position: 100% 100%, 0 100%;
	background-size: 0% 1px, 100% 1px;
	padding-bottom: 1px;
	transition: background-size var(--bd-hover) var(--bd-ease-hover);
}
.bd-nav .wp-block-navigation-item__content {
	background-size: 0% 1px, 0% 1px;
}
@media (hover: hover) {
	:where(.wp-site-blocks) :where(p, li) a:not(.wp-element-button):hover,
	.bd-nav .wp-block-navigation-item__content:hover {
		background-position: 0 100%, 0 100%;
		background-size: 100% 1px, 100% 1px;
	}
	.bd-nav .wp-block-navigation-item__content:hover {
		background-size: 100% 1px, 0% 1px;
	}
}
:where(.wp-site-blocks) :where(p, li) a:not(.wp-element-button):focus-visible,
.bd-nav .wp-block-navigation-item__content:focus-visible {
	background-position: 0 100%, 0 100%;
	background-size: 100% 1px, 100% 1px;
}

/* --- Buttons ---------------------------------------------------------------- */

.wp-element-button,
.wp-block-button__link {
	transition:
		background-color var(--bd-hover) var(--bd-ease-hover),
		color var(--bd-hover) var(--bd-ease-hover),
		transform var(--bd-hover) var(--bd-ease-hover);
}
@media (hover: hover) {
	.wp-element-button:hover,
	.wp-block-button__link:hover {
		transform: translateY(-2px);
	}
	.bd-signup__button:hover {
		background: var(--wp--preset--color--white) !important;
	}
}
.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}
.bd-signup__input {
	transition: border-color var(--bd-hover) var(--bd-ease-hover), background-color var(--bd-hover) var(--bd-ease-hover);
}
.bd-signup__input:hover {
	border-color: color-mix(in srgb, var(--wp--preset--color--cream) 80%, transparent);
}

/* --- Reduced motion: everything still, everything visible ------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
	.bd-scroll-cue {
		display: none;
	}
}
