/* ==========================================================================
   BASE — typography, accessibility, and the few global corrections.

   Scoped narrowly on purpose. My Listing and Elementor both ship opinionated
   resets, and broad element selectors here fight them in ways that only show up
   on pages nobody tested. Prefer the component classes in components.css.
   ========================================================================== */

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

body {
	font-family: var(--kbia-font-body);
	font-size: var(--kbia-fs-body);
	line-height: var(--kbia-lh-body);
	color: var(--kbia-body);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--kbia-font-heading);
	line-height: var(--kbia-lh-heading);
	color: var(--kbia-heading);
	text-wrap: balance;
}

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

/* Skip link. The reference site has none; every page here gets one. */
.kbia-skip-link {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	border-radius: 0 0 var(--kbia-radius) 0;
	background: var(--kbia-blue-800);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	transform: translateY(-120%);
	transition: transform var(--kbia-dur) var(--kbia-ease-out);
}

.kbia-skip-link:focus { transform: translateY(0); }

/* Brand-coloured focus ring. The reference leaves Tailwind's default indigo
   in place on every button and link -- an easy thing to inherit by accident. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 3px solid var(--kbia-accent);
	outline-offset: 2px;
}

/* Screen-reader-only text, for icon-only controls. */
.kbia-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.kbia-sr-only:focus {
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip-path: none;
	white-space: normal;
}

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

/* The reference does not honour this for its hero video, parallax or counters.
   Ours does, globally. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.kbia-card:hover,
	.kbia-tile:hover { transform: none !important; }
}

/* Smooth scrolling is JavaScript, so the rules above cannot switch it off.
   assets/js/smooth-scroll.js watches the same query and destroys the Lenis
   instance when it matches -- that file, not this one, is where to look. */

/* --- Layout primitives --------------------------------------------------- */

.kbia-container {
	width: 100%;
	max-width: var(--kbia-container);
	margin-inline: auto;
	padding-inline: var(--kbia-gutter);
}

.kbia-container--wide { max-width: var(--kbia-container-wide); }
.kbia-container--text { max-width: var(--kbia-container-text); }

.kbia-band { padding-block: var(--kbia-band-y); }
.kbia-band--alt { background: var(--kbia-surface-alt); }

/* Wide content must scroll inside itself rather than pushing the page. */
.kbia-scroll-x {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
