/*
Theme Name: AgroInveste Child
Description: Personalizações seguras do AgroInveste sobre o tema BlogHash.
Author: AgroInveste
Template: bloghash
Version: 1.2.0
Text Domain: agroinveste-child
*/

/*
 * As personalizações visuais serão adicionadas por fases.
 * Esta versão apenas preserva o aspeto configurado no BlogHash e corrige o H1 duplicado.
 */

/* Anúncios dentro dos artigos (inc/adsense.php) */
.agro-ad {
	clear: both;
	margin: 2em 0;
	text-align: center;
}

.agro-ad__label {
	display: block;
	margin-bottom: 6px;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.55;
}

.agro-ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
	display: none;
}

/* Caixa de autor no fim dos artigos (inc/author-box.php) */
.agro-author-box {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	margin: 2.5em 0 1.5em;
	padding: 18px 20px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 10px;
	background: rgba(46, 125, 50, 0.05);
}

.agro-author-box__avatar {
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #2e7d32;
	color: #fff;
	font-weight: 700;
	font-size: 18px;
	line-height: 52px;
	text-align: center;
}

.agro-author-box__body p {
	margin: 0 0 6px;
}

.agro-author-box__byline {
	font-size: 1.05em;
}

.agro-author-box__bio {
	font-size: 0.95em;
}

.agro-author-box__meta {
	font-size: 0.85em;
	opacity: 0.7;
}

@media (max-width: 480px) {
	.agro-author-box {
		flex-direction: column;
		gap: 10px;
	}
}

/* Mercado Agrícola: destaque no menu, faixa na homepage e chamada nos artigos (inc/mercado-promo.php) */
/*
 * O BlogHash força "padding: .2rem 0" no texto do menu e desenha um sublinhado
 * animado (span:before); daí os seletores mais específicos.
 */
#bloghash-header-inner .bloghash-nav > ul > li.agro-menu-mercado > a > span,
#bloghash-header .bloghash-nav > ul > li.agro-menu-mercado > a > span {
	padding: 7px 16px;
	border-radius: 999px;
	background: #287d2e;
	color: #fff;
	font-weight: 700;
	line-height: 1.2;
	transition: background-color 0.2s ease;
}

#bloghash-header-inner .bloghash-nav > ul > li.agro-menu-mercado > a:hover > span,
#bloghash-header-inner .bloghash-nav > ul > li.agro-menu-mercado > a:focus > span,
#bloghash-header .bloghash-nav > ul > li.agro-menu-mercado > a:hover > span,
#bloghash-header .bloghash-nav > ul > li.agro-menu-mercado > a:focus > span {
	background: #1f6324;
	color: #fff;
}

#bloghash-header-inner .bloghash-nav > ul > li.agro-menu-mercado > a > span::before,
#bloghash-header .bloghash-nav > ul > li.agro-menu-mercado > a > span::before {
	display: none;
}

.agro-mercado-btn {
	display: inline-block;
	padding: 12px 22px;
	border-radius: 999px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.agro-mercado-btn--primary {
	background: #287d2e;
	color: #fff !important;
}

.agro-mercado-btn--primary:hover,
.agro-mercado-btn--primary:focus {
	background: #1f6324;
}

.agro-mercado-btn--secondary {
	border: 2px solid #287d2e;
	color: #287d2e !important;
}

.agro-mercado-btn--secondary:hover,
.agro-mercado-btn--secondary:focus {
	background: #e0f2df;
}

.agro-mercado-band {
	display: grid;
	grid-template-columns: 1fr 1.1fr;
	gap: 36px;
	align-items: center;
	max-width: 1180px;
	margin: 0 auto 60px;
	padding: 48px 40px;
	border-radius: 28px;
	background: #18251b;
	color: #fff;
}

.agro-mercado-band__tag {
	display: inline-block;
	margin-bottom: 14px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	color: #bfe6bc;
	font-size: 14px;
	font-weight: 700;
}

.agro-mercado-band h2 {
	margin: 0 0 14px;
	color: #fff;
	font-size: clamp(28px, 3.6vw, 42px);
	line-height: 1.12;
	letter-spacing: -1px;
}

.agro-mercado-band p {
	margin: 0 0 24px;
	color: rgba(255, 255, 255, 0.8);
	font-size: 17px;
	line-height: 1.7;
}

.agro-mercado-band__buttons,
.agro-mercado-cta__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.agro-mercado-band .agro-mercado-btn--primary {
	background: #6cc46f;
	color: #10200f !important;
}

.agro-mercado-band .agro-mercado-btn--primary:hover,
.agro-mercado-band .agro-mercado-btn--primary:focus {
	background: #86d488;
}

.agro-mercado-band .agro-mercado-btn--secondary {
	border-color: rgba(255, 255, 255, 0.6);
	color: #fff !important;
}

.agro-mercado-band .agro-mercado-btn--secondary:hover,
.agro-mercado-band .agro-mercado-btn--secondary:focus {
	background: rgba(255, 255, 255, 0.1);
}

.agro-mercado-band__shortcuts {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.agro-mercado-band__shortcut {
	display: grid;
	grid-template-columns: 44px 1fr;
	column-gap: 14px;
	align-items: center;
	padding: 16px 18px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #fff !important;
	text-decoration: none !important;
	transition: background-color 0.2s ease;
}

.agro-mercado-band__shortcut:hover,
.agro-mercado-band__shortcut:focus {
	background: rgba(255, 255, 255, 0.12);
}

.agro-mercado-band__icon {
	grid-row: span 2;
	font-size: 30px;
	line-height: 1;
	text-align: center;
}

.agro-mercado-band__shortcut strong {
	font-size: 17px;
}

.agro-mercado-band__shortcut span:last-child {
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	line-height: 1.5;
}

.agro-mercado-cta {
	margin: 2.5em 0 0;
	padding: 24px;
	border-radius: 16px;
	border: 1px solid rgba(40, 125, 46, 0.2);
	background: linear-gradient(135deg, #f3fbf2 0%, #ffffff 60%, #eef7e9 100%);
}

.agro-mercado-cta__tag {
	display: inline-block;
	margin-bottom: 8px;
	color: #287d2e;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.agro-mercado-cta p {
	margin: 0 0 8px;
}

.agro-mercado-cta__title {
	color: #18251b;
	font-size: 1.3em;
	font-weight: 800;
	line-height: 1.3;
}

.agro-mercado-cta__text {
	color: #4d5f52;
}

.agro-mercado-cta__buttons {
	margin-top: 16px;
}

/* Homepage automática (inc/home-sections.php) */
.agro-hero__card-label {
	display: inline-block;
	margin-bottom: 10px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #e0f2df;
	color: #256b2b;
	font-size: 13px;
	font-weight: 700;
}

.agro-hero__card .agro-btn {
	margin-top: 18px;
}

.agro-news-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}

.agro-news-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 20px;
	background: #fff;
	border: 1px solid rgba(40, 125, 46, 0.12);
	box-shadow: 0 14px 34px rgba(27, 62, 34, 0.08);
	color: inherit;
	text-decoration: none !important;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.agro-news-card:hover,
.agro-news-card:focus {
	transform: translateY(-4px);
	box-shadow: 0 22px 44px rgba(27, 62, 34, 0.13);
}

.agro-news-card__media {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #edf8eb;
}

.agro-news-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.agro-news-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px 22px;
}

.agro-news-card__meta {
	color: #287d2e;
	font-size: 13px;
	font-weight: 700;
}

.agro-news-card__title {
	color: #18251b;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.3;
}

.agro-news-card__summary {
	color: #5d6b60;
	font-size: 15px;
	line-height: 1.55;
}

.agro-home-more {
	margin: 28px 0 0;
	text-align: center;
}

.agro-month-grid {
	display: grid;
	grid-template-columns: 1.2fr 1fr 1fr;
	gap: 22px;
}

.agro-month-grid--related-1 {
	grid-template-columns: 1.2fr 1fr;
}

.agro-month-grid--related-0 {
	grid-template-columns: 1fr;
}

.agro-month-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 30px;
	border-radius: 20px;
	background: linear-gradient(135deg, #287d2e 0%, #1f6324 100%);
	color: #fff !important;
	text-decoration: none !important;
	transition: transform 0.25s ease;
}

.agro-month-card:hover,
.agro-month-card:focus {
	transform: translateY(-4px);
}

.agro-month-card__icon {
	font-size: 34px;
	line-height: 1;
}

.agro-month-card__title {
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
}

.agro-month-card__text {
	color: rgba(255, 255, 255, 0.85);
	font-size: 15px;
	line-height: 1.6;
}

.agro-month-card__link {
	margin-top: auto;
	font-weight: 700;
}

@media (max-width: 1000px) {
	.agro-news-grid,
	.agro-month-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.agro-month-card {
		grid-column: 1 / -1;
	}
}

@media (max-width: 620px) {
	.agro-news-grid,
	.agro-month-grid {
		grid-template-columns: 1fr;
	}
}

/* Partilha e artigos relacionados no fim dos artigos (inc/engagement.php) */
.agro-share {
	margin: 2.2em 0 0;
	padding: 18px 0 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.agro-share__label {
	display: block;
	margin-bottom: 10px;
	font-weight: 700;
}

.agro-share__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.agro-share__button {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 999px;
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	transition: opacity 0.2s ease;
}

.agro-share__button:hover,
.agro-share__button:focus {
	opacity: 0.85;
}

.agro-share__button--whatsapp {
	background: #1f8f4e;
}

.agro-share__button--facebook {
	background: #1877f2;
}

.agro-share__button--telegram {
	background: #1c8ad3;
}

.agro-share__button--x {
	background: #111;
}

.agro-share__button--email {
	background: #5d6b60;
}

.agro-related {
	margin: 2.5em 0 0;
}

.agro-related__title {
	margin: 0 0 18px;
	font-size: 1.5em;
}

.agro-related .agro-news-card__title {
	font-size: 16px;
}

.agro-related .agro-news-card__summary {
	display: none;
}

@media (min-width: 621px) and (max-width: 1000px) {
	.agro-related .agro-news-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/*
 * Auto ads da Google: quando a Google insere um anúncio dentro de uma grelha
 * (topo da homepage, cartões, faixa do Mercado), ele ocupa a linha inteira em vez
 * de roubar uma coluna e desformatar o conteúdo à volta.
 */
.agro-hero > .google-auto-placed,
.agro-topics__grid > .google-auto-placed,
.agro-news-grid > .google-auto-placed,
.agro-month-grid > .google-auto-placed,
.agro-mercado-band > .google-auto-placed,
.agro-mercado-band__shortcuts > .google-auto-placed {
	grid-column: 1 / -1;
	width: 100%;
}

/* Modo escuro do BlogHash (html[data-darkmode="dark"]) */
[data-darkmode="dark"] .agro-share {
	border-top-color: rgba(255, 255, 255, 0.12);
}

/* Secções antigas da homepage (o estilo delas está dentro da própria página) */
[data-darkmode="dark"] .agro-hero {
	background: linear-gradient(135deg, #17231a 0%, #1b2a1e 50%, #142017 100%);
}

[data-darkmode="dark"] .agro-hero h1,
[data-darkmode="dark"] .agro-section-heading h2,
[data-darkmode="dark"] .agro-topic-card h3 {
	color: #fff !important;
}

[data-darkmode="dark"] .agro-hero p,
[data-darkmode="dark"] .agro-section-heading p,
[data-darkmode="dark"] .agro-topic-card p {
	color: rgba(255, 255, 255, 0.78) !important;
}

[data-darkmode="dark"] .agro-hero__tag,
[data-darkmode="dark"] .agro-hero__card-label {
	background: rgba(108, 196, 111, 0.16);
	color: #8fd391;
}

[data-darkmode="dark"] .agro-section-heading span {
	color: #8fd391;
}

[data-darkmode="dark"] .agro-hero__card,
[data-darkmode="dark"] .agro-topic-card {
	border-color: rgba(255, 255, 255, 0.08);
	background: #1d2620;
	box-shadow: none;
}

[data-darkmode="dark"] .agro-hero__card strong {
	color: #8fd391;
}

[data-darkmode="dark"] .agro-topic-card__icon {
	background: rgba(108, 196, 111, 0.14);
}

[data-darkmode="dark"] .agro-btn--secondary {
	border-color: rgba(143, 211, 145, 0.5);
	background: transparent;
	color: #8fd391;
}
[data-darkmode="dark"] .agro-author-box {
	border-color: rgba(255, 255, 255, 0.15);
	background: rgba(108, 196, 111, 0.08);
}

[data-darkmode="dark"] .agro-mercado-cta {
	border-color: rgba(108, 196, 111, 0.3);
	background: rgba(108, 196, 111, 0.08);
}

[data-darkmode="dark"] .agro-mercado-cta__tag {
	color: #8fd391;
}

[data-darkmode="dark"] .agro-mercado-cta__title {
	color: #fff;
}

[data-darkmode="dark"] .agro-mercado-cta__text {
	color: rgba(255, 255, 255, 0.8);
}

[data-darkmode="dark"] .agro-mercado-btn--secondary {
	border-color: #8fd391;
	color: #8fd391 !important;
}

[data-darkmode="dark"] .agro-mercado-btn--secondary:hover,
[data-darkmode="dark"] .agro-mercado-btn--secondary:focus {
	background: rgba(108, 196, 111, 0.12);
}

[data-darkmode="dark"] .agro-news-card {
	border-color: rgba(255, 255, 255, 0.08);
	background: #1d2620;
}

[data-darkmode="dark"] .agro-news-card__meta {
	color: #8fd391;
}

[data-darkmode="dark"] .agro-news-card__title {
	color: #fff;
}

[data-darkmode="dark"] .agro-news-card__summary {
	color: rgba(255, 255, 255, 0.75);
}

[data-darkmode="dark"] .agro-banner--house strong {
	color: #8fd391;
}

@media (max-width: 900px) {
	.agro-mercado-band {
		grid-template-columns: 1fr;
		padding: 32px 22px;
		margin: 0 16px 48px;
	}
}
