/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* -------------------------------------------------------------------------
 * Classic [gallery] shortcode grid.
 * Blocksy declares html5 'gallery' support, so WordPress no longer prints the
 * default inline column widths -> galleries collapse into a single column.
 * These rules restore a responsive grid driven by the shortcode's columns="N".
 * ---------------------------------------------------------------------- */
.gallery {
	display: grid;
	grid-template-columns: repeat(var(--gallery-cols, 3), 1fr);
	gap: 12px;
	margin: 0 0 1.5em;
}

.gallery-columns-1 { --gallery-cols: 1; }
.gallery-columns-2 { --gallery-cols: 2; }
.gallery-columns-3 { --gallery-cols: 3; }
.gallery-columns-4 { --gallery-cols: 4; }
.gallery-columns-5 { --gallery-cols: 5; }
.gallery-columns-6 { --gallery-cols: 6; }
.gallery-columns-7 { --gallery-cols: 7; }
.gallery-columns-8 { --gallery-cols: 8; }
.gallery-columns-9 { --gallery-cols: 9; }

.gallery .gallery-item {
	width: 100% !important;
	margin: 0 !important;
	padding: 0;
}

.gallery .gallery-icon {
	margin: 0;
}

.gallery .gallery-icon a {
	display: block;
	line-height: 0;
}

.gallery .gallery-icon img {
	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
	border: 0;
	border-radius: 6px;
	cursor: zoom-in;
	transition: opacity .2s ease, transform .2s ease;
}

.gallery .gallery-icon img:hover {
	opacity: .9;
}

/* SIF Mobile screenshots: preserve each image's original portrait ratio. */
.page-id-1909 #gallery-1 .gallery-icon img {
	height: auto;
	aspect-ratio: auto;
	object-fit: contain;
}

.gallery .gallery-caption {
	margin: 4px 0 0;
	font-size: 12px;
	line-height: 1.3;
}

/* Responsive fallbacks: cap the column count on smaller screens. */
@media (max-width: 1024px) {
	.gallery { grid-template-columns: repeat(min(var(--gallery-cols, 3), 3), 1fr); }
}
@media (max-width: 680px) {
	.gallery { grid-template-columns: repeat(min(var(--gallery-cols, 3), 2), 1fr); }
}

/* -------------------------------------------------------------------------
 * Latest-posts listing (Blocksy .entries grid, e.g. the homepage block).
 * The grid uses grid-template-columns: repeat(var(--columns),1fr) but keeps
 * --columns:3 down to mobile, cramming the cards into 3 narrow columns.
 * Force a single column on phones.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.entries {
		--columns: 1 !important;
		grid-template-columns: 1fr !important;
	}
}

/* -------------------------------------------------------------------------
 * Single post / archive header.
 * ---------------------------------------------------------------------- */

/* Breadcrumb: drop the redundant current-page item (the full title, already
 * shown as the <h1> right below) and the now-dangling separator. All sizes. */
.ct-breadcrumbs .last-item {
	display: none !important;
}
.ct-breadcrumbs > span:nth-last-child(2) .ct-separator {
	display: none !important;
}

/* Desktop: smaller, tighter title that uses more of the available width. */
@media (min-width: 768px) {
	.entry-header.ct-container-narrow {
		max-width: 1000px;
	}
	.page-title {
		font-size: 32px !important;
		line-height: 1.2 !important;
	}
}

/* Mobile: shrink title and breadcrumb. */
@media (max-width: 767px) {
	.page-title {
		font-size: 26px !important;
		line-height: 1.25 !important;
		overflow-wrap: break-word;
	}
	.ct-breadcrumbs {
		font-size: 12px;
	}
	.entry-header.ct-container-narrow {
		padding-top: 30px !important;
		padding-bottom: 30px !important;
	}
}

@media (max-width: 430px) {
	.page-title { font-size: 22px !important; }
}

/* Mobile: shrink the text logo (site title "DNFFB") slightly to gain a bit
 * of breathing room at the top of the header. */
@media (max-width: 767px) {
	.site-title,
	.site-title a {
		font-size: 20px !important;
	}
}

/* Mobile: tighten the site description line-height. */
@media (max-width: 767px) {
	.site-description {
		line-height: 1.3 !important;
	}
}

/* Nudge the site title container down slightly. */
.site-title-container {
	margin-top: 5px;
}


/* -------------------------------------------------------------------------
 * Tipografia de CONTEÚDO dos artigos — apresentação uniforme para todos os
 * posts, seja qual for o editor de origem (Gutenberg, clássico, texto colado,
 * conteúdo de IA). Circunscrito a `.single-post .entry-content`, por isso NÃO
 * afecta páginas nem layouts Elementor. (2026-07-02)
 * A fonte fica uniforme por si só: os `style=` embutidos foram removidos do
 * conteúdo, logo tudo herda a tipografia do tema.
 * ---------------------------------------------------------------------- */
.single-post .entry-content {
	line-height: 1.75;
	overflow-wrap: break-word;
}

/* Ritmo uniforme de parágrafos */
.single-post .entry-content p { margin: 0 0 1.25em; }
.single-post .entry-content > *:first-child { margin-top: 0; }
.single-post .entry-content > *:last-child { margin-bottom: 0; }

/* Espaçamento coerente à volta de subtítulos dentro do artigo */
.single-post .entry-content h2 { margin: 1.8em 0 .6em; line-height: 1.25; }
.single-post .entry-content h3 { margin: 1.5em 0 .5em; line-height: 1.3; }
.single-post .entry-content h4 { margin: 1.3em 0 .4em; line-height: 1.35; }

/* Listas / bullets — marcadores na cor da marca (o "ícone" uniforme) */
.single-post .entry-content ul,
.single-post .entry-content ol { margin: 0 0 1.25em; padding-left: 1.6em; }
.single-post .entry-content ul { list-style: disc; }
.single-post .entry-content ol { list-style: decimal; }
.single-post .entry-content li { margin: .4em 0; }
.single-post .entry-content li::marker { color: var(--theme-palette-color-1, #16794a); }
.single-post .entry-content li > ul,
.single-post .entry-content li > ol { margin: .4em 0; }

/* Citações uniformes (vários posts usam blockquote) */
.single-post .entry-content blockquote {
	margin: 1.5em 0;
	padding: .6em 1.2em;
	border-left: 4px solid var(--theme-palette-color-1, #16794a);
	background: rgba(0, 0, 0, .03);
	font-style: italic;
}
.single-post .entry-content blockquote p:last-child { margin-bottom: 0; }

/* Imagens uniformes */
.single-post .entry-content img { max-width: 100%; height: auto; border-radius: 6px; }
.single-post .entry-content p > img { margin: .35em .5em .35em 0; }        /* filas de imagens */
.single-post .entry-content p > img:only-child { display: block; margin: 1em auto; } /* imagem isolada: centrada */

/* -------------------------------------------------------------------------
 * Páginas convertidas de Elementor -> editor clássico (2026-07-02).
 * Circunscrito a `.page:not(.elementor-page)` — só apanha páginas que já NÃO
 * são renderizadas pelo Elementor (as de layout mantêm a classe elementor-page
 * e ficam intocadas). Dá-lhes a mesma tipografia dos posts + estilo de tabela.
 * ---------------------------------------------------------------------- */
.page:not(.elementor-page) .entry-content { line-height: 1.75; overflow-wrap: break-word; }
.page:not(.elementor-page) .entry-content p { margin: 0 0 1.25em; }
.page:not(.elementor-page) .entry-content > *:first-child { margin-top: 0; }
.page:not(.elementor-page) .entry-content h2 { margin: 1.8em 0 .6em; line-height: 1.25; }
.page:not(.elementor-page) .entry-content h3 { margin: 1.6em 0 .5em; line-height: 1.3; }
.page:not(.elementor-page) .entry-content ul,
.page:not(.elementor-page) .entry-content ol { margin: 0 0 1.25em; padding-left: 1.6em; }
.page:not(.elementor-page) .entry-content ul { list-style: disc; }
.page:not(.elementor-page) .entry-content ol { list-style: decimal; }
.page:not(.elementor-page) .entry-content li { margin: .4em 0; }
.page:not(.elementor-page) .entry-content li::marker { color: var(--theme-palette-color-1, #16794a); }
.page:not(.elementor-page) .entry-content blockquote {
	margin: 1.5em 0; padding: .6em 1.2em; font-style: italic;
	border-left: 4px solid var(--theme-palette-color-1, #16794a); background: rgba(0,0,0,.03);
}
.page:not(.elementor-page) .entry-content img { max-width: 100%; height: auto; border-radius: 6px; }

/* -------------------------------------------------------------------------
 * Tabelas de conteúdo — fonte e apresentação uniformes (posts e páginas
 * convertidas). Cabeçalho na cor da marca, linhas alternadas, responsiva.
 * ---------------------------------------------------------------------- */
.single-post .entry-content table,
.page:not(.elementor-page) .entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0;
	font-size: .96em;
	line-height: 1.5;
}
.single-post .entry-content th,
.single-post .entry-content td,
.page:not(.elementor-page) .entry-content th,
.page:not(.elementor-page) .entry-content td {
	border: 1px solid #e2e2e2;
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
}
.single-post .entry-content thead th,
.page:not(.elementor-page) .entry-content thead th {
	background: var(--theme-palette-color-1, #16794a);
	color: #fff;
	font-weight: 600;
}
.single-post .entry-content tbody tr:nth-child(even),
.page:not(.elementor-page) .entry-content tbody tr:nth-child(even) {
	background: rgba(0,0,0,.03);
}
/* Tabela larga: rola na horizontal no telemóvel em vez de rebentar o layout */
@media (max-width: 767px) {
	.single-post .entry-content table,
	.page:not(.elementor-page) .entry-content table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Metabase / embeds — ocupar toda a largura disponível do conteúdo (páginas clássicas).
   Altura fica a cargo do atributo height de cada iframe (dashboards têm altura fixa). */
.page:not(.elementor-page) .entry-content iframe {
	display: block;
	width: 100%;
	max-width: 100%;
	border: 0;
	margin: 0 0 1.5em;
}

/* ---- Uniformização dos cards de post (arquivos de categoria + shortcode da homepage) ----
   Imagem no topo (como na homepage), metadados (categorias) juntos com a data no fim,
   e espaçamento compacto e uniforme entre imagem, título, excerto e meta.
   Só reordena visualmente (flex order) — não altera o HTML. Escopado a estes 2 contextos. */
.archive .entries .entry-card,
.ct-posts-shortcode .entry-card {
	display: flex;
	flex-direction: column;
}
.archive .entries .entry-card > .ct-media-container,
.ct-posts-shortcode .entry-card > .ct-media-container { order: 1; margin: 0 0 16px; }
.archive .entries .entry-card > .entry-title,
.ct-posts-shortcode .entry-card > .entry-title { order: 2; margin: 0 0 10px; }
.archive .entries .entry-card > .entry-excerpt,
.ct-posts-shortcode .entry-card > .entry-excerpt { order: 3; margin: 0 0 12px; }
.archive .entries .entry-card > .entry-meta,
.ct-posts-shortcode .entry-card > .entry-meta { order: 4; margin: 0 0 6px; }
.archive .entries .entry-card > *:last-child,
.ct-posts-shortcode .entry-card > *:last-child { margin-bottom: 0; }

/* Meta (categorias + data) juntos e encostados ao fundo do card, alinhado entre cards
   de alturas diferentes. O Blocksy já põe margin-top:auto em CADA .entry-meta para os
   encostar ao fundo — com dois metas o espaço dividia-se entre eles (vão indesejado).
   Neutralizamos e pomos auto só no primeiro (categorias) → o bloco desce todo junto. */
.archive .entries .entry-card > .entry-meta,
.ct-posts-shortcode .entry-card > .entry-meta { margin-top: 0 !important; }
.archive .entries .entry-card > .entry-meta:not(:last-child),
.ct-posts-shortcode .entry-card > .entry-meta:not(:last-child) { margin-top: auto !important; margin-bottom: 4px; }

/* ------------------------------------------------------------------ *
 * Uniform card thumbnail aspect ratio (homepage + category archives).
 * Every card shows the same 16:10 frame regardless of the original
 * image's proportions. object-fit:cover center-crops photos; the
 * fallback placeholder is authored at 16:10 so it is never cropped.
 * ------------------------------------------------------------------ */
.archive .entries .entry-card > .ct-media-container,
.ct-posts-shortcode .entry-card > .ct-media-container {
	display: block !important;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}
.archive .entries .entry-card > .ct-media-container img,
.ct-posts-shortcode .entry-card > .ct-media-container img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block;
}

/* Correction: neutralise Blocksy boundless-image bleed so the card thumbnail
   aligns with the title/text (same as archives) instead of a widened,
   asymmetric full-bleed. Overrides the boundless width + negative top margin. */
.archive .entries .entry-card > .ct-media-container,
.ct-posts-shortcode .entry-card > .ct-media-container {
	width: 100% !important;
	margin: 0 0 16px !important;
}

/* ------------------------------------------------------------------ *
 * Equal-height program cards (homepage grid). The layout is 3 flex
 * columns (already stretched to equal height) each holding 2 stacked
 * .ct-imagebox-small cards that otherwise size to their own content
 * (FRIP ended up shorter than its neighbours). Make the cards grow to
 * fill their column so every card is the same height.
 * ------------------------------------------------------------------ */
.ct-imagebox-small {
	flex-grow: 1 !important;
	flex-basis: 0 !important;
}

/* Program cards: force the stacked widgets to never wrap into a second
   column. The card is a column flex with flex-wrap:wrap, so when it is not
   tall enough (e.g. on phones) the text widget wrapped sideways beside the
   heading and overflowed the card. nowrap keeps heading/text stacked. */
.ct-imagebox-small {
	flex-wrap: nowrap !important;
}

/* Mobile fix: the equal-height rule above (flex-grow:1; flex-basis:0) forces
   every program card to a SHARED height (~270px). On phones the cards stack
   into a single column where that shared height is smaller than the card's own
   content (up to ~323px), so the text spilled out below the grey card box and
   looked cut off. Equal-height only makes sense for the multi-column desktop
   grid, so below the Elementor mobile breakpoint let each card size to its own
   content again. */
@media (max-width: 767px) {
	.ct-imagebox-small {
		flex-grow: 0 !important;
		flex-basis: auto !important;
		height: auto !important;
		min-height: 0 !important;
	}
}

/* ------------------------------------------------------------------ *
 * Header dropdown (sub-menu) hover / selected contrast.
 * The sub-menu panel is dark green (rgb(25,44,39)); Blocksy colours the
 * current (selected) item mid-green rgb(93,165,34) — low contrast — and
 * hover had no affordance. Use white text + underline for hover, focus and
 * current/ancestor states so the active/hovered item is clearly legible.
 * Scoped to .header-menu-1 .sub-menu so top-level items (on the light
 * header, where white would be invisible) are untouched.
 * ------------------------------------------------------------------ */
.header-menu-1 .sub-menu a:hover,
.header-menu-1 .sub-menu a:focus,
.header-menu-1 .sub-menu .current-menu-item > a,
.header-menu-1 .sub-menu .current_page_item > a,
.header-menu-1 .sub-menu .current-menu-ancestor > a,
.header-menu-1 .sub-menu .current-page-ancestor > a {
	color: #ffffff !important;
	text-decoration: underline !important;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* Header navigation: display every desktop and mobile menu label in uppercase. */
.header-menu-1 .ct-menu-link,
.mobile-menu .ct-menu-link {
	text-transform: uppercase;
}

/* ------------------------------------------------------------------ *
 * Contact page (page ID 1947).
 * Contact details are presented as accessible cards and the location
 * map uses the full wide-content area instead of the old text column.
 * ------------------------------------------------------------------ */
.page-id-1947 .entry-content {
	--contact-green: var(--theme-palette-color-1, #5a8139);
	--contact-green-dark: var(--theme-palette-color-4, #192c27);
	--contact-ink: #26332f;
	--contact-muted: #62706b;
	--contact-line: #dfe8e3;
}

.page-id-1947 .hero-section {
	display: none;
}

.page-id-1947 .dinaf-contact {
	width: min(1280px, calc(100% - 40px));
	max-width: 1280px !important;
	margin: 0 auto;
	padding: 12px 0 80px;
}

.page-id-1947 .dinaf-contact-intro {
	max-width: 720px;
	margin: 0 auto 40px;
	text-align: center;
}

.page-id-1947 .dinaf-contact-kicker,
.page-id-1947 .dinaf-map-kicker {
	margin: 0 0 10px;
	color: var(--contact-green);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .13em;
	text-transform: uppercase;
}

.page-id-1947 .dinaf-contact-intro h2 {
	margin: 0 0 14px;
	color: var(--contact-green-dark);
	font-size: clamp(30px, 3vw, 43px);
	line-height: 1.14;
}

.page-id-1947 .dinaf-contact-intro > p:last-child {
	margin: 0;
	color: var(--contact-muted);
	font-size: 17px;
	line-height: 1.75;
}

.page-id-1947 .dinaf-contact-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 50px;
	margin: 0 0 50px;
}

.page-id-1947 .dinaf-contact-card {
	display: flex;
	gap: 22px;
	align-items: flex-start;
	min-height: 220px;
	margin: 0;
	padding: 35px;
	background: #e9ede9;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: background-color .3s ease;
}

.page-id-1947 .dinaf-contact-card:hover,
.page-id-1947 .dinaf-contact-card:focus-within {
	background: #2e4e2a;
}

.page-id-1947 .dinaf-contact-icon {
	display: inline-grid;
	flex: 0 0 58px;
	width: 58px;
	height: 58px;
	place-items: center;
	color: #41663c;
	background: transparent;
	border-radius: 0;
}

.page-id-1947 .dinaf-contact-icon svg {
	width: 50px;
	height: 50px;
	fill: currentColor;
}

.page-id-1947 .dinaf-contact-card h3 {
	margin: 2px 0 9px;
	color: var(--contact-green-dark);
	font-size: 19px;
	line-height: 1.3;
}

.page-id-1947 .dinaf-contact-card p {
	margin: 0;
	color: var(--contact-muted);
	font-size: 15px;
	line-height: 1.75;
	overflow-wrap: anywhere;
}

.page-id-1947 .dinaf-contact-card a {
	color: var(--contact-green-dark);
	font-weight: 600;
	text-decoration: none;
}

.page-id-1947 .dinaf-contact-card a:hover,
.page-id-1947 .dinaf-contact-card a:focus-visible {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.page-id-1947 .dinaf-contact-card:hover .dinaf-contact-icon,
.page-id-1947 .dinaf-contact-card:hover h3,
.page-id-1947 .dinaf-contact-card:hover p,
.page-id-1947 .dinaf-contact-card:hover a,
.page-id-1947 .dinaf-contact-card:focus-within .dinaf-contact-icon,
.page-id-1947 .dinaf-contact-card:focus-within h3,
.page-id-1947 .dinaf-contact-card:focus-within p,
.page-id-1947 .dinaf-contact-card:focus-within a {
	color: #fff;
}

.page-id-1947 .dinaf-map-section {
	margin: 0;
	padding: 0;
	background: #41663c;
	border-radius: 0;
	box-shadow: none;
	overflow: hidden;
}

.page-id-1947 .dinaf-map-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	padding: 30px 35px;
}

.page-id-1947 .dinaf-map-kicker {
	margin-bottom: 5px;
	color: #b8d69f;
}

.page-id-1947 .dinaf-map-header h2 {
	margin: 0;
	color: #fff;
	font-size: clamp(25px, 2.3vw, 34px);
	line-height: 1.2;
}

.page-id-1947 .dinaf-map-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 12px 17px;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 0;
	transition: background .2s ease, color .2s ease;
}

.page-id-1947 .dinaf-map-link:hover,
.page-id-1947 .dinaf-map-link:focus-visible {
	color: var(--contact-green-dark);
	background: #fff;
}

.page-id-1947 .dinaf-map-frame {
	line-height: 0;
	background: #e7ece9;
	border-radius: 0;
	overflow: hidden;
}

.page-id-1947 .dinaf-map-frame iframe {
	display: block;
	width: 100%;
	height: clamp(480px, 52vw, 650px);
}

@media (max-width: 900px) {
	.page-id-1947 .dinaf-contact-grid {
		grid-template-columns: 1fr;
	}

	.page-id-1947 .dinaf-contact-card {
		min-height: 0;
	}
}

@media (max-width: 600px) {
	.page-id-1947 .dinaf-contact {
		width: min(100% - 28px, 1280px);
		padding: 4px 0 52px;
	}

	.page-id-1947 .dinaf-contact-intro {
		margin-bottom: 30px;
		text-align: left;
	}

	.page-id-1947 .dinaf-contact-intro h2 {
		font-size: 28px;
	}

	.page-id-1947 .dinaf-contact-intro > p:last-child {
		font-size: 16px;
	}

	.page-id-1947 .dinaf-contact-grid {
		gap: 16px;
		margin-bottom: 30px;
	}

	.page-id-1947 .dinaf-contact-card {
		gap: 15px;
		padding: 23px 20px;
	}

	.page-id-1947 .dinaf-contact-icon {
		flex-basis: 46px;
		width: 46px;
		height: 46px;
	}

	.page-id-1947 .dinaf-contact-icon svg {
		width: 40px;
		height: 40px;
	}

	.page-id-1947 .dinaf-map-header {
		align-items: flex-start;
		flex-direction: column;
		gap: 18px;
		padding: 22px 18px;
	}

	.page-id-1947 .dinaf-map-link {
		width: 100%;
		justify-content: center;
	}

	.page-id-1947 .dinaf-map-frame iframe {
		height: 480px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.page-id-1947 .dinaf-contact-card,
	.page-id-1947 .dinaf-map-link {
		transition: none;
	}
}
