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

html {
	scroll-behavior: smooth;
	/* Sticky header: in-page anchors land below it (plus a little air). */
	scroll-padding-top: calc(var(--atv-header-h) + var(--spacing-s));
}

/* Core admin-bar.css sets scroll-padding-top on html at the same specificity: override at every width. */
html:has(body.admin-bar) {
	scroll-padding-top: calc(var(--atv-header-h) + var(--spacing-s));
}

@media (min-width: 601px) {
	html:has(body.admin-bar) {
		scroll-padding-top: calc(var(--atv-header-h) + var(--spacing-s) + var(--wp-admin--admin-bar--height, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body.atv-body {
	margin: 0;
	min-height: 100svh;
}

.wp-site-blocks {
	padding: 0;
}

.atv-main {
	min-height: 50svh;
}

.atv-placeholder-hero {
	min-height: 100svh;
	margin-top: calc(-1 * var(--atv-header-h));
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: calc(var(--atv-header-h) + var(--spacing-layout-l)) var(--spacing-layout-s) calc(var(--spacing-layout-xl) + 8rem);
	background:
		linear-gradient(180deg, rgb(11 18 21 / 0.15) 0%, rgb(11 18 21 / 0.72) 100%),
		var(--atv-scrim);
	color: var(--color-white);
}

.atv-placeholder-hero h1 {
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: var(--fontsize-heading-xl-mobile);
	line-height: var(--lineheight-s);
	letter-spacing: -0.03em;
	margin: 0 0 var(--spacing-xs);
	color: var(--color-white);
	max-width: 18ch;
}

.atv-placeholder-hero p {
	margin: 0;
	font-size: var(--fontsize-body-l);
	max-width: 36rem;
}

@media (min-width: 768px) {
	.atv-placeholder-hero h1 {
		font-size: var(--fontsize-heading-xl);
	}
}

@media (min-width: 1440px) {
	.atv-placeholder-hero h1 {
		font-size: var(--fontsize-heading-xxl);
	}
}

/* ---- Tipografia base (ver docs/design-system.md › Tipografia) ---------- */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* Headings never break inside a word (no "TRANSFORMAMO/S"): they wrap at spaces and at hyphens the author typed.
   Display sizes are capped on narrow screens so the longest word still fits (see the split/slide titles). */
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
	text-wrap: balance;
}

/* Prose wraps normally; only a word that cannot fit (a long URL, an e-mail address) may break. */
p,
li,
dd,
figcaption,
blockquote {
	max-width: var(--wp--custom--measure--prose, 65ch);
	overflow-wrap: break-word;
}

:is(p, li, dd, figcaption, blockquote) a {
	overflow-wrap: anywhere;
}

.atv-lead,
.is-style-atv-lead {
	font-size: var(--fontsize-body-xl);
	line-height: 1.5;
	max-width: var(--wp--custom--measure--lead, 40rem);
}

.atv-eyebrow,
.is-style-atv-eyebrow {
	font-family: var(--font-heading);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-black-60);
}

.atv-meta,
.is-style-atv-meta {
	font-size: var(--fontsize-body-s);
	color: var(--color-black-60);
}

/* ---- Foco visível (WCAG 2.4.7 / 2.4.11 / 1.4.11) ------------------------
   Anel de 3px, offset 2px. Cor navy em fundos claros, lima em contextos escuros
   (--color-focus-outline é trocado em hds-theme.css para .atv-on-dark e afins). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--atv-focus-width, 3px) solid var(--color-focus-outline);
	outline-offset: var(--atv-focus-offset, 2px);
}

:focus:not(:focus-visible) {
	outline: none;
}

/* Alvos mínimos (WCAG 2.5.8: 24×24; controlos primários 44×44). */
.atv-target,
.atv-nav__item > a,
.atv-nav__button,
.hds-checkbox__label,
.hds-radio-button__label {
	min-height: var(--wp--custom--target--min, 24px);
}

/* Windows High Contrast / forced-colors: deixa o sistema mandar nas cores,
   mas garante contornos visíveis onde a cor era o único sinal. */
@media (forced-colors: active) {
	.hds-button,
	.wp-element-button,
	.wp-block-button__link,
	.hds-tag,
	.hds-card,
	.hds-notification,
	.atv-tile {
		border: 2px solid ButtonText;
		forced-color-adjust: auto;
	}

	.hds-button--primary,
	.wp-element-button {
		background: ButtonFace;
		color: ButtonText;
	}

	:focus-visible {
		outline: 3px solid Highlight;
	}

	.atv-hero__media::after,
	.atv-agenda__media::after,
	.atv-tile::after {
		display: none;
	}
}

.atv-page {
	padding-block: var(--spacing-layout-m);
}

.atv-page h1 {
	margin-top: 0;
}

.skip-link.screen-reader-text {
	position: absolute;
	inset-inline-start: var(--spacing-s);
	top: var(--spacing-s);
	z-index: 100000;
}

.skip-link.screen-reader-text:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	margin: 0;
	padding: var(--spacing-xs) var(--spacing-s);
	background: var(--atv-green);
	color: var(--atv-navy); /* navy sobre lima: 4,89:1 (branco sobre lima falha: 2,24:1) */
	font-family: var(--font-heading);
	font-weight: 700;
	text-decoration: none;
	border-radius: var(--atv-radius-control);
	outline: var(--atv-focus-width, 3px) solid var(--atv-focus-light);
	outline-offset: var(--atv-focus-offset, 2px);
}

@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;
	}
}
