/*
 * Mi Barrio Beverley Barbershop — base layer.
 *
 * Foundation only: reset, document defaults, containers, typographic roles,
 * control primitives, focus and reduced-motion. No component, no section and
 * no page layout is styled here — those arrive with their approved designs.
 *
 * Every value is a var(--*) from design-tokens.css. If a rule below needs a
 * number the token file does not define, that is a gap to report, not a
 * literal to invent. (CLAUDE.md section 3.6.)
 */

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

/*
 * The browser's own `[hidden] { display: none }` loses to any author rule that
 * sets display — and .button sets display: inline-flex. That is why the
 * booking flow showed Back, Continue and Submit all at once: the script set
 * the attribute correctly and the stylesheet ignored it.
 */
[hidden] {
	display: none !important;
}

html {
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
	margin: 0;
}

ul[class],
ol[class] {
	margin: 0;
	padding: 0;
	list-style: none;
}

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

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

/* --------------------------------------------------------------------------
   Document
   -------------------------------------------------------------------------- */

body {
	background-color: var(--color-bg-primary);
	color: var(--color-text-primary);
	font-family: var(--font-body);
	font-size: var(--text-body);
	font-weight: var(--weight-regular);
	line-height: var(--leading-body);
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background-color: var(--color-gold);
	color: var(--color-bg-primary);
}

/* --------------------------------------------------------------------------
   Containers
   -------------------------------------------------------------------------- */

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

/*
 * <main> spans the full width and adds no padding of its own.
 *
 * Constraining it kept every section background inset from the viewport edge,
 * while the approved design runs them edge to edge. Each section brings its
 * own .container, so the measure is still controlled — just one level lower.
 */
.site-main {
	flex: 1 0 auto;
	width: 100%;
	padding-block: var(--space-section-sm);
}

/*
 * A page that ends in a full-width section already has that section's own
 * bottom padding, so `<main>` adding more would open a gap twice the size.
 * A page that ends in a plain container has nothing, and before this it ran
 * straight into the footer with zero space between the last line of text and
 * the rule above "Visit" — which is what the client was looking at.
 *
 * `:has()` is what makes the distinction possible without a body class per
 * template; it is supported everywhere this theme targets.
 */
.site-main:has( > .section:last-child ) {
	padding-bottom: 0;
}

.site-footer {
	width: 100%;
	margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: var(--weight-regular);
	line-height: var(--leading-heading);
	color: var(--color-text-primary);
	text-wrap: balance;
}

h1 {
	font-size: var(--text-h1);
	line-height: var(--leading-display);
	letter-spacing: var(--tracking-display);
}

h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); line-height: var(--leading-subhead); }
h4 { font-size: var(--text-h4); line-height: var(--leading-subhead); }

h5 {
	font-family: var(--font-body);
	font-size: var(--text-h5);
	font-weight: var(--weight-semibold);
	line-height: var(--leading-tight);
	text-transform: uppercase;
}

p {
	max-width: 65ch;
}

p + p {
	margin-top: var(--space-4);
}

small,
.text-small {
	font-size: var(--text-body-sm);
}

/*
 * --color-text-muted is only legible at 14px and above; the accessibility
 * spec restricts it to meta text. Never apply it to body copy.
 */
.text-meta {
	font-size: var(--text-body-sm);
	color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

a {
	color: var(--color-gold);
	text-decoration-thickness: var(--border-hairline);
	text-underline-offset: var(--space-1);
	transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
	color: var(--color-gold-bright);
}

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */

button,
input[type="submit"],
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--button-height-md);
	min-width: var(--touch-target-min);
	padding-inline: var(--space-5);
	border: var(--border-hairline) solid transparent;
	border-radius: var(--radius-none);
	background-color: var(--color-gold);
	color: var(--color-bg-primary);
	font-family: var(--font-body);
	font-size: var(--text-caption);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--duration-fast) var(--ease-standard),
		color var(--duration-fast) var(--ease-standard);
}

button:hover,
.button:hover {
	background-color: var(--color-gold-bright);
	color: var(--color-bg-primary);
}

button:active,
.button:active {
	background-color: var(--color-gold-shadow);
}

button:disabled,
.button[aria-disabled="true"] {
	opacity: 40%;
	pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="date"],
textarea,
select {
	width: 100%;
	min-height: var(--form-control-height);
	padding: var(--space-3) var(--space-4);
	border: var(--border-hairline) solid var(--color-border-dark-strong);
	border-radius: var(--radius-sm);
	background-color: var(--color-bg-raised);
	color: var(--color-text-primary);
	font-size: var(--text-body);
}

label {
	display: block;
	margin-bottom: var(--space-2);
	font-size: var(--text-label);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Focus
   -------------------------------------------------------------------------- */

:focus-visible {
	outline: var(--border-emphasis) solid var(--color-focus-ring-dark);
	outline-offset: 2px;
}

/* Light sections invert the ring so it stays visible against cream. */
.on-light :focus-visible {
	outline-color: var(--color-focus-ring-light);
}

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: var(--z-toast);
	display: inline-flex;
	align-items: center;
	min-height: var(--touch-target-min);
	padding: var(--space-3) var(--space-5);
	background-color: var(--color-gold);
	color: var(--color-bg-primary);
	font-size: var(--text-caption);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	text-decoration: none;
}

.skip-link:focus {
	left: var(--space-4);
	top: var(--space-4);
}

/* The main landmark takes focus from the skip link but must not show a ring. */
.site-main:focus {
	outline: none;
}

/* --------------------------------------------------------------------------
   Accessibility utilities
   -------------------------------------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip-path: none;
	white-space: normal;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

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

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

/* --------------------------------------------------------------------------
   Scaffold notice — Gate 2 only, removed when the homepage is built
   -------------------------------------------------------------------------- */

.scaffold-notice {
	padding-block: var(--space-8);
}

.scaffold-notice p {
	margin-top: var(--space-4);
	color: var(--color-text-secondary);
}
