/*
Theme Name: Idaho Stones
Theme URI: https://www.idahostones.com
Author: Lazy Potato Mining & Gemstones LLC
Description: Light, gallery-style block theme for Idaho Stones: fine Idaho gemstones, agate and jewelry.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
Version: 1.3.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: idahostones
Tags: block-theme, full-site-editing, e-commerce, one-column, custom-colors, editor-style
*/

/* Small refinements theme.json can't express. Colors and type live in theme.json. */

:root {
	--is-hairline: 1px solid var(--wp--preset--color--border);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Even line lengths in headings (no single word left on the last line). */
:where(h1, h2, h3, .wp-block-post-title) {
	text-wrap: balance;
}

::selection {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--white);
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Header: plain bar on the page background. */
.is-site-header {
	background: var(--wp--preset--color--base);
}

/* Small uppercase kicker above headings (paragraph style "Eyebrow"). */
.is-style-eyebrow {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

/* Outline button style. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1px solid currentColor;
	/* Same size as the solid button (core shrinks outline padding). */
	padding: calc(0.85rem - 1px) calc(1.75rem - 1px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Framed image style: a gallery mat around stone photos. */
.wp-block-image.is-style-framed img {
	padding: clamp(0.5rem, 1.5vw, 1rem);
	background: var(--wp--preset--color--white);
	border: var(--is-hairline);
}

/* Card group style for features and listings. */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--white);
	border: var(--is-hairline);
	padding: var(--wp--preset--spacing--40);
}

/* Footer. */
.is-site-footer {
	border-top: var(--is-hairline);
}

.is-site-footer a {
	color: inherit;
	text-decoration: none;
}

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

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Contact form (FormLayer): match the theme. FormLayer loads after this
   stylesheet, so rules are scoped under .formlayer-form-wrapper .formlayer-form
   to win on specificity. */
.formlayer-form-wrapper {
	box-sizing: border-box;
	padding: clamp(1.25rem, 4vw, 2.25rem);
	background: var(--wp--preset--color--white);
	border: var(--is-hairline);
}

.formlayer-form-wrapper .formlayer-form .formlayer-label,
.formlayer-form-wrapper .formlayer-form label {
	margin-bottom: 6px;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.formlayer-form-wrapper .formlayer-form .formlayer-field-wrap {
	margin-bottom: 18px;
}

/* FormLayer stacks first/last name in a column; put them side by side. */
.formlayer-form-wrapper .formlayer-form .formlayer-name-fields-wrap {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 12px;
}

.formlayer-form-wrapper .formlayer-form .formlayer-sub-field {
	flex: 1 1 200px;
}

/* The "First Name / Last Name" captions repeat the placeholders: keep them
   for screen readers only. */
.formlayer-form-wrapper .formlayer-form .formlayer-sub-label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.formlayer-form-wrapper .formlayer-form input[type="text"],
.formlayer-form-wrapper .formlayer-form input[type="email"],
.formlayer-form-wrapper .formlayer-form input[type="tel"],
.formlayer-form-wrapper .formlayer-form textarea,
.formlayer-form-wrapper .formlayer-form select {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
	box-shadow: none;
	font-family: inherit;
}

.formlayer-form-wrapper .formlayer-form input:focus,
.formlayer-form-wrapper .formlayer-form textarea:focus,
.formlayer-form-wrapper .formlayer-form select:focus {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px rgba(123, 45, 59, 0.15);
	transform: none;
}

.formlayer-form-wrapper .formlayer-form textarea {
	min-height: 180px;
}

.formlayer-form-wrapper .formlayer-form .formlayer-submit-btn {
	height: auto;
	padding: 0.85rem 1.75rem;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border-radius: 2px;
	box-shadow: none;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.formlayer-form-wrapper .formlayer-form .formlayer-submit-btn:hover,
.formlayer-form-wrapper .formlayer-form .formlayer-submit-btn:focus-visible {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--white);
	transform: none;
}

/* Footer link lists: plain, evenly spaced. */
.is-footer-links {
	list-style: none;
	margin-bottom: 0; /* keep the block gap above, under the heading */
}

.is-footer-links li + li {
	margin-top: 0.5rem;
}

/* Header: menu plus WooCommerce's account and cart icons grouped on the right
   (WooCommerce adds the icons next to the menu as separate items). */
.is-site-header .wp-block-navigation {
	margin-left: auto;
}

.is-site-header .alignwide {
	gap: 1.25rem;
}

/* ------------------------------------------------------------------
   Gallery layout: tall photo strips, muted panels, italic captions.
   ------------------------------------------------------------------ */

:root {
	--is-gap: 0.75rem;
}

/* Wordmark: italic name over a hairline, small tagline beneath. */
.is-wordmark .wp-block-site-title {
	font-style: italic;
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	line-height: 1.1;
	padding: 0 0.35rem 0.3rem;
	border-bottom: 1px solid var(--wp--preset--color--contrast);
}
.is-wordmark .is-wordmark-tagline {
	margin: 0.35rem 0 0;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--contrast-2);
	text-align: center;
}

/* Pendant logo beside the name (header and footer). */
.is-brand .is-brand-logo {
	flex-shrink: 0;
	margin: 0;
	line-height: 0;
}
.is-brand .is-brand-logo img {
	height: auto;
}
.is-footer-brand .wp-block-site-title {
	font-style: italic;
	font-size: 1.4rem;
}
/* Phones: keep logo, name, menu and icons on one line. */
@media (max-width: 600px) {
	.is-site-header .alignwide {
		flex-wrap: nowrap;
		gap: 0.9rem;
	}
	.is-site-header .is-brand {
		gap: 0.5rem;
		min-width: 0;
	}
	.is-site-header .is-brand .is-brand-logo img {
		width: 36px !important;
	}
}

/* Caption heading style: italic serif, hairline rule beneath (or above). */
.is-style-caption {
	font-style: italic;
	line-height: 1.2;
}
.is-style-caption:not(.is-caption-ruled-above) {
	padding-bottom: 0.35em;
	border-bottom: 1px solid currentColor;
}
.is-style-caption.is-caption-ruled-above {
	margin-top: 0.75rem;
	margin-bottom: 0;
	padding-top: 0.5rem;
	border-top: 1px solid var(--wp--preset--color--contrast);
}
.is-style-caption a {
	color: inherit;
	text-decoration: none;
}
.is-style-caption a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

/* Home: blocks sit close together, like hung frames. */
.is-gallery-main > * + * {
	margin-block-start: var(--is-gap) !important;
}

/* Panels: solid color, caption at the foot. */
.is-panel {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: clamp(1.25rem, 2.5vw, 2rem);
	min-height: clamp(22rem, 48vw, 34rem);
}
.is-panel > * {
	margin-block: 0;
}
.is-panel > * + * {
	margin-top: 0.75rem;
}
.is-panel a {
	color: inherit;
}
.is-pair-short .is-panel {
	min-height: 18rem;
}
.wp-block-columns.is-pair {
	gap: var(--is-gap);
}

/* Collection panels: the whole panel is clickable through the heading link. */
.is-collection-tile {
	position: relative;
}
.is-collection-tile h2 a::after {
	content: "";
	position: absolute;
	inset: 0;
}
.is-collection-tile h2 a:focus-visible {
	outline: none;
}
.is-collection-tile:focus-within {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 3px;
}

/* Tall photo strips everywhere products are listed. */
.is-feature-pairs .wc-block-components-product-image img,
.is-product-grid .wc-block-components-product-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 5;
	object-fit: cover;
	background: var(--wp--preset--color--base-2);
}
.is-feature-pairs .wc-block-components-product-image,
.is-product-grid .wc-block-components-product-image {
	margin: 0 !important;
}

/* Home featured pieces: photo + panel pairs, alternating sides. */
.is-feature-pairs .wc-block-product-template {
	display: flex !important;
	flex-direction: column;
	gap: var(--is-gap) !important;
}
.is-feature-pairs .wc-block-product {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--is-gap);
	max-width: none !important;
	margin: 0 !important;
	text-align: left;
}
.is-feature-pairs .wc-block-product:nth-child(even) > .wc-block-components-product-image {
	order: 2;
}
.is-feature-pairs .wc-block-product .is-panel {
	min-height: 0;
}
.is-feature-pairs .wc-block-product:nth-child(4n+1) .is-panel { background: var(--wp--preset--color--ochre); }
.is-feature-pairs .wc-block-product:nth-child(4n+2) .is-panel { background: var(--wp--preset--color--sage); }
.is-feature-pairs .wc-block-product:nth-child(4n+3) .is-panel { background: var(--wp--preset--color--clay); }
.is-feature-pairs .wc-block-product:nth-child(4n) .is-panel { background: var(--wp--preset--color--base-2); }
.is-feature-pairs .is-panel .wc-block-components-product-price {
	color: inherit;
}

/* Shop, category and related grids. */
.is-product-grid .wc-block-product-template {
	column-gap: var(--is-gap) !important;
	row-gap: var(--wp--preset--spacing--50) !important;
}
.is-product-grid .wc-block-product {
	text-align: left;
}
.is-product-grid .wc-block-components-product-price {
	margin-top: 0.3rem;
}
.is-related-pieces > .wp-block-heading {
	margin-bottom: var(--wp--preset--spacing--40);
}

/* Shop: collection links under the title. */
.is-collection-nav {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.25rem;
	font-style: italic;
	color: var(--wp--preset--color--contrast-2);
}
.is-collection-nav a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.is-collection-nav a:hover {
	text-decoration: underline;
}

/* Product page: tall photo, label low beside it, colored card below. */
.is-product-photo .woocommerce-product-gallery__image > a > img {
	width: 100%;
	aspect-ratio: 9 / 20;
	object-fit: cover;
}
.is-product-photo .flex-control-thumbs {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.5rem !important;
}
.is-product-photo .flex-control-thumbs li {
	width: 4.5rem !important;
	float: none !important;
}
.is-product-label .wp-block-post-title {
	margin-bottom: 0;
}
.is-product-label .woocommerce-breadcrumb {
	margin-bottom: 0.75rem;
	color: var(--wp--preset--color--contrast-2);
}
.is-product-card-row {
	display: flex;
	justify-content: flex-end;
	margin-top: var(--is-gap) !important;
}
.is-product-card {
	width: min(100%, 62%);
	padding: clamp(1.25rem, 3vw, 2.25rem);
}
.is-product-card > * {
	margin-block: 0;
}
.is-product-card > * + * {
	margin-top: 1rem;
}
.is-product-card .is-product-assurance {
	padding-top: 0.75rem;
	border-top: 1px solid rgba(30, 28, 26, 0.2);
	color: var(--wp--preset--color--contrast-2);
}
.is-product-card .is-product-assurance a {
	color: inherit;
}

/* Arco store pieces. */
.is-store-tag {
	display: inline-block;
	margin-left: 0.5em;
	padding: 0.1em 0.55em;
	border: 1px solid var(--wp--preset--color--accent-2);
	border-radius: 2px;
	color: var(--wp--preset--color--accent-2);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	vertical-align: middle;
}
.is-price-request {
	font-style: italic;
}
.is-nowrap {
	white-space: nowrap;
}
.is-store-piece-note p {
	margin: 0 0 1rem;
}
.is-store-piece-note .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* Phones: pairs stack, strips get a little less tall. */
@media (max-width: 781px) {
	.is-feature-pairs .wc-block-product {
		grid-template-columns: 1fr;
	}
	.is-feature-pairs .wc-block-product:nth-child(even) > .wc-block-components-product-image {
		order: 0;
	}
	.is-feature-pairs .wc-block-components-product-image img {
		aspect-ratio: 4 / 5 !important;
	}
	.is-panel {
		min-height: 14rem;
	}
	.is-product-photo .woocommerce-product-gallery__image > a > img {
		aspect-ratio: 3 / 5;
	}
	.is-product-card {
		width: 100%;
	}
}

/* Centered captions: the rule fits the words, not the column. */
.is-style-caption.has-text-align-center {
	width: fit-content;
	max-width: 100%;
	margin-inline: auto !important;
	padding-inline: 1.25rem;
}
