/*
Theme Name: Top Hat Store
Theme URI: https://tophatcountrystore.com/
Author: Top Hat Country Store
Description: A lightweight block theme for the Top Hat Country Store CMS and future Square-connected catalog.
Version: 0.2.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: top-hat-store
Tags: block-patterns, full-site-editing, custom-colors, custom-logo, editor-style, featured-images, wide-blocks
*/

:root {
	--ths-shadow-soft: 0 14px 40px rgba(31, 36, 33, 0.10);
	--ths-shadow-card: 0 8px 24px rgba(31, 36, 33, 0.08);
}

html {
	scroll-behavior: smooth;
}

body {
	text-rendering: optimizeLegibility;
}

.wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.wp-site-blocks > footer {
	margin-top: auto;
}

a {
	text-underline-offset: 0.18em;
}

.ths-topbar {
	font-size: 0.875rem;
	letter-spacing: 0.015em;
}

.ths-header {
	position: relative;
	z-index: 20;
	box-shadow: 0 1px 0 rgba(31, 36, 33, 0.10);
}

.ths-brand-line {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: clamp(1.35rem, 3vw, 2rem);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.ths-hero {
	position: relative;
	overflow: hidden;
	box-shadow: var(--ths-shadow-soft);
}

.ths-hero::after {
	content: '';
	position: absolute;
	inset: auto -12% -58% auto;
	width: 32rem;
	height: 32rem;
	border: 1px solid rgba(247, 241, 227, 0.22);
	border-radius: 50%;
	pointer-events: none;
}

.ths-eyebrow {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.ths-card {
	height: 100%;
	border: 1px solid rgba(31, 36, 33, 0.10);
	box-shadow: var(--ths-shadow-card);
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.ths-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--ths-shadow-soft);
}

.ths-icon-tile {
	width: 3rem;
	height: 3rem;
	display: grid;
	place-items: center;
	border-radius: 999px;
	font-size: 1.35rem;
}

.ths-notice {
	border-left: 5px solid var(--wp--preset--color--copper);
}

.ths-contact-panel {
	box-shadow: var(--ths-shadow-soft);
}

.ths-meta-label {
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Media blocks are available in every template through the Site Editor. */
.wp-block-image img,
.wp-block-gallery img {
	display: block;
	height: auto;
}

.wp-block-gallery.has-nested-images figure.wp-block-image {
	overflow: hidden;
	border-radius: var(--wp--custom--radius--small);
}

.ths-slider {
	position: relative;
	overflow: hidden;
	background: var(--wp--preset--color--charcoal);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--ths-shadow-soft);
}

.ths-slider__viewport {
	position: relative;
	min-height: 18rem;
}

.ths-slider__slide {
	display: none;
	position: relative;
	margin: 0;
}

.ths-slider__slide.is-active {
	display: block;
}

.ths-slider__slide img {
	display: block;
	width: 100%;
	height: clamp(18rem, 52vw, 38rem);
	object-fit: cover;
}

.ths-slider__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 2.75rem 5rem 1.25rem;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
	text-align: center;
}

.ths-slider__button {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 2.8rem;
	height: 2.8rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 999px;
	color: #fff;
	background: rgba(31, 36, 33, 0.78);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
}

.ths-slider__button:hover,
.ths-slider__button:focus-visible {
	background: var(--wp--preset--color--forest);
}

.ths-slider__button--previous { left: 1rem; }
.ths-slider__button--next { right: 1rem; }

.ths-slider__dots {
	position: absolute;
	right: 0;
	bottom: 0.7rem;
	left: 0;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 0.45rem;
}

.ths-slider__dot {
	width: 0.7rem;
	height: 0.7rem;
	padding: 0;
	border: 1px solid #fff;
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
}

.ths-slider__dot.is-active { background: #fff; }

.ths-slider-editor__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}

.ths-slider-editor__item img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 8px;
}

@media (max-width: 600px) {
	.ths-slider__viewport { min-height: 14rem; }
	.ths-slider__slide img { height: 16rem; }
	.ths-slider__caption { padding: 2.5rem 3.75rem 1.25rem; }
	.ths-slider__button { width: 2.35rem; height: 2.35rem; }
}

@media (prefers-reduced-motion: reduce) {
	.ths-slider { scroll-behavior: auto; }
}

.ths-product-placeholder {
	min-height: 15rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px dashed rgba(46, 94, 78, 0.34);
}

.wp-block-button__link {
	transition: transform 160ms ease, filter 160ms ease;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
	filter: brightness(0.96);
}

.wp-block-navigation a {
	text-decoration: none;
}

.wp-block-navigation a:hover,
.wp-block-navigation .current-menu-item > a {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

.wp-block-post-title a {
	text-decoration: none;
}

.wp-block-post-title a:hover {
	text-decoration: underline;
}

@media (max-width: 781px) {
	.ths-topbar .wp-block-group {
		justify-content: center !important;
		text-align: center;
	}

	.ths-hero {
		border-radius: 0 !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
