/*
 * Subud Books — supplementary stylesheet.
 *
 * Bespoke layer ONLY. Everything expressible as a design token lives in
 * theme.json; this file holds presentation the block system cannot yet describe
 * declaratively: cover-led product cards, the WooCommerce archive grid, refined
 * hover/focus states, header/footer detailing, and accessibility hardening.
 * All values reference theme.json CSS custom properties so the token system
 * stays the single source of truth.
 */

:root {
	--sb-cover-radius: 2px;
	--sb-ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ---------------------------------------------------------------------------
 * Global rhythm + accessibility
 * ------------------------------------------------------------------------- */

html {
	-webkit-text-size-adjust: 100%;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
	overflow-x: hidden; /* contain the off-canvas WooCommerce mini-cart drawer */
}

/* Visible, generous focus ring for keyboard users (WCAG 2.2). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary-deep);
	outline-offset: 3px;
	border-radius: 2px;
}

/* Skip link */
.skip-link.screen-reader-text {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	padding: 0.75rem 1.25rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
}
.skip-link.screen-reader-text:focus {
	left: 1rem;
	top: 1rem;
}

::selection {
	background: var(--wp--preset--color--primary-soft);
	color: var(--wp--preset--color--ink);
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------- */

.sb-header {
	border-bottom: 1px solid var(--wp--preset--color--stone-line);
}

/* SPI logo mark, bottom-aligned beside the wordmark so it sits on the same line */
.sb-brand {
	align-items: flex-end;
}
.sb-logo {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	flex: 0 0 auto;
}
.sb-logo img {
	display: block;
	height: 2.75rem;       /* ~44px, aligns with the two-line wordmark */
	width: auto;
	max-width: none;
}
@media (max-width: 600px) {
	.sb-logo img { height: 2.25rem; }
	.sb-brand { gap: 0.625rem !important; }
}

.sb-header .wp-block-site-title a {
	transition: color 0.2s var(--sb-ease);
}

/* The small eyebrow under the wordmark */
.sb-wordmark-sub {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.6875rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	line-height: 1;
	margin-top: 0.35rem;
}

/* Navigation underline-on-hover, no chrome */
.sb-header .wp-block-navigation-item__content {
	position: relative;
	padding-bottom: 2px;
}
.sb-header .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 1px;
	background: var(--wp--preset--color--primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s var(--sb-ease);
}
.sb-header .wp-block-navigation-item:hover .wp-block-navigation-item__content::after,
.sb-header .current-menu-item .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

/* "Members" gets a quiet key on it */
.sb-nav-members .wp-block-navigation-item__label::after {
	content: "›";
	margin-left: 0.3rem;
	color: var(--wp--preset--color--primary);
}

/* Cart icon link — accessible name supplied in markup */
.sb-cart-link {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 24px;
	padding: 0.35rem 0.2rem;
	transition: color 0.2s var(--sb-ease);
}
.sb-cart-link:hover { color: var(--wp--preset--color--primary); }
.sb-cart-link .wp-block-woocommerce-mini-cart__button { all: unset; cursor: pointer; }

/* ---------------------------------------------------------------------------
 * Sectioning + eyebrow labels
 * ------------------------------------------------------------------------- */

.sb-eyebrow {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

.sb-rule {
	height: 1px;
	background: var(--wp--preset--color--stone-line);
	border: 0;
	width: 100%;
}

.sb-section-paper { background: var(--wp--preset--color--paper); }
.sb-section-surface { background: var(--wp--preset--color--surface); }

/* ---------------------------------------------------------------------------
 * COVER ART AS HERO — the product card
 * Applies to WooCommerce archive grids and the All-Products / Products blocks.
 * ------------------------------------------------------------------------- */

/* Force-override WooCommerce's .columns-N float layout with a real grid.
 * Woo applies width:30.75% + float to li.product; we reset that and grid the ul. */
ul.products,
.wc-block-grid__products,
.wp-block-woocommerce-product-template {
	list-style: none;
	margin: 0 !important;
	padding: 0;
	display: grid;
	gap: clamp(2.25rem, 4vw, 3.5rem) clamp(1.5rem, 2.5vw, 2.25rem);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
	ul.products,
	.wc-block-grid__products,
	.wp-block-woocommerce-product-template {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (min-width: 1000px) {
	ul.products,
	.wc-block-grid__products,
	.wp-block-woocommerce-product-template {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* ---------------------------------------------------------------------------
 * WooCommerce 10.8 search results grid fix
 * Woo hijacks core query on product searches and renders .wc-block-product-template
 * with is-layout-flow (single column). Force it into the same responsive grid.
 * ------------------------------------------------------------------------- */
.wc-block-product-template {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: grid !important;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}
.wc-block-product-template > li {
	margin: 0 !important;
	list-style: none !important;
}
@media (min-width: 600px) {
	.wc-block-product-template {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}
@media (min-width: 782px) {
	.wc-block-product-template {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}
@media (min-width: 1024px) {
	.wc-block-product-template {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}
}

/* FIX 2 — The empty-cart "New in store" cross-sell renders a
 * .wc-block-grid__products inside a centred wrapper. WooCommerce blocks CSS
 * sets display:flex + flex:1 0 25% / max-width:25% on each .wc-block-grid__product.
 * We switch the parent to display:grid (auto-fit), but the max-width:25% from
 * Woo still clamps each grid cell to 25% of its OWN track width (~68px).
 * Override max-width:none so grid tracks fill freely. */
.wc-block-grid__products,
.cross-sells ul.products,
.wp-block-woocommerce-cart ul.products,
.woocommerce-cart ul.products {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
/* Belt-and-braces: the block-grid add-to-cart button must keep its label on
 * one readable line, never collapse to per-character vertical text. */
.wc-block-grid__product .wp-block-button__link,
.wc-block-grid__product-add-to-cart a {
	display: inline-block !important;
	width: auto !important;
	min-width: max-content;
	white-space: nowrap !important;
	word-break: normal !important;
}
.wc-block-grid__product {
	min-width: 0;
	text-align: left;
	/* Woo blocks CSS sets flex:1 0 25%; max-width:25% on these items.
	 * Inside our grid that max-width clamps cells to ~68px. Remove it. */
	max-width: none !important;
	flex: none !important;
}
/* Block-grid covers: show the whole small cover inside the calm mat, not a
 * cropped corner. These thumbnails don't fill the 3:4 frame, so relax it. */
.wc-block-grid__product .wc-block-grid__product-link,
.wc-block-grid__product-image {
	display: block;
	aspect-ratio: auto;
	padding: 0.75rem;
}
.wc-block-grid__product-image img {
	width: 100%;
	height: auto;
	max-height: none;
	object-fit: contain;
}

/* Individual card: strip Woo float chrome, lead with the cover.
 * EQUAL-HEIGHT CARDS — every li is a full-height flex column so the
 * add-to-cart button can be pinned to the bottom and align across the row. */
ul.products li.product,
.wc-block-grid__product,
.wp-block-woocommerce-product-template li,
.wp-block-post {
	list-style: none;
	width: auto !important;
	float: none !important;
	clear: none !important;
	margin: 0 !important;
	padding: 0;
	text-align: left;
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;   /* fill the grid row so siblings match height */
}

ul.products li.product::before,
ul.products li.product::after { content: none !important; display: none; }

/* FIX 1 — WooCommerce injects a clearfix ::before/::after on ul.products with
 * content:" "; display:table. In a CSS grid those pseudo-elements become grid
 * items and occupy cell 1, pushing real products into columns 2-4.
 * Suppress both so item 1 always lands in column 1. */
ul.products::before,
ul.products::after { content: none !important; display: none !important; }

/* The cover LINK wraps the image (and, in the classic loop, the title+price).
 * Keep it a simple block so the text flows normally underneath the framed mat. */
li.product > a.woocommerce-LoopProduct-link,
li.product > a:first-child {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* CONSISTENT COVER MAT — a fixed 3:4 frame on the IMAGE itself, object-fit
 * contain, so NO cover is ever cropped top/bottom and every card matches.
 * The mat is a calm neutral field; portrait, square and landscape covers all
 * sit centred inside the same frame. */
li.product .wp-post-image,
li.product img.attachment-woocommerce_thumbnail,
.wc-block-grid__product-image img,
.wp-block-post .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	height: auto;
	object-fit: contain;
	background: linear-gradient(180deg, #FBFAF7 0%, #EFE9DF 100%);
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 3px;
	padding: clamp(0.9rem, 2.2vw, 1.6rem);
	box-sizing: border-box;
	box-shadow: var(--wp--preset--shadow--cover);
	margin-bottom: 1.1rem;
	transition: transform 0.4s var(--sb-ease), box-shadow 0.4s var(--sb-ease);
}

/* gentle lift on hover */
li.product:hover .wp-post-image,
.wp-block-post:hover .wp-block-post-featured-image img {
	transform: translateY(-4px);
	box-shadow: var(--wp--preset--shadow--cover-hover);
}

/* Title — serif, quiet. Flex to fill the gap so prices/buttons align. */
li.product .woocommerce-loop-product__title,
.wc-block-grid__product-title,
.wp-block-post .wp-block-post-title {
	font-family: var(--wp--preset--font-family--serif) !important;
	font-size: 1.0625rem !important;
	font-weight: 440;
	line-height: 1.3;
	letter-spacing: -0.005em;
	color: var(--wp--preset--color--ink);
	margin: 0 0 0.35rem;
	padding: 0;
}
li.product .woocommerce-loop-product__title a,
.wp-block-post .wp-block-post-title a {
	text-decoration: none;
	color: inherit;
}
li.product:hover .woocommerce-loop-product__title { color: var(--wp--preset--color--primary-deep); }

/* Price — sans, restrained. Pin the price to the bottom of the cover-link's
 * flowing text so the button below it sits at a consistent baseline. */
li.product .price,
.wc-block-grid__product-price,
.wp-block-post .wp-block-woocommerce-product-price {
	font-family: var(--wp--preset--font-family--sans) !important;
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
	margin: 0.15rem 0 0.9rem;
}

/* The cover link holds img + title + price; let it grow so the sibling button
 * is pushed to the bottom of the card (equal-height alignment across the row). */
li.product > a.woocommerce-LoopProduct-link { flex: 1 1 auto; }
/* Pin the add-to-cart button to the bottom of every card. */
li.product > .button,
li.product > .added_to_cart { margin-top: auto; align-self: flex-start; }
li.product .price ins { text-decoration: none; color: var(--wp--preset--color--ink); }
li.product .price del { color: var(--wp--preset--color--muted); opacity: 0.7; margin-right: 0.4rem; }

/* Add to cart on the card — a quiet ghost button, not a loud buy bar.
 * white-space:normal + nowrap-safe width so the label never stacks vertically
 * in narrow cross-sell columns (empty-cart "New in store"). */
li.product .button,
li.product .added_to_cart,
.wp-block-post .wp-block-button__link {
	display: inline-block;
	width: auto;
	max-width: 100%;
	white-space: normal;
	text-align: center;
	font-family: var(--wp--preset--font-family--sans) !important;
	font-size: var(--wp--preset--font-size--caption) !important;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary-deep) !important;
	background: transparent !important;
	border: 1px solid var(--wp--preset--color--stone-line) !important;
	border-radius: 2px;
	padding: 0.55rem 1rem !important;
	min-height: 24px;
	text-decoration: none;
	transition: all 0.2s var(--sb-ease);
}
li.product .button:hover,
.wp-block-post .wp-block-button__link:hover {
	background: var(--wp--preset--color--primary-deep) !important;
	color: var(--wp--preset--color--ink-invert) !important;
	border-color: var(--wp--preset--color--primary-deep) !important;
}
li.product .added_to_cart { margin-left: 0.5rem; }

/* Placeholder (no cover) — a tasteful branded mat, NOT a faint/empty square.
 * We hide WooCommerce's grey placeholder pixels but keep the framed mat, then
 * lay a quiet "SPI" wordmark over it via the cover link, so no-cover products
 * (audio/video/CD/talk items) read as intentional rather than empty/indented.
 * This is what fixed the "empty first slot" on desktop: the first product had
 * no cover and the old faint placeholder made the whole card look blank. */
li.product img[src*="woocommerce-placeholder"],
li.product img[src*="placeholder"] {
	/* keep the 3:4 mat (frame/background/padding from the cover rule above)
	   but blank the grey camera glyph */
	object-fit: contain;
	color: transparent;
	text-indent: -9999px;
}
li.product > a.woocommerce-LoopProduct-link {
	position: relative;
}
/* Branded glyph only when the card is using the placeholder image. */
li.product.sb-no-cover > a.woocommerce-LoopProduct-link::before {
	content: "SPI";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	/* sit over the 3:4 mat region only (matches the image area, not the text) */
	aspect-ratio: 3 / 4;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 700;
	font-size: clamp(1.5rem, 4vw, 2.25rem);
	letter-spacing: 0.18em;
	color: var(--wp--preset--color--primary-soft);
	opacity: 0.55;
	pointer-events: none;
}

/* Sale flash — turned into a small quiet caption, not a loud ribbon */
.onsale {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.25rem 0.55rem;
	border-radius: 2px;
	min-height: 0;
	min-width: 0;
	line-height: 1.2;
}

/* ---------------------------------------------------------------------------
 * Archive header — collection intro, not an algorithmic feed
 * ------------------------------------------------------------------------- */

/* Our block template supplies the centred .sb-archive-intro. WooCommerce's
 * legacy template ALSO prints its own page title; suppress it so we never get
 * a duplicate "Shop" heading under our intro.
 * WCAG 1.3.1 (fix A1): the block theme supplies the real H1; hide the
 * WooCommerce legacy H1 from both visual and accessibility tree so archive
 * pages have exactly one H1. The title element is targeted directly in
 * addition to the parent container as belt-and-braces. */
.woocommerce-products-header {
	display: none !important;
}
.woocommerce-products-header__title {
	display: none !important;
}
.post-type-archive-product .woocommerce-breadcrumb,
.tax-product_cat .woocommerce-breadcrumb {
	display: none;
}
.sb-archive-intro {
	max-width: 720px;
	margin: 0 auto;
}
.term-description {
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.55;
	color: var(--wp--preset--color--muted);
	max-width: 60ch;
	margin: 1rem auto 0;
	text-align: center;
}

/* Result count + ordering — quiet utility row */
.woocommerce-result-count,
.woocommerce-ordering select {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--caption);
	color: var(--wp--preset--color--muted);
}
.woocommerce-ordering select {
	border: 1px solid var(--wp--preset--color--stone-line);
	background: var(--wp--preset--color--surface);
	padding: 0.5rem 0.75rem;
	border-radius: 2px;
	min-height: 36px;
}

/* ---------------------------------------------------------------------------
 * SINGLE PRODUCT — large cover, serif title, dignified add-to-cart
 * ------------------------------------------------------------------------- */

.single-product div.product {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(2rem, 5vw, 4rem);
	align-items: start;
}
@media (min-width: 900px) {
	.single-product div.product {
		grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
	}
}

/* Override WooCommerce's floated gallery so it sits cleanly in the grid cell
 * and never pushes the summary off the page. */
.single-product div.product .woocommerce-product-gallery {
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: clamp(1.5rem, 3vw, 2.5rem);
	background: linear-gradient(180deg, #FBFAF7 0%, #EFE9DF 100%);
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 4px;
	box-sizing: border-box;
}
.single-product div.product .woocommerce-product-gallery__wrapper {
	margin: 0;
	transform: none !important;
	width: 100% !important;
}
/* Tame the zoom magnifier so it doesn't crowd the cover corner */
.single-product .woocommerce-product-gallery__trigger {
	top: 1rem;
	right: 1rem;
	opacity: 0.7;
}
.single-product .woocommerce-product-gallery img {
	border-radius: var(--sb-cover-radius);
	box-shadow: var(--wp--preset--shadow--cover);
}

.single-product div.product .summary {
	float: none !important;
	width: 100% !important;
	margin: 0;
}

.single-product .product_title {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--headline);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.012em;
	color: var(--wp--preset--color--ink);
	margin: 0 0 1rem;
	overflow-wrap: break-word;
	hyphens: auto;
}

/* Mobile containment: keep the framed gallery and all product chrome inside
 * the viewport. WooCommerce sets an inline px width on the gallery + wrapper
 * (flexslider) that overflows a narrow column, so we clamp hard. */
@media (max-width: 899px) {
	.single-product div.product {
		grid-template-columns: minmax(0, 1fr);
		width: 100%;
		max-width: 100%;
	}
	.single-product div.product > * {
		min-width: 0;
		max-width: 100%;
		box-sizing: border-box;
	}
	.single-product div.product .woocommerce-product-gallery,
	.single-product div.product .woocommerce-product-gallery__wrapper,
	.single-product div.product .woocommerce-product-gallery__image,
	.single-product div.product .woocommerce-product-gallery__image a,
	.single-product div.product .woocommerce-product-gallery img,
	.single-product div.product .summary {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box;
	}
	.single-product form.cart { gap: 0.5rem; }
}

.single-product .summary .price {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--title);
	font-weight: 400;
	color: var(--wp--preset--color--ink);
	margin: 0 0 1.5rem;
}
.single-product .summary .price del { color: var(--wp--preset--color--muted); opacity: 0.6; margin-right: 0.6rem; }
.single-product .summary .price ins { text-decoration: none; }

.single-product .woocommerce-product-details__short-description {
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.6;
	color: var(--wp--preset--color--ink);
	max-width: 60ch;
	margin-bottom: 1.75rem;
}

/* The add-to-cart cluster */
.single-product form.cart {
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
	margin: 1.5rem 0 2rem;
	flex-wrap: wrap;
}
.single-product form.cart .quantity input.qty {
	width: 4rem;
	height: 100%;
	min-height: 48px;
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 3px;
	background: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--body);
	text-align: center;
	color: var(--wp--preset--color--ink);
}
.single-product form.cart button.single_add_to_cart_button {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--ink-invert);
	background: var(--wp--preset--color--primary-deep);
	border: 1px solid var(--wp--preset--color--primary-deep);
	border-radius: 3px;
	padding: 0 2.25rem;
	min-height: 48px;
	cursor: pointer;
	transition: background 0.2s var(--sb-ease);
}
.single-product form.cart button.single_add_to_cart_button:hover {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
}

/* Product meta — quiet, editorial */
.single-product .product_meta {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--caption);
	color: var(--wp--preset--color--muted);
	border-top: 1px solid var(--wp--preset--color--stone-line);
	padding-top: 1.25rem;
	margin-top: 1.5rem;
	line-height: 1.9;
}
.single-product .product_meta > span { display: block; }
.single-product .product_meta a { color: var(--wp--preset--color--primary-deep); }

/* Tabs — flatten the default Woo tab chrome into a clean editorial block */
.single-product .woocommerce-tabs {
	grid-column: 1 / -1;
	margin-top: clamp(2.5rem, 5vw, 4rem);
	border-top: 1px solid var(--wp--preset--color--stone-line);
	padding-top: 2rem;
}
.single-product .woocommerce-tabs ul.tabs {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.75rem;
	border: 0;
}
.single-product .woocommerce-tabs ul.tabs::before { display: none; }
.single-product .woocommerce-tabs ul.tabs li {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	margin: 0;
}
.single-product .woocommerce-tabs ul.tabs li::before,
.single-product .woocommerce-tabs ul.tabs li::after { display: none; }
.single-product .woocommerce-tabs ul.tabs li a {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	padding: 0 0 0.5rem;
	border-bottom: 2px solid transparent;
}
.single-product .woocommerce-tabs ul.tabs li.active a {
	color: var(--wp--preset--color--ink);
	border-bottom-color: var(--wp--preset--color--primary);
}
.single-product .woocommerce-tabs .panel h2 {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--subtitle);
	font-weight: 420;
}
.single-product .woocommerce-tabs .panel,
.single-product .woocommerce-Tabs-panel {
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.7;
	color: var(--wp--preset--color--ink);
	max-width: 66ch;
}

/* Related products heading */
.related.products > h2,
.up-sells > h2 {
	grid-column: 1 / -1;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--title);
	font-weight: 400;
	margin: clamp(3rem, 6vw, 5rem) 0 2rem;
}
.related.products,
.up-sells {
	grid-column: 1 / -1;
}

/* ---------------------------------------------------------------------------
 * Cart + Checkout — same dignity as the front
 * ------------------------------------------------------------------------- */

.woocommerce-cart table.cart,
.woocommerce-checkout .woocommerce {
	font-family: var(--wp--preset--font-family--sans);
}
.woocommerce table.shop_table {
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 4px;
	border-collapse: separate;
}
.woocommerce table.shop_table th {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
.woocommerce .cart_totals h2,
.woocommerce-checkout h3 {
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 420;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce-checkout select,
.select2-container .select2-selection {
	border: 1px solid var(--wp--preset--color--stone-line) !important;
	border-radius: 3px !important;
	min-height: 44px;
	padding: 0.6rem 0.75rem;
	font-family: var(--wp--preset--font-family--sans);
	background: var(--wp--preset--color--surface);
}
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce .checkout-button {
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 600;
	letter-spacing: 0.02em;
	background: var(--wp--preset--color--primary-deep);
	color: var(--wp--preset--color--ink-invert);
	border: 1px solid var(--wp--preset--color--primary-deep);
	border-radius: 3px;
	padding: 0.85rem 1.75rem;
	min-height: 44px;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce .checkout-button:hover {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
}
.woocommerce a.button.alt,
.woocommerce button.button.alt { background: var(--wp--preset--color--primary-deep); }

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-top-color: var(--wp--preset--color--primary) !important;
	font-family: var(--wp--preset--font-family--sans);
	border-radius: 3px;
}

/* Breadcrumb */
.sb-breadcrumb,
.woocommerce-breadcrumb {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--caption);
	color: var(--wp--preset--color--muted);
	letter-spacing: 0.01em;
	margin-bottom: 1.5rem;
}
.woocommerce-breadcrumb a { color: var(--wp--preset--color--primary-deep); text-decoration: none; }
.woocommerce-breadcrumb a:hover { text-decoration: underline; }
.sb-crumb-sep { color: var(--wp--preset--color--stone-line); }

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------- */

.sb-footer {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink-invert);
}
.sb-footer a { color: var(--wp--preset--color--primary-soft); text-decoration: none; }
.sb-footer a:hover { color: var(--wp--preset--color--ink-invert); text-decoration: underline; }
.sb-footer h2, .sb-footer h3, .sb-footer .wp-block-site-title a {
	color: var(--wp--preset--color--ink-invert);
}
.sb-footer .sb-eyebrow { color: var(--wp--preset--color--primary-soft); }
.sb-footer p { color: rgba(246, 243, 238, 0.78); }

/* ---------------------------------------------------------------------------
 * Home — hero + featured shelf nuances
 * ------------------------------------------------------------------------- */

.sb-hero {
	border-bottom: 1px solid var(--wp--preset--color--stone-line);
}
.sb-hero-title {
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 380;
	line-height: 1.04;
	letter-spacing: -0.02em;
}
.sb-hero-lede {
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
	max-width: 46ch;
}

/* The hero cover shelf: three covers leaning together */
.sb-hero-shelf .wp-block-post-template,
.sb-hero-shelf ul {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(0.5rem, 2vw, 1rem);
	align-items: end;
	margin: 0;
	padding: 0;
	list-style: none;
}
.sb-hero-shelf li { margin: 0 !important; }
.sb-hero-shelf img {
	width: 100%;
	height: auto;
	border-radius: 2px;
	box-shadow: var(--wp--preset--shadow--cover);
}
/* Centre cover stands slightly proud */
.sb-hero-shelf li:nth-child(2) { transform: translateY(-0.75rem); }

@media (max-width: 781px) {
	.sb-hero { text-align: center; }
	.sb-hero-lede { margin-left: auto; margin-right: auto; }
	.sb-hero .wp-block-buttons { justify-content: center; }
	.sb-hero-shelf {
		max-width: 300px;
		margin: 2.5rem auto 0;
	}
	/* Core's grid post-template collapses to 1 column on mobile by default;
	 * keep the featured shelf as a tidy 2-up so the home page stays compact. */
	.wp-block-query .wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 1.5rem 1.25rem !important;
	}
}

/* Collection cards on the home page (route tiles) */
.sb-route-card {
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 4px;
	background: var(--wp--preset--color--surface);
	transition: border-color 0.25s var(--sb-ease), transform 0.25s var(--sb-ease);
	height: 100%;
}
.sb-route-card:hover {
	border-color: var(--wp--preset--color--primary-soft);
	transform: translateY(-3px);
}
.sb-route-card h3 a { text-decoration: none; }

/* A members panel that reads as a quiet invitation, not a paywall */
.sb-members-panel {
	background: var(--wp--preset--color--primary-deep);
	color: var(--wp--preset--color--ink-invert);
	border-radius: 6px;
}
.sb-members-panel h2, .sb-members-panel h3 { color: var(--wp--preset--color--ink-invert); }
.sb-members-panel p { color: rgba(246, 243, 238, 0.82); }
.sb-members-panel .wp-block-button__link {
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--paper);
}
.sb-members-panel .wp-block-button__link:hover {
	background: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--surface);
}

/* ---------------------------------------------------------------------------
 * Prose pages (About, etc.)
 * ------------------------------------------------------------------------- */

.sb-prose p { margin-bottom: 1.25rem; line-height: 1.7; }
.sb-prose .wp-block-post-title,
.sb-prose h1 { margin-bottom: 2rem; }

/* WCAG 1.4.3 link contrast (fix A4): prose/body link hover + focus must meet
 * AA 4.5:1 on paper (#F6F3EE). primary (#4F79A7) gives 4.10:1 — just under.
 * primary-deep (#294A6D) gives ~8.5:1. Resting state unchanged; only
 * hover and focus-visible states are tightened here. */
.entry-content a:hover,
.entry-content a:focus-visible,
.sb-prose a:hover,
.sb-prose a:focus-visible,
.woocommerce-product-details__short-description a:hover,
.woocommerce-product-details__short-description a:focus-visible,
.wp-block-post-content a:hover,
.wp-block-post-content a:focus-visible {
	color: var(--wp--preset--color--primary-deep);
}

/* 404 + search */
.sb-utility-page {
	min-height: 50vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
}

/* ============================================================
   Header search (entry point; searches products only)
   ============================================================ */
.sb-search {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 999px;
	background: var(--wp--preset--color--paper);
	overflow: hidden;
	transition: border-color 0.2s var(--sb-ease), box-shadow 0.2s var(--sb-ease);
}
.sb-search:focus-within {
	border-color: var(--wp--preset--color--primary-soft);
	box-shadow: 0 0 0 3px rgba(79, 121, 167, 0.15);
}
.sb-search__field {
	border: 0;
	background: transparent;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.875rem;
	color: var(--wp--preset--color--ink);
	padding: 0.45rem 0.25rem 0.45rem 0.95rem;
	width: 11rem;
	max-width: 42vw;
	line-height: 1.2;
}
.sb-search__field::placeholder { color: var(--wp--preset--color--muted); }
.sb-search__field:focus { outline: none; }
.sb-search__btn {
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--primary);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 0.85rem 0 0.4rem;
	cursor: pointer;
	transition: color 0.2s var(--sb-ease);
}
.sb-search__btn:hover { color: var(--wp--preset--color--ink); }
.sb-search__btn svg { display: block; }
@media (max-width: 900px) {
	.sb-search__field { width: 8rem; }
}
@media (max-width: 600px) {
	.sb-search__field { width: 6.5rem; padding-left: 0.75rem; }
}

/* ============================================================
   Shop "Browse by section" filter (gating-aware product categories,
   rendered as a centred row of pills)
   ============================================================ */
.sb-shop-filters { text-align: center; }
.sb-filters-label { margin-bottom: 0.85rem; }
.sb-shop-filters .wc-block-product-categories,
.sb-shop-filters .widget_product_categories { margin: 0; }
.sb-shop-filters ul.wc-block-product-categories-list,
.sb-shop-filters ul.product-categories {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 0.6rem;
}
.sb-shop-filters li { margin: 0; }
.sb-shop-filters li a {
	display: inline-block;
	padding: 0.35rem 0.9rem;
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 999px;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	transition: border-color 0.2s var(--sb-ease), background 0.2s var(--sb-ease), color 0.2s var(--sb-ease);
	white-space: nowrap;
}
.sb-shop-filters li a:hover {
	border-color: var(--wp--preset--color--primary-soft);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
}
.sb-shop-filters .count {
	color: var(--wp--preset--color--muted);
	font-size: 0.78em;
	margin-left: 0.3rem;
}
.sb-shop-filters li.current-cat > a {
	border-color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--ink-invert);
}
.sb-shop-filters li.current-cat .count { color: rgba(246, 243, 238, 0.75); }

/* FIX 3 — When the public can only see one category the filter bar is a
 * single pill ("Publications for All (18)") which is pointless/confusing.
 * Hide the whole bar when it contains exactly one list item.
 * :has() is supported in all modern browsers; this degrades gracefully
 * (logged-in members see multiple pills and are unaffected). */
.sb-shop-filters:has(.wc-block-product-categories-list-item:only-child) {
	display: none;
}

/* ===========================================================================
 * MOBILE RESPONSIVE FIXES — verified at 390 px (2026-06-17)
 * =========================================================================== */

/* ---------------------------------------------------------------------------
 * FIX M1 — Hero display heading: 4 rem is unreadable/overflowing on phones.
 * Scale down progressively so the title fits the viewport width cleanly.
 * --------------------------------------------------------------------------- */
@media (max-width: 781px) {
	.sb-hero-title.has-display-font-size,
	.sb-hero-title {
		font-size: clamp(2rem, 8vw, 3rem) !important;
		line-height: 1.08;
	}
}

/* ---------------------------------------------------------------------------
 * FIX M2 — Hero eyebrow + body text overflow.
 * All text blocks must respect the viewport; force wrapping.
 * --------------------------------------------------------------------------- */
.sb-eyebrow,
.sb-hero-lede,
.wp-block-post-title,
h1, h2, h3, h4 {
	overflow-wrap: break-word;
	word-break: break-word;
	max-width: 100%;
}

/* ---------------------------------------------------------------------------
 * FIX M3 — Header: at <= 480 px the brand + search + nav + cart row is too
 * crowded. Switch to a two-row layout: brand fills the top row; search and
 * the hamburger sit on the second row (nav becomes the overlay toggle).
 *
 * Implementation: allow the outer flex row to wrap, give the brand flex:1 so
 * it takes the first row, and the search + nav group wraps to the next.
 * The nav block already uses overlayMenu="mobile" so it renders as a single
 * hamburger icon at this width; we just need to ensure it wraps neatly.
 * --------------------------------------------------------------------------- */
@media (max-width: 480px) {
	/* Let the outer row wrap so brand takes row 1, controls take row 2 */
	.sb-header .wp-block-group.alignwide {
		flex-wrap: wrap !important;
		row-gap: 0.5rem;
	}

	/* Brand group: fill row 1 entirely */
	.sb-header .sb-brand {
		flex: 1 1 100%;
		min-width: 0;
	}

	/* Controls group (search + nav + cart): fill row 2, align left */
	.sb-header .sb-brand ~ .wp-block-group {
		flex: 1 1 100%;
		justify-content: flex-start !important;
		gap: var(--wp--preset--spacing--40) !important;
	}

	/* Shrink search field to something comfortable on one row with the hamburger */
	.sb-search__field {
		width: 9rem !important;
		max-width: 55vw;
	}

	/* SPI logo: slightly smaller so the wordmark has room */
	.sb-logo img { height: 1.75rem; }

	/* Site title (wordmark) wraps at 390 px at the subtitle size (1.5 rem).
	 * Drop it to a comfortable single-line size for phones. */
	.sb-header .wp-block-site-title {
		font-size: 1.125rem !important;
	}
	.sb-header .wp-block-site-title a {
		font-size: inherit !important;
	}

	/* Eyebrow "SUBUD PUBLICATIONS INTERNATIONAL" under the wordmark:
	 * too wide to spell out in full at 390 px; truncate gracefully. */
	.sb-wordmark-sub {
		max-width: 15ch;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

/* ---------------------------------------------------------------------------
 * FIX M4 — Viewport containment: ensure no block can generate horizontal
 * scroll at any mobile width. The body has overflow-x:hidden which hides the
 * scroll bar but still clips the right-side content of any overflowing block
 * (e.g. product grid right column, hero, alignwide blocks).
 * Setting max-width:100% + box-sizing on the main layout groups prevents the
 * overflow from occurring in the first place.
 * --------------------------------------------------------------------------- */
.wp-block-group,
.wp-block-columns,
.wp-block-column,
.wp-block-query,
.wp-block-post-template,
.entry-content {
	max-width: 100%;
	box-sizing: border-box;
}

@media (max-width: 600px) {
	/* alignwide blocks: WP FSE generates per-container classes like
	 * .wp-container-core-group-is-layout-XXXX > .alignwide { max-width:1200px }
	 * These use attribute-selector CSS so the specificity is (0,2,0).
	 * Our override needs at least the same specificity + !important to win
	 * even though our stylesheet loads AFTER the inline <style> in <head>.
	 *
	 * Strategy: use the .wp-site-blocks ancestor (always present, added by WP
	 * core to the outermost wrapper) to bump specificity to (0,2,0) without
	 * needing to know the unique per-container hash.
	 */
	:root {
		--wp--style--global--wide-size: 100vw;
	}

	.wp-site-blocks .alignwide {
		max-width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
		box-sizing: border-box;
	}

	/* Belt-and-braces: also target via the has-global-padding wrapper */
	.has-global-padding .alignwide,
	.is-layout-constrained .alignwide {
		max-width: 100% !important;
	}
}

/* ---------------------------------------------------------------------------
 * FIX M5 — Cart empty-state "New in store" cross-sell.
 * The wc-block-product-template defaults to 1fr (1 column) below 600 px,
 * making each cross-sell card full-width and very tall. Force it to 2-up
 * from 360 px so the cross-sell reads as a compact grid, not a stack.
 * Also remove min-width:max-content from buttons so they don't overflow
 * their half-width column.
 * --------------------------------------------------------------------------- */
@media (max-width: 599px) {
	/* 2-up cross-sell in the empty cart "New in store" block */
	.wc-block-cart__empty-cart__title ~ * .wc-block-product-template,
	.wp-block-woocommerce-cart .wc-block-product-template,
	.woocommerce-cart .wc-block-product-template {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.wc-block-grid__product .wp-block-button__link,
	.wc-block-grid__product-add-to-cart a {
		min-width: 0 !important;
		white-space: normal !important;
	}
}


/* ---------------------------------------------------------------------------
 * FIX M6 — Members / WooCommerce login page: the WC login form has a fixed
 * min-width of 360 px on some Woo versions that can clip on narrow phones.
 * Ensure the form and its fields scale to the available width.
 * --------------------------------------------------------------------------- */
.woocommerce-form-login,
.woocommerce form.login {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
}
.woocommerce form.login p,
.woocommerce form.login .form-row {
	width: 100% !important;
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
 * FIX M7 — Tablet (768 px) hero shelf: the three-cover grid gets very tight
 * between the two columns. Give the shelf column slightly more breathing room
 * and keep the central cover lift effect subtle.
 * --------------------------------------------------------------------------- */
@media (min-width: 600px) and (max-width: 900px) {
	.sb-hero-shelf {
		max-width: 260px;
		margin-left: auto;
	}
}

/* ---------------------------------------------------------------------------
 * FIX M8 — Members page: large cream gap above footer on mobile.
 * The page-no-title template gives <main> padding-bottom:8rem (spacing--100).
 * On phones that reads as a disproportionately large cream void. Pull it back
 * to ~3rem on mobile; desktop stays at the template default.
 * --------------------------------------------------------------------------- */
@media (max-width: 781px) {
	/* Outer <main> template padding */
	.page-id-314 main.wp-block-group {
		padding-bottom: 2rem !important;
	}
	/* Inner content group has its own padding-bottom:6rem from the post content block */
	.page-id-314 main.wp-block-group > .wp-block-post-content > .wp-block-group,
	.page-id-314 main.wp-block-group .wp-block-post-content .wp-block-group {
		padding-bottom: 2.5rem !important;
	}
}

/* ---------------------------------------------------------------------------
 * FIX P1 — Members page WooCommerce "Login" H2: sits flush against the intro
 * copy with no visual separation. Add top breathing room and a subtle divider
 * so it reads as a distinct section rather than running straight on.
 * --------------------------------------------------------------------------- */
.page-id-314 .woocommerce-MyAccount-content h2,
.page-id-314 .woocommerce form.login > h2,
.page-id-314 .u-column1 h2,
.page-id-314 .woocommerce-notices-wrapper + .woocommerce-form-login h2,
.page-id-314 [class*="woocommerce"] h2:first-of-type {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--wp--preset--color--stone-line);
}

/* ===========================================================================
 * INFINITE SCROLL — loading sentinel + spinner
 * Appended below the product grid by sb-infinite-scroll.js.
 * Degrades gracefully: if JS does not run, this sentinel is never inserted.
 * =========================================================================== */

.sb-scroll-sentinel {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 0 1rem;
	min-height: 3.5rem;
}

/* A quiet 24 px ring spinner using the theme's primary colour. */
.sb-scroll-spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 2.5px solid var(--wp--preset--color--primary-soft);
	border-top-color: var(--wp--preset--color--primary-deep);
	border-radius: 50%;
	animation: sb-spin 0.7s linear infinite;
}

@keyframes sb-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.sb-scroll-spinner {
		animation: none;
		border-top-color: var(--wp--preset--color--primary-soft);
		opacity: 0.5;
	}
}

/* ---------------------------------------------------------------------------
 * CONTACT FORM (Contact Form 7)
 *
 * CF7 emits bare browser-default inputs, which read as a plugin dropped onto
 * the page. These rules reuse the same idiom already established on the product
 * page — 48px touch targets, stone-line borders, 3px radius, a primary-deep
 * solid button — so the form belongs to the site rather than sitting on it.
 * Everything is expressed in theme.json tokens; no literal colours.
 * ------------------------------------------------------------------------ */

:is(.wpcf7, .sb-verify) { margin-top: 1.5rem; }

/* Field label. The <label> wraps its input, so it is the row container too. */
:is(.wpcf7, .sb-verify) .sb-cf-field {
	display: block;
	margin-bottom: 1.4rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--ink);
}

:is(.wpcf7, .sb-verify) input[type="text"],
:is(.wpcf7, .sb-verify) input[type="email"],
:is(.wpcf7, .sb-verify) textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin-top: 0.5rem;
	padding: 0.7rem 0.9rem;
	min-height: 48px;
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 3px;
	background: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 400;
	line-height: 1.55;
	color: var(--wp--preset--color--ink);
	transition: border-color 0.2s var(--sb-ease), box-shadow 0.2s var(--sb-ease);
}

:is(.wpcf7, .sb-verify) textarea { min-height: 11rem; resize: vertical; }

:is(.wpcf7, .sb-verify) input[type="text"]::placeholder,
:is(.wpcf7, .sb-verify) input[type="email"]::placeholder,
:is(.wpcf7, .sb-verify) textarea::placeholder { color: var(--wp--preset--color--muted); }

/* Focus: a visible ring rather than the UA outline, matching the site accent.
 * Kept as box-shadow so it does not shift layout. */
:is(.wpcf7, .sb-verify) input[type="text"]:focus,
:is(.wpcf7, .sb-verify) input[type="email"]:focus,
:is(.wpcf7, .sb-verify) textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 22%, transparent);
}

/* Submit — the same solid button as add-to-cart, so the site has one button. */
:is(.wpcf7, .sb-verify) input[type="submit"] {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--ink-invert);
	background: var(--wp--preset--color--primary-deep);
	border: 1px solid var(--wp--preset--color--primary-deep);
	border-radius: 3px;
	padding: 0 2.25rem;
	min-height: 48px;
	margin-top: 0.25rem;
	cursor: pointer;
	transition: background 0.2s var(--sb-ease), border-color 0.2s var(--sb-ease);
}
:is(.wpcf7, .sb-verify) input[type="submit"]:hover {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
}
:is(.wpcf7, .sb-verify) input[type="submit"]:disabled { opacity: 0.6; cursor: default; }

/* Validation. CF7's defaults are a red that clashes with the paper ground; the
 * theme has no error token, so these borrow the muted/deep pairing and rely on
 * weight and position rather than colour alone (WCAG 1.4.1). */
:is(.wpcf7, .sb-verify) .wpcf7-not-valid-tip {
	display: block;
	margin-top: 0.4rem;
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
	letter-spacing: 0.01em;
	color: #9C4A3C;
}
:is(.wpcf7, .sb-verify) input.wpcf7-not-valid,
:is(.wpcf7, .sb-verify) textarea.wpcf7-not-valid { border-color: #9C4A3C; }

/* Response banner — CF7's default is a bordered box in a stock colour. */
:is(.wpcf7, .sb-verify) form .wpcf7-response-output {
	margin: 1.5rem 0 0;
	padding: 0.85rem 1.1rem;
	border-width: 1px;
	border-radius: 3px;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
}
:is(.wpcf7, .sb-verify) form.sent .wpcf7-response-output {
	border-color: var(--wp--preset--color--primary-soft);
	background: color-mix(in srgb, var(--wp--preset--color--primary-soft) 18%, transparent);
	color: var(--wp--preset--color--primary-deep);
}
:is(.wpcf7, .sb-verify) form.invalid .wpcf7-response-output,
:is(.wpcf7, .sb-verify) form.unaccepted .wpcf7-response-output,
:is(.wpcf7, .sb-verify) form.failed .wpcf7-response-output {
	border-color: #9C4A3C;
	background: color-mix(in srgb, #9C4A3C 10%, transparent);
	color: #7d3b30;
}

:is(.wpcf7, .sb-verify) .wpcf7-spinner { margin: 0 0 0 0.75rem; vertical-align: middle; }

@media (prefers-reduced-motion: reduce) {
	.wpcf7 input, .wpcf7 textarea { transition: none; }
}

/* --- Grouped form sections (members application) --------------------------
 * A long form reads as less of an ordeal when it is visibly in parts. These are
 * real <fieldset>/<legend> elements rather than styled divs, so the grouping is
 * announced to screen readers too, not just drawn.
 * ---------------------------------------------------------------------- */

:is(.wpcf7, .sb-verify) .sb-cf-group {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--stone-line);
	margin: 0 0 2rem;
	padding: 1.6rem 0 0;
}
:is(.wpcf7, .sb-verify) .sb-cf-group:first-of-type { border-top: 0; padding-top: 0; }

:is(.wpcf7, .sb-verify) .sb-cf-group > legend {
	padding: 0;
	margin-bottom: 1.1rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--subtitle);
	font-weight: 600;
	letter-spacing: -0.005em;
	color: var(--wp--preset--color--ink);
}

/* "optional" sits beside a legend; quiet, so the eye skips it when scanning. */
:is(.wpcf7, .sb-verify) .sb-cf-optional {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin-left: 0.5rem;
	vertical-align: 0.12em;
}

/* Hint under a label, above its input. Regular weight so it does not compete
 * with the label it belongs to. */
:is(.wpcf7, .sb-verify) .sb-cf-hint {
	display: block;
	margin-top: 0.2rem;
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 400;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

/* Explanatory note for a whole section. */
:is(.wpcf7, .sb-verify) .sb-cf-note {
	margin: -0.4rem 0 1.2rem;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

/* Consent checkbox. CF7 wraps acceptance in its own spans, so the layout is
 * set on the wrapper and the input pulled up to sit with the first line. */
:is(.wpcf7, .sb-verify) .sb-cf-accept { display: block; margin-top: 0.4rem; }
:is(.wpcf7, .sb-verify) .sb-cf-accept .wpcf7-list-item { margin: 0; }
:is(.wpcf7, .sb-verify) .sb-cf-accept label {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	line-height: 1.5;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}
:is(.wpcf7, .sb-verify) .sb-cf-accept input[type="checkbox"] {
	flex: 0 0 auto;
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.1rem;
	accent-color: var(--wp--preset--color--primary-deep);
}

:is(.wpcf7, .sb-verify) .sb-cf-privacy {
	margin: 0 0 1.6rem;
	padding-top: 1.4rem;
	border-top: 1px solid var(--wp--preset--color--stone-line);
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.65;
	color: var(--wp--preset--color--muted);
}

/* Turnstile sits between the last field and the submit; give it room. */
:is(.wpcf7, .sb-verify) .cf-turnstile { margin: 0 0 1.4rem; }

/* CF7 wraps each field in <p> and appends <br /> after label text (its "autop").
 * The per-form `wpcf7_autop: off` setting does not reliably take effect, so the
 * spacing is normalised here instead — which also holds if autop is ever
 * re-enabled. Labels are already block-level, so the <br /> only adds a stray
 * line, and the <p> margin doubles up with the label's own. */
:is(.wpcf7, .sb-verify) .sb-cf-group > p,
:is(.wpcf7, .sb-verify) form > p { margin: 0; }
:is(.wpcf7, .sb-verify) .sb-cf-field > br,
:is(.wpcf7, .sb-verify) .sb-cf-hint + br { display: none; }

/* With the <p> margins gone, spacing comes from the label alone. */
:is(.wpcf7, .sb-verify) .sb-cf-group > p > .sb-cf-field { margin-bottom: 1.4rem; }
:is(.wpcf7, .sb-verify) .sb-cf-group > p:last-of-type > .sb-cf-field { margin-bottom: 0; }

/* The sentinel is observed by IntersectionObserver, so it must always have a
 * layout box — it is never display:none while paging is possible. The spinner
 * inside it toggles visibility (which preserves space) rather than display. */
.sb-scroll-spinner { visibility: hidden; }

/* Turnstile inside the review form — give it room above the submit button. */
.sb-comment-turnstile { margin: 1.2rem 0 1rem; }


/* ---------------------------------------------------------------------------
 * VERIFICATION FORM (/verify-membership/)
 *
 * Shares the field, group and hint styling above via :is(.wpcf7, .sb-verify),
 * so there is one definition rather than a parallel copy that drifts. Only the
 * parts CF7 has no equivalent of are defined here.
 * ------------------------------------------------------------------------ */

.sb-verify { margin-top: 1.5rem; }

.sb-verify > p {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.7;
	margin-bottom: 1.2rem;
}

/* The applicant's details, shown so the verifier knows who they are vouching
 * for. A quiet panel rather than a table that reads as data entry. */
.sb-verify-summary {
	width: 100%;
	border-collapse: collapse;
	margin: 1.4rem 0 1.6rem;
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 3px;
}
.sb-verify-summary th,
.sb-verify-summary td {
	text-align: left;
	padding: 0.6rem 1rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	vertical-align: top;
	border-bottom: 1px solid var(--wp--preset--color--stone-line);
}
.sb-verify-summary tr:last-child th,
.sb-verify-summary tr:last-child td { border-bottom: 0; }
.sb-verify-summary th {
	width: 42%;
	font-weight: 400;
	color: var(--wp--preset--color--muted);
	white-space: nowrap;
}
.sb-verify-summary td {
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}

.sb-verify-note {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.65;
	color: var(--wp--preset--color--muted);
	margin-bottom: 1.8rem;
}

/* Confirm / decline. Full-width rows with a visible border so the choice reads
 * as a decision rather than an afterthought, and the whole row is clickable. */
.sb-verify-choice {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin: 0.4rem 0 1.4rem;
}
.sb-verify-choice > label {
	display: flex;
	align-items: flex-start;
	gap: 0.7rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--wp--preset--color--stone-line);
	border-radius: 3px;
	background: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	transition: border-color 0.2s var(--sb-ease), background 0.2s var(--sb-ease);
}
.sb-verify-choice > label:hover { border-color: var(--wp--preset--color--primary-soft); }
.sb-verify-choice > label:has(input:checked) {
	border-color: var(--wp--preset--color--primary-deep);
	background: color-mix(in srgb, var(--wp--preset--color--primary-soft) 14%, transparent);
}
.sb-verify-choice input[type="radio"] {
	flex: 0 0 auto;
	width: 1.1rem;
	height: 1.1rem;
	margin-top: 0.12rem;
	accent-color: var(--wp--preset--color--primary-deep);
}

/* Same solid button as add-to-cart and the CF7 submit, so the site has one. */
.sb-verify-button {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--ink-invert);
	background: var(--wp--preset--color--primary-deep);
	border: 1px solid var(--wp--preset--color--primary-deep);
	border-radius: 3px;
	padding: 0 2.25rem;
	min-height: 48px;
	cursor: pointer;
	transition: background 0.2s var(--sb-ease), border-color 0.2s var(--sb-ease);
}
.sb-verify-button:hover {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
}

/* Outcome messages: valid link answered, expired, or opened without a token. */
.sb-verify-message {
	padding: 1.1rem 1.3rem;
	border: 1px solid var(--wp--preset--color--primary-soft);
	border-left: 3px solid var(--wp--preset--color--primary-deep);
	border-radius: 3px;
	background: var(--wp--preset--color--paper);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.7;
	color: var(--wp--preset--color--ink);
}

@media (prefers-reduced-motion: reduce) {
	.sb-verify-choice > label, .sb-verify-button { transition: none; }
}
