/* Wild Lore: small additions on top of theme.json. Keep under ~5 KB. */

/* Visible keyboard focus everywhere (WCAG 2.2 2.4.7 / 2.4.11) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--gold-text);
	outline-offset: 2px;
}

/* Text for screen readers only (e.g. the checkout H1) */
.wl-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* WooCommerce's closed mini-cart drawer is aria-hidden but its buttons stay focusable (axe: aria-hidden-focus).
   Hiding it while closed removes it from the tab order too; opening sets aria-hidden="false" and shows it. */
.wc-block-mini-cart__drawer[aria-hidden="true"] { visibility: hidden; }

/* Static product gallery (flexslider off): main photo full width, the rest in a 4-across grid.
   Fixed square boxes, so nothing moves while images load (CLS). */
.woocommerce-product-gallery__wrapper {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr)); /* minmax(0,…): columns can't grow to fit a big image */
	gap: 0.5rem;
	margin: 0;
}
.woocommerce-product-gallery__image:first-child { grid-column: 1 / -1; }
/* WooCommerce's classic CSS still gives thumbnails width: 25% of their grid cell (≈21 px on phones). */
.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image {
	width: auto !important;
	float: none !important;
	display: block !important;
	margin: 0 !important;
}
.woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
.woocommerce-product-gallery { opacity: 1 !important; }
.woocommerce-product-gallery .zoomImg { display: none !important; }

/* Express-checkout containers left empty on product pages (scripts dequeued in functions.php). */
.single-product #wcpay-express-checkout-element,
.single-product #wcpay-express-checkout-wrapper,
.single-product [id^="ppc-button"],
.single-product .ppc-button-wrapper { display: none !important; }

/* Gold rule under section headings: decorative only, never text */
.wl-rule {
	width: 64px;
	height: 3px;
	border: 0;
	background: var(--wp--preset--gradient--mark-gold);
}

/* Registered mark beside the extract product title (USPTO SOU specimen) */
.wl-mark-wrap { margin: 0 0 0.5rem; }
.wl-mark { display: block; width: 160px; height: auto; }

/* Trust row near the price */
.wl-trust {
	display: grid;
	gap: 0.5rem;
	padding: 0.9rem 1rem;
	background: var(--wp--preset--color--paper);
	border-radius: 6px;
	font-size: var(--wp--preset--font-size--small);
}
.wl-trust p { margin: 0; }

/* Mobile sticky add-to-cart: shown by sticky-atc.js once the main button scrolls out of view */
.wl-sticky-atc {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
	background: var(--wp--preset--color--base);
	border-top: 1px solid var(--wp--preset--color--paper);
	box-shadow: 0 -4px 16px rgb(0 0 0 / 0.08);
	transform: translateY(110%);
	transition: transform 0.2s ease;
}
.wl-sticky-atc[data-visible="true"] { transform: none; }
.wl-sticky-atc__price { font-weight: 600; }
.wl-sticky-atc button {
	min-height: 44px; /* WCAG 2.2 target size */
	padding: 0 1.25rem;
	border: 0;
	border-radius: 4px;
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--white);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
@media (max-width: 781px) {
	/* Keep the end of the page (footer links) reachable above the bar */
	body:has(.wl-sticky-atc[data-visible="true"]) { padding-bottom: 72px; }
}
@media (min-width: 782px) { .wl-sticky-atc { display: none; } }

/* Phones: header on two rows ([menu] logo … account cart / full-width search). On one row the
   search pushed the cart off screen and squeezed the logo to nothing (mobile QA 2026-10-28). */
.wl-header-row > .wp-block-site-logo { flex-shrink: 0; }
@media (max-width: 781px) {
	.wl-header-row { flex-wrap: wrap !important; row-gap: 0.5rem; }
	/* Beats WordPress's layout rule (body .is-layout-flex { display: flex }). */
	.wl-header-row > .wl-header-tools { display: contents !important; }
	.wl-header-row > .wp-block-navigation { order: 0; }
	.wl-header-row > .wp-block-site-logo { order: 1; margin-right: auto; }
	.wl-header-tools > .wp-block-woocommerce-customer-account { order: 2; }
	.wl-header-tools > .wc-block-mini-cart { order: 3; }
	.wl-header-tools > .wp-block-woocommerce-product-search { order: 4; flex: 1 0 100%; }
}

/* Touch targets ≥ 44 px and form text ≥ 16 px (iOS zooms into smaller inputs). */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close,
.wc-block-customer-account__link,
.wc-block-mini-cart__button,
.wc-block-product-search__button,
.wc-block-cart-link,
.wc-block-components-quantity-selector__button {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.wc-block-product-search__field,
.quantity .qty,
.wc-block-components-quantity-selector__input,
select.orderby,
.wc-block-components-text-input input,
.wc-block-components-textarea {
	font-size: 16px;
	min-height: 44px;
}
.wc-block-cart-item__remove-link,
.woocommerce-product-gallery__trigger {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}
/* Text links that stand alone (menu, breadcrumb, footer, card titles, tabs): 44 px tall rows. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.woocommerce-breadcrumb a,
.has-forest-background-color li a,
.wl-guide-links a,
.wp-block-column > h3 > a,
.wc-block-product .wp-block-post-title a,
.wp-block-woocommerce-related-products .wp-block-post-title a,
.woocommerce-tabs ul.tabs li a,
.wp-block-site-title a,
.wc-block-checkout__login-prompt,
.wc-block-components-address-form__address_2-toggle,
.wc-block-components-panel__button,
.wl-header-row .wp-block-navigation-item__content,
.wp-block-post-content li > a[href^="mailto:"],
.wp-block-post-content li > a[href^="tel:"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
}
.wl-header-row .wp-block-navigation-submenu__toggle { min-width: 44px; min-height: 44px; }
.wc-block-components-checkbox label { min-height: 44px; align-items: center; }
/* WooCommerce's own sizes win without !important here. */
.wc-block-components-quantity-selector__button,
.wc-block-components-quantity-selector__input { min-width: 44px !important; }
/* Narrow phones: a 64 px cart thumbnail leaves room for the 44 px quantity controls (no sideways scroll at 375). */
@media (max-width: 400px) {
	.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image { width: 64px !important; padding-right: 12px !important; }
	.wc-block-cart-items .wc-block-cart-item__image img { width: 64px !important; max-width: 64px; }
	.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total { padding-left: 8px !important; }
	/* Quantity control + remove button wrap instead of widening the table. */
	.wc-block-cart-items .wc-block-cart-item__quantity { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; padding-right: 0 !important; }
}
.wp-element-button, .wp-block-button__link { min-height: 44px; }
.wp-block-woocommerce-empty-cart-block a:not(.wp-block-button__link) { display: inline-flex; align-items: center; min-height: 44px; }
/* WooPayments' card-brand strip at checkout is a button (opens the "+4 more" list). */
.payment-methods--logos [role="button"] { min-height: 44px; display: inline-flex; align-items: center; }
.wc-block-components-quantity-selector__input,
select.orderby,
.variations select { font-size: 16px !important; }
.variations select { min-height: 44px; }
/* The mini-cart drawer is 480 px wide by default: never wider than the screen. */
.wc-block-components-drawer.wc-block-mini-cart__drawer { width: min(480px, 100vw) !important; max-width: 100vw !important; }

/* Links on the forest footer: gold hover/focus would be ~1.8:1, so stay light (WCAG 1.4.3 / 1.4.11) */
.has-forest-background-color a:hover,
.has-forest-background-color a:focus-visible { color: var(--wp--preset--color--white); }
.has-forest-background-color :where(a, button):focus-visible { outline-color: var(--wp--preset--color--white); }
@media (prefers-reduced-motion: reduce) { .wl-sticky-atc { transition: none; } }

/* ===== Design polish, options 1–11 picked by Gino 2026-10-29 (docs/qa/polish/POLISH-OPTIONS.md) ===== */
/* ── P1 Type: Fraunces 600 for headings + a fluid scale ─────────────────────────────── */
@font-face {
	font-family: "Fraunces";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2");
}
:where(h1, h2, h3, h4, .wp-block-post-title, .wc-block-components-product-name) {
	font-family: "Fraunces", Georgia, serif;
	font-weight: 600;
	letter-spacing: -0.01em;
	font-optical-sizing: auto;
}
h1, .wp-block-post-title { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.25rem); line-height: 1.15; }
h3 { font-size: clamp(1.2rem, 1.1rem + 0.6vw, 1.45rem); line-height: 1.25; }
body { line-height: 1.65; }
.wp-block-post-content > p, .wp-block-post-content > ul { max-width: 68ch; }

/* ── P2 Spacing: one vertical rhythm for sections and grids ─────────────────────────── */
main > .wp-block-group:not(.wl-uses), .wp-block-post-content > .wp-block-group {
	padding-top: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) !important;
	padding-bottom: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) !important;
}
.wp-block-columns { gap: clamp(1.25rem, 0.75rem + 2vw, 2.5rem); }
:where(h2) { margin-bottom: 1.25rem; }
.wc-block-product-template, ul.products { gap: clamp(1rem, 0.5rem + 2vw, 2rem) !important; }

/* ── P3 Buttons: taller, softer, one style for theme + WooCommerce buttons ──────────── */
:where(.wp-element-button, .wp-block-button__link, .single_add_to_cart_button, .wc-block-components-button, .wc-block-cart__submit-button, .wp-block-button .wp-block-button__link) {
	min-height: 48px;
	border-radius: 999px !important;
	padding-inline: 1.6rem !important;
	letter-spacing: 0.02em;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
:where(.wp-element-button, .single_add_to_cart_button, .wc-block-components-button:not(.is-link)):hover {
	box-shadow: 0 4px 14px rgb(35 64 47 / 0.22);
}
.wp-block-button.is-style-outline .wp-block-button__link { border-width: 1.5px; }

/* ── P4 Product cards: paper card, soft border, gold price, full-width button ───────── */
:where(.wc-block-product, ul.products li.product, .wc-block-grid__product) {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--paper);
	border-radius: 12px;
	padding: 0.75rem 0.75rem 1rem;
	box-shadow: 0 1px 2px rgb(30 28 24 / 0.04);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
:where(.wc-block-product, ul.products li.product):hover { box-shadow: 0 8px 24px rgb(30 28 24 / 0.08); transform: translateY(-2px); }
:where(.wc-block-product, ul.products li.product) img { border-radius: 8px; background: var(--wp--preset--color--paper); }
:where(.wc-block-product .wp-block-post-title, ul.products li.product .woocommerce-loop-product__title) {
	font-size: 1rem !important;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
}
:where(.wc-block-product .wc-block-components-product-price, ul.products li.product .price) {
	color: var(--wp--preset--color--gold-text) !important;
	font-weight: 600;
}
:where(.wc-block-product .wp-block-button, .wc-block-product .wc-block-components-product-button) { width: 100%; }
:where(.wc-block-product .wp-block-button__link, .wc-block-product .wc-block-components-product-button__button) { width: 100%; justify-content: center; }
@media (prefers-reduced-motion: reduce) { :where(.wc-block-product, ul.products li.product) { transition: none; } :where(.wc-block-product, ul.products li.product):hover { transform: none; } }

/* ── P5 Hero: forest gradient for contrast, eyebrow with gold rule, tighter on phones ─ */
.home .wp-block-cover { min-height: clamp(420px, 62vh, 600px) !important; }
.home .wp-block-cover__background {
	background: linear-gradient(90deg, rgb(23 42 31 / 0.82) 0%, rgb(23 42 31 / 0.55) 45%, rgb(23 42 31 / 0.15) 100%) !important;
	opacity: 1 !important;
}
.home .wp-block-cover__inner-container { max-width: 1200px; }
.home .wp-block-cover__inner-container > * { max-width: 34rem; }
.home .wl-eyebrow {
	margin: 0 0 0.9rem;
	padding-bottom: 0.6rem;
	border-bottom: 2px solid var(--wp--preset--color--gold);
	width: max-content;
	max-width: 100%;
	font: 600 0.8rem/1.2 system-ui, sans-serif;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #F3E3BD;
}
@media (max-width: 781px) {
	.home .wp-block-cover__background { background: linear-gradient(180deg, rgb(23 42 31 / 0.35) 0%, rgb(23 42 31 / 0.85) 70%) !important; }
	.home .wp-block-cover { align-items: flex-end; }
	.home .wp-block-buttons { flex-wrap: nowrap; gap: 0.6rem; }
	.home .wp-block-buttons .wp-block-button__link { padding-inline: 1rem !important; font-size: 0.95rem; }
}

/* ── P6 Header + footer: gold hairline, calmer nav, footer mark + small-caps headings ─ */
header .wp-block-group.has-base-background-color {
	border-bottom: 0 !important;
	box-shadow: inset 0 -1px 0 var(--wp--preset--color--paper);
	background-image: linear-gradient(90deg, transparent, var(--wp--preset--color--gold), transparent);
	background-size: 100% 1px;
	background-repeat: no-repeat;
	background-position: bottom;
}
.wl-header-row .wp-block-navigation-item__content { letter-spacing: 0.03em; font-weight: 500; }
.wl-header-row .wp-block-site-logo img { width: 84px !important; height: auto; }
footer .has-forest-background-color { border-top: 3px solid var(--wp--preset--color--gold); }
footer .has-forest-background-color h2.has-medium-font-size {
	font: 600 0.8rem/1.2 system-ui, sans-serif !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #E9D9B4 !important;
}
footer .has-forest-background-color h2.has-large-font-size::before {
	content: "";
	display: block;
	width: 56px;
	height: 48px;
	margin-bottom: 0.5rem;
	background: url("../images/wild-lore-mark-480.webp") left top / contain no-repeat;
}

/* ── P7 Trust row by Add to cart: icons, gold edge, scannable lines ─────────────────── */
.wl-trust {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--paper);
	border-left: 3px solid var(--wp--preset--color--gold);
	border-radius: 8px;
	gap: 0.65rem;
}
.wl-trust p { position: relative; padding-left: 1.9rem; }
.wl-trust p::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.1em;
	width: 1.25rem;
	height: 1.25rem;
	background-color: var(--wp--preset--color--forest);
	-webkit-mask: var(--wl-icon) center / contain no-repeat;
	mask: var(--wl-icon) center / contain no-repeat;
}
.wl-trust p:nth-child(1) { --wl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h11v9H3zM14 10h4l3 3v3h-7z'/%3E%3Ccircle cx='7' cy='17.5' r='1.8'/%3E%3Ccircle cx='17' cy='17.5' r='1.8'/%3E%3C/svg%3E"); }
.wl-trust p:nth-child(2) { --wl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 1 0 3-6.2'/%3E%3Cpath d='M4 4v4h4'/%3E%3C/svg%3E"); }
.wl-trust p:nth-child(3) { --wl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }

/* ── P8 Botanical accent: leaf + gold rule under centred section headings ───────────── */
h2.has-text-align-center::after {
	content: "";
	display: block;
	width: 120px;
	height: 18px;
	margin: 0.75rem auto 0;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23B8892E' d='M12 3c4 3 6 6.5 6 10a6 6 0 0 1-12 0c0-3.5 2-7 6-10zm0 4v12' /%3E%3C/svg%3E") center / 18px 18px no-repeat,
		linear-gradient(var(--wp--preset--color--gold), var(--wp--preset--color--gold)) left center / 44px 1px no-repeat,
		linear-gradient(var(--wp--preset--color--gold), var(--wp--preset--color--gold)) right center / 44px 1px no-repeat;
}

/* ── P9–P11 Brand Store adoptions on the home page (patterns/home.php) ── */
.wl-best { padding: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) 1rem 1rem; }
.wl-best ul.wc-block-grid__products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
@media (min-width: 782px) { .wl-best ul.wc-block-grid__products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wl-best .wc-block-grid__product { max-width: none !important; flex: none !important; text-align: center; }
.wl-best .wc-block-grid__product-image img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; }

.wl-features { padding: clamp(2rem, 1rem + 4vw, 4rem) 1rem; }
.wl-features .wp-block-media-text { margin-bottom: clamp(1.5rem, 1rem + 2vw, 3rem); }
.wl-features .wp-block-media-text__media img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; }
.wl-features .wp-block-media-text__content p { max-width: 34rem; }

.wl-uses { background: var(--wp--preset--color--forest); padding: 1.25rem 1rem; }
.wl-uses ul { max-width: 1200px; margin: 0 auto; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 782px) { .wl-uses ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wl-uses a { display: flex; flex-direction: column; gap: 0.2rem; min-height: 44px; padding: 0.85rem 1rem; border: 1px solid rgb(255 255 255 / 0.25); border-radius: 8px; color: var(--wp--preset--color--white); text-decoration: none; }
.wl-uses a:hover, .wl-uses a:focus-visible { border-color: var(--wp--preset--color--gold); color: var(--wp--preset--color--white); }
.wl-uses strong { font-size: 1rem; }
.wl-uses span { font-size: 0.85rem; color: #E9D9B4; }

/* Checkout: ground-only destinations note above the shipping options */
/* SDS link on product pages: a standalone link, so give it a full 44 px tap target. */
.wl-sds a { display: inline-flex; align-items: center; min-height: 44px; }
.wl-ship-note { margin: 0 0 0.75rem; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--contrast); }

/* ── P12 Black header + footer (Gino 2026-10-31). CSS-only so the template parts and the
   P6 selectors above stay as they are. Contrast on #000: cream 19.6:1, gold #B8892E 6.7:1 (AA). ── */
header.wp-block-template-part > .wp-block-group,
footer.wp-block-template-part > .wp-block-group { --wl-hf-bg: #000; --wl-hf-text: var(--wp--preset--color--base); background-color: var(--wl-hf-bg) !important; }
header.wp-block-template-part > .wp-block-group { color: var(--wl-hf-text); box-shadow: none; }
header.wp-block-template-part .wl-header-row :where(a, button, .wp-block-navigation-item__content) { color: var(--wl-hf-text); }
header.wp-block-template-part .wl-header-row a:hover,
header.wp-block-template-part .wl-header-row a:focus-visible { color: var(--wp--preset--color--gold); }
header.wp-block-template-part :where(a, button):focus-visible { outline-color: var(--wp--preset--color--gold); }
/* Desktop "Shop" dropdown and the phone menu overlay: core paints them white unless the nav has a background. */
header.wp-block-template-part .wp-block-navigation .wp-block-navigation__submenu-container {
	background-color: var(--wl-hf-bg) !important;
	color: var(--wl-hf-text) !important;
	border-color: var(--wp--preset--color--gold) !important;
}
header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wl-hf-bg) !important;
	color: var(--wl-hf-text) !important;
}
header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open :where(a, button) { color: var(--wl-hf-text); }
/* Search: cream field, gold button with an ink icon (5.4:1). */
header.wp-block-template-part .wc-block-product-search__field { background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); border-color: var(--wp--preset--color--base); }
header.wp-block-template-part .wc-block-product-search__button { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--contrast); border-color: var(--wp--preset--color--gold); }
header.wp-block-template-part .wc-block-product-search__button svg { fill: currentColor; }
/* The mini-cart drawer lives inside the header: keep it on its own light colors. */
header.wp-block-template-part .wc-block-mini-cart__drawer { color: var(--wp--preset--color--contrast); }
header.wp-block-template-part .wc-block-mini-cart__drawer :where(a, button):not(.wp-element-button):not(.wc-block-components-button) { color: inherit; }
/* Footer: same black; the forest-footer link rules above (white hover/focus) still apply. */
footer.wp-block-template-part > .wp-block-group { color: var(--wl-hf-text); }
