/*
Theme Name: Seath Golf
Description: Block theme for Iain Seath Golf. Pairs with the Seath Golf Blocks plugin and WooCommerce (catalogue mode).
Version: 1.0.0
Requires at least: 6.8
Requires PHP: 8.1
Text Domain: seath-golf
*/

/* ---------- Header ---------- */

.site-header {
	color: var(--wp--preset--color--white);
	position: relative;
	z-index: 20;
}

.site-header a:where(:not(.wp-element-button)) {
	color: inherit;
}

.site-header .wp-block-navigation__container {
	gap: 0 1.6rem;
}

.site-header .wp-block-navigation-item__content:hover,
.site-header .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-underline-offset: 6px;
}

/* Header laid over the first block of the page (front page hero). */
.header-overlay {
	position: absolute;
	inset: 0 0 auto 0;
}

.has-overlay-header {
	position: relative;
}

/* The overlaid header is out of the flow, so the content would otherwise get the block gap above it
   (showing as a white strip at the top of the page). */
.has-overlay-header > .wp-block-post-content {
	margin-block-start: 0;
}

/* No white gap between the page content and the footer, or between header parts. */
.wp-site-blocks > footer,
.wp-site-blocks > header + * ,
header.wp-block-template-part > * + * {
	margin-block-start: 0;
}

/* Logged in: a light line separating the WordPress toolbar from the site header. */
body.admin-bar .wp-site-blocks {
	border-top: 1px solid var(--wp--preset--color--border);
}

/* Dark scrim block style for groups with a background image. */
.is-style-scrim {
	position: relative;
	isolation: isolate;
}

.is-style-scrim::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.45) 100%);
	z-index: -1;
	pointer-events: none;
}

.hero {
	color: var(--wp--preset--color--white);
}

/* Room for the overlaid header on the front page hero. */
.has-overlay-header .hero:first-child {
	padding-top: clamp(11rem, 22vw, 14rem) !important;
}

.shop-subnav {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.shop-subnav a {
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

.shop-subnav .wp-block-navigation-item:not(:last-child)::after {
	content: "|";
	margin-left: 0.75rem;
	opacity: 0.5;
}

/* ---------- Section heading with rules either side ---------- */

.is-style-ruled {
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.is-style-ruled::before,
.is-style-ruled::after {
	content: "";
	flex: 1;
	border-top: 1px solid var(--wp--preset--color--border);
}

/* ---------- Cards ---------- */

.content-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	height: 100%;
	overflow: hidden;
}

.content-card .wp-block-post-featured-image {
	margin: 0;
}

.content-card .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
	width: 100%;
}

.wp-block-post-template.is-flex-container > li {
	display: flex;
	flex-direction: column;
}

/* ---------- Footer ---------- */

.site-footer {
	color: #e6e6e6;
}

.site-footer a {
	color: inherit;
}

.site-footer .footer-legal a {
	text-decoration: none;
}

.site-footer .footer-legal a:hover {
	text-decoration: underline;
}

/* ---------- Shop ---------- */

.shop-sidebar h3 {
	font-size: 1rem;
	margin-bottom: 0.5rem;
}

.shop-sidebar .wp-block-categories {
	list-style: none;
	padding-left: 0;
	margin-top: 0;
	font-size: var(--wp--preset--font-size--small);
}

.shop-sidebar .wp-block-categories li {
	margin: 0.15rem 0;
}

.shop-sidebar .wp-block-categories > li > a {
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.shop-sidebar .wp-block-categories .children {
	list-style: none;
	padding-left: 0;
	margin: 0.25rem 0 0.75rem;
}

.shop-sidebar .wp-block-categories .children a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.shop-sidebar .wp-block-categories a:hover {
	color: var(--wp--preset--color--primary);
}

.wc-block-product-template .wc-block-components-product-image img,
.wc-block-product-template .wp-block-woocommerce-product-image img {
	aspect-ratio: 1;
	object-fit: contain;
	background: var(--wp--preset--color--light);
}

.trade-in-callout {
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.wp-block-details.features-benefits {
	background: var(--wp--preset--color--light);
	border: 1px solid var(--wp--preset--color--border);
	padding: 0.85rem 1rem;
}

.wp-block-details.features-benefits summary {
	font-weight: 700;
	cursor: pointer;
}

/* ---------- Forms (Contact Form 7) ---------- */

.wpcf7-form p {
	margin: 0 0 1rem;
}

.wpcf7-form label {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.wpcf7-form input:where([type="text"], [type="email"], [type="tel"], [type="url"]),
.wpcf7-form select,
.wpcf7-form textarea,
.wp-block-search__input {
	display: block;
	width: 100%;
	margin-top: 0.35rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 4px;
	font: inherit;
	font-weight: 400;
	background: var(--wp--preset--color--white);
	box-sizing: border-box;
}

.wpcf7-form textarea {
	min-height: 9rem;
}

.wpcf7-form :is(input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--primary);
}

.wpcf7-form .wpcf7-list-item {
	margin: 0 1.25rem 0 0;
}

.wpcf7-form .wpcf7-list-item label {
	font-weight: 400;
}

.wpcf7-form input[type="submit"] {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--primary);
	border-radius: 6px;
	padding: 0.6rem 1.4rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.wpcf7-form input[type="submit"]:hover {
	background: var(--wp--preset--color--primary-dark);
}

/* Image-right rows still show the image first when stacked on phones. */
@media (max-width: 781px) {
	.wp-block-columns.is-media-right {
		flex-direction: column-reverse;
	}
}
