/**
 * Base.
 *
 * Element defaults and shared primitives. No component styles here — those
 * live in layout.css, cards.css and single.css so each can be dropped on
 * pages that don't need them.
 */

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

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

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

body {
	margin: 0;
	background: var(--wpx-bg);
	color: var(--wpx-text);
	font-family: var(--wpx-font-body);
	font-size: var(--wpx-text-base);
	line-height: var(--wpx-leading-base);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--wpx-space-3);
	font-family: var(--wpx-font-heading);
	font-weight: var(--wpx-weight-bold);
	line-height: var(--wpx-leading-tight);
	color: var(--wpx-text);
}

h1 { font-size: var(--wpx-text-3xl); }
h2 { font-size: var(--wpx-text-2xl); }
h3 { font-size: var(--wpx-text-xl); }
h4 { font-size: var(--wpx-text-lg); }

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

a {
	color: var(--wpx-accent);
	text-decoration: none;
	transition: color var(--wpx-transition);
}

a:hover { color: var(--wpx-accent-hover); }

/* A visible focus ring is the difference between a keyboard-usable site and
   one that silently isn't. */
:focus-visible {
	outline: 2px solid var(--wpx-accent);
	outline-offset: 2px;
	border-radius: var(--wpx-radius-sm);
}

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

ul, ol { margin: 0 0 var(--wpx-space-4); padding-inline-start: var(--wpx-space-5); }

table { width: 100%; border-collapse: collapse; }

/* --- Forms ------------------------------------------------------------- */

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

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea,
select {
	width: 100%;
	padding: var(--wpx-space-2) var(--wpx-space-3);
	background: var(--wpx-surface-1);
	border: 1px solid var(--wpx-border);
	border-radius: var(--wpx-radius);
	color: var(--wpx-text);
	transition: border-color var(--wpx-transition), box-shadow var(--wpx-transition);
}

input:focus, textarea:focus, select:focus {
	border-color: var(--wpx-accent);
	box-shadow: 0 0 0 3px rgb(from var(--wpx-accent) r g b / 0.2);
	outline: none;
}

input::placeholder, textarea::placeholder { color: var(--wpx-text-dim); }

/* --- Buttons ----------------------------------------------------------- */

.wpx-button,
button:not(.wpx-nav-toggle):not(.wpx-search__submit),
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wpx-space-2);
	padding: var(--wpx-space-3) var(--wpx-space-5);
	background: var(--wpx-accent);
	color: var(--wpx-accent-ink);
	border: 0;
	border-radius: var(--wpx-radius);
	font-weight: var(--wpx-weight-medium);
	cursor: pointer;
	transition: background var(--wpx-transition), transform var(--wpx-transition), box-shadow var(--wpx-transition);
}

.wpx-button:hover,
button:not(.wpx-nav-toggle):not(.wpx-search__submit):hover,
input[type="submit"]:hover {
	background: var(--wpx-accent-hover);
	color: var(--wpx-accent-ink);
	transform: translateY(-1px);
	box-shadow: var(--wpx-shadow-accent);
}

.wpx-button:active { transform: translateY(0); }

.wpx-button--store {
	background: var(--wpx-surface-3);
	color: var(--wpx-text);
	border: 1px solid var(--wpx-border-strong);
}

.wpx-button--store:hover {
	background: var(--wpx-surface-4);
	color: var(--wpx-text);
	box-shadow: var(--wpx-shadow);
}

/* --- Icons ------------------------------------------------------------- */

.wpx-icon {
	fill: currentColor;
	flex: none;
}

/* --- Accessibility helpers --------------------------------------------- */

.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;
}

.wpx-skip-link:focus {
	position: fixed;
	top: var(--wpx-space-3);
	inset-inline-start: var(--wpx-space-3);
	z-index: var(--wpx-z-modal);
	width: auto;
	height: auto;
	clip-path: none;
	margin: 0;
	padding: var(--wpx-space-3) var(--wpx-space-4);
	background: var(--wpx-accent);
	color: var(--wpx-accent-ink);
	border-radius: var(--wpx-radius);
}

/* --- Prose ------------------------------------------------------------- */

.wpx-prose { color: var(--wpx-text-muted); }
.wpx-prose h2, .wpx-prose h3 { color: var(--wpx-text); margin-top: var(--wpx-space-6); }
.wpx-prose img { border-radius: var(--wpx-radius); margin-block: var(--wpx-space-4); }

.wpx-prose blockquote {
	margin: var(--wpx-space-5) 0;
	padding: var(--wpx-space-4) var(--wpx-space-5);
	border-inline-start: 3px solid var(--wpx-accent);
	background: var(--wpx-surface-2);
	border-radius: 0 var(--wpx-radius) var(--wpx-radius) 0;
}

.wpx-prose code {
	font-family: var(--wpx-font-mono);
	font-size: 0.9em;
	background: var(--wpx-surface-3);
	padding: 0.15em 0.4em;
	border-radius: var(--wpx-radius-sm);
}
