/**
 * Tipografia editorial — páginas e artigos
 * Breakpoints = Bootstrap 5.3 (sm 576 | md 768 | lg 992 | xl 1200 | xxl 1400)
 * Depende de: tokens/variables.css (--font-size-*), Bootstrap (body 1rem)
 * Fonte do site: --font-family-base (usar em global.css, botões, plugins)
 * @font-face: fonts/plus-jakarta-sans/*.woff2 (self-hosted, subset latin; raiz do tema)
 */

/* Plus Jakarta Sans — 300, 400, 500, 600 */
@font-face {
	font-display: swap;
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 300;
	src: url("../../fonts/plus-jakarta-sans/plus-jakarta-sans-v12-latin-300.woff2") format("woff2");
}

@font-face {
	font-display: swap;
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 400;
	src: url("../../fonts/plus-jakarta-sans/plus-jakarta-sans-v12-latin-regular.woff2") format("woff2");
}

@font-face {
	font-display: swap;
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 500;
	src: url("../../fonts/plus-jakarta-sans/plus-jakarta-sans-v12-latin-500.woff2") format("woff2");
}

@font-face {
	font-display: swap;
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 600;
	src: url("../../fonts/plus-jakarta-sans/plus-jakarta-sans-v12-latin-600.woff2") format("woff2");
}

/*
 * ESCALA TIPOGRÁFICA — referência rápida
 * ─────────────────────────────────────────
 * Token              mobile    768px    992px
 * --text-body-size   14px      16px     16px
 * --text-h1-page     24px      30px     36px
 * --text-h1-section  20px      24px     24px
 * --text-h2-page     22px      30px     30px
 * --text-h3-page     20px      20px     20px
 * --text-h4-page     16px      20px     20px
 * --text-h5-page     14px      14px     14px
 * ─────────────────────────────────────────
 * Breakpoints Bootstrap 5.3: 576|768|992|1200|1400
 */

/* ── Tokens semânticos (mobile first) ── */
:root {
	--font-family-base: "Plus Jakarta Sans", system-ui, sans-serif;
	/* Pesos reais (woff2) — alterar só aqui */
	--font-weight-light: 300;
	--font-weight-regular: 400;
	--font-weight-medium: 500;
	--font-weight-semibold: 600;

	/* Aliases semânticos (máx. 600 no UI) */
	--font-weight-base: var(--font-weight-light);
	--font-weight-heading: var(--font-weight-semibold);
	--font-weight-bold: var(--font-weight-semibold);
	--font-weight-heavy: var(--font-weight-semibold);
	--font-weight-strong: var(--font-weight-semibold);

	--text-body-size: 0.875rem; /* 14px — abaixo do body Bootstrap no mobile */
	--text-body-line: 1.6;

	--text-h1-page: var(--font-size-24);
	--text-h1-section: var(--font-size-20);
	--text-h2-page: var(--font-size-22);
	--text-h3-page: var(--font-size-20);
	--text-h4-page: var(--font-size-16);
	--text-h5-page: var(--font-size-14);
	--text-h6-page: var(--font-size-14);
}

/* md | min-width: 768px */
@media (min-width: 768px) {
	:root {
		--text-body-size: 1rem; /* 16px — alinhado ao Bootstrap */
		--text-h1-page: var(--font-size-30);
		--text-h1-section: var(--font-size-24);
		--text-h2-page: var(--font-size-30);
		--text-h4-page: var(--font-size-20);
	}
}

/* lg | min-width: 992px */
@media (min-width: 992px) {
	:root {
		--text-h1-page: var(--font-size-36);
	}
}

/* ── Corpo: páginas (serviços, política, etc.) ── */
.th-page-content {
	font-size: var(--text-body-size, 1rem);
	font-weight: var(--font-weight-base);
	line-height: var(--text-body-line);
}

.th-page-content p,
.th-page-content li,
.th-page-content ul,
.th-page-content ol,
.th-page-content .wp-block-list,
.th-page-content strong,
.th-page-content b {
	font-size: inherit;
}

/* ── Corpo: artigos (mesma escala que páginas) ── */
.single article .subtitle_content {
	font-size: var(--text-body-size, 1rem);
	font-weight: var(--font-weight-base);
	line-height: var(--text-body-line);
}

.single article .subtitle_content p,
.single article .subtitle_content li,
.single article .subtitle_content ul,
.single article .subtitle_content ol,
.single article .subtitle_content ul.wp-block-list,
.single article .subtitle_content strong,
.single article .subtitle_content b {
	font-size: inherit;
}

/* ── Título da página (template, fora do conteúdo Gutenberg) ── */
.page-title,
.th-page-content > h1:first-of-type,
.th-page-content > h1.page-title {
	text-align: center;
	font-size: var(--text-h1-page);
	font-weight: var(--font-weight-heading);
	color: var(--color-primary-dark);
	line-height: 1.25;
	margin-top: 0;
	margin-bottom: 1rem;
}

.page-title + .th-page-content > h1:first-of-type {
	display: none;
}

/* Subtítulo ACF (titulo_secundario) — logo abaixo do .page-title ou título do artigo */
.page-subtitle,
h4.page-subtitle,
.single article > h4.page-subtitle {
	display: block;
	width: 100%;
	flex: 0 0 100%;
	max-width: 100%;
	text-align: center !important;
	font-size: var(--text-h4-page);
	font-weight: var(--font-weight-heading);
	color: var(--color-text-primary);
	line-height: 1.35;
	margin-top: 0;
	margin-bottom: 1rem;
}

/* H1 de secção no conteúdo (2.º h1 em diante) */
.th-page-content > h1:not(:first-of-type) {
	font-size: var(--text-h1-section);
	font-weight: var(--font-weight-heading);
	color: var(--color-primary-dark);
	text-align: left;
	line-height: 1.3;
	margin-top: 1.5rem;
	margin-bottom: 0.75rem;
}

/* Headings h2–h6 no conteúdo de página */
.th-page-content h2 {
	font-size: var(--text-h2-page);
	font-weight: var(--font-weight-heading);
	color: var(--color-primary-dark);
	line-height: 1.25;
	margin-top: 1.25rem;
	margin-bottom: 0.75rem;
}

.th-page-content h3 {
	font-size: var(--text-h3-page);
	font-weight: var(--font-weight-heading);
	color: var(--color-primary-dark);
	line-height: 1.3;
	margin-top: 1rem;
	margin-bottom: 0.5rem;
}

.th-page-content h4 {
	font-size: var(--text-h4-page);
	font-weight: var(--font-weight-heading);
	line-height: 1.35;
	margin-top: 1rem;
	margin-bottom: 0.5rem;
}

.th-page-content h5,
.th-page-content h6 {
	font-size: var(--text-h5-page);
	font-weight: var(--font-weight-heading);
	line-height: 1.4;
	margin-top: 0.75rem;
	margin-bottom: 0.5rem;
}

/* Artigo (single) — títulos fora do .subtitle_content */
.single article > h2 {
	font-size: var(--text-h2-page);
	font-weight: var(--font-weight-heading);
	line-height: 1.25;
}

.single article > h4 {
	font-size: var(--text-h4-page);
	line-height: 1.35;
}
