/**
 * Base Layer — Reset & HTML Element Defaults
 * ---------------------------------------------------------------------------
 * File: assets/css/base.css
 * Enqueued by: inc/enqueue.php (handle: gdq-base), depends on gdq-variables.
 *
 * A minimal, modern CSS reset plus bare HTML-element defaults, expressed
 * entirely through the tokens in variables.css. This file normalises
 * technical browser defaults (list markers, table spacing, font
 * inheritance) — it does NOT design how typographic elements look when
 * used in content; that's typography.css. The split: base.css answers
 * "what does the browser do by default and how do we neutralise it",
 * typography.css answers "how should this element actually look".
 *
 * Still contains NO component or section styling — that begins Sprint 2B.
 * Mobile-first throughout: base rules target mobile, breakpoints add
 * complexity upward.
 */

/* ==========================================================================
   BOX MODEL RESET
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Remove default margin everywhere so spacing is deliberate and
   token-driven (assigned by typography.css/layout.css), never accidental
   browser-default margin stacking. */
* {
	margin: 0;
}

/* ==========================================================================
   HTML / ROOT
   ========================================================================== */
html {
	-webkit-text-size-adjust: 100%; /* prevent iOS auto-zoom text resizing */
	scroll-behavior: smooth;
}

/* Reduced motion support — sitewide, applies ahead of any animation being
   built, so no future component can accidentally ship motion that ignores
   this. Design Spec §3.6/§7 requirement. */
@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;
	}
}

/* ==========================================================================
   BODY
   ========================================================================== */
body {
	font-family: var(--gdq-font-family-base);
	font-size: var(--gdq-text-body-size);
	font-weight: var(--gdq-text-body-weight);
	line-height: var(--gdq-text-body-lh);
	color: var(--gdq-color-text-body);
	background-color: var(--gdq-color-bg-primary);
	min-height: 100vh;
	text-rendering: optimizeSpeed; /* prioritises paint speed over kerning
	                                   precision — appropriate for a
	                                   content-heavy marketing site */
}

/* ==========================================================================
   SELECTION — brand-coloured text selection, a small but noticeable
   polish detail; uses the accent gold rather than the browser default blue,
   which would clash with the navy/gold palette.
   ========================================================================== */
::selection {
	background-color: var(--gdq-color-text-selection-bg);
	color: var(--gdq-color-text-selection-fg);
}

/* ==========================================================================
   LINKS
   Base reset only — visual "button-style" links and text-link-with-arrow
   are components, built in Sprint 2B. This is the bare <a> default that
   every other link style is built on top of.
   ========================================================================== */
a {
	color: var(--gdq-color-accent);
	text-decoration: none;
	transition: var(--gdq-transition-fast);
}

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

/* ==========================================================================
   FOCUS-VISIBLE
   Applied to every interactive element sitewide — accessibility baseline
   that every later component inherits automatically rather than having to
   remember to add it individually. Uses :focus-visible (not :focus) so the
   ring only appears for keyboard/assistive-tech navigation, not every
   mouse click — matching modern accessibility guidance without being
   visually noisy for mouse users.
   ========================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--gdq-color-focus-ring);
	outline-offset: 2px;
}

/* ==========================================================================
   IMAGES / MEDIA
   object-fit is intentionally NOT set here — it's applied per-component on
   fixed-aspect-ratio containers (cards, thumbnails) per Design Spec §3.8,
   since not every image sits inside a fixed-ratio box (e.g. inline content
   images should scale naturally, not crop).
   ========================================================================== */
img,
picture,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ==========================================================================
   FORMS — bare technical reset only; the styled Form component (inputs,
   labels, buttons) is built in a later sprint per the Design Spec §2.15.
   ========================================================================== */
button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
	background: none;
	border: none;
}

/* ==========================================================================
   LISTS — reset to unstyled by default. Content-area lists (inside
   article/entry-content) get real markers back in typography.css, since a
   blog body needs visible bullets/numbers but a nav menu or card list does
   not, and resetting-then-re-adding is more predictable than the reverse.
   ========================================================================== */
ul,
ol {
	list-style: none;
	padding: 0;
}

/* ==========================================================================
   TABLES — spacing/border reset only; visual table styling for content
   areas is defined in typography.css.
   ========================================================================== */
table {
	border-collapse: collapse;
	width: 100%;
}

th,
td {
	text-align: left;
	vertical-align: top;
}

/* ==========================================================================
   CODE / PRE — technical reset (font inheritance, no default margin);
   visual treatment (background, padding, radius) lives in typography.css
   since it's a content-typography concern, not a base-element concern.
   ========================================================================== */
code,
pre,
kbd,
samp {
	font-family: var(--gdq-font-family-mono);
	font-size: 0.9em; /* relative to surrounding text, not a fixed token —
	                      deliberately proportional so code reads correctly
	                      at any heading/body context it appears inside */
}

pre {
	overflow-x: auto; /* long code lines scroll rather than breaking layout
	                      or forcing horizontal page overflow */
}

/* ==========================================================================
   HR
   ========================================================================== */
hr {
	border: none;
	border-top: 1px solid var(--gdq-color-border);
	margin-block: var(--gdq-space-4);
}

/* ==========================================================================
   ACCESSIBILITY UTILITIES
   ========================================================================== */

/* Skip-to-content link — hidden until focused. Rendered in header.php. */
.skip-link {
	position: absolute;
	top: -100%;
	left: 0;
	z-index: var(--gdq-z-toast); /* must sit above the sticky header while focused */
	padding: var(--gdq-space-2) var(--gdq-space-3);
	background: var(--gdq-color-accent);
	color: var(--gdq-color-bg-primary);
	font-weight: 600;
	text-decoration: none;
}

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

/* Screen-reader-only utility — visually hidden but readable by assistive
   tech. Re-declared here (rather than relying on wp-admin's copy) so it
   works reliably on the front end regardless of what's enqueued. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
