/**
 * base.css — conservative reset and base element styles.
 * No aggressive/destructive reset: form controls, buttons, lists, tables,
 * and iframes keep their native appearance except where Ditechted
 * deliberately restyles its own scoped classes elsewhere.
 * Per docs/seo-plugin-compatibility.md §24 / §12.
 */

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

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

body {
	margin: 0;
	background: var(--ditechted-bg-default);
	color: var(--ditechted-text-primary);
	font-family: var(--wp--preset--font-family--ditechted-text);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.65;
}

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

/* Headings use the display typeface — this is the one place bare semantic
   elements are styled globally, per the narrow, documented exception in
   docs/seo-plugin-compatibility.md §23. */
h1, h2, h3, h4 {
	font-family: var(--wp--preset--font-family--ditechted-display);
	line-height: 1.05;
	margin: 0 0 var(--wp--preset--spacing--sm);
	font-weight: 600;
}

h1 { font-size: var(--wp--preset--font-size--display-1); }
h2 { font-size: var(--wp--preset--font-size--h2); font-weight: 500; }
h3 { font-size: var(--wp--preset--font-size--h3); font-weight: 500; }
h4 { font-family: var(--wp--preset--font-family--ditechted-text); font-size: var(--wp--preset--font-size--h4); font-weight: 700; }

p {
	margin: 0 0 var(--wp--preset--spacing--md);
}

a {
	color: var(--ditechted-brand-primary);
	text-decoration: underline;
}

a:hover {
	color: var(--ditechted-brand-dark);
}

/* Focus — one definition, inherited everywhere, :focus-visible only so mouse
   clicks don't show an outline where it isn't needed. */
:focus-visible {
	outline: var(--ditechted-focus-width) solid var(--ditechted-focus-color);
	outline-offset: var(--ditechted-focus-offset);
}

/* Skip link — visually hidden until focused, first focusable element on
   every page (output by inc/accessibility.php). */
.ditechted-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	background: var(--ditechted-brand-primary);
	color: var(--ditechted-text-inverse);
	padding: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--sm);
	text-decoration: none;
}

.ditechted-skip-link:focus {
	left: var(--wp--preset--spacing--sm);
	top: var(--wp--preset--spacing--sm);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Reduced motion — global, single definition, inherited everywhere. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* Body scroll lock, toggled by mobile-nav.js while the overlay is open. */
body.ditechted-scroll-locked {
	overflow: hidden;
}
