/* PT Base – Agrupamento de Escolas de Ansião.
 * Um só ficheiro CSS, fontes de sistema, sem frameworks.
 * Contrastes verificados para WCAG 2.2 AA (texto normal ≥ 4.5:1, componentes ≥ 3:1).
 */

/* ---------- Tokens ---------- */
:root {
	--primary: #0066cc;          /* 5.6:1 em branco */
	--brand: #00739a;            /* azul-petróleo do catavento, 5.3:1 em branco */
	--primary-hover: #0055b3;
	--focus: #0058b0;
	--ink: #1d1d1f;
	--ink-muted: #555558;        /* 7.4:1 em branco */
	--ink-soft: #636366;         /* 6.0:1 em branco – datas e metadados */
	--canvas: #ffffff;
	--parchment: #f5f5f7;
	--subtle: #fbfbfd;
	--hairline: #d8d8dc;
	--dark: #111113;
	--on-dark: #b9b9be;          /* 9.6:1 em --dark */

	/* Tons das 4 cores do catavento, versão acessível (texto/fundo ≥ 6:1). */
	--amber-bg: #fff4cc; --amber-ink: #7a4a00;
	--blue-bg: #dcf3fb;  --blue-ink: #02607e;
	--green-bg: #eef7d6; --green-ink: #3d5a00;
	--red-bg: #fde4e7;   --red-ink: #a3122a;

	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 18px;
	--r-xl: 24px;
	--pill: 9999px;

	--shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
	--shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.1);
	--ease: cubic-bezier(0.16, 1, 0.3, 1);

	--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--container: 1272px;         /* largura do conteúdo, sem margens */
	--gutter: clamp(24px, 4vw, 64px); /* margem lateral: 24 px no telemóvel, ~55 px em 1366 */
	--header-h: 72px;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	font: 1.0625rem/1.55 var(--font);
	color: var(--ink);
	background: var(--parchment);
	-webkit-font-smoothing: antialiased;
}

img,
video,
iframe {
	max-width: 100%;
	height: auto;
}

h1, h2, h3, h4 {
	line-height: 1.2;
	letter-spacing: -0.01em;
	margin: 0 0 0.5em;
}

p {
	margin: 0 0 1em;
}

a {
	color: var(--primary);
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--primary-hover);
	text-decoration-thickness: 2px;
}

button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

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

/* Em fundos escuros o contorno de foco passa a branco. */
.top-bar :focus-visible,
.hero :focus-visible,
.site-footer :focus-visible,
.skip-link:focus-visible {
	outline-color: #fff;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 10000;
	padding: 12px 20px;
	background: var(--ink);
	color: #fff;
	font-weight: 600;
	border-radius: var(--pill);
	text-decoration: none;
}

.skip-link:focus {
	top: 16px;
	color: #fff;
}

.container {
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--narrow {
	max-width: calc(760px + 2 * var(--gutter));
}

.site-main {
	outline: none;
	min-height: 50vh;
}

/* Sem JS: separadores, setas e botão de menu escondidos; títulos dos painéis visíveis. */
.js .no-js-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

/* Editor clássico (este CSS também é carregado no editor): sem contorno de foco na área de escrita. */
.mce-content-body:focus,
.mce-content-body:focus-visible {
	outline: none;
}

.mce-content-body {
	padding: 16px;
	background: #fff;
}

/* ---------- Botões ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 22px;
	border: 2px solid transparent;
	border-radius: var(--pill);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s, transform 0.1s;
}

.btn:active {
	transform: scale(0.97);
}

.btn--primary {
	background: var(--primary);
	color: #fff;
}

.btn--primary:hover {
	background: var(--primary-hover);
	color: #fff;
}

/* Secundário (ex.: INOVAR no cabeçalho): o único botão "principal" fica para a ação da página. */
.btn--outline {
	border-color: var(--primary);
	background: var(--canvas);
	color: var(--primary);
}

.btn--outline:hover {
	background: var(--blue-bg);
	color: var(--primary-hover);
}

.btn--dark {
	background: var(--ink);
	color: #fff;
}

.btn--dark:hover {
	background: #3a3a3c;
}

.btn--light {
	background: #fff;
	color: var(--ink);
	font-size: 1rem;
	padding: 12px 26px;
}

.btn--light:hover {
	background: #eef2f6;
	color: var(--ink);
}

.btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--parchment);
	color: var(--ink);
	transition: background-color 0.15s;
}

.btn-icon:hover {
	background: #e5e5ea;
}

.btn-icon--glass {
	background: transparent;
	color: #fff;
}

.btn-icon--glass:hover {
	background: rgba(255, 255, 255, 0.2);
}

.btn-icon--soft {
	border: 1px solid var(--hairline);
}

.btn-icon:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.icon {
	flex-shrink: 0;
}

/* ---------- Avisos no topo ---------- */
.site-alert {
	color: #fff;
}

.site-alert--urgente {
	background: #991b1b;          /* branco: 8.3:1 */
}

.site-alert--informativo {
	background: #075985;          /* branco: 7.6:1 */
}

.site-alert + .site-alert {
	border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.site-alert__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-block: 10px;
}

.site-alert__text {
	flex: 1;
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.site-alert__text a {
	color: #fff;
	font-weight: 700;
	text-decoration-thickness: 2px;
	white-space: nowrap;
}

.site-alert__text a:hover {
	color: #fff;
	text-decoration-thickness: 3px;
}

.site-alert__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	background: transparent;
	color: #fff;
}

.site-alert__close:hover {
	background: rgba(255, 255, 255, 0.15);
}

.site-alert :focus-visible {
	outline-color: #fff;
}

html:not(.js) .site-alert__close {
	display: none;
}

/* ---------- Barra do topo ---------- */
.top-bar {
	background: #000;
	color: #e5e5ea;
	font-size: 0.875rem;
}

.top-bar__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 4px 16px;
	min-height: 40px;
}

.top-bar p {
	margin: 0;
}

.top-bar a {
	color: #fff;
}

.top-bar__note {
	color: #b9b9be;
}

.top-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.top-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	color: #e5e5ea;
	text-decoration: none;
}

.top-nav a:hover {
	color: #fff;
	text-decoration: underline;
}

@media (max-width: 640px) {
	.top-bar__note {
		display: none;
	}
}

/* ---------- Cabeçalho ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	backdrop-filter: blur(20px) saturate(180%);
	border-bottom: 1px solid var(--hairline);
}

.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 0;
	}
}

.site-header__inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	min-height: var(--header-h);
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	color: var(--ink);
	text-decoration: none;
}

.brand:hover {
	color: var(--ink);
}

.brand__logo {
	display: block;
	width: auto;
	height: 56px;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.menu-toggle__icon {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 18px;
	height: 12px;
}

.menu-toggle__icon span {
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}

@media (max-width: 480px) {
	.brand__logo {
		height: 46px;
	}
	.btn--inovar {
		padding-inline: 14px;
	}
	.btn--inovar .icon {
		display: none;
	}
}

html:not(.js) .menu-toggle {
	display: none;
}

/* ---------- Mega menu (computador) ---------- */
.mega {
	display: none;
}

@media (min-width: 1024px) {
	.js .mega {
		display: block;
		flex: 1;
		margin-left: 32px;
	}
	.js .menu-toggle {
		display: none;
	}
}

.mega__list {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mega__toggle,
.mega__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
	border: 0;
	border-radius: var(--pill);
	background: none;
	color: var(--ink);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s;
}

.mega__toggle .icon {
	transform: rotate(90deg);
	color: var(--ink-soft);
	transition: transform 0.2s var(--ease);
}

.mega__toggle:hover,
.mega__link:hover {
	background: var(--parchment);
	color: var(--ink);
}

.mega__toggle[aria-expanded="true"] {
	background: var(--parchment);
}

.mega__toggle[aria-expanded="true"] .icon {
	transform: rotate(-90deg);
}

/* Secção onde está a página atual: sublinhado na cor da marca. */
.mega__toggle.is-current,
.mega__link.is-current {
	box-shadow: inset 0 -3px 0 var(--brand);
	border-radius: 0;
}

.mega__panel {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	border-top: 1px solid var(--hairline);
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
}

.mega__panel:not([hidden]) {
	animation: mega-in 0.2s var(--ease);
}

@keyframes mega-in {
	from { opacity: 0; transform: translateY(-6px); }
}

.mega__inner {
	padding-top: 32px;
	padding-bottom: 28px;
}

.mega__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 8px 40px;
}

.mega__heading {
	margin: 0 0 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--hairline);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--brand);
}

.mega__heading a {
	color: inherit;
	text-decoration: none;
}

.mega__heading a:hover {
	text-decoration: underline;
}

.mega__links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mega__links--loose {
	padding-top: 31px; /* alinha com as colunas que têm título */
}

.mega__links a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 4px 0;
	color: var(--ink);
	font-size: 1rem;
	line-height: 1.4;
	text-decoration: none;
}

.mega__links a:hover {
	color: var(--primary);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.mega__links a[aria-current="page"] {
	color: var(--primary);
	font-weight: 700;
}

.mega__all {
	display: flex;
	justify-content: flex-end;
	margin: 20px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--hairline);
}

.mega__all a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	font-weight: 600;
	text-decoration: none;
}

.mega__all a:hover {
	text-decoration: underline;
}

/* Pesquisa no cabeçalho (computador; no telemóvel está na gaveta) */
.header-search {
	display: none;
	position: relative;
}

@media (min-width: 1024px) {
	.js .header-search {
		display: block;
	}
}

.header-search__toggle[aria-expanded="true"] {
	background: #e5e5ea;
}

.header-search__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 12px);
	width: 360px;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--hairline);
	border-radius: var(--r-md);
	box-shadow: var(--shadow-hover);
}

/* ---------- Gaveta do menu (<dialog>) ---------- */
.drawer {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(100%, 520px);
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
	color: var(--ink);
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.drawer[open] {
	animation: drawer-in 0.35s var(--ease);
}

.drawer::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

@keyframes drawer-in {
	from { transform: translateX(100%); }
}

html:has(.drawer[open]),
html:has(.popup[open]) {
	overflow: hidden;
}

/* Sem JS: o menu aparece como lista normal abaixo do cabeçalho. */
html:not(.js) .drawer {
	display: block;
	position: static;
	width: auto;
	height: auto;
	box-shadow: none;
	border-bottom: 1px solid var(--hairline);
}

html:not(.js) .drawer__close {
	display: none;
}

.drawer__top {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 24px;
	background: #fff;
	border-bottom: 1px solid var(--hairline);
}

.drawer__title {
	margin: 0;
	font-size: 1.375rem;
}

.drawer__search {
	padding: 16px 24px 0;
}

.drawer__nav {
	padding: 8px 24px 48px;
}

.nav-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav-list .sub-menu {
	list-style: none;
	padding-left: 16px;
}

.nav-list a,
.nav-forward {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 12px 4px;
	border: 0;
	border-bottom: 1px solid var(--hairline);
	background: none;
	color: var(--ink);
	font-size: 1.0625rem;
	font-weight: 500;
	text-align: left;
	text-decoration: none;
}

.nav-list a:hover,
.nav-forward:hover {
	color: var(--primary);
}

.nav-list [aria-current="page"],
.nav-forward.is-current {
	color: var(--primary);
	font-weight: 700;
}

/* Página atual: texto à esquerda, a azul e negrito, com traço à esquerda (não é um elemento do flex). */
.nav-list a[aria-current="page"] {
	justify-content: flex-start;
	padding-left: 14px;
	box-shadow: inset 4px 0 0 var(--primary);
}

.menu-item--parent a {
	font-weight: 600;
	color: var(--primary);
}

.nav-panel:not([hidden]) {
	animation: panel-in 0.25s var(--ease);
}

@keyframes panel-in {
	from { opacity: 0; transform: translateX(24px); }
}

.nav-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	margin: 8px 0 4px -8px;
	padding: 8px;
	border: 0;
	border-radius: var(--r-sm);
	background: none;
	color: var(--primary);
	font-weight: 600;
}

.nav-back:hover {
	background: var(--parchment);
}

.nav-panel__title {
	margin: 4px 0 8px;
	font-size: 1.5rem;
	outline-offset: 4px;
}

/* ---------- Pesquisa ---------- */
.search-form__label {
	flex-basis: 100%;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ink);
}

.search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
}

.search-field {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	padding: 8px 14px;
	border: 1px solid #8e8e93;   /* 3.3:1 – contorno de campo visível */
	border-radius: var(--r-sm);
	font: inherit;
	background: #fff;
	color: var(--ink);
}

.search-field::placeholder {
	color: var(--ink-soft);   /* 6.0:1 – o cinzento do browser pode ficar abaixo de 4,5:1 */
	opacity: 1;
}

.search-form .button {
	min-height: 44px;
	padding: 8px 18px;
	border: 0;
	border-radius: var(--r-sm);
	background: var(--ink);
	color: #fff;
	font-weight: 600;
}

/* ---------- Boas-vindas (h1 e propósito do site) ----------
 * h1 discreto em forma de etiqueta + frase de propósito (Selo de Usabilidade 1.1).
 */
.intro {
	padding: 28px 0 0;
}

.intro__title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--brand);
}

/* Quatro linhas finas em escada, nas cores do catavento */
.intro__mark {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 2px;
	width: 20px;
}

.intro__mark i {
	height: 2px;
	border-radius: 1px;
}

/* Em escada: cada linha mais curta do que a de cima */
.intro__mark i:nth-child(1) { width: 20px; }
.intro__mark i:nth-child(2) { width: 15px; }
.intro__mark i:nth-child(3) { width: 10px; }
.intro__mark i:nth-child(4) { width: 5px; }

.intro__mark i:nth-child(1) { background: #00a3d4; }
.intro__mark i:nth-child(2) { background: #a5d020; }
.intro__mark i:nth-child(3) { background: #fcc70a; }
.intro__mark i:nth-child(4) { background: #e8193c; }

.intro__text {
	max-width: 48rem;
	margin: 6px 0 0;
	font-size: 1rem;               /* 16 px = 12 pt, mínimo do Selo para texto */
	line-height: 1.5;
	color: var(--ink-muted);
}

@media (max-width: 640px) {
	.intro {
		padding-top: 20px;
	}
	.intro__title {
		font-size: 1rem;
		letter-spacing: 0.08em;
	}
}

.intro + .hero {
	padding-top: 18px;
}

/* ---------- Destaques (carrossel) ---------- */
.hero {
	padding: 28px 0 0;
}

.hero__swiper {
	position: relative;
	border-radius: var(--r-xl);
	overflow: hidden;
	background: var(--dark);
	box-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;
}

/* .hero .hero__slide: mais forte que o .swiper-slide { display: block } do Swiper (carregado depois). */
.hero .hero__slide {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 520px;
	height: auto;
	overflow: hidden;
}

.hero__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center; /* se cortar, corta em baixo */
}

/* Escurece só onde está o texto (em baixo e à esquerda); o topo da imagem fica com o brilho original. */
.hero__slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0) 75%),
		linear-gradient(180deg, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.75) 100%);
}

.hero__content {
	position: relative;
	z-index: 1;
	max-width: 860px;
	padding: 56px 48px 96px;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 16px rgba(0, 0, 0, 0.35);
}

.hero__content .btn,
.hero__content .badge {
	text-shadow: none;
}

.hero__title {
	font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
	line-height: 1.08;
	margin-bottom: 14px;
}

.hero__text {
	max-width: 720px;
	font-size: clamp(1rem, 0.9rem + 0.4vw, 1.1875rem);
	color: #fff;
	margin-bottom: 24px;
}

.hero__controls {
	position: absolute;
	right: 24px;
	bottom: 20px;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	background: rgba(0, 0, 0, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: var(--pill);
}

.hero__counter {
	min-width: 44px;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	text-align: center;
}

@media (max-width: 768px) {
	.hero .hero__slide {
		min-height: 440px;
	}
	.hero__content {
		padding: 32px 24px 88px;
	}
	.hero__controls {
		left: 16px;
		right: auto;
		bottom: 16px;
	}
}

/* Ecrãs baixos (portáteis 1366×768): menos espaço vertical, mesma letra do texto e alvos de 44px. */
@media (min-width: 769px) and (max-height: 800px) {
	:root { --container: 1112px; } /* mais margem dos lados em 1366×768 */
	.intro { padding-top: 20px; }
	.intro + .hero { padding-top: 12px; }
	.hero .hero__slide { min-height: 340px; }
	.hero__content { padding: 32px 48px 72px; }
	.hero__title { font-size: clamp(1.75rem, 1rem + 2vw, 2.25rem); }
	.paa { padding-bottom: 40px; }
	.news { padding: 48px 0 40px; }
	.card--feature .card__body { padding: 24px; }
	.school-life { padding: 40px 0 48px; }
	.seals { padding: 48px 0; }
}

/* Um só destaque: sem espaço reservado para os controlos. */
.hero--single .hero__content {
	padding-bottom: 56px;
}

@media (max-width: 768px) {
	.hero--single .hero__content {
		padding-bottom: 32px;
	}
}

/* Sem JS os diapositivos ficam empilhados. */
html:not(.js) .hero .swiper-wrapper {
	display: block;
}

/* ---------- Atalhos ---------- */
.quick-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

.quick-tile {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 76px;
	height: 100%;
	padding: 16px 20px;
	background: var(--canvas);
	border: 1px solid var(--hairline);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow);
	color: var(--ink);
	text-decoration: none;
	transition: transform 0.2s, box-shadow 0.2s;
}

.quick-tile:hover {
	color: var(--ink);
	transform: translateY(-2px);
	box-shadow: var(--shadow-hover);
}

.quick-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	border-radius: var(--r-sm);
}

.quick-grid li:nth-child(4n + 1) .quick-icon { background: var(--blue-bg); color: var(--blue-ink); }
.quick-grid li:nth-child(4n + 2) .quick-icon { background: var(--green-bg); color: var(--green-ink); }
.quick-grid li:nth-child(4n + 3) .quick-icon { background: var(--amber-bg); color: var(--amber-ink); }
.quick-grid li:nth-child(4n + 4) .quick-icon { background: var(--red-bg); color: var(--red-ink); }

.quick-title {
	display: block;
	font-weight: 600;
}

.quick-desc {
	display: block;
	font-size: 0.875rem;
	color: var(--ink-muted);
}

/* ---------- Atividades PAA (template-parts/paa.php) ---------- */
.paa {
	padding: 0 0 56px;            /* a seguir às Últimas notícias */
}

.paa__kicker {
	display: block;
	margin-top: 4px;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--brand);               /* 5.4:1 */
}

.paa__groups {
	display: grid;
	align-items: start;                /* sem atividades a decorrer, o cartão fica baixo */
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
	gap: 20px;
}

.paa__group {
	padding: 8px 24px 12px;
	background: var(--canvas);
	border: 1px solid var(--hairline);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow);
}

.paa__group-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0 4px;
	font-size: 1.125rem;
	font-weight: 700;
}

.paa__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--brand);
}

.paa__group--hoje .paa__dot {
	background: #3d8a00;               /* verde do catavento (decorativo, sem texto) */
	box-shadow: 0 0 0 4px rgba(61, 138, 0, 0.18);
}

@media (prefers-reduced-motion: no-preference) {
	.paa__group--hoje .paa__dot { animation: paa-pulse 2s ease-in-out infinite; }
}

@keyframes paa-pulse { 50% { box-shadow: 0 0 0 7px rgba(61, 138, 0, 0.05); } }

.paa__empty {
	margin: 8px 0 20px;
	color: var(--ink-muted);
}

.paa__group--hoje:has(.paa__empty) .paa__dot {
	background: var(--hairline);       /* nada a decorrer: ponto apagado */
	box-shadow: none;
	animation: none;
}

.paa__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.paa__item {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 18px;
	padding: 18px 0;
}

.paa__item + .paa__item {
	border-top: 1px solid var(--hairline);
}

.paa__date {
	position: relative;
	align-self: start;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 68px;
	padding: 10px 2px 8px;
	background: #f2f7f9;
	border-radius: var(--r-md);
	overflow: hidden;
	text-align: center;
}

/* Traço nas cores do catavento (decorativo). */
.paa__date::before {
	content: "";
	position: absolute;
	top: 0;
	left: 22px;
	right: 22px;
	height: 3px;
	border-radius: 0 0 2px 2px;
	background: #00a3d4;
}

.paa__item:nth-child(4n + 2) .paa__date::before { background: #a5d020; }
.paa__item:nth-child(4n + 3) .paa__date::before { background: #fcc70a; }
.paa__item:nth-child(4n + 4) .paa__date::before { background: #e8193c; }

.paa__day {
	font-size: 1.625rem;
	font-weight: 800;
	line-height: 1;
	color: var(--brand);               /* 5.0:1 em #f2f7f9 */
}

.paa__day--range {
	font-size: 1.125rem;
	white-space: nowrap;
}

.paa__month {
	margin-top: 4px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-muted);           /* 6.9:1 em #f2f7f9 */
}

.paa__title {
	margin: 0 0 6px;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
}

.paa__title a {
	color: var(--ink);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.paa__title a:hover {
	color: var(--primary);
}

.paa__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 0;
	font-size: 0.9375rem;
	color: var(--ink);
}

.paa__meta > span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.paa__meta .icon {
	flex-shrink: 0;
	color: var(--brand);
}

.paa__when {
	font-weight: 600;
}

.paa__desc {
	margin: 8px 0 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--ink-muted);
}

.paa__who {
	display: block;
	margin-top: 2px;
	font-size: 0.875rem;
	color: var(--ink-soft);
}

/* ---------- Secções ---------- */
.section-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px 16px;
	margin-bottom: 24px;
}

.section-title {
	margin: 0;
	font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
	font-weight: 600;
}

.section-title--sm {
	font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
	margin-bottom: 8px;
}

.section-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	font-weight: 600;
	text-decoration: none;
}

.section-link:hover {
	text-decoration: underline;
}

.eyebrow {
	margin: 0 0 4px;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--green-ink);
}

/* ---------- Etiquetas ---------- */
.badge {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	padding: 4px 12px;
	margin-bottom: 12px;
	border-radius: var(--pill);
	font-size: 0.84375rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.badge-amber { background: var(--amber-bg); color: var(--amber-ink); }
.badge-blue { background: var(--blue-bg); color: var(--blue-ink); }
.badge-green { background: var(--green-bg); color: var(--green-ink); }
.badge-red { background: var(--red-bg); color: var(--red-ink); }

/* ---------- Cartões ---------- */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--canvas);
	border: 1px solid var(--hairline);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow);
	overflow: hidden;
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-hover);
	border-color: #b8b8bd;
}

/* Cartão todo clicável sem link duplicado. */
.card__link {
	color: inherit;
	text-decoration: none;
}

.card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.card__link:hover {
	color: var(--primary);
	text-decoration: underline;
}

.card__link:focus-visible {
	outline: none;
}

.card:has(.card__link:focus-visible) {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.card__media {
	aspect-ratio: 3 / 2; /* = 860×571 das imagens existentes */
	background: #e2e8f0;
	overflow: hidden;
}

.card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center; /* se cortar, corta em baixo: títulos de cartazes e caras ficam visíveis */
	transition: transform 0.4s ease;
}

.card:hover .card__media img {
	transform: scale(1.03);
}

.card__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 24px;
}

.card__title {
	font-size: 1.1875rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 8px;
}

.card__excerpt {
	flex-grow: 1;
	font-size: 0.9375rem;
	color: var(--ink-muted);
	margin-bottom: 16px;
}

.card__meta {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ink-soft);
}

.card--feature .card__body {
	padding: 32px;
}

/* Data logo a seguir ao texto (o cartão estica até à altura da lista ao lado). */
.card--feature .card__excerpt {
	flex-grow: 0;
}

.card--feature .card__title {
	font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
}

.card--compact {
	flex-direction: row;
	align-items: center;
	gap: 16px;
	padding: 14px;
	border-radius: var(--r-md);
}

.card--compact:hover {
	transform: translateX(4px);
}

.card--compact .card__media {
	width: 88px;
	height: 88px;
	aspect-ratio: auto;
	flex-shrink: 0;
	border-radius: var(--r-sm);
}

.card--compact .card__body {
	padding: 0;
}

.card--compact .card__title {
	font-size: 1rem;
	margin: 0 0 4px;
}

.card--school {
	background: var(--subtle);
}

.card--school .card__body {
	padding: 24px;
}

/* ---------- Últimas notícias ---------- */
.news {
	padding: 64px 0 56px;
}

.news__layout {
	display: grid;
	grid-template-columns: 1.35fr 1fr;
	gap: 28px;
}

.news__list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* No computador, a coluna da direita estica até à altura do cartão grande. */
@media (min-width: 961px) {
	.news__list > li {
		flex: 1 1 0;
		display: flex;
	}
	.news__list .card--compact {
		width: 100%;
	}
}

/* Ecrãs baixos: destaque mais estreito, imagem 3:2 mais baixa. */
@media (min-width: 961px) and (max-height: 800px) {
	.news__layout {
		grid-template-columns: 1fr 1.15fr;
	}
}

@media (max-width: 960px) {
	.news__layout {
		grid-template-columns: 1fr;
	}
}

/* ---------- Vida escolar ---------- */
.school-life {
	padding: 56px 0 64px;
	background: var(--canvas);
	border-block: 1px solid var(--hairline);
}

.shelf-nav {
	display: flex;
	gap: 8px;
}

.tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--hairline);
	overflow-x: auto;
}

.tab {
	min-height: 48px;
	padding: 10px 18px;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	color: var(--ink-muted);
	font-weight: 600;
	white-space: nowrap;
}

.tab:hover {
	color: var(--ink);
}

.tab[aria-selected="true"] {
	color: var(--primary);
	border-bottom-color: var(--primary);
}

.tab:focus-visible {
	outline-offset: -3px;
}

/* Telemóvel: separadores em "pills" que quebram linha – todos visíveis, sem deslizar. */
@media (max-width: 640px) {
	.tabs {
		flex-wrap: wrap;
		gap: 8px;
		border-bottom: 0;
		overflow: visible;
	}
	.tab {
		min-height: 44px;
		padding: 8px 16px;
		border: 1px solid var(--hairline);
		border-radius: var(--pill);
		background: var(--parchment);
		color: var(--ink);
		white-space: normal;
		text-align: left;
		line-height: 1.5;
	}
	.tab[aria-selected="true"] {
		background: var(--primary);
		border-color: var(--primary);
		color: #fff;                      /* 5.6:1 */
	}
	.tab:focus-visible {
		outline-offset: 2px;
	}
}

.tab-panel {
	outline-offset: 4px;
}

.tab-panel + .tab-panel {
	margin-top: 32px;
}

.js .tab-panel + .tab-panel {
	margin-top: 0;
}

.shelf {
	padding: 4px 4px 16px;
	margin: -4px;
}

.shelf .swiper-wrapper {
	margin: 0;
	padding: 0;
	list-style: none;
}

.shelf .swiper-slide {
	height: auto;
	display: flex;
}

html:not(.js) .shelf .swiper-wrapper {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}

.tab-panel__more {
	display: flex;
	justify-content: flex-end;
	margin: 8px 0 0;
}

/* ---------- Selos ---------- */
.seals {
	padding: 64px 0;
}

.seals__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	margin-top: 16px;
	list-style: none;
}

.seal {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100%;
	min-height: 130px;
	padding: 16px;
	background: var(--canvas);
	border: 1px solid var(--hairline);
	border-radius: var(--r-lg);
	transition: transform 0.2s, box-shadow 0.2s;
}

.seal:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-hover);
}

.seal img {
	width: auto;
	max-width: 100%;
	max-height: 96px;
	object-fit: contain;
}

/* ---------- Páginas e artigos ---------- */
.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
}

.breadcrumbs li + li::before {
	content: "›";
	margin-right: 4px;
	color: var(--ink-soft);
}

.breadcrumbs a {
	color: var(--ink-muted);
}

.breadcrumbs [aria-current] {
	color: var(--ink-soft);
}

.page-header,
.entry-header {
	padding: 32px 0 24px;
}

.page-title,
.entry-title {
	margin: 0;
	font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
	font-weight: 700;
	line-height: 1.1;
}

.page-header .search-form {
	max-width: 560px;
	margin-top: 16px;
}

.page-description,
.page-count {
	color: var(--ink-muted);
	margin: 8px 0 0;
}

/* Descrição da categoria pode ter títulos e listas: linhas até ~80 caracteres (Selo Conteúdo 2.3). */
.page-description {
	max-width: 48rem;
}

.page-description > :last-child {
	margin-bottom: 0;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;               /* no telemóvel, "Atualizado a" passa para baixo */
	gap: 0 10px;
	margin: 12px 0 0;
	font-size: 0.9375rem;          /* 2 pt abaixo do corpo (Selo Conteúdo 1.3) */
	color: var(--ink-soft);        /* 6.0:1 */
}

.entry-meta__sep {               /* traço vertical fino entre as datas */
	align-self: center;
	width: 1px;
	height: 1rem;
	overflow: hidden;
	font-size: 0;
	background: var(--ink-soft);
}

.entry {
	padding-bottom: 64px;
}

.archive-notice {
	margin: 0 0 28px;
	padding: 14px 18px;
	border: 1px solid #e7d9a8;
	border-left: 4px solid var(--amber-ink);
	border-radius: var(--r-sm);
	background: var(--amber-bg);
	color: var(--amber-ink);       /* 6.8:1 */
	font-size: 0.9375rem;
}

.archive-notice p {
	margin: 0;
}

.archive-notice a {
	color: inherit;
	font-weight: 700;
}

.entry-thumbnail {
	margin: 0 0 32px;
}

.entry-thumbnail img {
	display: block;
	width: 100%;
	border-radius: var(--r-lg);
}

.entry-thumbnail figcaption {
	margin-top: 8px;
	font-size: 0.875rem;
	color: var(--ink-muted);
}

.entry-content {
	font-size: 1.125rem;
	line-height: 1.65;
}

.entry-content > * {
	max-width: 100%;
}

/* Escala 1,33 / 1,17 sobre o texto de 18px: títulos marcam a secção sem esmagar o texto. */
.entry-content h2 { font-size: 1.5rem; line-height: 1.25; margin: 1.8em 0 0.6em; }
.entry-content h3 { font-size: 1.25rem; line-height: 1.3; margin: 1.5em 0 0.5em; }

.entry-content img {
	border-radius: var(--r-md);
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 1rem;
}

.entry-content th,
.entry-content td {
	padding: 10px 12px;
	border: 1px solid var(--hairline);
	text-align: left;
}

.entry-content th {
	background: var(--parchment);
}

/* ---------- Listas e ligações no conteúdo ----------
 * Marcadores em seta fina, na cor do logótipo (azul-petróleo do catavento).
 * As listas recebem role="list" (inc/setup.php) para o VoiceOver as continuar a anunciar.
 */
.entry-content ul,
.entry-content ol {
	margin: 0 0 1.25em;
	padding-left: 1.75em;
}

.entry-content li {
	margin-bottom: 0.5em;
}

.entry-content li > ul,
.entry-content li > ol {
	margin: 0.5em 0 0.75em;
}

.entry-content ul {
	list-style: none;
}

.entry-content ul > li {
	position: relative;
}

/* Marcadores: seta (1.º nível), divisa (2.º), traço (3.º) – ícones Phosphor Bold, a par dos números a negrito.
 * Desenhados em CSS sem texto: os leitores de ecrã anunciam só "lista, N itens". */
.entry-content ul > li::before {
	content: "";
	position: absolute;
	left: -1.5em;
	top: 0.3em;
	width: 1em;
	height: 1em;
	background: var(--brand);             /* 5.4:1 */
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Níveis contados sem os itens invisíveis de recuo do editor antigo (li style="list-style-type: none"). */
.entry-content li:not([style*="list-style-type: none"]) > ul > li::before {
	left: -1.35em;
	width: 0.9em;
	height: 0.9em;
	top: 0.35em;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z'/%3E%3C/svg%3E");
}

.entry-content li:not([style*="list-style-type: none"]) > ul > li:not([style*="list-style-type: none"]) > ul > li::before {
	top: 0.75em;
	width: 0.6em;
	height: 2px;
	background: var(--brand);
	-webkit-mask: none;
	mask: none;
}

/* Declaração de Acessibilidade (gerador da ARTE): os itens já trazem "1.", "2." no texto. */
.entry-content ul.mr > li::before {
	content: none;
}

/* Itens usados só para recuar uma sublista (editor antigo): sem marcador. */
.entry-content li[style*="list-style-type: none"]::before,
.entry-content li[style*="list-style:none"]::before,
.entry-content li[style*="list-style: none"]::before {
	content: none;
}

.entry-content ol > li::marker {
	color: var(--brand);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.entry-content ol ol {
	list-style-type: lower-alpha;
}

/* Listas de definições (ex.: Glossário): termo a negrito, definição por baixo. */
.entry-content dl {
	margin: 0 0 1.5em;
}

.entry-content dt {
	margin-top: 1em;
	font-weight: 700;
}

.entry-content dd {
	margin: 0.15em 0 0;
	color: var(--ink-muted);
}

/* Número de secção (lista de 1 item convertida em título no PHP) e listas cujos itens começam por título:
 * o número fica do tamanho do título. */
.heading-num {
	color: var(--brand);
	font-variant-numeric: tabular-nums;
}

.entry-content ol > li:has(> h2:first-child)::marker { font-size: 1.5rem; }
.entry-content ol > li:has(> h3:first-child)::marker { font-size: 1.25rem; }

/* Sublista recuada com um item sem marcador (editor antigo): sem recuo a dobrar. */
.entry-content li[style*="list-style-type: none"] > :is(ul, ol) {
	margin-top: 0;
	padding-left: 0;
}

/* Ligações no texto: sublinhado fino sempre presente (WCAG 1.4.1) e,
 * ao passar/focar, um realce que sobe de baixo. */
.entry-content :is(a:not([class]), a.link) {
	color: var(--primary);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
	background: linear-gradient(rgba(0, 102, 204, 0.1), rgba(0, 102, 204, 0.1)) no-repeat 0 100% / 100% 0;
	border-radius: 2px;
	transition: background-size 0.2s var(--ease), text-decoration-thickness 0.2s;
}

.entry-content :is(a:not([class]), a.link):hover,
.entry-content :is(a:not([class]), a.link):focus-visible {
	color: var(--primary-hover);           /* 6.4:1 sobre o realce */
	text-decoration-thickness: 2px;
	background-size: 100% 100%;
}

/* Fora do site: pequena seta (sem texto, por isso os leitores de ecrã ignoram-na). */
.entry-content :is(a:not([class]), a.link)[data-external]::after {
	content: "";
	display: inline-block;
	width: 0.7em;
	height: 0.7em;
	margin-left: 0.2em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Galerias também são listas: sem marcadores nem recuo. */
.entry-content .ptb-gallery__grid,
.entry-content .blocks-gallery-grid {
	margin: 0;
	padding: 0;
}

.entry-content .ptb-gallery__grid > li,
.entry-content .blocks-gallery-grid > li {
	margin: 0;
}

.entry-content .ptb-gallery__grid > li::before,
.entry-content .blocks-gallery-grid > li::before {
	content: none;
}

@media (forced-colors: active) {
	.entry-content ul > li::before {
		background: CanvasText;
		forced-color-adjust: none;
	}
}

.entry-updated {
	margin: 4px 0 0;
	font-size: 0.9375rem;          /* 2 pt abaixo do corpo (18 px) */
	color: var(--ink-soft);        /* 6.0:1 */
}

/* Índice automático ("Nesta página") */
.toc {
	margin: 0 0 32px;
	padding: 18px 22px;
	background: var(--canvas);
	border: 1px solid var(--hairline);
	border-radius: var(--r-md);
}

.toc__title {
	margin: 0 0 8px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--ink);
}

.entry-content .toc ol {
	margin: 0;
	padding-left: 1.4em;
	font-size: 1rem;
}

.entry-content .toc li {
	margin-bottom: 4px;
}

.entry-content :is(h2, h3)[id] {
	scroll-margin-top: calc(var(--header-h) + 24px);
}

/* Tabelas largas: deslizam dentro da sua caixa, nunca a página inteira */
.table-wrap {
	max-width: 100%;
	margin: 0 0 1.25em;
	overflow-x: auto;
	border-radius: var(--r-sm);
}

.table-wrap table {
	margin: 0;
}

.entry-link {
	margin-top: 32px;
}

/* Ligações a ficheiros (PDF, DOC…) mostram o formato. */
.entry-content a[href$=".pdf" i]::after { content: " (PDF)"; font-size: 0.85em; }
.entry-content a[href$=".doc" i]::after,
.entry-content a[href$=".docx" i]::after { content: " (Word)"; font-size: 0.85em; }

/* ---------- Artigos relacionados ---------- */
.related {
	padding: 56px 0 72px;
	background: var(--canvas);
	border-top: 1px solid var(--hairline);
}

.related__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr)); /* alinhado com a coluna de texto do artigo */
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 700px) {
	.related__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.card--mini {
	border-radius: var(--r-md);
}

.card--mini .card__body {
	padding: 12px 14px 14px;
}

.card--mini .card__title {
	font-size: 0.9375rem;
	line-height: 1.35;
	margin-bottom: 6px;
}

.card--mini .card__meta {
	font-size: 0.875rem;
}

/* ---------- Formulário de contacto ---------- */
.cf {
	margin: 32px 0;
	font-size: 1rem;
}

.cf__intro {
	color: var(--ink-muted);
}

.cf__field {
	margin-bottom: 22px;
}

.cf__field > label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}

.cf__req,
.cf__opt {
	font-weight: 400;
	color: var(--ink-muted);
}

.cf__input {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #8e8e93;       /* 3.3:1 */
	border-radius: var(--r-sm);
	background: #fff;
	color: var(--ink);
	font: inherit;
}

/* Tamanho do campo de acordo com os dados (Transação 2.1) */
.cf__input--m { max-width: 30rem; }
.cf__input--s { max-width: 13rem; }

.cf__file {
	display: block;
	max-width: 100%;
	font: inherit;
	font-size: 1rem;
}

.cf__file::file-selector-button {
	min-height: 44px;
	margin-right: 12px;
	padding: 8px 18px;
	border: 1px solid var(--primary);
	border-radius: var(--pill);
	background: var(--canvas);
	color: var(--primary);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.cf__file::file-selector-button:hover {
	background: var(--blue-bg);
}

.cf__file[aria-invalid="true"]::file-selector-button {
	border-color: var(--red-ink);
}

textarea.cf__input {
	min-height: 160px;
	resize: vertical;
}

.cf__input[aria-invalid="true"] {
	border: 2px solid var(--red-ink);
}

.cf__hint {
	margin: 6px 0 0;
	font-size: 0.9375rem;
	color: var(--ink-muted);
}

.cf__error {
	margin: 6px 0 0;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--red-ink);           /* 7.8:1 */
}

.cf__error::before {
	content: "⚠ ";
}

.cf__field--check {
	display: grid;
	grid-template-columns: 24px 1fr;
	gap: 4px 12px;
	align-items: start;
}

.cf__field--check input {
	width: 24px;
	height: 24px;
	margin: 2px 0 0;
	accent-color: var(--primary);
}

.cf__field--check .cf__error {
	grid-column: 1 / -1;
}

.cf__group {
	margin: 0 0 22px;
	padding: 0;
	border: 0;
}

.cf__group > legend {
	margin-bottom: 8px;
	padding: 0;
	font-weight: 600;
}

.cf__group[aria-invalid="true"] .cf__choice input {
	outline: 2px solid var(--red-ink);
	outline-offset: 1px;
}

.cf__choice {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
}

.cf__choice input {
	width: 22px;
	height: 22px;
	margin: 0;
	flex-shrink: 0;
	accent-color: var(--primary);
}

.cf__other {
	margin: 4px 0 8px 34px;
}

.cf__other > label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}

.cf__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cf__actions {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.cf__submit[aria-disabled="true"] {
	opacity: 0.7;
	pointer-events: none;
}

.cf__sending {
	color: var(--ink-muted);
}

.cf__status {
	margin-bottom: 24px;
	padding: 16px 20px;
	border-radius: var(--r-md);
	border-left: 4px solid;
}

.cf__status:focus {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.cf__status--ok {
	background: var(--green-bg);
	border-color: var(--green-ink);
	color: var(--green-ink);
}

.cf__status--error {
	background: var(--red-bg);
	border-color: var(--red-ink);
	color: var(--red-ink);
}

.cf__status p:last-child,
.cf__status ul {
	margin-bottom: 0;
}

.cf__status a {
	color: inherit;
}

/* ---------- Listagens ---------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
	margin: 0 0 48px;
	padding: 0;
	list-style: none;
}

.pagination {
	margin-bottom: 64px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--hairline);
	border-radius: var(--pill);
	background: #fff;
	text-decoration: none;
	font-weight: 600;
}

.pagination .page-numbers.current {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
}

.no-results {
	padding-bottom: 64px;
}

/* ---------- Popup ---------- */
.popup {
	width: min(100% - 32px, 560px);
	max-height: calc(100% - 32px);
	padding: 0;
	border: 0;
	border-radius: var(--r-lg);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
	overflow: auto;
}

.popup::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 1;
	background: #fff;
	box-shadow: var(--shadow);
}

.popup__img {
	display: block;
	width: 100%;
	height: auto;
}

.popup__body {
	padding: 28px;
}

.popup__title {
	font-size: 1.5rem;
	padding-right: 40px;
}

/* Modelo "Índice de subpáginas" */
.subpages-intro {
	max-width: 760px;
	margin-bottom: 32px;
}

/* Página Contactos (page-contactos.php) */
.contact-page {
	max-width: calc(1120px + 2 * var(--gutter));
}

.contact-layout {
	display: grid;
	gap: 32px;
	padding-bottom: 64px;
}

.contact-card {
	align-self: start;
	padding: 28px;
	border: 1px solid var(--hairline);
	border-radius: var(--r-lg);
	background: var(--canvas);
	box-shadow: var(--shadow);
}

.contact-card__title {
	margin: 0 0 20px;
	font-size: 1.25rem;
}

.contact-card__list {
	display: grid;
	gap: 22px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.contact-card__list > li {
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 14px;
	align-items: start;
}

.contact-card__list > li > .icon {
	box-sizing: content-box;
	padding: 10px;
	border-radius: 50%;
	background: var(--blue-bg);
	color: var(--blue-ink);
	width: 24px;
	height: 24px;
}

.contact-card__label {
	margin: 0 0 2px;
	color: var(--ink-muted);
	font-size: 0.875rem;
	font-weight: 600;
}

.contact-card__value {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--ink);
	font-size: 1.25rem;
	font-weight: 700;
	overflow-wrap: anywhere;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.contact-card__value:hover {
	color: var(--primary);
}

.contact-card__note {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.875rem;
}

.contact-card address {
	font-style: normal;
	line-height: 1.5;
}

.contact-card__map,
.contact-card__social a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	color: var(--primary);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.contact-card__social {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.contact-layout__main > :first-child {
	margin-top: 0;
}

.contact-layout__main .cf {
	padding: 28px;
	border: 1px solid var(--hairline);
	border-radius: var(--r-lg);
	background: var(--canvas);
}

@media (min-width: 1024px) {
	.contact-layout {
		grid-template-columns: 360px minmax(0, 1fr);
		gap: 56px;
	}

	.contact-layout__main .cf {
		padding: 36px 40px;
	}
}

/* Cartão fixo ao fazer scroll só se couber no ecrã */
@media (min-width: 1024px) and (min-height: 760px) {
	.contact-card {
		position: sticky;
		top: calc(var(--header-h) + 24px);
	}
}

/* Janela de sucesso dos formulários */
.form-success .popup__body {
	text-align: center;
}

.form-success .popup__title {
	padding-right: 0;
}

.form-success__icon {
	display: grid;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	margin: 0 auto 1rem;
	border-radius: 50%;
	background: #eef7d6;
	color: #3d5a00;
	font-size: 1.75rem;
	font-weight: 700;
}

/* ---------- Rodapé ---------- */
.site-footer {
	padding: 64px 0 32px;
	background: var(--dark);
	color: var(--on-dark);
	font-size: 0.9375rem;
}

.site-footer a {
	color: #fff;
}

.footer-columns {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
	gap: 40px;
	margin-bottom: 48px;
}

@media (max-width: 960px) {
	.footer-columns {
		grid-template-columns: 1fr 1fr;
	}
	.footer-about {
		grid-column: 1 / -1;
	}
}

@media (max-width: 520px) {
	.footer-columns {
		grid-template-columns: 1fr;
	}
}

.footer-logo {
	width: 189px;
	margin-bottom: 16px;
}

.site-footer address {
	font-style: normal;
	margin-bottom: 1em;
}

.footer-h {
	margin-bottom: 16px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #fff;
}

.footer-list,
.legal-strip {
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-list li {
	margin-bottom: 6px;
}

.footer-list a,
.legal-strip a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--on-dark);
}

.footer-list a:hover,
.legal-strip a:hover {
	color: #fff;
}

.btn--outline-light {
	border-color: rgba(255, 255, 255, 0.7);
	color: #fff;
}

.site-footer .btn--outline-light {
	color: #fff;
}

.btn--outline-light:hover {
	background: #fff;
	color: var(--ink);
}

.site-footer .btn--outline-light:hover {
	color: var(--ink);
}

.footer-h--spaced {
	margin-top: 28px;
}

.footer-note {
	display: block;
	font-size: 0.875rem;
}

.footer-complaints {
	display: inline-block;
	margin-top: 16px;
}

.footer-complaints img {
	display: block;
	width: 150px;
	height: auto;
}

.link-button {
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--on-dark);
	font-size: inherit;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.link-button:hover {
	color: #fff;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	font-size: 0.875rem;
}

.footer-bottom p {
	margin: 0;
}

.legal-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 0 18px;
}

/* ---------- Blocos (alinhamentos básicos) ---------- */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }

/* ---------- Entrada suave ao fazer scroll (estilo Apple) ----------
 * main.js marca com .reveal só os elementos ainda fora do ecrã e junta .is-visible quando entram.
 * Usa "translate" (não "transform") para não anular o hover dos cartões.
 * Sem JS ou com "reduzir movimento": nada fica escondido.
 */
@media (prefers-reduced-motion: no-preference) {
	.reveal {
		opacity: 0;
		translate: 0 28px;
		transition: opacity 0.7s var(--ease), translate 0.7s var(--ease);
	}
	.reveal.is-visible {
		opacity: 1;
		translate: 0 0;
	}
}

@media print {
	.reveal {
		opacity: 1 !important;
		translate: none !important;
	}
}

/* ---------- Preferências do sistema ---------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Modo de alto contraste do Windows: devolver contornos que dependiam de fundos. */
@media (forced-colors: active) {
	.btn,
	.btn-icon,
	.tab[aria-selected="true"],
	.badge,
	.quick-tile,
	.card {
		border: 1px solid CanvasText;
	}
	.hero__slide::after {
		display: none;
	}
	.hero__content {
		background: Canvas;
		color: CanvasText;
		border: 1px solid CanvasText;
	}
	.tab[aria-selected="true"] {
		outline: 3px solid Highlight;
		outline-offset: -3px;
	}
}

/* ---------- Galerias ---------- */
.ptb-gallery {
	margin: 2em 0;
}

.ptb-gallery__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.ptb-gallery__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 12px;
	}
}

@media (min-width: 900px) {
	.ptb-gallery__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.ptb-gallery__item {
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: var(--r-md);
	overflow: hidden;
	background: #e2e8f0;
}

.entry-content .ptb-gallery__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.3s ease;
}

.ptb-gallery__item:hover img {
	transform: scale(1.04);
}

.wp-block-gallery a {
	cursor: zoom-in;
}

/* Visualizador */
.lightbox {
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;      /* o fundo é o ::backdrop: página desfocada e escurecida */
	color: #fff;
	overscroll-behavior: contain;
	touch-action: pan-y pinch-zoom;
}

.lightbox::backdrop {
	/* Pior caso (página branca por trás): ≈ #707071 – texto branco 4,95:1. Não baixar de 0.6. */
	background: rgba(17, 17, 19, 0.6);
	-webkit-backdrop-filter: blur(18px) saturate(1.2);
	backdrop-filter: blur(18px) saturate(1.2);
}

@media (prefers-reduced-transparency: reduce) {
	.lightbox::backdrop {
		background: #111113;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.lightbox[open]::backdrop { animation: lb-fade 0.25s ease-out; }
	.lightbox[open] .lightbox__img { animation: lb-in 0.3s var(--ease); }
}

@keyframes lb-fade { from { opacity: 0; } }
@keyframes lb-in { from { opacity: 0; transform: scale(0.97); } }

.lightbox :focus-visible {
	outline-color: #fff;
}

html:has(.lightbox[open]) {
	overflow: hidden;
}

.lightbox__bar {
	position: absolute;
	inset: 0 0 auto;
	z-index: 2;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 12px 12px 12px 20px;
}

.lightbox__count {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
}

.lightbox__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	transition: background 0.2s;
}

.lightbox__btn:hover {
	background: rgba(255, 255, 255, 0.22);
}

.lightbox__prev,
.lightbox__next {
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
}

.lightbox__prev { left: 12px; }
.lightbox__next { right: 12px; }

/* No telemóvel os botões descem para junto do polegar. */
@media (max-width: 640px) {
	.lightbox__prev,
	.lightbox__next {
		top: auto;
		bottom: 16px;
		transform: none;
	}
	.lightbox__prev { left: calc(50% - 60px); }
	.lightbox__next { right: calc(50% - 60px); }
}

.lightbox__figure {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	height: 100%;
	margin: 0;
	padding: 72px 72px 24px;
}

@media (max-width: 640px) {
	.lightbox__figure {
		padding: 64px 0 88px;
	}
}

.lightbox__img {
	max-width: 100%;
	max-height: 100%;
	min-height: 0;
	object-fit: contain;
	border-radius: var(--r-md);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
	.lightbox__img {
		border-radius: 0;
	}
}

.lightbox__caption {
	max-width: 60em;
	padding: 12px 16px 0;
	text-align: center;
	color: #fff;                  /* branco: o fundo translúcido só garante 4,5:1 com branco */
}
