/*
 * CSS da página inicial (front-page.php) — AgropecNews (portal de
 * notícias de agronegócio, pt-BR). Segunda versão: a primeira
 * dependia de posts reais em quase toda seção e o hero não tinha
 * identidade visual própria (só texto encostado numa imagem de post).
 * Agora o hero é construído inteiramente em CSS (faixa decorativa
 * evocando linhas de plantio + selo + estatísticas) e só a seção
 * "Últimas Notícias do Agro" depende de posts. Prefixo "agn-"
 * (AgropecNews) em todas as classes.
 *
 * Cores: tudo usa var(--tn-color-primary/secondary/extra/text/muted/
 * border/surface/bg) [+ -rgb] — nada hardcoded.
 *
 * Layout: só display:flex (+ flex-wrap) em todas as regras — nenhum
 * display:grid.
 *
 * Moldura automática: var(--tn-frame-image) via .image-frame::after,
 * sempre numa caixa 16:9 fixa.
 */

.agn-home {
    overflow: hidden;
    background: var(--tn-color-bg);
    color: var(--tn-color-text);
    font-family: var(--tn-font);
}

.agn-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.agn-home .agn-section {
    padding: 5rem 0;
}

.agn-home h2 {
    font-family: var(--tn-font-heading);
    font-weight: 700;
    font-size: 1.9rem;
    margin: 0;
    color: var(--tn-color-text);
}

.agn-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tn-color-primary);
    margin-bottom: 0.6rem;
}

.agn-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tn-color-primary);
    background: rgba(var(--tn-color-primary-rgb), 0.08);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.6rem;
}

.agn-date {
    font-size: 0.78rem;
    color: var(--tn-color-muted);
}

.agn-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.9rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.agn-btn-primary {
    background: var(--tn-color-primary);
    color: #fff;
}

.agn-btn-primary:hover {
    background: var(--tn-color-secondary);
    transform: translateY(-2px);
}

.agn-btn-ghost {
    background: transparent;
    border-color: var(--tn-color-border);
    color: var(--tn-color-text);
}

.agn-btn-ghost:hover {
    border-color: var(--tn-color-primary);
    color: var(--tn-color-primary);
}

.agn-btn-light {
    background: #fff;
    color: var(--tn-color-primary);
}

.agn-btn-light:hover {
    transform: translateY(-2px);
}

.agn-arrow {
    transition: transform 0.2s ease;
}

.agn-btn:hover .agn-arrow,
.agn-link:hover .agn-arrow,
.agn-topic-card:hover .agn-arrow {
    transform: translateX(3px);
}

.agn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tn-color-primary);
    text-decoration: none;
}

.agn-link:hover {
    color: var(--tn-color-secondary);
}

.agn-section-head {
    margin-bottom: 2.5rem;
}

.agn-section-head-stack {
    text-align: center;
}

.agn-section-head-stack .agn-eyebrow {
    justify-content: center;
    width: 100%;
}

.agn-section-cta {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.agn-section-alt {
    background: var(--tn-color-surface);
}

/* ===================== HERO ===================== */
.agn-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 5rem 0 3rem;
    background: var(--tn-color-bg);
}

.agn-hero-field {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 55%;
    z-index: -1;
    background:
        repeating-linear-gradient(
            -32deg,
            rgba(var(--tn-color-primary-rgb), 0.07) 0,
            rgba(var(--tn-color-primary-rgb), 0.07) 2px,
            transparent 2px,
            transparent 34px
        ),
        linear-gradient(to top, var(--tn-color-surface) 0%, transparent 100%);
}

.agn-hero-field::before {
    content: "";
    position: absolute;
    top: -6rem;
    right: 8%;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--tn-color-extra-rgb), 0.3) 0%, transparent 72%);
}

.agn-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 48rem;
    margin: 0 auto;
}

.agn-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tn-color-primary);
    background: rgba(var(--tn-color-primary-rgb), 0.08);
    border: 1px solid rgba(var(--tn-color-primary-rgb), 0.2);
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
}

.agn-hero-inner h1 {
    font-family: var(--tn-font-heading);
    font-size: clamp(2rem, 4.6vw, 3.1rem);
    line-height: 1.2;
    font-weight: 700;
    color: var(--tn-color-text);
    margin: 0 0 1.25rem;
    letter-spacing: -0.01em;
}

.agn-hero-inner h1 span {
    color: var(--tn-color-primary);
}

.agn-hero-description {
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--tn-color-muted);
    margin: 0 0 2rem;
    max-width: 38rem;
}

.agn-hero-cta-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.agn-hero-topics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1rem;
    padding-bottom: 2.25rem;
    margin-bottom: 2.25rem;
    border-bottom: 1px solid var(--tn-color-border);
    width: 100%;
}

.agn-hero-topics a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tn-color-muted);
    background: #fff;
    border: 1px solid var(--tn-color-border);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.agn-hero-topics a i {
    color: var(--tn-color-primary);
}

.agn-hero-topics a:hover {
    border-color: var(--tn-color-primary);
    color: var(--tn-color-primary);
}

.agn-hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.agn-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.agn-hero-stat-value {
    font-family: var(--tn-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tn-color-primary);
}

.agn-hero-stat-label {
    font-size: 0.8rem;
    color: var(--tn-color-muted);
    margin-top: 0.25rem;
}

/* ===================== EXPLORE POR CATEGORIA ===================== */
.agn-topics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.agn-topic-card {
    flex: 1 1 16rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.75rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--tn-color-border);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.agn-topic-card:hover {
    transform: translateY(-4px);
    border-color: var(--tn-color-primary);
    box-shadow: 0 16px 32px rgba(var(--tn-color-primary-rgb), 0.1);
}

.agn-topic-card-1 .agn-topic-icon,
.agn-topic-card-4 .agn-topic-icon {
    background: rgba(var(--tn-color-primary-rgb), 0.1);
    color: var(--tn-color-primary);
}

.agn-topic-card-2 .agn-topic-icon,
.agn-topic-card-5 .agn-topic-icon {
    background: rgba(var(--tn-color-extra-rgb), 0.12);
    color: var(--tn-color-extra);
}

.agn-topic-card-3 .agn-topic-icon,
.agn-topic-card-6 .agn-topic-icon {
    background: rgba(var(--tn-color-secondary-rgb), 0.12);
    color: var(--tn-color-secondary);
}

.agn-topic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 1.1rem;
}

.agn-topic-card h3 {
    font-family: var(--tn-font-heading);
    font-size: 1.1rem;
    margin: 0 0 0.6rem;
    color: var(--tn-color-text);
}

.agn-topic-card p {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--tn-color-muted);
    margin: 0 0 1.1rem;
}

.agn-topic-cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tn-color-primary);
}

/* ===================== ÚLTIMAS NOTÍCIAS DO AGRO ===================== */
.agn-news-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.agn-news-card {
    flex: 1 1 17rem;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.agn-news-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: var(--tn-color-surface);
}

.agn-news-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.agn-news-card:hover .agn-news-media img {
    transform: scale(1.04);
}

.agn-news-media.image-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--tn-frame-image) center/cover no-repeat;
    pointer-events: none;
    z-index: 2;
}

.agn-news-body {
    padding-top: 1rem;
}

.agn-news-body h3 {
    font-family: var(--tn-font-heading);
    font-size: 1.1rem;
    line-height: 1.35;
    margin: 0 0 0.5rem;
    color: var(--tn-color-text);
}

.agn-news-body p {
    font-size: 0.9rem;
    color: var(--tn-color-muted);
    margin: 0 0 0.5rem;
}

.agn-news-card:hover .agn-news-body h3 {
    color: var(--tn-color-primary);
}

/* ===================== SOBRE A AGROPECNEWS ===================== */
.agn-about-row {
    display: flex;
    justify-content: center;
}

.agn-about-copy {
    max-width: 40rem;
    text-align: center;
}

.agn-about-copy p {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--tn-color-text);
    margin: 0 0 1.25rem;
}

/* ===================== BANNER EDITORIAL ===================== */
.agn-banner {
    background: linear-gradient(135deg, var(--tn-color-primary), var(--tn-color-secondary));
    padding: 4.5rem 0;
}

.agn-banner-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.75rem;
}

.agn-banner-inner h2 {
    font-family: var(--tn-font-heading);
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    margin: 0;
    max-width: 34rem;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
    .agn-container {
        padding: 0 1.25rem;
    }

    .agn-home .agn-section {
        padding: 3.5rem 0;
    }

    .agn-hero {
        padding: 3.5rem 0 2.5rem;
    }

    .agn-hero-cta-group {
        flex-direction: column;
        width: 100%;
    }

    .agn-hero-cta-group .agn-btn {
        justify-content: center;
    }

    .agn-hero-stats {
        gap: 1.75rem;
    }
}
