/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/****************
* Global Styles *
****************/

/* Style body links with green underline */
:is(.page, .single-post) .inside-article a {
	text-decoration-color: var(--accent);
	text-underline-offset: 3px;
}

/* Local Google Fonts */
@font-face {
	font-display: auto;
	font-family: "Montserrat";
	font-style: normal;
	font-weight: 400;
	src:
		url("/wp-content/themes/generatepress_child/fonts/montserrat-v25-latin-regular-subset.woff2") format("woff2"),
		url("/wp-content/themes/generatepress_child/fonts/montserrat-v25-latin-regular.woff") format("woff");
}

/* Fallback font */
/* Montserrat is close to Verdana which is web safe (except Android) */
@font-face {
	font-family: "Montserrat-Fallback";
	size-adjust: 99.5%;
	src: local("Verdana");
}

/* Horizontal scrollbar fix for full-width blocks */
body {
	overflow-x: hidden;
}

/* Header - Search bar */
.inside-header {
	position: relative;
}
.header-search {
	position: absolute;
	top: 90px;
	left: 0;
}
@media only screen and (max-width: 768px) {
	.header-search {
		top: 0;
		left: 0;
		right: 0;
	}
}
.header-search .wp-block-search__input {
	background-color: white;
	border: 0;
	border-bottom: 1px solid #c8c8c8;
}
.header-search .wp-block-search__input:focus {
	background-color: white;
}

/* Footer - Social media buttons */
.footer-social .wp-block-image {
	margin-right: 22px;
}

/* Footer bar */
footer.site-info {
	border-top: 1px solid #c8c8c8;
}
.inside-site-info {
	padding: 12px;
}

/* Indent bullets, with exceptions for certain Gutenberg blocks */
.site-content :is(ol, ul):not(.wc-block-grid__products, .wp-block-post-template) {
	margin-left: 3em;
}

/* Horizontal List */
.list-horizontal {
	display: flex;
	flex-wrap: wrap;
}
.list-horizontal li {
 	/* flex: 0 0 33.3%; */
	flex: 0 0 50%;
}

/* Blog Sidebar Spacing */
.sidebar aside {
	padding-top: 0 !important;
	padding-bottom: 8px !important;
}

/* Fix category page product image hover overlapping the images */
/* GeneratePress feature, fix adapted from https://generatepress.com/forums/topic/woocommerce-image-hover-on-shop-category-pages/#post-1231831 */
body:not(.single) .products .inside-wc-product-image {
	overflow: hidden;
	display: flex;
	align-items: center;
	margin: auto;
}
body:not(.single) .products .secondary-image {
	object-fit: cover;
	height: 100% !important;
}



/*************
* Navigation *
*************/

/* Desktop Nav */
@media (min-width: 769px) {
	/* Mega Menu */
	/* Adapted from https://docs.generatepress.com/article/building-simple-mega-menu/ */
	.menu > li {
		position: static;
	}
	.menu .sub-menu {
		width: 100%;
		left: 0 !important;
		display: flex;
		flex-wrap: wrap;
	}
	.menu .sub-menu > li {
		width: 25%;
	}

	/* Style dropdown */
	.menu .sub-menu {
		min-height: 124px;
		border: 1px solid rgba(0, 0, 0, 0.15);
		box-shadow: 0 3px 8px rgb(0 0 0 / 18%);
		background-color: #fdfdfd;
		padding: 20px 0 20px 80px;
		transition: opacity 0s !important;
		align-content: flex-start;
		row-gap: 3px;
	}

	/* Add tabbed border around selected parent */
	.menu > li {
		border: 1px solid transparent;
		cursor: default;
	}
	.menu > li:hover,
	.menu > li:focus-within {
		border: 1px solid rgba(0, 0, 0, 0.15);
		box-shadow: 0 6px 6px rgb(0 0 0 / 18%);
	}
	/* Hide box shadow with bottom border */
	.menu > li:hover > a,
	.menu > li:focus-within > a {
		border-bottom: 1px solid #fdfdfd;
		margin-bottom: -1px;
		z-index: 100000;
	}

	/* Remove background color from links */
	.menu .sub-menu > li > a:any-link {
		background-color: transparent !important;
	}
}

/* Mobile Nav */
@media (max-width: 768px) {
	/* Expand toggle button over anchor */
	/* From https://generatepress.com/forums/topic/navigation-dropdown-separate-for-mobile/#post-2179684 */
	.main-navigation.toggled .menu-item-has-children a {
		padding-right: 40px !important;
	}
	.main-navigation.toggled .menu-item-has-children .dropdown-menu-toggle {
		position: absolute;
		inset: 0;
		text-align: right;
	}

	/* Style submenu */
	.main-navigation.toggled .sub-menu.toggled-on {
		margin-bottom: 10px;
		padding-left: 20px;
		border-bottom: none;
	}
}

/* Breadcrumbs are inserted above the article, then it's set to a column so the placement is directly above the article header */
.site-content:has(> .rank-math-breadcrumb) {
	flex-direction: column;
}
.rank-math-breadcrumb p {
	margin-bottom: 10px;
}


/******************
* Utility Classes *
******************/

/* Product description div being injected in functions.php */
.product-description {
	clear: both;
	margin-bottom: 40px;
}


/* Group Block - No padding, useful for eliminated breakings in adjacent groups with background-colors */
.group-nopadding .wp-block-group__inner-container {
	padding: 0;
}
.group-nopadding li {
	margin-left: 17px;
}

/* Remove padding from groups under gallery */
#under-gallery-static-content {
	display: none;
	margin-top: 15px;
}
#under-gallery {
	display: none;
}
#under-gallery .wp-block-group__inner-container {
	padding: 0;
}

/* Group Block - Center content even when stretched wide */
.group-center .wp-block-group__inner-container {
	max-width: 1200px;
	margin: 25px auto;
}
.group-center .wp-block-group__inner-container *:last-child {
	margin-bottom: 0;
}

/* Group Header - Eliminate margins */
.group-header .wp-block-group__inner-container {
	margin-top: 0;
	margin-bottom: 0;
}
.group-header + .wp-block-group .wp-block-group__inner-container {
	margin-top: 0;
}
.wp-block-group:has(+ .group-header) .wp-block-group__inner-container {
	margin-bottom: 0;
}

/* 40px padding */
.pad-40 {
	padding: 40px;
}

/* Image Floats - Remove float and center on mobile */
@media (max-width: 700px) {
	.mobile-nofloat figure {
		float: none !important;
		margin: 0 auto 15px auto !important;
	}
}

/* Media & Text Block - Reduce margins and size, center on mobile.  Meant for icons */
@media (min-width: 601px) {
	.media-text-icon .wp-block-media-text__content {
		padding-left: 30px;
	}
	.media-text-icon figure {
		text-align: right;
	}
}
@media (max-width: 600px) {
	.media-text-icon figure {
		max-width: 60%;
		margin: 0 auto 15px auto !important;
	}
	.media-text-icon {
		text-align: center;
	}
	.media-text-icon + .media-text-icon {
		margin-top: 20px;
	}
	.media-text-icon .wp-block-media-text__content {
		padding: 0;
	}
}

/* Useful specifically on Media & Text blocks that set the image width to 100%, blurring small images */
.reset-image img {
	width: initial;
}


/*******************
* Product Template *
*******************/

/* Hide WooCommerce info tabs on product page, as currently it only shows for user reviews */
.wc-tabs {
	display: none !important;
}

/* Add padding for Mobile */
.single-product article {
	padding: 0 20px;
}

/* Shrink quantity buttons from screen size */
.woobuilder-add-to-cart {
	container-type: inline-size;
}
@container (max-width: 310px) {
	.quantity {
		margin-right: .5em !important;
	}
	.quantity a {
		width: 40px !important;
	}
}

/* Product Variants - Remove pseudo-element for FontAwesome dropdown icon */
.woobuilder-select-wrap::after {
	content: none !important;
}
/* Restore native Select arrow */
.woobuilder-select-wrap select {
	appearance: auto !important;
	-webkit-appearance: auto !important;
	-moz-appearance: auto !important;
}
/* Restore padding - Uses hack to boost specificity to match library */
#main .woobuilder-select-wrap select {
	padding-right: 10px !important;
	margin-right: 0;
}

/* Hide "clear variants" link */
.woobuilder-add-to-cart .reset_variations {
	display: none !important;
}

/* Move Digital Wallet buttons (Google Pay, Apple Wallet) under Add to Cart */
/* Absolute position wallet buttons to allow [Add to Cart] button to move up  */
/*
body:not(.woocommerce-checkout) .woobuilder-add-to-cart form.cart {
	position: relative;
}
body:not(.woocommerce-checkout) #wc-square-digital-wallet {
	position: absolute;
	top: calc(100% + 40px);
	left: 0;
	padding-top: 0 !important;
}
body:not(.woocommerce-checkout) #wc-square-wallet-divider {
	position: absolute;
	top: -32px;
	left: 0;
	right: 0;
	margin: 0 !important;
}
*/
/* Reserve space for absolute elements */
/*body:not(.woocommerce-checkout) .woobuilder-add-to-cart {
	margin-bottom: 115px;
}*/
/* Match button heights */
/*body:not(.woocommerce-checkout) .single_add_to_cart_button {
	min-height: 50px;
}*/

/* Improving tab-focus accessibility of checkout buttons */
/*body:not(.woocommerce-checkout) #main button.single_add_to_cart_button:focus {
	background-color: #dbdbdb !important;
}
body:not(.woocommerce-checkout) #wc-square-google-pay .gpay-card-info-container:focus {
	background-color: #3e3e3e;
}*/

/* Checkout CSS Fix - eProcessingNetwork */
.payment_method_epn_lightweight fieldset {
	min-width: min-content;
}
.payment_method_epn_lightweight img {
	width: 40px;
}


/***********************
* New Product Template *
***********************/

/* Product Template - Pricing styling */
.single-product .price del,
.single-product .woobuilder-price del {
	color: #858a8e;
}
.single-product .price ins,
.single-product .woobuilder-price ins {
	font-size: 1.5em;
}

/* Product Template - Save $XX badge */
.product-percent-off {
	border: 1px solid #1bae4b;
	border-radius: 25px;
	font-weight: bold;
	background-color: #1bae4b;
	color: white;
	padding: 5px 8px;
	margin-left: 10px;
	vertical-align: super;
	white-space: nowrap;
}

/* Product Template - Product badges layout */
.product-badges {
	text-align: center;
	align-items: flex-start !important;
}
.product-badges > figure {
	flex-basis: 150px;
	flex-grow: 1;
	min-width: min-intrinsic;
}

/* Related products - Align buttons on desktop */
@media (min-width: 769px) {
	.products {
		display: flex;
	}
}

/* Related Products margin */
.related.products {
	margin-top: 60px;
}



/*************
* Components *
*************/

/* Cookie Notice */
/* Dismiss button (X), automatically dismissed */
body.cookies-accepted .cookie-notice {
	display: none;
}
.cookie-notice {
	min-width: 270px;
	max-width: 350px;
	position: fixed;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	background-color: white;
	box-shadow: 0 11px 32px -5px rgb(54 61 77 / 60%);
}
@media (min-width: 700px) {
	.cookie-notice {
		bottom: 50px;
	}
}
.cookie-notice p {
	margin-bottom: 0;
	font-size: 16.5px;
	padding: 25px;
	padding-right: 55px;
}
.cookie-notice button {
	background-color: transparent;
	position: absolute;
	top: 0;
	right: 0;
	padding: 0;
	width: 64px;
	height: 64px;
	border: transparent;
}
.cookie-notice button::before {
	background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%3E%3Cpath%20d%3D%22M464%2032H48C21.5%2032%200%2053.5%200%2080v352c0%2026.5%2021.5%2048%2048%2048h416c26.5%200%2048-21.5%2048-48V80c0-26.5-21.5-48-48-48zm0%20394c0%203.3-2.7%206-6%206H54c-3.3%200-6-2.7-6-6V86c0-3.3%202.7-6%206-6h404c3.3%200%206%202.7%206%206v340zM356.5%20194.6L295.1%20256l61.4%2061.4c4.6%204.6%204.6%2012.1%200%2016.8l-22.3%2022.3c-4.6%204.6-12.1%204.6-16.8%200L256%20295.1l-61.4%2061.4c-4.6%204.6-12.1%204.6-16.8%200l-22.3-22.3c-4.6-4.6-4.6-12.1%200-16.8l61.4-61.4-61.4-61.4c-4.6-4.6-4.6-12.1%200-16.8l22.3-22.3c4.6-4.6%2012.1-4.6%2016.8%200l61.4%2061.4%2061.4-61.4c4.6-4.6%2012.1-4.6%2016.8%200l22.3%2022.3c4.7%204.6%204.7%2012.1%200%2016.8z%22%2F%3E%3C%2Fsvg%3E%0A");
	content: "";
	display: block;
	width: 24px;
	height: 24px;
	margin: 20px;
	opacity: 0.5;
	transition: opacity 0.2s ease-in-out;
}
.cookie-notice button:hover::before {
	opacity: 1;
}

/* Age Notice */
/* Yes/No buttons, must be accepted */
body.age-accepted .age-notice {
	display: none;
}
.age-notice {
	min-width: 350px;
	max-width: 400px;
	min-width: 310px;
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 25px;
	background-color: white;
	box-shadow: 0 11px 32px -5px rgb(54 61 77 / 60%);
}
.age-notice > div {
	display: flex;
	justify-content: space-evenly;
}
.age-notice p {
	font-size: 16.5px;
}
.age-notice button {
	background-color: var(--accent);
}
/* Prevent clicks while modal exists */
body.age-gated-product:not(.age-accepted) .site-content {
	pointer-events: none;
	opacity: 30%;
}


/* Author page - Reduce padding on post feed */
.archive.author .wp-block-query li {
	padding-bottom: 0 !important;
}

/* Author box on blog posts */
.author-box {
	border: 1px solid grey;
	margin: 3em 0;
	padding: 1em 1.3em;

	p {
		margin-bottom: 0.9rem;
	}

	@media (width <= 600px) {
		.wp-block-media-text__content {
			margin-top: 1rem;
		}
	}
}


/****************/
/* Review Cards */
/****************/

/* Containing Row (includes multiple reviews) */
.review-row {
	gap: 20px;
}
.review-row .review {
	flex-grow: 1;
	flex-basis: 300px;
}

/* Container */
.review {
	container-name: review;
	container-type: inline-size;
	width: 100%;
	min-width: 270px;
	max-width: 450px;
	position: relative;
	margin-top: 120px !important;
	background-color: #d3e1d6;
	color: black;
	border-radius: 70px;
}

/* Quotation Marks */
.review::before {
	content: "\201c";
	font-family: serif;
	font-size: 8em;
	line-height: 0;
	color: #e3eed4;
	position: absolute;
	top: 80px;
	left: 25px;
}
.review::after {
	content: "\201d";
	font-family: serif;
	font-size: 8em;
	line-height: 0;
	color: #e3eed4;
	position: absolute;
	bottom: 20px;
	right: 25px;
}

/* Headshot */
.review > div > figure {
	margin-top: -120px;
}
.review > div > figure:first-child img {
	height: auto !important;
	object-fit: cover;
	border-radius: 50%;
}
.review figure:first-child {
	text-align: center;
}

/* Single Letter instead of Headshot */
.review h4 {
	margin: 0 auto;
	margin-top: calc(15cqw - 120px);
	width: 140px;
	height: 140px;
	font-size: 5.5em;
	text-align: center;
	border-radius: 50%;
	background-color: #e3edd4;
	color: var(--contrast);
	font-weight: bold;
}

/* Quote */
.review blockquote {
	text-align: center;
	border-left: 0;
	padding: 15px 0 5px 0;
	margin-bottom: 0;
}

/* Name */
.review cite {
	display: block;
	text-align: center;
}
.review cite::before {
	content: "\2014  ";
}

/* Stars */
.review > div > p:last-child {
	margin-bottom: 0;
	text-align: center;
	font-size: 2em;
	color: #fffb4f;
}

/* Mobile responsiveness */
@container (max-width: 400px) {
	/* Container */
	.review > div {
		padding: 5cqw !important;
	}
	/* Headshot */
	.review img {
		max-width: 50%;
		margin-top: 15cqw;
	}
}
@container (min-width: 0) {
	/* Quote */
	.review blockquote {
		font-size: clamp(0.9em, 5cqw, 1em);
	}
}


/***********************/
/* WooCommerce Reviews */
/***********************/

.woocommerce-Reviews {
	/* Remove pseudo-elements (normally used for float clears) */
	.commentlist::before,
	.commentlist::after {
		content: none !important;
	}

	/* Adjust WooCommerce reviews layout into grid */
	.commentlist {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 2rem;
		margin-bottom: 1rem !important;

		/* Responsive: single column on smaller screens */
		@media (width < 850px) {
			grid-template-columns: 1fr;
			gap: 1rem;
		}
	}

	/* Remove extra padding on mobile */
	.comment_container {
		padding: 0 !important;
	}

	/* Remove weirdly-tall vertical spacing between reviews */
	.review {
		margin: 0 !important;
		max-width: inherit;
	}

	/* Remove spacing for avatars */
	.comment-text {
		margin-left: 0 !important;
	}

	/* Bring quotation into document flow, and put behind text */
	.review::after {
		position: static;
		float: right;
		margin-right: 5px;
	}
}

/* WooCommerce stars are moved above title, under other star ratings.  Reduce spacing between them. */
.woocommerce-product-rating {
	margin-top: 0 !important;
}


/* Featured Product Border */
body:not(.home) .products .featured::before {
	content: "";
 	border-top: 2.1em solid #5e36ca;
	position: absolute;
	inset: 0;
	z-index: 10;
	border-radius: 10px;
	pointer-events: none;
}
body:not(.home) .products .featured::after {
	content: "Best Value";
	color: white;
	font-size: 1.15em;
	position: absolute;
	inset: 0;
	bottom: -5px;
	border: 3px solid #5e36ca;
	z-index: 20;
	border-radius: 10px;
	pointer-events: none;
}
/* Side padding for titles */
body:not(.home) .products .featured .woocommerce-loop-product__title {
	margin-left: 4px !important;
	margin-right: 4px !important;
}
/* Featured and on sale, so move Sale tag down */
body:not(.home) .products .featured .onsale {
	z-index: 30;
	top: 35px !important;
}

/* Table of Contents */
.toc {
	border: 1px solid #aaa;
	background-color: #f9f9f9;
	padding: 20px;
}

/* Google Rating, blue link */
.google-review-link {
	margin-bottom: 6px;
}
.google-review-link a {
	color: #222; /* Previously #1A0DAB */
}
/* Hack: Set parent group with class .google-review-center to center review link */
.google-review-center .wp-block-group__inner-container {
	padding: 0;
}
.google-review-center .wp-block-group.is-layout-flex {
	justify-content: center;
}

/* Add publish and update date to posts */
.posted-on {
	display: inline-flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
}
.posted-on .updated {
	display: inline-block;
}
.posted-on .published::before {
	content: "Published ";
}
.posted-on .updated::before {
	content: ", updated ";
}

/* Hide extra text under Related Products */
.woobuilder-related_products .related.products > h2 {
	display: none;
}

/* Contact Page */
.contact-category {
	margin-bottom: 0.5em;
}
.contact-category + hr {
	margin: 10px 0;
}


/* Highlight white logo on Brands page */
.white-logo figure {
	background-color: var(--contrast-2);
}


/**********************/
/* Manila File Folder */
/**********************/

.manila {
	position: relative;
	background-color: #d2b387;
	margin: 55px 8% 25px 8%;
	border: 1px solid grey;
	border-radius: 20px 20px 0 0;
	padding: 20px;
 	/* font-family: monospace; */
}
/* Tab */
.manila::before {
	position: absolute;
	display: inline-block;
	top: 1px;
	right: 30px;
	transform: translateY(-100%);

	content: "From the files...";
	text-transform: uppercase;
	font-size: 1.1em;
	line-height: 1;
	padding: 11px 11px 6px 10px;
	color: white;
	background-color: #d2b387;

	border: 1px solid grey;
	border-bottom: none;
	border-radius: 20px 20px 0 0;
}
/* Inner group */
.manila > .wp-block-group__inner-container {
	background-color: white;
	padding: 15px;
}
/* Closing paragraph */
.manila p:last-child {
	margin-bottom: 0;
}
/* Mobile - Spread tab */
@media (max-width: 500px) {
	.manila {
		margin: 55px 0 25px 0;
		border-radius: 0;
	}
	.manila::before {
		font-size: 0.9em;
		right: -1px;
		left: -1px;
	}
}


/***********************/
/* Review Rewards Form */
/* https://www.flourishandlivewell.com/review-rewards/ */
/***********************/

/* Header Styling */
.form-feedback-type {
	font-size: 1.4em;
}
p:has(.form-feedback-type) {
	margin-bottom: 1rem;
}

/* Inner Form Styling */
.form-review-rewards-inner {
	background-color: #fdfdfd;
	padding: 1rem 1rem 1px 1rem;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	border-radius: 15px;

	input[type="text"],
	input[type="email"] {
		width: 100%;
	}
	textarea {
		height: 170px;
		min-height: 170px;
		resize: vertical
	}
}

/* Conditional Fields - Initial State */
.form-product-name,
.form-product-rating,
.form-video-url {
	display: none;
}

/* Conditional Fields - Re-enable */
.form-review-rewards-wrapper:has(.form-feedback-type input[value="Product review"]:checked) {
	.form-product-name,
	.form-product-rating {
		display: inline;
	}
}
.form-review-rewards-wrapper:has(.form-feedback-type input[value="Video review"]:checked) {
	.form-video-url {
		display: inline;
	}
}

/* Testimonial - Star rating */
/* Remove gaps between stars */
.form-product-rating .wpcf7-list-item {
	margin-left: 0;
}
/* Hide span containing default text */
.form-star-rating .wpcf7-list-item-label {
	display: none;
}
/* Hide radio buttons and set default star color */
.form-star-rating input {
	appearance: none;
	color: #90A0A3;
}
/* Create stars */
.form-star-rating input::before {
	content: "★";
	font-size: 2.7em;
	padding-right: 4px;
}
/* Color previous-to-selected stars */
.form-star-rating:not(:hover) .wpcf7-list-item:has(~ span input:checked) input,
.form-star-rating .wpcf7-list-item:has(~ span input:hover) input {
	color: #F79426
}
/* Highlight selected star */
.form-star-rating:not(:hover) input:checked,
.form-star-rating:not(:hover) input:focus,
.form-star-rating input:hover {
	color: #febd31;
}
/* Hide first/blank star, which acts as default/unset value.  Needed to sidestep radios being required. */
.form-star-rating .wpcf7-list-item.first {
	display: none;
}
