/*
 * Oak Hollow child theme styles.
 * Loaded after qoe/style.css and qoe/woocommerce.css.
 * Tokens come from theme.json (--wp--preset--*). Local shorthands below.
 */

:root {
	--oh-bark: var(--wp--preset--color--bark);
	--oh-muted: var(--wp--preset--color--bark-muted);
	--oh-ash: var(--wp--preset--color--ash);
	--oh-kraft: var(--wp--preset--color--kraft);
	--oh-line: var(--wp--preset--color--quinary);
	--oh-radius: 2px;
}

/* ---------- Type ---------- */

body {
	font-stretch: 100%;
	text-rendering: optimizeLegibility;
}

h1, h2, h3,
.wp-block-post-title,
.wp-block-query-title {
	font-stretch: 116%;
	text-wrap: balance;
}

h4, h5, h6 {
	font-stretch: 100%;
}

p {
	text-wrap: pretty;
}

/* ---------- Links and focus ---------- */

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	text-decoration-color: var(--oh-kraft);
	transition: text-decoration-color 0.15s ease;
}

a:hover {
	text-decoration-color: currentColor;
}

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

.oh-footer :focus-visible,
.oh-announce :focus-visible {
	outline-color: var(--oh-kraft);
}

/* qoe gives every image block vertical margins; reset where the layout owns spacing. */
.oh-slice.wp-block-image,
.oh-frame.wp-block-image,
.oh-gifts-media .wp-block-image,
.oh-cards.wp-block-image {
	margin-block: 0;
}

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

.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background-color: var(--oh-bark);
	color: #fff;
}

/* qoe's generic button styles (classic Woo markup, forms). */
.button,
button,
input[type="submit"] {
	border-radius: var(--oh-radius);
}

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

.oh-announce p {
	margin: 0;
	letter-spacing: 0.02em;
}

.oh-header {
	border-bottom: 1px solid var(--oh-line);
}

.oh-logo img {
	display: block;
}

.oh-nav a {
	text-decoration: none;
}

.oh-nav .wp-block-navigation-item__content:hover {
	text-decoration: underline;
	text-decoration-color: var(--oh-kraft);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.45em;
}

.oh-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--medium) clamp(1.25rem, 4vw, 2.5rem);
}

.oh-nav .is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--x-large);
	font-stretch: 116%;
	font-weight: 600;
	letter-spacing: -0.02em;
	padding-block: 0.15em;
}

.oh-mini-cart .wc-block-mini-cart__button {
	color: var(--oh-bark);
	padding: 0.25rem;
}

.oh-mini-cart .wc-block-mini-cart__badge {
	background: var(--oh-bark) !important;
	color: #fff !important;
	border-color: #fff !important;
}

/* ---------- Home: banner (bar strip with the hero copy on top) ---------- */

.oh-banner {
	position: relative;
	isolation: isolate;
	--oh-banner-h: clamp(540px, 68vh, 700px);
}

/* The strip: bars edge to edge, no gaps, full banner height. */
.oh-loaf {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 0;
	height: var(--oh-banner-h);
	overflow: hidden;
	background: var(--oh-bark);
}

.oh-slice.wp-block-image {
	position: relative;
	min-width: 0;
	height: 100%;
	margin: 0;
}

.oh-slice a {
	display: block;
	height: 100%;
	background: var(--oh-ash);
}

.oh-slice img {
	display: block;
	/* 1px overlap hides sub-pixel seams between bars. */
	width: calc(100% + 1px);
	max-width: none;
	height: 100% !important;
	object-fit: cover;
	object-position: 50% 60%;
}

/* Bar names: shown on hover or keyboard focus, top of each bar (the copy sits at the bottom). */
.oh-slice .wp-element-caption {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	right: 0.75rem;
	z-index: 3;
	width: max-content;
	max-width: calc(100% - 1.5rem);
	margin: 0;
	padding: 0.3em 0.6em;
	background: rgba(255, 255, 255, 0.94);
	color: var(--oh-bark);
	border-radius: var(--oh-radius);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
}

.oh-slice:hover .wp-element-caption,
.oh-slice:focus-within .wp-element-caption {
	opacity: 1;
	transform: none;
}

.oh-slice a:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

/* Hero copy laid over the strip. Clicks pass through to the bars except on links. */
.oh-banner > .oh-hero {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding-top: 0;
	padding-bottom: var(--wp--preset--spacing--x-large);
	pointer-events: none;
	background: linear-gradient(
		to top,
		rgba(24, 20, 17, 0.86) 0%,
		rgba(24, 20, 17, 0.62) 28%,
		rgba(24, 20, 17, 0.22) 55%,
		rgba(24, 20, 17, 0) 72%
	);
}

.oh-banner > .oh-hero > .wp-block-columns {
	width: 100%;
	margin-bottom: 0;
}

.oh-banner > .oh-hero a {
	pointer-events: auto;
}

.oh-hero-title {
	margin: 0;
	color: #fff;
	font-size: clamp(2.5rem, 1.2rem + 4vw, 4.6rem) !important;
	hyphens: manual;
	font-stretch: 125%;
	font-weight: 640;
	letter-spacing: -0.045em;
	line-height: 0.98;
}

.oh-hero-lede {
	margin-top: 0;
	color: rgba(255, 255, 255, 0.9);
	max-width: 34ch;
	line-height: 1.5;
}

/* Buttons on the dark fade: solid white, and white outline. */
.oh-hero .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	background: #fff;
	border-color: #fff;
	color: var(--oh-bark);
}

.oh-hero .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
	background: var(--oh-ash);
	border-color: var(--oh-ash);
}

.oh-hero .wp-block-button.is-style-outline > .wp-block-button__link {
	border-color: #fff;
	color: #fff;
}

.oh-hero .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: #fff;
	color: var(--oh-bark);
}

.oh-hero :focus-visible {
	outline-color: #fff;
}

/* The one page-load moment: bars are set down left to right, then the copy appears. */
@media (prefers-reduced-motion: no-preference) {
	.oh-slice {
		animation: oh-set 700ms cubic-bezier(0.22, 0.8, 0.2, 1) both;
	}

	.oh-slice:nth-child(2) { animation-delay: 60ms; }
	.oh-slice:nth-child(3) { animation-delay: 120ms; }
	.oh-slice:nth-child(4) { animation-delay: 180ms; }
	.oh-slice:nth-child(5) { animation-delay: 240ms; }
	.oh-slice:nth-child(6) { animation-delay: 300ms; }
	.oh-slice:nth-child(7) { animation-delay: 360ms; }

	.oh-banner > .oh-hero {
		animation: oh-fade 600ms ease 550ms both;
	}

	@keyframes oh-set {
		from { clip-path: inset(0 0 100% 0); }
		to { clip-path: inset(0 0 0 0); }
	}

	@keyframes oh-fade {
		from { opacity: 0; }
		to { opacity: 1; }
	}
}

/* Narrower screens: fewer, wider bars; stronger fade behind the taller copy block. */
@media (max-width: 1024px) {
	.oh-loaf {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.oh-slice:nth-child(n+6) {
		display: none;
	}
}

/* Phones: bars on top, copy on a dark band below them (the bars would sit behind the copy otherwise). */
@media (max-width: 781px) {
	.oh-banner {
		display: flex;
		flex-direction: column;
		background: var(--oh-bark);
		--oh-banner-h: clamp(300px, 52vh, 460px);
	}

	.oh-loaf {
		order: -1;
		position: relative;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.oh-slice:nth-child(n+4) {
		display: none;
	}

	.oh-loaf::after {
		content: "";
		position: absolute;
		inset: auto 0 0 0;
		height: 40%;
		background: linear-gradient(to top, var(--oh-bark), rgba(43, 38, 34, 0));
		pointer-events: none;
	}

	.oh-banner > .oh-hero {
		position: static;
		margin-top: -4.5rem !important;
		padding-top: 0;
		padding-bottom: var(--wp--preset--spacing--large);
		background: none;
	}
}

/* ---------- Home: sections ---------- */

.oh-section-title {
	margin: 0 0 var(--wp--preset--spacing--medium);
	font-size: var(--wp--preset--font-size--x-large);
}

.oh-section-head {
	margin-bottom: var(--wp--preset--spacing--medium);
}

.oh-section-head .oh-section-title {
	margin: 0;
}

.oh-more {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

.oh-frame a {
	display: block;
}

.oh-frame img {
	display: block;
	width: 100%;
	object-fit: cover;
	border-radius: var(--oh-radius);
	background: var(--oh-ash);
}

.oh-frame--portrait img {
	aspect-ratio: 4 / 5;
}

.oh-frame--wide img {
	aspect-ratio: 16 / 10;
}

/* "What we make": the lead image fills the column so both sides end level. */
.oh-kinds h3 {
	margin: 1rem 0 0.35rem;
}

.oh-kinds h3 a {
	text-decoration: none;
}

.oh-kinds h3 a:hover {
	text-decoration: underline;
	text-decoration-color: var(--oh-kraft);
}

.oh-kinds p {
	margin: 0;
	color: var(--oh-muted);
	max-width: 44ch;
}

.oh-kind-stack {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--large);
}

.oh-kind-stack > .oh-kind {
	margin: 0;
}

@media (min-width: 782px) {
	.oh-kind--lead {
		display: flex;
		flex-direction: column;
	}

	.oh-kind--lead > .oh-frame {
		flex: 1 1 auto;
		display: flex;
		min-height: 0;
	}

	.oh-kind--lead > .oh-frame a {
		flex: 1 1 auto;
		display: flex;
	}

	.oh-kind--lead > .oh-frame img {
		aspect-ratio: auto;
		height: 100%;
		min-height: 100%;
	}
}

/* Corporate and gift orders band: photo runs to the left edge. */
.oh-gifts.oh-gifts {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

.oh-gifts > .wp-block-columns {
	align-items: stretch !important;
	margin: 0 !important;
	max-width: none !important;
}

.oh-gifts-media {
	align-self: stretch !important;
}

.oh-gifts-media .wp-block-image,
.oh-gifts-media .wp-block-image img {
	height: 100%;
}

.oh-gifts-media .wp-block-image img {
	display: block;
	width: 100%;
	min-height: 420px;
	object-fit: cover;
}

.oh-gifts-copy {
	padding: var(--wp--preset--spacing--xx-large) clamp(1.25rem, 6vw, 6rem);
}

.oh-gifts-copy > * {
	max-width: 30rem;
}

.oh-gifts-copy h2 {
	margin-top: 0;
}

/* ---------- Product grid (home, shop, related) ---------- */

.oh-grid .wc-block-product-template {
	column-gap: clamp(1rem, 2vw, 1.75rem) !important;
	row-gap: var(--wp--preset--spacing--large) !important;
}

/* Woo's responsive grid assumes a 1.25em gap; set columns directly. */
.oh-grid .wc-block-product-template__responsive.columns-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
	.oh-grid .wc-block-product-template__responsive.columns-4 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.oh-grid .wc-block-product-template__responsive.columns-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.oh-grid .wc-block-product {
	display: flex;
	flex-direction: column;
	text-align: left;
	margin: 0;
}

.oh-grid .oh-card-image {
	margin: 0 !important;
}

.oh-grid .oh-card-image img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: var(--oh-radius);
	background: var(--oh-ash);
}

.oh-card-meta {
	margin-top: 0.85rem !important;
	align-items: baseline !important;
}

.oh-grid .oh-card-title {
	margin: 0;
	font-stretch: 100%;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.35;
	text-align: left;
}

.oh-grid .oh-card-title a {
	text-decoration: none;
}

.oh-grid .oh-card-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--oh-kraft);
}

.oh-grid .oh-card-price {
	margin: 0 !important;
	flex-shrink: 0;
	white-space: nowrap;
	color: var(--oh-muted);
	text-align: right;
}

.oh-grid .oh-card-price ins {
	text-decoration: none;
	color: var(--oh-bark);
}

.oh-grid .oh-card-button {
	margin-top: auto !important;
	padding-top: 0.9rem;
	text-align: left;
}

.oh-grid .oh-card-button .wp-block-button__link {
	width: 100%;
	background: transparent;
	color: var(--oh-bark);
	border: 1px solid var(--oh-bark);
	border-radius: var(--oh-radius);
	padding: 0.8em 1em;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

.oh-grid .oh-card-button .wp-block-button__link:hover,
.oh-grid .oh-card-button .wp-block-button__link.added {
	background: var(--oh-bark);
	color: #fff;
}

.oh-grid .oh-card-button .added_to_cart {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: var(--wp--preset--font-size--small);
}

.wc-block-components-product-sale-badge {
	background: var(--oh-bark) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: var(--oh-radius) !important;
	text-transform: none !important;
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 500 !important;
	letter-spacing: 0.02em;
	padding: 0.35em 0.65em !important;
	margin: 0.6rem !important;
}

/* ---------- Shop and category pages ---------- */

.oh-shop-title {
	margin: 0;
	font-stretch: 125%;
	letter-spacing: -0.045em;
	line-height: 0.95;
}

.oh-shop-desc {
	margin-top: 0.75rem;
	color: var(--oh-muted);
	max-width: 60ch;
}

.oh-chips {
	margin-top: var(--wp--preset--spacing--medium) !important;
}

.oh-chip {
	margin: 0;
}

.oh-chip a {
	display: inline-block;
	padding: 0.55em 1.05em;
	border: 1px solid var(--oh-line);
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.oh-chip a:hover {
	border-color: var(--oh-bark);
}

/* Current filter, from WordPress body classes. */
body.woocommerce-shop .oh-chip--all a,
body.term-tallow .oh-chip--tallow a,
body.term-classic .oh-chip--classic a,
body.term-tools .oh-chip--tools a {
	background: var(--oh-bark);
	border-color: var(--oh-bark);
	color: #fff;
}

.oh-shop-bar {
	margin-top: var(--wp--preset--spacing--large) !important;
	margin-bottom: var(--wp--preset--spacing--medium) !important;
	padding-block: 0.75rem;
	border-top: 1px solid var(--oh-line);
	font-size: var(--wp--preset--font-size--small);
	color: var(--oh-muted);
}

.oh-shop-bar p,
.oh-shop-bar form {
	margin: 0;
}

.oh-shop-bar .orderby {
	padding: 0.5em 2.25em 0.5em 0.75em !important;
	font-size: var(--wp--preset--font-size--small) !important;
	border: 1px solid var(--oh-line) !important;
	border-radius: var(--oh-radius) !important;
	color: var(--oh-bark);
	background-color: #fff;
}

.oh-pagination {
	margin-top: var(--wp--preset--spacing--x-large) !important;
	gap: 0.25rem 1rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

.oh-pagination .page-numbers {
	display: inline-block;
	min-width: 2.25em;
	padding: 0.4em 0.6em;
	text-align: center;
	text-decoration: none;
	border-radius: var(--oh-radius);
}

.oh-pagination .page-numbers.current {
	background: var(--oh-bark);
	color: #fff;
}

/* ---------- Single product ---------- */

.oh-product .wc-block-breadcrumbs,
.oh-product .woocommerce-breadcrumb {
	color: var(--oh-muted);
}

.oh-product .woocommerce-breadcrumb a {
	color: var(--oh-muted);
}

.oh-product-cats {
	margin: 0;
}

.oh-product-cats a {
	text-decoration: none;
}

.oh-product-title {
	margin-top: 0.35rem !important;
	font-stretch: 120%;
	letter-spacing: -0.035em;
	line-height: 1;
}

.oh-product .oh-product-price,
.oh-product .oh-product-price .amount {
	color: var(--oh-bark);
	font-weight: 500;
}

.oh-product-cart form.cart {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: stretch;
	margin: var(--wp--preset--spacing--small) 0 !important;
}

.oh-product-cart .stock {
	width: 100%;
	margin: 0 0 0.25rem;
	font-size: var(--wp--preset--font-size--small);
	color: var(--oh-muted) !important;
}

.woocommerce .oh-product-cart .quantity .qty,
.oh-product-cart .quantity .qty {
	width: 4.75rem;
	height: 100%;
	min-height: 3.25rem;
	border: 1px solid var(--oh-line);
	border-radius: var(--oh-radius);
	text-align: center;
	font-size: var(--wp--preset--font-size--base);
}

.woocommerce div.product .oh-product-cart form.cart .button,
.oh-product-cart .single_add_to_cart_button {
	flex: 1 1 12rem;
	min-height: 3.25rem;
	margin: 0 !important;
	background: var(--oh-bark) !important;
	color: #fff !important;
	border: 1px solid var(--oh-bark);
	border-radius: var(--oh-radius);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 500;
	letter-spacing: 0.01em;
}

.woocommerce div.product .oh-product-cart form.cart .button:hover,
.oh-product-cart .single_add_to_cart_button:hover {
	background: #4A423C !important;
}

.oh-product-cart table.variations {
	margin-bottom: 0.5rem;
}

.woocommerce div.product .oh-product-cart form.cart .variations select {
	border: 1px solid var(--oh-line);
	border-radius: var(--oh-radius);
	min-width: 14rem;
}

.oh-product-details {
	margin-top: var(--wp--preset--spacing--small) !important;
}

.oh-product-details .woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin: 0 0 1rem !important;
	padding: 0 !important;
	border-bottom: 1px solid var(--oh-line) !important;
}

.woocommerce div.product .oh-product-details .woocommerce-tabs ul.tabs li {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

.woocommerce div.product .oh-product-details .woocommerce-tabs ul.tabs li a {
	display: inline-block;
	padding: 0.6rem 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--oh-muted);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.woocommerce div.product .oh-product-details .woocommerce-tabs ul.tabs li.active a {
	color: var(--oh-bark);
	border-bottom-color: var(--oh-bark);
}

.oh-product-details .woocommerce-Tabs-panel {
	font-size: var(--wp--preset--font-size--base);
}

.oh-product-meta {
	margin-top: var(--wp--preset--spacing--small);
	padding-top: var(--wp--preset--spacing--small);
	border-top: 1px solid var(--oh-line);
	font-size: var(--wp--preset--font-size--small);
	color: var(--oh-muted);
}

.oh-product-meta a {
	color: var(--oh-muted);
}

.woocommerce div.product .oh-product-gallery div.images,
.oh-product-gallery .woocommerce-product-gallery {
	width: 100% !important;
	float: none !important;
	margin-bottom: 0;
}

.oh-product-gallery .woocommerce-product-gallery__image img {
	width: 100%;
}

.oh-product-cart .quantity {
	margin: 0 !important;
}

.oh-product-gallery .woocommerce-product-gallery__image img,
.oh-product-gallery .flex-control-thumbs img {
	border-radius: var(--oh-radius);
}

.oh-related {
	margin-top: var(--wp--preset--spacing--xx-large) !important;
	padding-top: var(--wp--preset--spacing--large);
	border-top: 1px solid var(--oh-line);
}

@media (min-width: 782px) {
	.oh-product-summary {
		position: sticky;
		top: var(--wp--preset--spacing--medium);
		align-self: flex-start;
	}
}

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

.oh-footer {
	font-size: var(--wp--preset--font-size--small);
}

.oh-footer-logo img {
	filter: invert(1);
	display: block;
}

.oh-footer-about {
	margin-top: var(--wp--preset--spacing--small);
	color: rgba(255, 255, 255, 0.78);
	max-width: 34ch;
	font-size: var(--wp--preset--font-size--base);
}

.oh-footer .oh-footer-heading {
	margin: 0 0 0.85rem;
	color: var(--oh-kraft);
	font-stretch: 100%;
	font-weight: 500;
	letter-spacing: 0.01em;
}

.oh-footer-list {
	margin: 0;
	line-height: 2;
}

.oh-footer-list a {
	text-decoration: none;
	overflow-wrap: anywhere;
}

.oh-footer-list a:hover {
	text-decoration: underline;
}

.oh-footer-note {
	margin-top: 1rem;
	color: rgba(255, 255, 255, 0.68);
	max-width: 36ch;
}

.oh-footer-base {
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.68);
}

.oh-footer-base p {
	margin: 0;
}

/* ---------- Pages (cart, checkout, account, contact) ---------- */

.wp-block-post-title {
	letter-spacing: -0.035em;
}

.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	background: var(--oh-bark);
	color: #fff;
	border-radius: var(--oh-radius);
}

/* Narrow cards: name above price. */
@media (max-width: 720px) {
	.oh-card-meta {
		flex-direction: column;
		align-items: flex-start !important;
		gap: 0.15rem !important;
	}

	.oh-grid .oh-card-price {
		text-align: left;
		white-space: normal;
	}
}
