/**
 * The Golf Shot — Base
 *
 * Site-wide foundation: design tokens, typography and shared components.
 * Loaded on every page after Blocksy's stylesheet and Customizer CSS.
 *
 * Naming: all custom classes use the `gs-` prefix to avoid collisions with
 * Blocksy (`ct-`) and WooCommerce (`woocommerce-`, `wc-`).
 *
 * Breakpoints (match Blocksy): mobile < 690px, tablet < 1000px.
 */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
	/* Colour */
	--gs-cream: #f5f1e8;          /* primary background */
	--gs-cream-deep: #ebe5d7;     /* secondary surfaces / placeholders */
	--gs-paper: #fbf9f4;          /* lightest surface */
	--gs-ink: #161614;            /* headings, primary buttons */
	--gs-charcoal: #2b2b28;       /* body text */
	--gs-stone: #6f6c64;          /* muted text */
	--gs-line: #d9d3c5;           /* borders / rules */
	--gs-olive: #4b5236;          /* accent — use sparingly */
	--gs-olive-dark: #373c27;

	/* Typography — system stack for now; swap for a self-hosted font once approved. */
	--gs-font-heading: Helvetica, Arial, sans-serif;
	--gs-font-body: Helvetica, Arial, sans-serif;

	--gs-text-xs: 0.75rem;
	--gs-text-sm: 0.875rem;
	--gs-text-base: 1rem;
	--gs-text-md: clamp(1.0625rem, 0.98rem + 0.35vw, 1.25rem);
	--gs-text-lg: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
	--gs-text-xl: clamp(1.75rem, 1.3rem + 2vw, 3rem);
	--gs-text-2xl: clamp(2.25rem, 1.4rem + 3.8vw, 4.5rem);
	--gs-text-display: clamp(2.75rem, 1.2rem + 6.4vw, 7.5rem);

	--gs-tracking-tight: -0.03em;
	--gs-tracking-wide: 0.14em;

	/* Spacing */
	--gs-gutter: clamp(1.25rem, 0.6rem + 3vw, 3.5rem);   /* page side padding */
	--gs-space-xs: 0.5rem;
	--gs-space-sm: 1rem;
	--gs-space-md: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
	--gs-space-lg: clamp(2.5rem, 1.8rem + 3vw, 4.5rem);
	--gs-space-xl: clamp(4rem, 2.5rem + 6vw, 8rem);      /* between homepage sections */

	--gs-max-width: 1600px;

	/* Motion */
	--gs-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--gs-duration: 240ms;

	/* Hand brand fonts to Blocksy so its own components (header, Woo, forms) use them. */
	--theme-font-family: var(--gs-font-body);
	--theme-button-font-family: var(--gs-font-heading);
}

/* ==========================================================================
   2. Typography
   ========================================================================== */

body {
	font-family: var(--gs-font-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
	--theme-font-family: var(--gs-font-heading);
	font-family: var(--gs-font-heading);
	letter-spacing: -0.015em;
}

/* Oversized display heading — hero and editorial statements. */
.gs-display {
	margin: 0;
	font-family: var(--gs-font-heading);
	font-size: var(--gs-text-display);
	font-weight: 800;
	line-height: 0.92;
	letter-spacing: var(--gs-tracking-tight);
	text-transform: uppercase;
	color: var(--gs-ink);
	text-wrap: balance;
}

/* Section headings. */
.gs-heading {
	margin: 0;
	font-family: var(--gs-font-heading);
	font-size: var(--gs-text-2xl);
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: var(--gs-tracking-tight);
	text-transform: uppercase;
	color: var(--gs-ink);
}

/* Small uppercase label above headings. */
.gs-eyebrow {
	margin: 0;
	font-family: var(--gs-font-heading);
	font-size: var(--gs-text-xs);
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: var(--gs-tracking-wide);
	text-transform: uppercase;
	color: var(--gs-stone);
}

.gs-lead {
	font-size: var(--gs-text-md);
	line-height: 1.6;
	color: var(--gs-charcoal);
}

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */

.gs-container {
	width: 100%;
	max-width: var(--gs-max-width);
	margin-inline: auto;
	padding-inline: var(--gs-gutter);
}

.gs-section {
	padding-block: var(--gs-space-xl);
}

.gs-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   4. Buttons
   Scoped to .gs-button so Blocksy/WooCommerce buttons are unaffected until
   we deliberately restyle them.
   ========================================================================== */

.gs-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.75em;
	min-height: 3.5rem;
	padding: 0 2rem;
	border: 1.5px solid var(--gs-ink);
	border-radius: 0;
	font-family: var(--gs-font-heading);
	font-size: var(--gs-text-sm);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--gs-duration) var(--gs-ease),
		color var(--gs-duration) var(--gs-ease),
		border-color var(--gs-duration) var(--gs-ease);
}

.gs-button--primary {
	background-color: var(--gs-ink);
	color: var(--gs-cream);
}

.gs-button--primary:hover,
.gs-button--primary:focus-visible {
	background-color: var(--gs-olive);
	border-color: var(--gs-olive);
	color: var(--gs-cream);
}

.gs-button--outline {
	background-color: transparent;
	color: var(--gs-ink);
}

.gs-button--outline:hover,
.gs-button--outline:focus-visible {
	background-color: var(--gs-ink);
	color: var(--gs-cream);
}

.gs-button:focus-visible {
	outline: 2px solid var(--gs-olive);
	outline-offset: 3px;
}

.gs-button__arrow {
	display: inline-block;
	font-family: var(--gs-font-body);
	font-weight: 400;
	transition: transform var(--gs-duration) var(--gs-ease);
}

.gs-button:hover .gs-button__arrow,
.gs-button:focus-visible .gs-button__arrow {
	transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
	.gs-button,
	.gs-button__arrow {
		transition: none;
	}
}

/* ==========================================================================
   5. Header cart
   Blocksy's own Cart header element (added/placed in Customizer > Header).
   Restyled to sit in the navigation: ink icon + total, no box/border.
   The total is empty while the cart is empty (see
   gs_header_cart_empty_subtotal() in inc/woocommerce.php) and hidden here.
   ========================================================================== */

#header .ct-header-cart .ct-cart-item {
	--theme-icon-color: var(--gs-ink);
	--theme-icon-hover-color: var(--gs-olive);
	--theme-link-initial-color: var(--gs-ink);
	--theme-link-hover-color: var(--gs-olive);
	--theme-icon-size: 17px;

	gap: 0.5rem;
	background: none;
	border: 0;
	box-shadow: none;
}

#header .ct-header-cart .ct-label {
	font-family: var(--gs-font-heading);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

/* Empty cart: no total, icon only. */
#header .ct-header-cart .ct-label:has(.ct-amount:empty) {
	display: none;
}
