/* ==========================================================================
   Blog (/blog/, /blog/<slug>/, /blog/category/<slug>/)
   --------------------------------------------------------------------------
   Origem: app/(pages)/(blog)/blog/ — index.tsx, [slug].tsx, PostCard.tsx,
   blog.style.tsx (medidas) e PostBody.web.tsx (tipografia do corpo, BODY_CSS).
   Templates: home.html (listagem), category.html, archive.html, single.html.

   Diferenças de propósito em relação ao app:
   - Os filtros por categoria eram estado do React; aqui são links para
     /blog/category/<slug>/ (o chip ativo é o `current-cat` do bloco Categorias).
   - Listas no corpo do post mostram marcador (no app o Quill 2 grava tudo como
     <ol data-list> e o RN-web zerava o list-style: bolinha e número sumiam).
   - "Uncategorized" (categoria padrão do WP) nunca aparece: o app não tinha.
   - Corpo do post em Inter, como o BODY_CSS do app pede. Na prática o app ao
     vivo mostra o corpo em Roboto: um `* { font-family: Roboto, Inter }` global
     do app vence o `.cl-blog-body p`. Para imitar isso, troque
     --cl-blog-body-font (e acrescente a Roboto ao tema).
   ========================================================================== */

.cl-ic--newspaper { --cl-icon: url("../../icons/newspaper.svg"); }
.cl-ic--arrow-left { --cl-icon: url("../../icons/arrow-left.svg"); }

.cl-blog,
.cl-blog-article {
	--cl-blog-pad-x: 32px;
	font-family: var(--wp--preset--font-family--inter, "Inter", system-ui, sans-serif);
}
@media (max-width: 767px) {
	.cl-blog,
	.cl-blog-article { --cl-blog-pad-x: 20px; }
}

/* ---------- Topo (hero) ---------- */

.cl-blog-hero {
	background: var(--cl-bg-light);
	padding: 72px var(--cl-blog-pad-x) 56px;
}
.cl-blog-eyebrow {
	margin-bottom: 12px !important;
	font-size: 12px;
	line-height: 15px;
	font-weight: 700;
	letter-spacing: 1.6px;
	color: var(--cl-accent-text);
}
.cl-blog-hero__title {
	font-size: 46px;
	line-height: 54px;
	font-weight: 700;
	letter-spacing: -0.4px;
	color: var(--cl-navy);
}
.cl-blog-hero__subtitle {
	max-width: 620px;
	margin-top: 14px !important;
	font-size: 16px;
	line-height: 26px;
	color: var(--cl-text-gray);
}

/* Chips de categoria: o "All" é um parágrafo, o resto vem do bloco Categorias
   (<ul><li class="cat-item">); o <ul> some do layout para todos ficarem lado a lado. */
.cl-blog-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
}
.cl-blog-chips__list {
	display: contents;
	list-style: none;
}
.cl-blog-chips .cat-item-none,
.cl-blog-chips li:has(> a[href$="/category/uncategorized/"]) { display: none; }
.cl-blog-chip a,
.cl-blog-chips .cat-item > a {
	display: block;
	padding: 9px 14px;
	border: 1px solid var(--cl-border);
	border-radius: 999px;
	background: var(--cl-white);
	font-size: 13px;
	line-height: 16px;
	font-weight: 600;
	color: var(--cl-text-gray);
	text-decoration: none;
	transition: transform 0.15s var(--cl-ease), border-color 0.15s;
}
.cl-blog-chip a:hover,
.cl-blog-chips .cat-item > a:hover { border-color: var(--cl-text-gray); }
.cl-blog-chip a:active,
.cl-blog-chips .cat-item > a:active { transform: scale(0.97); }
.cl-blog-chip.is-active a,
.cl-blog-chips .current-cat > a {
	background: var(--cl-navy);
	border-color: var(--cl-navy);
	color: var(--cl-white);
}

/* ---------- Lista de posts ---------- */

.cl-blog-list { padding: 56px var(--cl-blog-pad-x); }

/* Mesma regra do app: largura 31.5%, mínimo 300, cresce para preencher a linha
   (por isso o último card de uma linha incompleta estica, como lá). */
.cl-blog-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.cl-blog-grid > li {
	display: flex;
	flex: 1 0 31.5%;
	min-width: 300px;
	margin: 0;
}
.cl-blog-cardwrap { display: flex; width: 100%; }
/* Entrada em cascata: 60ms por card, até o sexto (PostCard: min(index, 5) * 60). */
html.cl-js .cl-blog-grid > li:nth-child(2) .cl-reveal { transition-delay: 60ms; }
html.cl-js .cl-blog-grid > li:nth-child(3) .cl-reveal { transition-delay: 120ms; }
html.cl-js .cl-blog-grid > li:nth-child(4) .cl-reveal { transition-delay: 180ms; }
html.cl-js .cl-blog-grid > li:nth-child(5) .cl-reveal { transition-delay: 240ms; }
html.cl-js .cl-blog-grid > li:nth-child(n + 6) .cl-reveal { transition-delay: 300ms; }

.cl-blog-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--cl-border);
	border-radius: 16px;
	background: var(--cl-white);
	overflow: hidden;
	transition: transform 150ms, border-color 150ms;
}
.cl-blog-card:hover {
	border-color: var(--cl-navy);
	transform: translateY(-2px);
}
.cl-blog-card:active { transform: scale(0.995); }

.cl-blog-card__cover {
	height: 180px;
	margin: 0;
	background: var(--cl-bg-light);
}
.cl-blog-card__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
/* Post sem capa: faixa navy clara com o ícone de jornal no lugar da imagem. */
.cl-blog-card:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	height: 180px;
	flex-shrink: 0;
	background: var(--cl-navy-wash);
}
.cl-blog-card:not(:has(.wp-block-post-featured-image))::after {
	content: "";
	position: absolute;
	top: 77px;
	left: 50%;
	width: 26px;
	height: 26px;
	margin-left: -13px;
	background-color: var(--cl-navy);
	-webkit-mask: url("../../icons/newspaper.svg") center / contain no-repeat;
	mask: url("../../icons/newspaper.svg") center / contain no-repeat;
}

.cl-blog-card__body { padding: 20px; }

.cl-blog-card__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px !important;
	font-size: 11px;
	line-height: 14px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--cl-accent-text);
}
.cl-blog-card__cats a { color: inherit; text-decoration: none; }
.cl-blog-card__cats .wp-block-post-terms__separator,
.cl-blog-card__cats a[href$="/category/uncategorized/"] { display: none; }
.cl-blog-card__cats:not(:has(a:not([href$="/category/uncategorized/"]))) { display: none; }

.cl-blog-card__title {
	font-size: 19px;
	line-height: 26px;
	font-weight: 700;
	color: var(--cl-navy);
}
.cl-blog-card__title a { color: inherit; text-decoration: none; }
/* O card inteiro é o link (no app era um Pressable). */
.cl-blog-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.cl-blog-card__title a:focus-visible { outline: none; }
.cl-blog-card:has(.cl-blog-card__title a:focus-visible) { outline: 2px solid var(--cl-navy); outline-offset: 2px; }

.cl-blog-card__excerpt { margin-top: 8px !important; }
.cl-blog-card__excerpt .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	font-size: 14px;
	line-height: 22px;
	color: var(--cl-text-gray);
}
.cl-blog-card__excerpt .wp-block-post-excerpt__more-text { display: none; }

/* Data · tempo de leitura (· categorias, no post). */
.cl-blog-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	font-size: 12px;
	line-height: 15px;
	color: var(--cl-text-gray);
}
.cl-blog-meta > * + *::before {
	content: "\00a0·\00a0";
}
.cl-blog-meta a { color: inherit; text-decoration: none; }
.cl-blog-meta a:hover { text-decoration: underline; }
.cl-blog-card__meta { margin-top: 14px !important; }

/* ---------- Paginação e estado vazio ---------- */

.cl-blog-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 40px !important;
	font-size: 14px;
	font-weight: 600;
	color: var(--cl-text-gray);
}
.cl-blog-pagination .wp-block-query-pagination-numbers { display: flex; gap: 4px; }
.cl-blog-pagination a,
.cl-blog-pagination .page-numbers {
	display: inline-block;
	min-width: 20px;
	padding: 8px 12px;
	border: 1px solid var(--cl-border);
	border-radius: 999px;
	color: var(--cl-text-gray);
	text-align: center;
	text-decoration: none;
}
.cl-blog-pagination .page-numbers.current {
	background: var(--cl-navy);
	border-color: var(--cl-navy);
	color: var(--cl-white);
}
.cl-blog-pagination .page-numbers.dots { border-color: transparent; }

.cl-blog-state {
	max-width: 720px;
	margin: 0 auto;
	padding: 72px 0;
	text-align: center;
}
.cl-blog-state__title {
	font-size: 22px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--cl-navy);
}
.cl-blog-state__body {
	margin-top: 10px !important;
	font-size: 15px;
	line-height: 24px;
	color: var(--cl-text-gray);
}

/* ---------- Post ---------- */

.cl-blog-article { padding: 56px var(--cl-blog-pad-x) 96px; }
.cl-blog-article__inner {
	max-width: 720px;
	margin: 0 auto;
}

.cl-blog-back { display: flex; margin-bottom: 24px !important; }
.cl-blog-back a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	line-height: 17px;
	font-weight: 600;
	color: var(--cl-text-gray);
	text-decoration: none;
	transition: color 0.2s;
}
.cl-blog-back a::before {
	content: "";
	width: 12px;
	height: 12px;
	background-color: currentColor;
	-webkit-mask: url("../../icons/arrow-left.svg") center / contain no-repeat;
	mask: url("../../icons/arrow-left.svg") center / contain no-repeat;
	transition: transform 0.2s var(--cl-ease);
}
.cl-blog-back a:hover { color: var(--cl-navy); }
.cl-blog-back a:hover::before { transform: translateX(-2px); }

.cl-blog-article__title {
	font-size: 42px;
	line-height: 50px;
	font-weight: 700;
	letter-spacing: -0.4px;
	color: var(--cl-navy);
}
.cl-blog-article__meta {
	margin-top: 14px !important;
	font-size: 13px;
	line-height: 16px;
}
.cl-blog-article__meta .wp-block-post-terms__separator { display: none; }
.cl-blog-article__meta .wp-block-post-terms a + .wp-block-post-terms__separator + a::before { content: ", "; }
.cl-blog-article__meta .wp-block-post-terms a[href$="/category/uncategorized/"] { display: none; }
.cl-blog-article__meta .wp-block-post-terms:not(:has(a:not([href$="/category/uncategorized/"]))) { display: none; }

.cl-blog-article__cover {
	height: 340px;
	margin: 28px 0 0;
	border-radius: 16px;
	background: var(--cl-bg-light);
	overflow: hidden;
}
.cl-blog-article__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- Corpo do post (BODY_CSS do PostBody.web.tsx) ---------- */

.cl-blog-body {
	--cl-blog-body-font: inherit;
	margin-top: 32px;
	font-family: var(--cl-blog-body-font);
	font-size: 17px;
	line-height: 1.75;
	color: var(--cl-text);
}
.cl-blog-body > *:first-child { margin-top: 0 !important; }
.cl-blog-body p { margin: 0 0 20px; }
.cl-blog-body :is(h1, h2, h3, h4, h5, h6) {
	color: var(--cl-navy);
	font-weight: 700;
	letter-spacing: -0.2px;
}
.cl-blog-body h1 { font-size: 30px; line-height: 1.25; margin: 44px 0 14px; }
.cl-blog-body h2 { font-size: 25px; line-height: 1.3; margin: 40px 0 12px; }
.cl-blog-body h3 { font-size: 20px; line-height: 1.35; margin: 32px 0 10px; }
.cl-blog-body :is(h4, h5, h6) { font-size: 17px; margin: 28px 0 8px; }
.cl-blog-body a { color: var(--cl-accent-text); text-decoration: underline; text-underline-offset: 2px; }
.cl-blog-body strong { font-weight: 700; color: var(--cl-navy); }
.cl-blog-body :is(ul, ol) { margin: 0 0 20px; padding-left: 24px; }
.cl-blog-body ul { list-style: disc; }
.cl-blog-body ol { list-style: decimal; }
.cl-blog-body li { margin-bottom: 8px; }
.cl-blog-body li > :is(ul, ol) { margin: 8px 0 0; }
.cl-blog-body li::marker { color: var(--cl-text-gray); }

/* No app a imagem do Quill ficava dentro de um <p> (12px de margem + 20 do <p>);
   no WP ela vira um bloco Imagem (<figure>), então a soma vai para a figura. */
.cl-blog-body .wp-block-image,
.cl-blog-body figure { margin: 12px 0 32px; }
.cl-blog-body img {
	max-width: 100%;
	height: auto;
	border-radius: 14px;
	vertical-align: middle;
}
.cl-blog-body figcaption {
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--cl-text-gray);
	text-align: center;
}

.cl-blog-body blockquote {
	margin: 28px 0;
	padding: 6px 0 6px 20px;
	border-left: 3px solid var(--cl-accent);
	font-size: 18px;
	color: var(--cl-text-gray);
}
.cl-blog-body blockquote > :last-child { margin-bottom: 0; }
.cl-blog-body blockquote cite { display: block; margin-top: 8px; font-size: 14px; font-style: normal; }

.cl-blog-body pre {
	margin: 0 0 20px;
	padding: 18px;
	border-radius: 12px;
	background: var(--cl-bg-light);
	overflow-x: auto;
	font-size: 14px;
	line-height: 1.6;
	white-space: pre;
}
.cl-blog-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.cl-blog-body pre code { font-size: inherit; }
.cl-blog-body :not(pre) > code { padding: 2px 6px; border-radius: 5px; background: var(--cl-bg-light); }

.cl-blog-body hr,
.cl-blog-body .wp-block-separator { margin: 36px 0; border: 0; border-top: 1px solid var(--cl-border); }

/* Tabela larga rola dentro de si, a página nunca rola na horizontal. */
.cl-blog-body table { display: block; width: 100%; margin: 0 0 20px; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.cl-blog-body .wp-block-table { margin: 0 0 20px; }
.cl-blog-body :is(th, td) { padding: 10px 12px; border: 1px solid var(--cl-border); text-align: left; }
.cl-blog-body th { background: var(--cl-bg-light); font-weight: 700; color: var(--cl-navy); }

.cl-blog-body .has-text-align-center { text-align: center; }
.cl-blog-body .has-text-align-right { text-align: right; }

/* ---------- Celular ---------- */

@media (max-width: 767px) {
	.cl-blog-hero { padding: 40px var(--cl-blog-pad-x) 36px; }
	.cl-blog-hero__title { font-size: 32px; line-height: 38px; }
	.cl-blog-list { padding: 36px var(--cl-blog-pad-x); }
	.cl-blog-grid { gap: 20px; }
	.cl-blog-grid > li { flex: 1 0 100%; min-width: 0; }
	.cl-blog-article { padding: 32px var(--cl-blog-pad-x) 64px; }
	.cl-blog-article__title { font-size: 30px; line-height: 38px; }
}
