/*
 * Base reset + typography.
 * Minimal — only what the theme needs. No utility framework.
 */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background-color: var(--at-canvas);
	color: var(--at-body);
	font-family: var(--at-font-body);
	font-size: var(--at-fs-body);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
/* WP admin bar (32px on desktop, 46px on mobile) eats into the viewport. */
body.admin-bar { min-height: calc(100vh - 32px); }
@media (max-width: 782px) {
	body.admin-bar { min-height: calc(100vh - 46px); }
}

/* Display headings (h1/h2) in WarText, subheadings (h3+) in IBM Plex Mono. */
h1, h2 {
	font-family: var(--at-font-display);
	color: var(--at-headline);
	text-transform: uppercase;
	letter-spacing: var(--at-tracking-default);
	line-height: 1.05;
	margin: 0 0 var(--at-space-4);
}
h3, h4, h5, h6 {
	font-family: var(--at-font-mono);
	color: var(--at-headline);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--at-tracking-eyebrow);
	margin: 0 0 var(--at-space-3);
}
h1 { font-size: var(--at-fs-h1); }
h2 { font-size: var(--at-fs-h2); }
h3 { font-size: var(--at-fs-subhead); }
h4 { font-size: var(--at-fs-body); }
h5 { font-size: var(--at-fs-body-sm); }
h6 { font-size: var(--at-fs-eyebrow); }

p { margin: 0 0 var(--at-space-4); }

a {
	color: var(--at-body);
	text-decoration: none;
	transition: color var(--at-trans-default);
}
a:hover { color: var(--at-highlight); }

img, svg, video { max-width: 100%; height: auto; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Form controls — brand default: black canvas, hairline border, square corners.
 * Prefixed with body#at-theme so we beat WC's `.woocommerce form .form-row .input-text`
 * (0,3,1) without resorting to !important. Our specificity: (1,1,2). */
body#at-theme input[type="text"],
body#at-theme input[type="email"],
body#at-theme input[type="tel"],
body#at-theme input[type="url"],
body#at-theme input[type="password"],
body#at-theme input[type="search"],
body#at-theme input[type="number"],
body#at-theme input[type="date"],
body#at-theme input[type="time"],
body#at-theme input[type="datetime-local"],
body#at-theme input[type="month"],
body#at-theme input[type="week"],
body#at-theme input[type="color"],
body#at-theme input[type="file"],
body#at-theme select,
body#at-theme textarea {
	background-color: var(--at-canvas);
	color: var(--at-headline);
	border: 1px solid var(--at-divider);
	border-radius: 0;
	padding: 0 var(--at-space-3);
	height: 44px;
	font-family: var(--at-font-body);
	font-size: var(--at-fs-body-sm);
	transition: border-color var(--at-trans-fast);
	box-sizing: border-box;
}
body#at-theme textarea {
	height: auto;
	min-height: 96px;
	padding: var(--at-space-2) var(--at-space-3);
}
body#at-theme input:focus,
body#at-theme select:focus,
body#at-theme textarea:focus {
	border-color: var(--at-highlight);
	outline: none;
}
body#at-theme input::placeholder,
body#at-theme textarea::placeholder {
	color: var(--at-muted);
}

/* === Global button component ===
 * Brand pattern:
 *   default → black fill, white border, white text
 *   hover   → white fill, black text (border stays white)
 *
 * Variants:
 *   .at-btn         → standard (the pattern above)
 *   .at-btn--ghost  → alias of .at-btn (semantic clarity)
 *   .at-btn--solid  → inverted (white default, black on hover) — use for
 *                     prominent CTAs (Place order, Proceed to checkout)
 */
body#at-theme .at-btn,
body#at-theme .at-btn--ghost,
body#at-theme .at-btn--solid {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--at-space-3) var(--at-space-6);
	font-family: var(--at-font-body);
	font-weight: 700;
	font-size: var(--at-fs-body-sm);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 0;
	border: 2px solid var(--at-highlight);
	background-color: var(--at-canvas);
	color: var(--at-highlight);
	cursor: pointer;
	text-decoration: none;
	transition: background-color var(--at-trans-fast), color var(--at-trans-fast);
}
body#at-theme .at-btn:hover,
body#at-theme .at-btn--ghost:hover {
	background-color: var(--at-highlight);
	color: var(--at-canvas);
}
body#at-theme .at-btn--solid {
	background-color: var(--at-highlight);
	color: var(--at-canvas);
}
body#at-theme .at-btn--solid:hover {
	background-color: var(--at-canvas);
	color: var(--at-highlight);
}

/* === Custom select (at-select.js) ===
 * Hides the native <select> visually but keeps it focusable for form submit.
 * Wrapper mirrors its state with brand-aligned dropdown.
 */
body#at-theme .at-select {
	position: relative;
	display: block;
}
body#at-theme .at-select > select {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	z-index: -1;
}
body#at-theme .at-select__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 44px;
	padding: 0 var(--at-space-3);
	background-color: var(--at-canvas);
	color: var(--at-headline);
	border: 1px solid var(--at-divider);
	border-radius: 0;
	font-family: var(--at-font-body);
	font-size: var(--at-fs-body-sm);
	cursor: pointer;
	transition: border-color var(--at-trans-fast);
	text-align: left;
}
body#at-theme .at-select__trigger:hover { border-color: var(--at-hairline-hover); }
body#at-theme .at-select.is-open .at-select__trigger,
body#at-theme .at-select__trigger:focus-visible {
	border-color: var(--at-highlight);
	outline: none;
}
body#at-theme .at-select__label {
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
body#at-theme .at-select__chevron {
	flex-shrink: 0;
	margin-left: var(--at-space-2);
	font-size: 0.75rem;
	color: var(--at-muted);
	transition: transform var(--at-trans-fast);
}
body#at-theme .at-select.is-open .at-select__chevron { transform: rotate(180deg); }

body#at-theme .at-select__menu {
	display: none;
	position: absolute;
	top: calc(100% + 2px);
	left: 0;
	right: 0;
	max-height: 280px;
	overflow-y: auto;
	margin: 0;
	padding: 0;
	list-style: none;
	background-color: var(--at-surface);
	border: 1px solid var(--at-divider);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	z-index: 200;
}
body#at-theme .at-select.is-open .at-select__menu { display: block; }
body#at-theme .at-select__option {
	padding: var(--at-space-2) var(--at-space-3);
	color: var(--at-body);
	font-family: var(--at-font-body);
	font-size: var(--at-fs-body-sm);
	cursor: pointer;
	transition: background-color var(--at-trans-fast), color var(--at-trans-fast);
}
body#at-theme .at-select__option:hover {
	background-color: rgba(255, 255, 255, 0.04);
	color: var(--at-highlight);
}
body#at-theme .at-select__option.is-selected {
	color: var(--at-highlight);
	background-color: rgba(255, 255, 255, 0.06);
}
body#at-theme .at-select__option.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Eyebrow utility — used widely across the design system */
.at-eyebrow {
	display: inline-block;
	font-family: var(--at-font-mono);
	font-size: var(--at-fs-eyebrow);
	color: var(--at-muted);
	text-transform: uppercase;
	letter-spacing: var(--at-tracking-pill);
	margin: 0;
}

.at-eyebrow--bracketed::before { content: "[ "; color: var(--at-divider); }
.at-eyebrow--bracketed::after  { content: " ]"; color: var(--at-divider); }

/* Screen-reader text */
.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute; word-wrap: normal !important;
}

/* Container helpers — same width as the header for grid alignment. */
.at-container {
	max-width: var(--at-content-max);
	margin-inline: auto;
	padding-inline: var(--at-space-5);
}
