/*
Theme Name: Skip's Prints
Theme URI: https://skipsprints.com
Author: Skip's Prints
Description: Custom block theme for Skip's Prints, built for WooCommerce. Navy, green and white, with a custom print request form.
Version: 1.3.2
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: skips-prints
*/

:root {
	--sp-ink: #171D29;
	--sp-ink-2: #222A39;
	--sp-accent: #23C55E;
	--sp-accent-hover: #1DB053;
	--sp-accent-deep: #15803D;
	--sp-mist: #F3F5F8;
	--sp-line: #DCE1E8;
	--sp-muted: #5A6375;
	--sp-muted-on-ink: #A9B1BF;
	--sp-radius: 6px;
}

/* ---------- Base ---------- */

h1, h2, h3, .wp-block-site-title {
	font-stretch: 118%;
	font-variation-settings: "wdth" 118;
}

h1 {
	font-stretch: 125%;
	font-variation-settings: "wdth" 125;
	font-weight: 800;
}

p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--sp-accent);
	outline-offset: 3px;
	border-radius: 2px;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: currentColor;
	border: 1.5px solid currentColor;
	padding: calc(0.85rem - 1.5px) calc(1.5rem - 1.5px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--sp-ink);
	border-color: var(--sp-ink);
	color: #fff;
}
.sp-on-ink .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: #fff;
	border-color: #fff;
	color: var(--sp-ink);
}

.sp-muted { color: var(--sp-muted); }

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

.sp-header {
	border-bottom: 1px solid var(--sp-line);
	background: #fff;
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin-bar .sp-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .sp-header { top: 0; position: relative; } }

.sp-header__bar {
	padding-block: 0.9rem;
	gap: 1.5rem;
}
.sp-brand { gap: 0.6rem; }
.sp-brand .wp-block-site-title { margin: 0; }
.sp-header .wp-block-navigation a:hover { color: var(--sp-accent-deep); }
.sp-header .wp-block-navigation .current-menu-item > a,
.sp-header .wp-block-navigation a[aria-current="page"] {
	text-decoration: underline;
	text-decoration-color: var(--sp-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
}
.sp-header__tools { gap: 0.75rem; }

/* ---------- Hero: printed layer lines ---------- */

.sp-hero {
	position: relative;
	overflow: hidden;
	background: var(--sp-ink);
	color: #fff;
	isolation: isolate;
}
.sp-hero::before {
	/* layer lines, like the side of a print */
	content: "";
	position: absolute;
	inset: 0 0 0 38%;
	background: repeating-linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0.075) 0 1px,
		transparent 1px 6px
	);
	-webkit-mask-image: linear-gradient(to right, transparent, #000 45%);
	mask-image: linear-gradient(to right, transparent, #000 45%);
	z-index: -1;
	pointer-events: none;
}
.sp-hero::after {
	/* the layer being printed right now */
	content: "";
	position: absolute;
	left: max(50%, 680px);
	right: 0;
	bottom: 31%;
	height: 2px;
	background: var(--sp-accent);
	box-shadow: 0 0 18px rgba(35, 197, 94, 0.55);
	transform-origin: left center;
	animation: sp-extrude 2.4s cubic-bezier(.6, .05, .25, 1) 0.3s both;
	z-index: -1;
	pointer-events: none;
}
@keyframes sp-extrude {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}
/* Phones and narrow tablets: the text fills the width, so the line
   runs along the bottom edge of the hero instead of through the copy. */
@media (max-width: 900px) {
	.sp-hero::before {
		inset: 0;
		-webkit-mask-image: linear-gradient(to bottom, transparent 55%, #000);
		mask-image: linear-gradient(to bottom, transparent 55%, #000);
	}
	.sp-hero::after {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		height: 3px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.sp-hero::after { animation: none; }
}
.sp-hero h1 {
	max-width: 13ch;
	margin-block: 0;
}
.sp-hero__lede {
	max-width: 46ch;
	color: var(--sp-muted-on-ink);
	font-size: var(--wp--preset--font-size--medium);
}
.sp-hero a:not(.wp-element-button) { color: var(--sp-accent); }

/* ---------- Sections ---------- */

.sp-section-head {
	gap: 1rem;
	align-items: flex-end;
	margin-bottom: 1.75rem;
}
.sp-section-head h2 { margin: 0; }
.sp-section-head p { margin: 0; }
.sp-link-arrow a { font-weight: 600; }

.sp-band {
	background: var(--sp-mist);
	border-block: 1px solid var(--sp-line);
}

/* Custom order steps: a real sequence, so they are numbered */
.sp-steps {
	list-style: none;
	counter-reset: sp-step;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0;
	border-top: 1px solid var(--sp-line);
}
.sp-steps li {
	counter-increment: sp-step;
	position: relative;
	padding: 1.25rem 0 1.25rem 3.75rem;
	border-bottom: 1px solid var(--sp-line);
	color: var(--sp-muted);
}
.sp-steps li::before {
	content: counter(sp-step);
	position: absolute;
	left: 0;
	top: 1.2rem;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 50%;
	background: var(--sp-ink);
	color: var(--sp-accent);
	font-weight: 750;
	display: grid;
	place-items: center;
	font-size: 0.95rem;
}
.sp-steps strong { font-size: 1.125rem; color: var(--sp-ink); }

/* ---------- Logo & social links ---------- */

.sp-brand .wp-block-site-logo img { border-radius: 8px; display: block; }
.sp-footer-logo img { border-radius: 12px; display: block; }

.wp-block-social-links.sp-social { gap: 0.6rem; margin-top: 1.25rem; }
.wp-block-social-links.sp-social .wp-social-link {
	background-color: var(--sp-ink);
	color: #fff;
	font-size: 22px;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.sp-footer .wp-block-social-links.sp-social .wp-social-link { background-color: var(--sp-ink-2); }
.wp-block-social-links.sp-social .wp-social-link a { padding: 0.45em; color: inherit; }
.wp-block-social-links.sp-social .wp-social-link:hover {
	background-color: var(--sp-accent);
	color: var(--sp-ink);
	transform: none;
}
.wp-block-social-links.sp-social .wp-social-link a:hover { color: var(--sp-ink); text-decoration: none; }

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

.sp-footer {
	background: var(--sp-ink);
	color: #fff;
}
.sp-footer h2 {
	font-size: 1rem;
	font-stretch: 100%;
	font-variation-settings: "wdth" 100;
	letter-spacing: 0;
	margin-bottom: 0.75rem;
}
.sp-footer p, .sp-footer li { color: var(--sp-muted-on-ink); }
.sp-footer a { color: #fff; text-decoration: none; }
.sp-footer a:hover { color: var(--sp-accent); text-decoration: underline; }
.sp-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.sp-footer .wp-block-site-title a { color: #fff; }
.sp-footer__base {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-top: 1.25rem;
	font-size: 0.875rem;
}

/* ---------- Forms (custom print request, contact) ---------- */

.wpcf7 form { display: grid; gap: 0.25rem; }
.wpcf7 label { display: block; font-weight: 600; font-size: 0.95rem; }
.wpcf7 .sp-hint { display: block; font-weight: 400; color: var(--sp-muted); font-size: 0.875rem; }
.sp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
@media (max-width: 600px) { .sp-form-grid { grid-template-columns: 1fr; } }

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="number"],
.wpcf7 textarea,
.wpcf7 select,
.woocommerce form .input-text,
.woocommerce form select {
	width: 100%;
	margin-top: 0.35rem;
	padding: 0.75rem 0.9rem;
	font: inherit;
	font-weight: 400;
	color: var(--sp-ink);
	background: #fff;
	border: 1px solid #C3CAD4;
	border-radius: var(--sp-radius);
	box-sizing: border-box;
}
.wpcf7 textarea { min-height: 9rem; resize: vertical; }
.wpcf7 input:focus, .wpcf7 textarea:focus {
	border-color: var(--sp-ink);
	outline: 2px solid var(--sp-accent);
	outline-offset: 0;
}
.wpcf7 input[type="file"] {
	margin-top: 0.5rem;
	padding: 1rem;
	width: 100%;
	box-sizing: border-box;
	border: 1.5px dashed #C3CAD4;
	border-radius: var(--sp-radius);
	background: var(--sp-mist);
	font: inherit;
	font-weight: 400;
}
.wpcf7 input[type="submit"] {
	justify-self: start;
	background: var(--sp-accent);
	color: var(--sp-ink);
	border: 0;
	border-radius: var(--sp-radius);
	padding: 0.85rem 1.75rem;
	font: inherit;
	font-weight: 650;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--sp-accent-hover); }
.wpcf7 .wpcf7-not-valid-tip { color: #B42318; font-size: 0.875rem; font-weight: 500; }
.wpcf7 form .wpcf7-response-output {
	margin: 1rem 0 0;
	padding: 0.85rem 1rem;
	border-radius: var(--sp-radius);
	border-width: 1px;
}
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--sp-accent); background: #ECFBF1; }

.sp-form-card {
	background: #fff;
	border: 1px solid var(--sp-line);
	border-radius: 10px;
	padding: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- WooCommerce ---------- */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	text-align: left;
}
.woocommerce ul.products li.product a img {
	border-radius: var(--sp-radius);
	background: var(--sp-mist);
	aspect-ratio: 1;
	object-fit: cover;
	margin-bottom: 0.85rem;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-category__title {
	font-size: 1rem;
	font-weight: 600;
	font-stretch: 100%;
	font-variation-settings: "wdth" 100;
	letter-spacing: 0;
	padding: 0;
	color: var(--sp-ink);
}
.woocommerce ul.products li.product .woocommerce-loop-category__title mark {
	background: none;
	color: var(--sp-muted);
	font-weight: 400;
}
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price,
.wc-block-components-product-price {
	color: var(--sp-ink);
	font-weight: 600;
}
.woocommerce ul.products li.product a { text-decoration: none; }

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce .single_add_to_cart_button {
	background: var(--sp-accent);
	color: var(--sp-ink);
	border-radius: var(--sp-radius);
	font-weight: 650;
	padding: 0.8rem 1.35rem;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover {
	background: var(--sp-accent-hover);
	color: var(--sp-ink);
}
.woocommerce span.onsale,
.wc-block-components-product-sale-badge {
	background: var(--sp-ink);
	color: var(--sp-accent);
	border: 0;
	border-radius: 999px;
	min-height: 0;
	min-width: 0;
	line-height: 1;
	padding: 0.45rem 0.7rem;
	font-weight: 650;
	font-size: 0.8rem;
}
.woocommerce .star-rating span::before,
.wc-block-components-product-rating__stars span::before { color: var(--sp-ink); }

/* Variation pickers (color, size, etc.) */
.woocommerce div.product form.cart .variations select,
.wc-block-add-to-cart-form select {
	min-width: 14rem;
	padding: 0.65rem 0.8rem;
	border: 1px solid #C3CAD4;
	border-radius: var(--sp-radius);
	font: inherit;
	background-color: #fff;
}
.woocommerce div.product form.cart .variations th label { font-weight: 600; }

.woocommerce-info,
.woocommerce-message,
.wc-block-components-notice-banner.is-success {
	border-top-color: var(--sp-accent);
}
.woocommerce-message::before,
.woocommerce-info::before { color: var(--sp-accent-deep); }

.woocommerce-store-notice, p.demo_store {
	background: var(--sp-ink);
	color: #fff;
}

/* Block-based cart & checkout */
.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	background: var(--sp-accent) !important;
	color: var(--sp-ink) !important;
	border-radius: var(--sp-radius) !important;
	font-weight: 650;
}
.wc-block-components-button:not(.is-link):hover {
	background: var(--sp-accent-hover) !important;
}
.wc-block-components-text-input input:focus,
.wc-block-components-select select:focus {
	box-shadow: 0 0 0 2px var(--sp-accent) !important;
}

/* Mini cart badge */
.wc-block-mini-cart__badge {
	background: var(--sp-accent) !important;
	color: var(--sp-ink) !important;
	font-weight: 700;
}

/* Category tiles on the home page */
.sp-categories ul.products li.product-category a img { aspect-ratio: 4 / 3; }
