/*
Theme Name: ASAFE
Theme URI: https://asafe.org.br
Author: Vagner Rodrigues Valentim
Description: Tema institucional da ASAFE, Associação dos Agricultores Familiares, Feirantes e Empreendedores Rurais do Município de Galileia/MG. Requer o plugin ASAFE Core.
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: asafe
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[id] { scroll-margin-top: 24px; }
img { height: auto; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

.asafe-eyebrow { margin: 0; font-family: var(--wp--preset--font-family--montserrat); font-weight: 700; font-size: 14px !important; letter-spacing: 2px; text-transform: uppercase; color: var(--wp--preset--color--laranja-texto); }
.asafe-eyebrow--dark, .asafe-eyebrow--dark a { color: #8F4300; text-decoration: none; }
.asafe-eyebrow--ambar { color: var(--wp--preset--color--ambar); }
.asafe-kicker { margin: 0; font-size: 14px; font-weight: 700; color: var(--wp--preset--color--laranja-texto); }
.asafe-kicker--dark { color: #8F4300; }
.asafe-section h2.wp-block-heading { margin-top: 0; }
.asafe-section--dark p { color: #E8F3EA; }

/* Imagens arredondadas */
.asafe-rounded img, .wp-block-post-featured-image.asafe-rounded img, .wp-block-post-featured-image.asafe-rounded { border-radius: 20px; }
.wp-block-post-featured-image.asafe-rounded { overflow: hidden; background: #DED4BA; }
.asafe-rounded figcaption { margin-top: 12px; text-align: left; }

/* ---------- Cabeçalho ---------- */
.asafe-site-header { position: relative; z-index: 20; }
.asafe-header__inner { gap: 24px; }
.asafe-brand { display: flex; gap: 14px; align-items: center; text-decoration: none; flex-shrink: 0; }
.asafe-brand img { width: 64px; height: 74px; object-fit: contain; display: block; }
.asafe-brand__text { display: flex; flex-direction: column; gap: 2px; }
.asafe-brand__name { font-family: var(--wp--preset--font-family--montserrat); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -0.5px; color: var(--wp--preset--color--verde); }
.asafe-brand__tagline { font-size: 13px; line-height: 1.2; max-width: 240px; color: var(--wp--preset--color--cinza); }
.asafe-header__nav { gap: 28px; }
.asafe-header .wp-block-navigation a { color: var(--wp--preset--color--tinta); text-decoration: none; padding: 10px 0; border-bottom: 3px solid transparent; }
.asafe-header .wp-block-navigation a:hover, .asafe-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--verde); border-bottom-color: var(--wp--preset--color--laranja); }
.asafe-header__cta .wp-block-button__link { padding: 12px 22px; font-size: 16px; white-space: nowrap; }
.asafe-header__cta .wp-block-button__link:hover { background: #F08A00 !important; }
.wp-block-navigation__responsive-container.is-menu-open { padding: 32px 24px; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 8px; font-size: 22px; }

/* ---------- Seções da página inicial ---------- */
.asafe-split { gap: 56px; }
.asafe-mosaico { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.asafe-mosaico img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 22px; display: block; }
.asafe-mosaico__wide { grid-column: 1 / -1; aspect-ratio: 16 / 8 !important; }

.asafe-steps { list-style: none; margin: 0; padding: 0; counter-reset: passo; display: flex; flex-direction: column; gap: 14px; }
.asafe-steps li { counter-increment: passo; display: flex; gap: 16px; align-items: flex-start; }
.asafe-steps li::before { content: counter(passo); flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--wp--preset--color--verde); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: -4px; }
.asafe-steps--orange li::before { background: var(--wp--preset--color--laranja); color: var(--wp--preset--color--tinta); }

.asafe-pnae-visual { position: relative; padding-left: 24px; }
.asafe-pnae-visual__art { position: relative; aspect-ratio: 4 / 5; max-height: 560px; border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, #FFF3DA 0%, #FFE7B8 100%); }
.asafe-pnae-visual__sun { position: absolute; width: 70%; aspect-ratio: 1; left: 15%; top: 14%; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #FFB300 0%, #FF9500 60%, #FF7A00 100%); }
.asafe-pnae-visual__hill { position: absolute; left: -20%; right: -20%; height: 60%; border-radius: 50%; }
.asafe-pnae-visual__hill--1 { bottom: -22%; background: #009405; }
.asafe-pnae-visual__hill--2 { bottom: -34%; left: 10%; right: -40%; background: var(--wp--preset--color--verde); }
.asafe-pnae-visual__badge { position: absolute; left: 0; bottom: 32px; display: flex; flex-direction: column; gap: 2px; max-width: 260px; padding: 20px 24px; border-radius: 18px; background: var(--wp--preset--color--laranja); color: var(--wp--preset--color--tinta); box-shadow: 0 16px 32px rgba(11, 61, 36, .25); font-weight: 600; }
.asafe-pnae-visual__badge strong { font-family: var(--wp--preset--font-family--montserrat); font-weight: 800; font-size: 36px; line-height: 1; }

.asafe-card-foto h3, .asafe-card-destaque h3 { margin: 0; }
.asafe-card-foto p, .asafe-card-destaque p { margin: 0; }
.asafe-card-foto .wp-block-image { margin: 0 0 4px; width: 100%; }
.asafe-card-destaque__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--wp--preset--color--verde); color: #fff; display: flex; align-items: center; justify-content: center; }
.asafe-diretoria-wrap .asafe-diretoria { margin-top: 72px; }

.asafe-link-strong-p { margin: 0; font-weight: 700; }

/* ---------- Cartões do blog ---------- */
.asafe-posts .wp-block-post-template { gap: 32px 28px; }
.asafe-post-card { height: 100%; }
.asafe-post-card .wp-block-post-featured-image { width: 100%; margin: 0 0 4px; }
.asafe-post-card .wp-block-post-featured-image img { transition: transform .3s ease; }
.asafe-post-card:hover .wp-block-post-featured-image img { transform: scale(1.03); }
.asafe-meta { font-size: 14px; font-weight: 700; color: var(--wp--preset--color--laranja-texto); }
.asafe-meta .wp-block-post-terms a { color: var(--wp--preset--color--laranja-texto); text-decoration: none; }
.asafe-meta .wp-block-post-terms + .wp-block-post-date::before { content: "·"; margin-right: 6px; }
.asafe-post-card__title { margin: 0; font-size: 22px !important; line-height: 1.25; }
.asafe-post-card__title a { color: var(--wp--preset--color--verde-noite); text-decoration: none; }
.asafe-post-card__title a:hover { text-decoration: underline; }
.asafe-post-card .wp-block-post-excerpt { margin: 0; }
.asafe-post-card .wp-block-post-excerpt__excerpt { margin: 0; }

/* Primeira publicação do blog em destaque (computador) */
@media (min-width: 782px) {
	.asafe-posts--blog .wp-block-post-template > li:first-child { grid-column: 1 / -1; }
	.asafe-posts--blog .wp-block-post-template > li:first-child .asafe-post-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 8px 40px; align-items: center; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 12px 32px rgba(11, 61, 36, .10); padding-right: 40px; }
	.asafe-posts--blog .wp-block-post-template > li:first-child .wp-block-post-featured-image { grid-row: 1 / span 3; margin: 0; height: 100%; min-height: 360px; border-radius: 0; }
	.asafe-posts--blog .wp-block-post-template > li:first-child .wp-block-post-featured-image img { border-radius: 0; height: 100%; }
	.asafe-posts--blog .wp-block-post-template > li:first-child .asafe-post-card__title { font-size: 32px !important; letter-spacing: -0.5px; }
	.asafe-posts--blog .wp-block-post-template > li:first-child .asafe-meta { align-self: end; }
	.asafe-posts--blog .wp-block-post-template > li:first-child .wp-block-post-excerpt { align-self: start; font-size: 18px !important; }
}

/* Categorias como botões */
.asafe-chips.wp-block-categories, ul.asafe-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.asafe-chips li { margin: 0; font-size: 0; }
.asafe-chips li a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; background: #fff; border: 1px solid #E0D8C6; color: var(--wp--preset--color--tinta); font-size: 16px; font-weight: 600; text-decoration: none; box-sizing: border-box; }
.asafe-chips li a:hover, .asafe-chips li.current-cat a { background: var(--wp--preset--color--verde); border-color: var(--wp--preset--color--verde); color: #fff; }

/* Paginação */
.asafe-pagination { margin-top: 24px; gap: 8px; font-weight: 700; }
.asafe-pagination a, .asafe-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid #E0D8C6; background: #fff; color: var(--wp--preset--color--tinta); text-decoration: none; box-sizing: border-box; }
.asafe-pagination .page-numbers.current { background: var(--wp--preset--color--verde); border-color: var(--wp--preset--color--verde); color: #fff; }

/* ---------- Faixa de topo das páginas internas ---------- */
.asafe-page-banner { position: relative; overflow: hidden; background: var(--wp--preset--color--pessego); padding-top: 64px; padding-bottom: 112px; }
.asafe-page-banner::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; right: 6%; top: -120px; background: radial-gradient(circle at 50% 40%, #FFB300 0%, #FF9500 60%, #FF7A00 100%); }
.asafe-page-banner::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -560px; height: 640px; border-radius: 50%; background: #009405; box-shadow: 30vw 30px 0 0 var(--wp--preset--color--verde); }
.asafe-page-banner__inner { position: relative; z-index: 1; }
.asafe-page-banner h1 { margin: 0; max-width: 760px; text-wrap: balance; }
.asafe-page-banner p { margin: 0; max-width: 620px; }
.asafe-page-banner--compact { padding-top: 48px; padding-bottom: 96px; }
.asafe-404 { padding-bottom: 160px; }

/* Busca */
.asafe-search { width: 100%; max-width: 520px; }
.asafe-search .wp-block-search__inside-wrapper { background: #fff; border-radius: 999px; padding: 6px 6px 6px 20px; border: 0 !important; box-shadow: 0 8px 24px rgba(11, 61, 36, .12); }
.asafe-search .wp-block-search__input { border: 0; min-height: 44px; font: inherit; background: transparent; }
.asafe-search .wp-block-search__input:focus { outline: none; }
.asafe-search .wp-block-search__button { margin-left: 8px; border-radius: 999px; min-height: 44px; padding: 10px 22px; background: var(--wp--preset--color--verde); color: #fff; font-weight: 700; border: 0; }

/* ---------- Publicação ---------- */
.asafe-breadcrumb { margin: 0; color: var(--wp--preset--color--cinza); }
.asafe-breadcrumb a { color: var(--wp--preset--color--cinza); }
.asafe-kicker-terms { font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.asafe-kicker-terms a { color: var(--wp--preset--color--laranja-texto); text-decoration: none; }
.asafe-single h1.wp-block-post-title { margin: 0; text-wrap: balance; }
.asafe-meta--single { font-weight: 400; }
.asafe-meta--single .wp-block-post-date { font-weight: 400; font-size: 15px; }
.asafe-meta--single .wp-block-post-author-name::before { content: "Por "; }
.asafe-single__img img { border-radius: 24px; }
.asafe-single__content > p:first-child { font-size: 22px; line-height: 1.5; color: var(--wp--preset--color--tinta); }
.asafe-single__content .wp-block-image img, .asafe-single__content .wp-block-gallery img { border-radius: 16px; }
.asafe-tags a { display: inline-block; margin: 0 4px 4px 0; padding: 6px 14px; border-radius: 999px; background: var(--wp--preset--color--verde-claro); color: var(--wp--preset--color--verde-noite); font-size: 15px; font-weight: 600; text-decoration: none; }
.asafe-tags .wp-block-post-terms__separator { display: none; }

/* ---------- Rodapé ---------- */
.asafe-footer { color: #DCEADF; }
.asafe-footer__title { margin: 0; font-size: 18px !important; letter-spacing: 0; color: var(--wp--preset--color--ambar) !important; }
.asafe-footer__logo { background: #fff; border-radius: 20px; padding: 14px; display: inline-block; }
.asafe-footer__logo img { width: 170px; height: auto; display: block; }
.asafe-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.asafe-footer p { margin: 0; }
.asafe-footer__bottom { border-top: 1px solid rgba(220, 234, 223, .2); color: #B9CFBF; }

/* ---------- Celular ---------- */
@media (max-width: 1080px) {
	.asafe-brand__tagline { display: none; }
}
@media (max-width: 781px) {
	.asafe-split { gap: 32px; }
	.asafe-header__cta, .wp-block-buttons.asafe-header__cta { display: none !important; }
	.asafe-brand__name { font-size: 24px; }
	.asafe-brand img { width: 52px; height: 60px; }
	.asafe-section { padding-top: 64px !important; padding-bottom: 64px !important; }
	#quem-somos.asafe-section { padding-top: 80px !important; }
	.asafe-pnae-visual { padding-left: 0; }
	.asafe-pnae-visual__art { aspect-ratio: 4 / 3; }
	.asafe-page-banner::before { width: 240px; height: 240px; right: -60px; top: -80px; }
	.asafe-single__content > p:first-child { font-size: 20px; }
}

/* Grade das publicações: 3 colunas no computador, 1 no celular. */
.asafe-posts .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.asafe-posts .wp-block-post-template > li, .asafe-post-card { min-width: 0; }
.asafe-post-card .wp-block-post-featured-image img { max-width: 100%; }
@media (max-width: 640px) {
	.asafe-posts .wp-block-post-template.is-layout-grid { grid-template-columns: minmax(0, 1fr); }
}
