
/* ── TOKENS ───────────────────────────────────────────── */
:root {
    --verde:      #1a6b3c;
    --verde-escuro: #0f4526;
    --verde-claro: #2e9d5e;
    --terra:      #c8722a;
    --ouro:       #e6b33d;
    --cinza-bg:   #f4f3ef;
    --cinza-borda: #ddd9d0;
    --texto:      #1c1c1a;
    --texto-leve: #5a5a52;
    --branco:     #fefefe;
    --fonte-titulo: 'Playfair Display', Georgia, serif;
    --fonte-corpo:  'Source Sans 3', sans-serif;
    --radius:     4px;
    --sombra:     0 2px 12px rgba(0,0,0,.09);
}

/* ── BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--fonte-corpo);
    background: var(--cinza-bg);
    color: var(--texto);
    font-size: 16px;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; object-fit: cover; }

/* ── UTILITÁRIOS ──────────────────────────────────────── */
.tag {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 2px;
    background: var(--verde);
    color: #fff;
}
.tag.terra  { background: var(--terra); }
.tag.ouro   { background: var(--ouro); color: var(--texto); }
.tag.outline {
    background: transparent;
    border: 1px solid var(--verde);
    color: var(--verde);
}
.section-title {
    font-family: var(--fonte-titulo);
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--verde-escuro);
    border-left: 4px solid var(--ouro);
    padding-left: 12px;
    margin-bottom: 1.4rem;
}
.divider-verde {
    border: none;
    border-top: 2px solid var(--verde);
    margin: 0;
}

/* ── TOP BAR ──────────────────────────────────────────── */
#topbar {
    background: var(--verde-escuro);
    color: rgba(255,255,255,.75);
    font-size: .78rem;
    padding: 5px 0;
}
#topbar a { color: rgba(255,255,255,.75); }
#topbar a:hover { color: var(--ouro); }
.topbar-cotacao span {
    color: #fff;
    font-weight: 600;
    margin-right: 18px;
}
.cotacao-up   { color: #6ee7a5 !important; }
.cotacao-down { color: #f4836a !important; }

/* ── NAVBAR ───────────────────────────────────────────── */
#navbar {
    background: var(--verde);
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-brand {
    font-family: var(--fonte-titulo);
    font-size: 1.65rem;
    font-weight: 900;
    color: #fff !important;
    letter-spacing: -.01em;
}
.navbar-brand span { color: var(--ouro); }
.nav-link {
    color: rgba(255,255,255,.88) !important;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .03em;
    padding: .5rem .85rem !important;
    transition: color .2s;
}
.nav-link:hover, .nav-link.active { color: var(--ouro) !important; }
.navbar-toggler {
    border: 1px solid rgba(255,255,255,.4);
}
.navbar-toggler-icon {
    filter: invert(1);
}
.nav-search-form .form-control {
    border-radius: 20px 0 0 20px;
    border: none;
    font-size: .85rem;
    padding: .35rem .9rem;
}
.nav-search-form .btn {
    background: var(--ouro);
    border: none;
    border-radius: 0 20px 20px 0;
    color: var(--texto);
    padding: .35rem .8rem;
}
.nav-search-form .btn:hover { background: #d4a030; }

.dropdown-submenu:hover > .submenu {
    display: block;
    top: 0;
    left: 100%;
    margin-top: -1px;
}

.submenu {
    display: none;
    position: absolute;
}

/* ── BREAKING NEWS TICKER ─────────────────────────────── */
#breaking {
    background: var(--terra);
    color: #fff;
    font-size: .82rem;
    padding: 6px 0;
    overflow: hidden;
}
.breaking-label {
    background: var(--verde-escuro);
    font-weight: 700;
    letter-spacing: .06em;
    font-size: .74rem;
    padding: 2px 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.ticker-wrap {
    overflow: hidden;
    flex: 1;
}
.ticker-track {
    display: flex;
    gap: 60px;
    white-space: nowrap;
    animation: ticker 38s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-track a { color: #fff; }
.ticker-track a:hover { color: var(--ouro); }
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── HERO DESTAQUE ────────────────────────────────────── */
#hero { background: var(--branco); padding: 28px 0 20px; }

.hero-principal {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 400px;
    box-shadow: var(--sombra);
}
.hero-principal img {
    height: 100%;
    transition: transform .5s ease;
}
.hero-principal:hover img { transform: scale(1.03); }
.hero-principal .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,40,20,.92) 40%, transparent 75%);
}
.hero-principal .conteudo {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px;
}
.hero-principal h2 {
    font-family: var(--fonte-titulo);
    font-size: clamp(1.3rem, 3vw, 1.85rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
    margin: 8px 0 6px;
}
.hero-principal p {
    color: rgba(255,255,255,.82);
    font-size: .9rem;
    line-height: 1.45;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta { color: rgba(255,255,255,.6); font-size: .77rem; }
.hero-meta i { margin-right: 4px; }

/* Cards de apoio do hero */
.hero-side { display: flex; flex-direction: column; gap: 12px; height: 400px; }
.card-side {
    flex: 1;
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--sombra);
    background: var(--branco);
    transition: transform .25s;
}
.card-side:hover { transform: translateY(-2px); }
.card-side-img {
    width: 120px;
    flex-shrink: 0;
    overflow: hidden;
}
.card-side-img img { height: 100%; }
.card-side-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}
.card-side-body h4 {
    font-family: var(--fonte-titulo);
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--texto);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-side-body h4:hover { color: var(--verde); }
.card-meta { color: var(--texto-leve); font-size: .73rem; }

/* ── AD BANNER ────────────────────────────────────────── */
.ad-banner {
    background: linear-gradient(135deg, #e8f5ec 0%, #f9f4e8 100%);
    border: 1px dashed var(--cinza-borda);
    border-radius: var(--radius);
    text-align: center;
    padding: 14px 10px;
    color: var(--texto-leve);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.ad-banner.tall {
    padding: 40px 10px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ad-banner i { font-size: 1.6rem; color: var(--cinza-borda); display: block; margin-bottom: 6px; }

.ad-banner img {
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain; /* Garante que a imagem não distorça dentro do bloco */
    border-radius: calc(var(--radius) - 2px); /* Acompanha o arredondamento da div */
}

.ad-banner:has(img) {
    padding: 0;
}

/* ── SEÇÃO NOTÍCIAS ───────────────────────────────────── */
#noticias { padding: 32px 0; }

.card-noticia {
    background: var(--branco);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .25s, box-shadow .25s;
}
.card-noticia:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.13);
}
.card-noticia-img {
    height: 180px;
    overflow: hidden;
}
.card-noticia-img img {
    height: 100%;
    transition: transform .4s;
}
.card-noticia:hover .card-noticia-img img { transform: scale(1.06); }
.card-noticia-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.card-noticia h3 {
    font-family: var(--fonte-titulo);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--texto);
}
.card-noticia h3:hover { color: var(--verde); }
.card-noticia p {
    font-size: .88rem;
    color: var(--texto-leve);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .75rem;
    color: var(--texto-leve);
    padding-top: 10px;
    border-top: 1px solid var(--cinza-borda);
}
.card-meta-footer .autor img {
    width: 26px; height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

/* ── LISTA LATERAL ────────────────────────────────────── */
.lista-noticia {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--cinza-borda);
}
.lista-noticia:last-child { border-bottom: none; }
.lista-noticia-img {
    width: 80px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}
.lista-noticia-img img { height: 100%; }
.lista-noticia h5 {
    font-family: var(--fonte-titulo);
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--texto);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lista-noticia h5:hover { color: var(--verde); }

/* ── MAIS LIDAS ───────────────────────────────────────── */
.mais-lida-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--cinza-borda);
}
.mais-lida-item:last-child { border-bottom: none; }
.mais-lida-num {
    font-family: var(--fonte-titulo);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--cinza-borda);
    line-height: 1;
    flex-shrink: 0;
    width: 32px;
}
.mais-lida-item h5 {
    font-family: var(--fonte-titulo);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--texto);
    margin: 0;
}
.mais-lida-item h5:hover { color: var(--verde); }

/* ── COTAÇÕES ─────────────────────────────────────────── */
#cotacoes { background: var(--verde-escuro); padding: 22px 0; }
.cotacao-card {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius);
    padding: 14px 18px;
    text-align: center;
    transition: background .2s;
}
.cotacao-card:hover { background: rgba(255,255,255,.13); }
.cotacao-card .produto {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.6);
    margin-bottom: 4px;
}
.cotacao-card .valor {
    font-family: var(--fonte-titulo);
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
}
.cotacao-card .variacao {
    font-size: .8rem;
    font-weight: 600;
    margin-top: 2px;
}
.variacao.up   { color: #6ee7a5; }
.variacao.down { color: #f4836a; }
.cotacao-card .unidade {
    font-size: .7rem;
    color: rgba(255,255,255,.45);
    margin-top: 2px;
}

/* ── CATEGORIAS ───────────────────────────────────────── */
#categorias { padding: 36px 0; }
.cat-card {
    background: var(--branco);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--sombra);
    position: relative;
    height: 130px;
    transition: transform .25s;
}
.cat-card:hover { transform: translateY(-3px); }
.cat-card img { height: 100%; filter: brightness(.55) saturate(.8); }
.cat-card .cat-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    gap: 6px;
}
.cat-card .cat-label i { font-size: 1.5rem; color: var(--ouro); }

/* ── NEWSLETTER ───────────────────────────────────────── */
#newsletter {
    background: linear-gradient(135deg, var(--verde-escuro) 0%, var(--verde) 100%);
    padding: 52px 0;
}
#newsletter h2 {
    font-family: var(--fonte-titulo);
    font-size: 2.1rem;
    font-weight: 900;
    color: #fff;
}
#newsletter p { color: rgba(255,255,255,.78); }
.newsletter-form .form-control {
    border-radius: 30px 0 0 30px;
    border: none;
    padding: .6rem 1.2rem;
    font-size: .92rem;
}
.newsletter-form .btn {
    background: var(--ouro);
    border: none;
    border-radius: 0 30px 30px 0;
    color: var(--texto);
    font-weight: 700;
    padding: .6rem 1.4rem;
}
.newsletter-form .btn:hover { background: #d4a030; }

/* ── FOOTER ───────────────────────────────────────────── */
#footer {
    background: var(--texto);
    color: rgba(255,255,255,.7);
    padding: 48px 0 0;
}
.footer-brand {
    font-family: var(--fonte-titulo);
    font-size: 1.7rem;
    font-weight: 900;
    color: #fff;
}
.footer-brand span { color: var(--ouro); }
#footer h6 {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
    margin-bottom: 14px;
}
#footer ul { list-style: none; padding: 0; }
#footer ul li { margin-bottom: 8px; }
#footer ul li a {
    color: rgba(255,255,255,.7);
    font-size: .88rem;
    transition: color .2s;
}
#footer ul li a:hover { color: var(--ouro); }
.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.8);
    font-size: 1rem;
    transition: background .2s, color .2s;
    margin-right: 6px;
}
.footer-social a:hover { background: var(--verde); color: #fff; }
.footer-bottom {
    margin-top: 36px;
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 18px 0;
    font-size: .78rem;
    color: rgba(255,255,255,.35);
}

/* ── BADGES ───────────────────────────────────────────── */
.badge-num {
    background: var(--verde);
    color: #fff;
    font-size: .68rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}

/* ── PLACEHOLDER IMGS ─────────────────────────────────── */
.img-placeholder {
    background: linear-gradient(135deg, #c8d8c4 0%, #dce8d5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(30,70,40,.3);
    font-size: 2.5rem;
}
.img-placeholder.small { font-size: 1.4rem; }

/* ── SCROLL TO TOP ────────────────────────────────────── */
#scrollTop {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 42px; height: 42px;
    background: var(--verde);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s, transform .3s;
    z-index: 999;
}
#scrollTop.visible { opacity: 1; transform: translateY(0); }
#scrollTop:hover { background: var(--verde-escuro); }

/* ── ANIMAÇÕES DE ENTRADA ─────────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .5s ease, transform .5s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVO ───────────────────────────────────────── */
@media (max-width: 991.98px) {
    .hero-principal { height: 320px; }
    .hero-side { height: auto; }
    .card-side { height: 120px; }
}
@media (max-width: 767.98px) {
    .hero-principal { height: 260px; }
    .topbar-cotacao { display: none; }
    #newsletter h2 { font-size: 1.6rem; }
}
