/**
 * 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;
}

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