/*
 * Athlete storefront base: a small reset, document typography, links, focus,
 * layout primitives (container, section, stack) and a few utilities.
 * Loaded after tokens.css, before components.css. Scoped to body.st so the
 * old storefront pages (style.css, Bootstrap 5.1) are never affected.
 */

/* ----- Reset ----- */
:where(.st) *,
:where(.st) *::before,
:where(.st) *::after {
	box-sizing: border-box;
}

html:has(body.st) {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--st-header-height) + var(--st-space-3));
}

body.st {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--st-bg);
	color: var(--st-ink);
	font-family: var(--st-font-sans);
	font-size: var(--st-text-base);
	line-height: var(--st-leading-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

.st main {
	flex: 1 0 auto;
	display: block;
}

:where(.st) img,
:where(.st) svg,
:where(.st) video {
	display: block;
	max-width: 100%;
}

:where(.st) img {
	height: auto;
}

:where(.st) button,
:where(.st) input,
:where(.st) select,
:where(.st) textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

:where(.st) button {
	cursor: pointer;
}

.st [hidden] {
	display: none !important; /* the one !important: [hidden] must win over component display rules */
}

.st ::selection {
	background: var(--st-yellow-300);
	color: var(--st-ink);
}

/* ----- Headings and text -----
   Element rules use :where() so component classes override them without extra weight. */
:where(.st) h1,
:where(.st) h2,
:where(.st) h3,
:where(.st) h4,
:where(.st) h5,
:where(.st) h6 {
	margin: 0 0 var(--st-space-3);
	color: var(--st-ink);
	font-weight: var(--st-weight-bold);
	line-height: var(--st-leading-snug);
}

:where(.st) h1,
.st .st-h1 {
	font-size: var(--st-text-2xl);
	line-height: var(--st-leading-tight);
	letter-spacing: var(--st-tracking-tight);
}

:where(.st) h2,
.st .st-h2 {
	font-size: var(--st-text-xl);
	line-height: var(--st-leading-snug);
	letter-spacing: var(--st-tracking-tight);
}

:where(.st) h3,
.st .st-h3 {
	font-size: var(--st-text-md);
	line-height: var(--st-leading-snug);
}

:where(.st) h4,
:where(.st) h5,
:where(.st) h6 {
	font-size: var(--st-text-base);
}

@media (min-width: 1024px) {
	:where(.st) h1,
	.st .st-h1 {
		font-size: var(--st-text-3xl);
	}

	:where(.st) h2,
	.st .st-h2 {
		font-size: var(--st-text-2xl);
		line-height: var(--st-leading-tight);
	}

	:where(.st) h3,
	.st .st-h3 {
		font-size: var(--st-text-lg);
	}
}

:where(.st) p,
:where(.st) ul,
:where(.st) ol,
:where(.st) dl {
	margin: 0 0 var(--st-space-3);
}

:where(.st) small {
	font-size: var(--st-text-sm);
}

:where(.st) strong,
:where(.st) b {
	font-weight: var(--st-weight-semibold);
}

:where(.st) table {
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

/* ----- Links ----- */
:where(.st) a {
	color: var(--st-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--st-duration-fast) var(--st-ease);
}

:where(.st) a:hover {
	color: var(--st-link-hover);
	text-decoration-thickness: 2px;
}

/* ----- Focus: always visible for keyboard users (WCAG 2.4.7) ----- */
.st :focus {
	outline: none;
}

.st :focus-visible {
	outline: var(--st-focus-width) solid var(--st-focus-color);
	outline-offset: var(--st-focus-offset);
	border-radius: var(--st-radius-sm);
}

.st .st-inverse :focus-visible,
.st .st-inverse:focus-visible {
	outline-color: var(--st-focus-color-inverse);
}

/* ----- Skip link ----- */
.st-skip {
	position: absolute;
	top: var(--st-space-2);
	left: var(--st-space-2);
	z-index: var(--st-z-toast);
	padding: var(--st-space-2) var(--st-space-3);
	background: var(--st-primary);
	color: var(--st-on-primary);
	font-weight: var(--st-weight-semibold);
	border-radius: var(--st-radius-sm);
	transform: translateY(-200%);
}

.st .st-skip:focus-visible {
	transform: none;
	color: var(--st-on-primary);
}

/* ----- Layout primitives ----- */
.st-container {
	width: 100%;
	max-width: var(--st-container);
	margin-inline: auto;
	padding-inline: var(--st-gutter);
}

.st-section {
	padding-block: var(--st-section);
}

.st-section--sm {
	padding-block: var(--st-section-sm);
}

.st-section--warm {
	background: var(--st-surface-warm);
}

.st-section--flush {
	padding-top: 0; /* follows a section on the same background: one gap, not two */
}

.st-stack > * + * {
	margin-top: var(--st-space-3);
}

.st-cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--st-space-2);
}

.st-prose {
	max-width: var(--st-measure);
	line-height: var(--st-leading-body);
}

.st-prose h2 {
	margin-top: var(--st-space-5);
	font-size: var(--st-text-lg);
}

.st-prose h3 {
	margin-top: var(--st-space-4);
	font-size: var(--st-text-md);
}

.st-prose ul,
.st-prose ol {
	padding-left: var(--st-space-4);
}

.st-prose li + li {
	margin-top: var(--st-space-1);
}

/* ----- Utilities (kept deliberately small) ----- */
.st-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.st-eyebrow {
	margin: 0 0 var(--st-space-2);
	font-size: var(--st-text-xs);
	font-weight: var(--st-weight-semibold);
	letter-spacing: var(--st-tracking-caps);
	line-height: var(--st-leading-ui);
	text-transform: uppercase;
	color: var(--st-ink-muted);
}

.st-lead {
	font-size: var(--st-text-md);
	line-height: var(--st-leading-body);
	color: var(--st-ink-muted);
}

.st-muted {
	color: var(--st-ink-muted);
}

.st-small {
	font-size: var(--st-text-sm);
	line-height: var(--st-leading-ui);
}

.st-num {
	font-variant-numeric: tabular-nums;
}

.st-text-center {
	text-align: center;
}

.st-mt-0 { margin-top: 0; }
.st-mb-0 { margin-bottom: 0; }
.st-mb-2 { margin-bottom: var(--st-space-2); }
.st-mb-3 { margin-bottom: var(--st-space-3); }
.st-mb-4 { margin-bottom: var(--st-space-4); }
.st-mb-5 { margin-bottom: var(--st-space-5); }
.st-mt-3 { margin-top: var(--st-space-3); }
.st-mt-4 { margin-top: var(--st-space-4); }
.st-mt-5 { margin-top: var(--st-space-5); }

.st-icon {
	flex: none;
	width: var(--st-icon);
	height: var(--st-icon);
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.st-icon--sm {
	width: var(--st-icon-sm);
	height: var(--st-icon-sm);
}

.st-icon--fill {
	fill: currentColor;
	stroke: none;
}

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

	.st *,
	.st *::before,
	.st *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
