/*
Theme Name: Old Henly - Ollie Child
Description: A child theme of ollie, scaffolded by Studio Code.
Template: ollie
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.2.8
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: old-henly-child
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* Linked cover cards - gently zoom the background image on hover. */
.wp-block-cover.is-linked {
	overflow: hidden;
}

.wp-block-cover.is-linked .wp-block-cover__image-background {
	transform: scale( 1 );
	transition: transform 0.5s ease;
	will-change: transform;
}

.wp-block-cover.is-linked:hover .wp-block-cover__image-background,
.wp-block-cover.is-linked:focus-within .wp-block-cover__image-background {
	transform: scale( 1.05 );
}

@media ( prefers-reduced-motion: reduce ) {
	.wp-block-cover.is-linked .wp-block-cover__image-background {
		transition: none;
	}
	.wp-block-cover.is-linked:hover .wp-block-cover__image-background,
	.wp-block-cover.is-linked:focus-within .wp-block-cover__image-background {
		transform: none;
	}
}

/* ============================================
   Product page tabs - match the clean "minimal"
   look shown in the editor instead of the filled
   pill-button treatment on the front end.
   body.woocommerce prefix keeps specificity above
   the parent theme's woocommerce.css, whatever
   order the two stylesheets load in.
   ============================================ */
body.woocommerce div.product .woocommerce-tabs ul.tabs,
body.woocommerce div.product .woocommerce-tabs ul.tabs::before,
body.woocommerce div.product .woocommerce-tabs ul.tabs li,
body.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
body.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
	border: none !important;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs {
	border-bottom: 1px solid color-mix( in srgb, var( --wp--preset--color--main ) 15%, transparent ) !important;
	margin-bottom: var(--wp--preset--spacing--medium);
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li {
	margin: 0 2rem 0 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border-radius: 0 !important;
	opacity: 1 !important;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	color: var( --wp--preset--color--main ) !important;
	font-weight: 500;
	font-size: var( --wp--preset--font-size--base );
	opacity: 0.55;
	padding: 0.6rem 0;
	transition: opacity 0.2s ease;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover,
body.woocommerce div.product .woocommerce-tabs ul.tabs li a:focus-visible {
	opacity: 1;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
	background: transparent !important;
	color: var( --wp--preset--color--main ) !important;
	border-radius: 0 !important;
	box-shadow: inset 0 -2px 0 var( --wp--preset--color--main );
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
	color: var( --wp--preset--color--main ) !important;
	opacity: 1;
}

/* Additional Information table - drop the parent theme's white
   background so the table blends with the tab panel. */
body.woocommerce table.woocommerce-product-attributes {
	background: transparent !important;
}

body.woocommerce table.woocommerce-product-attributes th,
body.woocommerce table.woocommerce-product-attributes td {
	background: transparent !important;
}

/* Attributes table values - drop the classic WooCommerce italic. */
body.woocommerce table.shop_attributes td,
body.woocommerce table.shop_attributes td p,
body.woocommerce table.shop_attributes td p a {
	font-style: normal !important;
}

/* Product gallery thumbnails - hide the scroll bar while
   keeping the swipe / scroll behaviour. */
.wc-block-product-gallery-thumbnails__scrollable {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.wc-block-product-gallery-thumbnails__scrollable::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

/* ============================================
   Hero video pause/play control
   ============================================ */
.oh-hero-video-toggle {
	position: absolute;
	inset-inline-end: var( --wp--style--root--padding-right, 2rem );
	bottom: var( --wp--preset--spacing--small, 1.25rem );
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 0;
	color: var( --wp--preset--color--base, #efe9dd );
	background-color: color-mix( in srgb, var( --wp--preset--color--main, #292622 ) 78%, transparent );
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.oh-hero-video-toggle:hover {
	background-color: var( --wp--preset--color--main, #292622 );
}

.oh-hero-video-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -4px;
}

.oh-hero-video-toggle svg {
	display: block;
	width: 16px;
	height: 16px;
}

.oh-hero-video-toggle .oh-video-icon-play {
	display: none;
}

.wp-block-cover.is-oh-paused .oh-hero-video-toggle .oh-video-icon-pause {
	display: none;
}

.wp-block-cover.is-oh-paused .oh-hero-video-toggle .oh-video-icon-play {
	display: block;
}

@media ( prefers-reduced-motion: reduce ) {
	.oh-hero-video-toggle {
		transition: none;
	}
}

/* Keep the site header visible as visitors scroll. */
.wp-site-blocks > .site-header {
	position: sticky;
	top: 0;
	z-index: 100;
}

@media (min-width: 601px) {
	.admin-bar .wp-site-blocks > .site-header {
		top: var(--wp-admin--admin-bar--height, 32px);
	}
}

/* Dim homepage video posters on hover or keyboard focus behind the play icon. */
body.home .wp-block-cover.ollie-video-modal-trigger > .wp-block-cover__background {
	background-image: linear-gradient(#16130f, #16130f);
}

body.home .wp-block-cover.ollie-video-modal-trigger:focus-visible > .wp-block-cover__background {
	opacity: 0.28;
}

@media (hover: hover) {
	body.home .wp-block-cover.ollie-video-modal-trigger:hover > .wp-block-cover__background {
		opacity: 0.28;
	}
}

@media (prefers-reduced-motion: no-preference) {
	body.home .wp-block-cover.ollie-video-modal-trigger > .wp-block-cover__background {
		transition: opacity 180ms ease;
	}
}

/* Match the Site Editor's Brand Alt button on the Old Henly Post form. */
.gform_wrapper #gform_submit_button_1 {
	font-family: var(--wp--preset--font-family--special-gothic-condensed);
	font-size: var(--wp--preset--font-size--base);
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.05rem;
	line-height: 1.5;
	text-transform: uppercase;
	transition-property: border-color, box-shadow;
	color: var(--wp--preset--color--base);
	background-color: var(--wp--preset--color--primary);
}

.gform_wrapper #gform_submit_button_1:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--main);
	background-color: var(--wp--preset--color--base);
}

/* Reveal footer link underlines on hover or keyboard focus. */
footer.site-footer a {
	text-decoration-line: none;
}

footer.site-footer a:is(:hover, :focus-visible) {
	text-decoration-line: underline;
}

/* Ollie inserts a style tag before the nav when mobile toggle colors are set. */
.site-header .wp-block-column > style:first-child + .wp-block-navigation {
	margin-block-start: 0;
}

/* Align mega menu text links with their column headings. */
.site-header .wp-block-ollie-mega-menu__menu-container .wp-block-paragraph a {
	padding-inline: 0;
}

/* Keep the mini-cart Cart and Checkout buttons square. */
.wc-block-mini-cart__footer .wp-block-woocommerce-mini-cart-cart-button-block,
.wc-block-mini-cart__footer .wp-block-woocommerce-mini-cart-checkout-button-block {
	border-radius: 0;
}

/* Keep the product specs compact and easy to scan. */
.product-specifications {
	width: 100%;
	border-collapse: collapse;
	border-block: 1px solid var(--wp--preset--color--border-light);
}

.product-specifications th,
.product-specifications td {
	padding-block: 0.65em;
	border-block-end: 1px solid var(--wp--preset--color--border-light);
	text-align: start;
	vertical-align: top;
}

.product-specifications th {
	width: 32%;
	padding-inline: 0 1em;
	font-weight: 600;
}

.product-specifications td {
	padding-inline: 0;
}

.product-specifications tr:last-child > * {
	border-block-end: 0;
}

@media (max-width: 600px) {
	.product-specifications tr {
		display: block;
		padding-block: 0.7em;
		border-block-end: 1px solid var(--wp--preset--color--border-light);
	}

	.product-specifications tr:last-child {
		border-block-end: 0;
	}

	.product-specifications tr > :is(th, td) {
		display: block;
		width: auto;
		padding: 0;
		border: 0;
	}

	.product-specifications td {
		margin-block-start: 0.15em;
	}
}

/* Let full-width Add to Cart buttons fill the available product form space. */
.single-product .wp-block-add-to-cart-with-options .wc-block-components-product-button.wp-block-button__width-100 {
	max-width: none;
}

/* Keep the variable product button visible before a selection is made. */
.single-product .wp-block-add-to-cart-with-options .single_add_to_cart_button.product_type_variable:is(.disabled, :disabled) {
	opacity: 1;
	background-color: color-mix(in srgb, var(--wp--preset--color--primary) 60%, var(--wp--preset--color--secondary)) !important;
}

/* Use Base cream for the cart count over WooCommerce's inline text color. */
.site-header .wc-block-mini-cart__badge {
	color: var(--wp--preset--color--base) !important;
}

/* Keep the homepage video control beside the shopping button. */
.wp-block-buttons:has(> .oh-hero-video-toggle) {
	column-gap: 16px;
}

.wp-block-buttons > .oh-hero-video-toggle {
	position: static;
	align-self: stretch;
	height: auto;
	min-height: 44px;
	width: 51.125px;
	aspect-ratio: 1;
}

/* Center the inline control below the Our Story video heading. */
.oh-story-video-actions {
	display: flex;
	justify-content: center;
	margin-block-start: 16px;
}

/* Keep the sticky story video above the page hit area and below later sections. */
.page-id-158 .entry-content:has(.oh-story-video-actions) {
	isolation: isolate;
}

/* Match the homepage video controls on the Around the Shop covers. */
.home .wp-block-cover.ollie-video-modal-trigger[data-play-icon="always"]::after {
	--play-icon-size: 51.125px;
	border-radius: 0;
	backdrop-filter: none;
	background-color: color-mix(in srgb, var(--wp--preset--color--main, #292622) 78%, transparent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23efe9dd' d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	background-size: 16px;
}

.home .wp-block-cover.ollie-video-modal-trigger[data-play-icon="always"]:is(:hover, :focus-visible)::after {
	background-color: var(--wp--preset--color--main, #292622);
}

.home .wp-block-cover.ollie-video-modal-trigger[data-play-icon="always"]:focus-visible::after {
	outline: 2px solid var(--wp--preset--color--base, #efe9dd);
	outline-offset: -4px;
}

/* Align stock choices, result count, and sorting in the catalog toolbar. */
.wp-block-group:has(> .oh-catalog-controls) {
	display: grid;
	grid-template-columns: calc(50% - 8px) minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px 16px;
}

.oh-catalog-controls {
	display: contents;
}

.oh-stock-filter {
	grid-area: 1 / 1;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 12px;
	color: var(--wp--preset--color--main);
	font-family: var(--wp--preset--font-family--special-gothic-condensed);
	font-weight: 700;
	font-size: 32px;
	text-transform: uppercase;
}

.oh-stock-filter a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
}

.oh-stock-filter a[aria-current],
.oh-stock-filter a:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--main);
}

.oh-stock-filter a[aria-current],
.oh-stock-filter a:is(:hover, :focus-visible) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.wp-block-group:has(> .oh-catalog-controls) > .wp-block-woocommerce-product-results-count {
	grid-area: 1 / 2;
}

.wp-block-group:has(> .oh-catalog-controls) .woocommerce-result-count {
	margin: 0;
	text-align: start;
}

.oh-catalog-controls > .wp-block-woocommerce-catalog-sorting {
	grid-area: 1 / 3;
	justify-self: end;
}

.oh-catalog-controls .woocommerce-ordering {
	margin: 0;
}

@media (max-width: 720px) {
	.wp-block-group:has(> .oh-catalog-controls) {
		grid-template-columns: minmax(0, 1fr);
	}

	.oh-stock-filter {
		gap: 4px 8px;
	}

	.oh-catalog-controls > .wp-block-woocommerce-catalog-sorting {
		grid-area: 3 / 1;
		justify-self: stretch;
	}

	.wp-block-group:has(> .oh-catalog-controls) > .wp-block-woocommerce-product-results-count {
		grid-area: 2 / 1;
	}

	.oh-catalog-controls .woocommerce-ordering select {
		width: 100%;
	}
}

/* Square off the empty product results panel and its search icon tile. */
.wp-block-woocommerce-product-collection-no-results > .wp-block-group,
.wp-block-woocommerce-product-collection-no-results .wp-block-outermost-icon-block .icon-container {
	border-radius: 0 !important;
}

/* Square corners throughout the storefront, including overlays mounted outside the site blocks. */
body.wp-child-theme-old-henly-child,
body.wp-child-theme-old-henly-child :not(#wpadminbar, #wpadminbar *, .wc-block-mini-cart__badge),
body.wp-child-theme-old-henly-child :not(#wpadminbar, #wpadminbar *)::before,
body.wp-child-theme-old-henly-child :not(#wpadminbar, #wpadminbar *)::after {
	border-radius: 0 !important;
}
