/* ==========================================================================
   Agrivencia — reset, typography, layout primitives
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* The header no longer pins, so an anchor only needs breathing room. */
	scroll-padding-top: 1rem;
}

body {
	margin: 0;
	font-family: var(--agv-font);
	font-size: var(--agv-t-base);
	line-height: var(--agv-lh-base);
	color: var(--agv-ink);
	background: var(--agv-canvas);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-feature-settings: "kern" 1, "liga" 1, "cv05" 1;
	overflow-x: hidden;
}

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

h1, h2, h3, h4, h5 {
	margin: 0 0 var(--agv-s3);
	font-family: var(--agv-display);
	font-weight: 600;
	line-height: var(--agv-lh-tight);
	letter-spacing: var(--agv-track-tight);
	text-wrap: balance;
	color: var(--agv-ink);
}
h1 { font-size: clamp(2.25rem, 5.5vw, var(--agv-t-4xl)); }
h2 { font-size: clamp(1.75rem, 3.8vw, var(--agv-t-2xl)); }
h3 { font-size: var(--agv-t-lg); }
h4 { font-size: var(--agv-t-md); }

p { margin: 0 0 var(--agv-s4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--agv-mod-shade); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--agv-mod-deep); }

ul, ol { margin: 0 0 var(--agv-s4); padding-left: 1.15rem; }
li { margin-bottom: var(--agv-s2); }

strong { font-weight: 640; }
em { font-style: italic; }

hr { border: 0; border-top: 1px solid var(--agv-line); margin: var(--agv-s7) 0; }

code, kbd, samp { font-family: var(--agv-mono); font-size: .9em; }

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

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--agv-mod-base);
	outline-offset: 2px;
	border-radius: var(--agv-r-xs);
}

::selection { background: var(--agv-mod-glow); color: var(--agv-mod-ink); }

/* --- Accessibility helpers ------------------------------------------ */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap; border: 0;
}

.agv-skip {
	position: absolute;
	top: -100px; left: var(--agv-s4);
	z-index: 999;
	padding: var(--agv-s3) var(--agv-s5);
	background: var(--agv-ink);
	color: #fff;
	border-radius: 0 0 var(--agv-r) var(--agv-r);
	font-weight: 600;
	text-decoration: none;
	transition: top var(--agv-fast) var(--agv-ease);
}
.agv-skip:focus { top: 0; color: #fff; }

/* --- Layout ---------------------------------------------------------- */
.agv-wrap {
	width: 100%;
	max-width: var(--agv-wrap);
	margin-inline: auto;
	padding-inline: var(--agv-gutter);
}
.agv-wrap--narrow { max-width: var(--agv-wrap-narrow); }

.agv-section {
	position: relative;
	padding-block: var(--agv-section-y);
}

/* Tone system: each section paints itself from the page's module colour. */
.agv-tone--light  { background: var(--agv-surface); }
.agv-tone--tint   { background: var(--agv-mod-wash); }
.agv-tone--deep   { background: var(--agv-mod-deep); color: #fff; }
.agv-tone--colour { background: var(--agv-mod-base); color: var(--agv-mod-on); }

.agv-tone--deep h1, .agv-tone--deep h2, .agv-tone--deep h3,
.agv-tone--colour h1, .agv-tone--colour h2, .agv-tone--colour h3 { color: inherit; }

/* Links inside painted sections inherit the section colour — but buttons carry
   their own foreground, so they are excluded rather than overridden later. */
:where(.agv-tone--deep, .agv-tone--colour) a:not(.agv-btn) { color: inherit; }

/* Alternating hairline so consecutive light sections still separate. */
.agv-tone--light + .agv-tone--light { border-top: 1px solid var(--agv-line-2); }

.agv-grid { display: grid; gap: var(--agv-s5); }
.agv-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.agv-grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.agv-grid--4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.agv-grid--modules { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: var(--agv-s4); }
.agv-grid--verticals { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.agv-grid--cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* --- Section header -------------------------------------------------- */
.agv-shead { max-width: 62ch; margin-bottom: var(--agv-s6); }
.agv-shead__title { margin-bottom: var(--agv-s3); }
.agv-shead__intro { font-size: var(--agv-t-md); color: var(--agv-ink-3); }
.agv-tone--deep .agv-shead__intro,
.agv-tone--colour .agv-shead__intro { color: rgba(255,255,255,.82); }

.agv-eyebrow {
	margin: 0 0 var(--agv-s2);
	font-family: var(--agv-mono);
	font-size: var(--agv-t-xs);
	font-weight: 600;
	letter-spacing: var(--agv-track-wide);
	text-transform: uppercase;
	color: var(--agv-mod-shade);
	display: flex; align-items: center; gap: var(--agv-s2);
}
.agv-eyebrow::before {
	content: ""; width: 22px; height: 2px;
	background: currentColor; border-radius: 2px;
}
.agv-eyebrow--on { color: currentColor; opacity: .78; }

.agv-lead { font-size: var(--agv-t-md); color: var(--agv-ink-2); }

.agv-prose { max-width: 68ch; }
.agv-prose p { font-size: var(--agv-t-md); color: var(--agv-ink-2); }

/* --- Notes ----------------------------------------------------------- */
.agv-note {
	display: flex; gap: var(--agv-s2); align-items: flex-start;
	margin-top: var(--agv-s5);
	padding: var(--agv-s3) var(--agv-s4);
	background: var(--agv-surface-2);
	border-left: 3px solid var(--agv-mod-base);
	border-radius: 0 var(--agv-r-sm) var(--agv-r-sm) 0;
	font-size: var(--agv-t-sm);
	color: var(--agv-ink-3);
	line-height: 1.5;
}
.agv-note .agv-icon { width: 16px; height: 16px; margin-top: 2px; color: var(--agv-mod-base); }
.agv-note--warn { background: var(--agv-warn-tint); border-left-color: var(--agv-warn); color: #6b4108; }
.agv-note--warn .agv-icon { color: var(--agv-warn); }
.agv-tone--deep .agv-note, .agv-tone--colour .agv-note {
	background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); border-left-color: rgba(255,255,255,.5);
}

.agv-consent-note { font-size: var(--agv-t-xs); opacity: .75; margin-top: var(--agv-s3); line-height: 1.5; }

/* --- Breadcrumbs ----------------------------------------------------- */
.agv-crumbs { padding-block: var(--agv-s4) 0; font-size: var(--agv-t-sm); }
.agv-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--agv-s2); list-style: none; margin: 0; padding: 0; }
.agv-crumbs li { margin: 0; display: flex; align-items: center; gap: var(--agv-s2); color: var(--agv-ink-4); }
.agv-crumbs li + li::before { content: "/"; color: var(--agv-line); }
.agv-crumbs a { color: var(--agv-ink-4); text-decoration: none; }
.agv-crumbs a:hover { color: var(--agv-mod-base); text-decoration: underline; }
.agv-crumbs [aria-current] { color: var(--agv-ink); font-weight: 560; }

/* --- Motion preference ----------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
	}
}
:root[data-agv-motion="reduce"] *,
:root[data-agv-motion="reduce"] *::before,
:root[data-agv-motion="reduce"] *::after {
	animation-duration: .001ms !important;
	transition-duration: .001ms !important;
}

/* --- Print ----------------------------------------------------------- */
@media print {
	.agv-cockpit, .agv-float, .agv-ticker, .agv-footer__subscribe,
	.agv-consent, .agv-panel, .agv-drawer, .agv-progress { display: none !important; }
	body { background: #fff; color: #000; font-size: 11pt; }
	.agv-section { padding-block: 1.2rem; break-inside: avoid; }
	.agv-tone--deep, .agv-tone--colour { background: #fff !important; color: #000 !important; }
	a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
	.agv-hero__title { font-size: 22pt; }
}
