/*
 * Team Grassroots base: reset, elements, layout primitives, a11y.
 * Component styles live in components.css.
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--tg-font-body);
	font-size: var(--tg-fs-base);
	line-height: var(--tg-lh-base);
	color: var(--tg-text);
	background: var(--tg-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Reserve space for the fixed mobile bottom bar so content is never hidden. */
@media (max-width: 768px) {
	body { padding-bottom: calc(var(--tg-bottombar-h) + env(safe-area-inset-bottom, 0px)); }
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--tg-font-head);
	font-weight: var(--tg-fw-black);
	line-height: var(--tg-lh-tight);
	margin: 0 0 var(--tg-sp-4);
	letter-spacing: -0.01em;
}
h1 { font-size: clamp(var(--tg-fs-2xl), 6vw, var(--tg-fs-4xl)); }
h2 { font-size: clamp(var(--tg-fs-xl), 4vw, var(--tg-fs-3xl)); }
h3 { font-size: var(--tg-fs-xl); }
h4 { font-size: var(--tg-fs-lg); }

p { margin: 0 0 var(--tg-sp-4); }

a { color: var(--tg-link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

ul, ol { margin: 0 0 var(--tg-sp-4); padding-left: 1.25em; }

button { font: inherit; cursor: pointer; }

hr { border: 0; border-top: var(--tg-bw) solid var(--tg-border); margin: var(--tg-sp-6) 0; }

/* ---- Focus (never rely on colour alone) ---- */
:focus-visible {
	outline: 3px solid var(--tg-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---- Layout primitives ---- */
.tg-container {
	width: 100%;
	max-width: var(--tg-maxw);
	margin-inline: auto;
	padding-inline: var(--tg-gutter);
}
.tg-container--text { max-width: var(--tg-maxw-text); }

.tg-section { padding-block: var(--tg-sp-7); }

.tg-stack > * + * { margin-top: var(--tg-sp-4); }

.tg-grid { display: grid; gap: var(--tg-sp-5); }

/* ---- Accessibility helpers ---- */
.screen-reader-text,
.tg-visually-hidden {
	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;
}

.tg-skip-link {
	position: absolute; left: -9999px; top: 0; z-index: var(--tg-z-toast);
	background: var(--tg-white); color: var(--tg-ink);
	padding: var(--tg-sp-3) var(--tg-sp-4); border-radius: 0 0 var(--tg-radius) 0;
	font-weight: var(--tg-fw-semi);
}
.tg-skip-link:focus { left: 0; }

/* Interactive elements meet the 48px minimum touch target on touch devices. */
@media (pointer: coarse) {
	a[href], button, input, select, .tg-tap {
		min-height: var(--tg-tap);
	}
}

[hidden] { display: none !important; }
