/*
 * Theme by IWT — base.css
 * Resets, typography, and accessibility foundations.
 * No frameworks, no unused utility classes.
 */

/* ---------- Custom properties (overridable via theme.json / Customizer) ---------- */
:root {
	--iwt-color-background: #ffffff;
	--iwt-color-foreground: #1a1a1a;
	--iwt-color-primary: #0a1f44;
	--iwt-color-accent: #c9a227;
	--iwt-color-muted: #5a5a5a;
	--iwt-color-border: #e2e2e2;
	--iwt-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--iwt-container-width: 1200px;
	--iwt-content-width: 760px;
	--iwt-space-1: 0.5rem;
	--iwt-space-2: 1rem;
	--iwt-space-3: 1.5rem;
	--iwt-space-4: 2.5rem;
	--iwt-radius: 3px;
}

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

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

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

body {
	margin: 0;
	font-family: var(--iwt-font-family);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--iwt-color-foreground);
	background-color: var(--iwt-color-background);
}

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

/* Preserve width/height attributes to avoid layout shift (Section 24) while still scaling. */
img[width][height] {
	height: auto;
}

figure {
	margin: 0;
}

a {
	color: var(--iwt-color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

a:hover,
a:focus {
	color: var(--iwt-color-accent);
}

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6 {
	line-height: 1.3;
	font-weight: 700;
	color: var(--iwt-color-foreground);
	margin: 0 0 var(--iwt-space-2);
}

h1 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.75rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
	margin: 0 0 var(--iwt-space-2);
}

ul, ol {
	margin: 0 0 var(--iwt-space-2);
	padding-left: 1.25em;
}

/* ---------- Focus states (Section 22) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--iwt-color-accent);
	outline-offset: 2px;
}

/* ---------- Skip link (Section 22) ---------- */
.skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	z-index: 100000;
	padding: var(--iwt-space-1) var(--iwt-space-2);
	background: var(--iwt-color-primary);
	color: #fff;
	text-decoration: none;
}

.skip-link:focus {
	top: 0;
}

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

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: var(--iwt-radius);
	clip: auto !important;
	clip-path: none;
	color: #1a1a1a;
	display: block;
	font-size: 0.875rem;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 1em 1.5em;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ---------- Forms ---------- */
input,
textarea,
select,
button {
	font-family: inherit;
	font-size: 1rem;
}

label {
	display: block;
	margin-bottom: 0.25em;
}
