/**
 * Base reset, typography and layout primitives.
 */
*,
*::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-text-base);
	color: var(--tg-text);
	background-color: var(--tg-white);
	line-height: 1.6;
	overflow-x: hidden;
}

/*
 * WordPress admin bar offsets the sticky header — but only above 782px,
 * where the admin bar is position:fixed. Below 782px WP core switches the
 * admin bar to position:absolute (it scrolls away with the page), so the
 * sticky header must NOT be offset there or a permanent gap opens up after
 * scrolling.
 */
@media (min-width: 783px) {
	body.admin-bar .tg-masthead {
		top: 32px;
	}
}

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

a {
	color: var(--tg-blue);
	text-decoration: none;
	transition: color var(--tg-transition);
}

a:hover,
a:focus {
	color: var(--tg-green);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--tg-font-heading);
	color: var(--tg-dark-blue);
	line-height: 1.25;
	margin: 0 0 0.5em;
	font-weight: 700;
}

h1 {
	font-size: var(--tg-text-4xl);
}

h2 {
	font-size: var(--tg-text-3xl);
}

h3 {
	font-size: var(--tg-text-2xl);
}

h4 {
	font-size: var(--tg-text-xl);
}

h5,
h6 {
	font-size: var(--tg-text-lg);
}

p {
	margin: 0 0 1em;
}

small {
	font-size: var(--tg-text-sm);
}

ul,
ol {
	margin: 0 0 1em;
	padding-left: 1.25em;
}

:focus-visible {
	outline: 3px solid var(--tg-orange);
	outline-offset: 2px;
}

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

.tg-container--narrow {
	max-width: var(--tg-container-narrow);
}

@media (max-width: 600px) {
	.tg-container {
		padding-inline: var(--tg-space-sm);
	}
}

/* Section rhythm — every homepage/page section wraps in .tg-section */
.tg-section {
	padding-block: var(--tg-section-space);
}

.tg-section--tight {
	padding-block: calc(var(--tg-section-space) * 0.6);
}

.tg-section--muted {
	background-color: var(--tg-background);
}

.tg-section--dark {
	background-color: var(--tg-dark-blue);
	color: var(--tg-white);
}

.tg-generic-content {
	padding-block: var(--tg-section-space);
}

.tg-page__body,
.tg-single__body {
	max-width: var(--tg-container-narrow);
	margin-inline: auto;
	color: var(--tg-text);
	font-size: var(--tg-text-base);
	line-height: 1.75;
}

.tg-page__body > * + *,
.tg-single__body > * + * {
	margin-top: var(--tg-space-md);
}

.tg-page__body h2,
.tg-single__body h2 {
	font-size: var(--tg-text-2xl);
	color: var(--tg-dark-blue);
	margin-top: var(--tg-space-lg);
}

.tg-page__body h3,
.tg-single__body h3 {
	font-size: var(--tg-text-xl);
	color: var(--tg-dark-blue);
	margin-top: var(--tg-space-md);
}

.tg-page__body ul,
.tg-page__body ol,
.tg-single__body ul,
.tg-single__body ol {
	padding-left: 1.25em;
}

.tg-page__body img,
.tg-single__body img {
	border-radius: var(--tg-radius-lg);
	height: auto;
	max-width: 100%;
}

.tg-single__thumbnail {
	border-radius: var(--tg-radius-lg);
	overflow: hidden;
	margin-bottom: var(--tg-space-lg);
}

.tg-single__thumbnail img {
	width: 100%;
	height: auto;
	display: block;
}

.tg-section--dark h1,
.tg-section--dark h2,
.tg-section--dark h3 {
	color: var(--tg-white);
}

/*
 * Subtle water/botanical motif — a soft radial droplet watermark used as a
 * background accent behind hero/CTA sections. Intentionally understated:
 * low opacity, no illustration assets, purely CSS.
 */
.tg-motif-water {
	position: relative;
	isolation: isolate;
}

.tg-motif-water::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		radial-gradient(circle at 85% 15%, rgba(22, 120, 184, 0.08) 0%, transparent 45%),
		radial-gradient(circle at 10% 90%, rgba(0, 155, 85, 0.07) 0%, transparent 40%);
	pointer-events: none;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--tg-white);
	color: var(--tg-text);
	clip: auto !important;
	clip-path: none;
	display: block;
	height: auto;
	left: 8px;
	top: 8px;
	padding: 12px 16px;
	width: auto;
	z-index: 100000;
}

/* ------------------------------------------------------------------ */
/* Scroll reveal                                                       */
/* ------------------------------------------------------------------ */

/*
 * Content blocks fade and rise into place as they scroll into view.
 *
 * The .tg-reveal class is applied by JS (assets/js/reveal.js), never in the
 * markup — so if scripting is unavailable the rule never matches and content
 * renders normally. Hiding via CSS alone would risk leaving a page blank.
 */
.tg-reveal {
	opacity: 0;
	transform: translateY(24px);
	/* Paint/layout hint for the duration of the animation only; cleared once
	   revealed so long pages don't hold dozens of composited layers. */
	will-change: opacity, transform;
	transition:
		opacity 0.6s ease-out,
		transform 0.6s ease-out;
}

.tg-reveal--visible {
	opacity: 1;
	transform: none;
	will-change: auto;
}

/*
 * Belt and braces: the script already skips setup entirely when reduced
 * motion is requested, but if a visitor changes the setting after load this
 * keeps content visible and still.
 */
@media (prefers-reduced-motion: reduce) {
	.tg-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
