/* Estilos do portal público Olho Cívico */
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* Sticky footer: o rodapé fica sempre na base, mesmo em páginas curtas. */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
body > main { flex: 1 0 auto; }
body > footer { flex-shrink: 0; }

/* Tokens das barras de marca (header + footer usam os mesmos → visual combinando
   e idêntico em tema claro/escuro). */
:root {
    --oc-bar-bg: #1a1d21;
    --oc-bar-accent: #c0392b;
    --oc-bar-fg: rgba(255,255,255,.72);
    --oc-bar-fg-hover: #fff;
    --oc-bar-soft: rgba(255,255,255,.08);
    --oc-bar-border: rgba(255,255,255,.08);
}

/* ---------- Header de marca (espelha o footer) ---------- */
.site-header {
    background: var(--oc-bar-bg);
    border-bottom: 4px solid var(--oc-bar-accent);
    position: sticky; top: 0; z-index: 1030;
    transition: box-shadow .2s ease;
}
.site-header.is-stuck { box-shadow: 0 .35rem 1rem rgba(0,0,0,.35); }
.site-header .navbar-brand { color: var(--oc-bar-fg-hover); font-weight: 700; }
.site-header .navbar-brand .bi { color: var(--oc-bar-accent); }
.site-header .nav-link {
    color: var(--oc-bar-fg); font-weight: 500;
    border-bottom: 2px solid transparent; padding-bottom: .35rem;
    transition: color .15s ease, border-color .15s ease;
}
.site-header .nav-link:hover,
.site-header .nav-link:focus { color: var(--oc-bar-fg-hover); border-bottom-color: rgba(192,57,43,.6); }
.site-header .nav-link.active { color: var(--oc-bar-fg-hover); border-bottom-color: var(--oc-bar-accent); }
.site-header .dropdown-menu { box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.4); }
/* Item ativo/selecionado do dropdown "Mais" → vermelho de marca (Bootstrap usaria azul) */
.site-header .dropdown-item.active,
.site-header .dropdown-item:active { background-color: var(--oc-bar-accent); color: #fff; }
.site-header .dropdown-item:hover,
.site-header .dropdown-item:focus { background-color: rgba(192,57,43,.18); color: var(--oc-bar-fg-hover); }
/* Busca e toggle de tema acompanham a barra escura nos dois temas */
.site-header .form-control { background: var(--oc-bar-soft); border-color: var(--oc-bar-border); color: #fff; }
.site-header .form-control::placeholder { color: rgba(255,255,255,.55); }
.site-header .form-control:focus { background: rgba(255,255,255,.14); border-color: var(--oc-bar-accent); box-shadow: 0 0 0 .2rem rgba(192,57,43,.25); color: #fff; }
.site-header .btn-bar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--oc-bar-soft); color: var(--oc-bar-fg); border: 0;
    transition: background .15s ease, color .15s ease;
}
.site-header .btn-bar:hover { background: var(--oc-bar-accent); color: #fff; }
/* No mobile, a faixa colapsada ganha respiro */
@media (max-width: 991.98px) {
    .site-header .navbar-collapse { padding-top: .75rem; }
    .site-header .nav-link { border-bottom: 0; padding-bottom: .25rem; }
    .site-header .nav-link.active { border-left: 3px solid var(--oc-bar-accent); padding-left: .5rem; }
}

/* ---------- Rodapé de marca ---------- */
.site-footer { background: var(--oc-bar-bg); border-top: 4px solid var(--oc-bar-accent); }
.site-footer h5, .site-footer h6 { color: #fff; }
.site-footer a { color: var(--oc-bar-fg); transition: color .15s ease; }
.site-footer a:hover { color: var(--oc-bar-fg-hover); text-decoration: none; }
.site-footer .footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--oc-bar-soft); font-size: 1.05rem; margin-right: .4rem;
}
.site-footer .footer-social a:hover { background: var(--oc-bar-accent); color: #fff; }
.site-footer .footer-links a { display: block; padding: .2rem 0; }
.site-footer .footer-bottom { border-top: 1px solid var(--oc-bar-border); font-size: .85rem; color: rgba(255,255,255,.55); }

a { text-decoration: none; }
a:hover { text-decoration: underline; }

.card-news .card-img-top { aspect-ratio: 16 / 9; object-fit: cover; }
.card-news .card-title a { color: var(--bs-emphasis-color); }
.card-news .card-text { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
.category-badge { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }

/* Conteúdo da matéria (cores via variáveis do Bootstrap p/ adaptar ao tema) */
.article-body { font-size: 1.12rem; line-height: 1.8; color: var(--bs-body-color); text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
.article-body img { max-width: 100%; height: auto; border-radius: .375rem; margin: 1rem 0; }
.article-body h2, .article-body h3 { margin-top: 1.6rem; font-weight: 700; }
.article-body figure { margin: 1.2rem 0; }
.article-cover { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-radius: .5rem; }

.article-summary { font-size: 1.2rem; color: var(--bs-secondary-color); font-weight: 500; border-left: 4px solid #c0392b; padding-left: 1rem; text-align: justify; -webkit-hyphens: auto; hyphens: auto; }

/* Paginação (cor de marca fixa; bordas/estados via variáveis) */
.pagination { gap: .25rem; }
.pagination .page-link { color: #c0392b; border-radius: .375rem; border-color: var(--bs-border-color); background-color: transparent; }
.pagination .page-link:hover { background: rgba(192, 57, 43, .12); color: #962d22; }
.pagination .page-item.active .page-link { background: #c0392b; border-color: #c0392b; color: #fff; }
.pagination .page-item.disabled .page-link { color: var(--bs-secondary-color); }

.hero-featured img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.hero-featured .overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.88));
    color: #fff; padding: 2.5rem 1.5rem 1.5rem;
}
.hero-featured a { text-decoration: none; }
.hero-featured .hero-meta { color: rgba(255,255,255,.8); display: flex; flex-wrap: wrap; gap: .85rem; }

/* ---------- Home: títulos de seção (acento de marca) ---------- */
.section-title {
    position: relative; font-weight: 700;
    padding-left: .9rem; margin-bottom: 1.5rem;
    color: var(--bs-emphasis-color);
}
.section-title::before {
    content: ""; position: absolute; left: 0; top: .1em; bottom: .1em;
    width: 5px; border-radius: 3px;
    background: var(--oc-section-accent, var(--oc-bar-accent, #c0392b));
}

/* ---------- Cabeçalho de categoria (barra de acento na cor da categoria) ---------- */
.category-head { margin-bottom: 1.75rem; padding-bottom: 1rem; border-bottom: 2px solid var(--bs-border-color); }
.category-head h1 {
    position: relative; padding-left: 1rem; margin-bottom: .25rem;
    font-weight: 800; color: var(--bs-emphasis-color);
}
.category-head h1::before {
    content: ""; position: absolute; left: 0; top: .12em; bottom: .12em;
    width: 6px; border-radius: 3px;
    background: var(--oc-section-accent, var(--oc-bar-accent, #c0392b));
}
.category-head .cat-desc { margin: 0; padding-left: 1rem; color: var(--bs-secondary-color); }
.category-head .cat-count { color: var(--bs-secondary-color); font-size: .85rem; white-space: nowrap; }

/* ---------- Cabeçalho de página (Sobre/Contato) ---------- */
.page-head { margin-bottom: 1.75rem; padding-bottom: 1rem; border-bottom: 2px solid var(--bs-border-color); }
.page-head h1 {
    position: relative; padding-left: 1rem; margin-bottom: .5rem;
    font-weight: 800; color: var(--bs-emphasis-color);
}
.page-head h1::before {
    content: ""; position: absolute; left: 0; top: .12em; bottom: .12em;
    width: 6px; border-radius: 3px; background: var(--oc-bar-accent, #c0392b);
}
.page-head .lead { margin: 0; padding-left: 1rem; color: var(--bs-secondary-color); }

/* Blocos de contato */
.contact-card { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.15rem; }
.contact-card .contact-ico {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(192,57,43,.12); color: var(--oc-bar-accent); font-size: 1.25rem;
}

/* Botões de compartilhar com hover de marca */
.share-btns .btn { border-color: var(--bs-border-color); color: var(--bs-body-color); }
.share-btns .btn:hover { background: var(--oc-bar-accent); border-color: var(--oc-bar-accent); color: #fff; }

/* ---------- Home: linha de meta dos cards ---------- */
.card-meta { display: flex; flex-wrap: wrap; gap: .65rem; font-size: .78rem; }
.card-meta .bi { opacity: .75; }

/* Recorte uniforme de título/resumo */
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

/* ---------- Card vertical: capa com badge e hover ---------- */
.card-news { transition: transform .15s ease, box-shadow .15s ease; }
.card-news:hover { transform: translateY(-4px); box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.12) !important; }
.card-news .card-cover { position: relative; display: block; overflow: hidden; }
.card-news .card-cat { position: absolute; left: .6rem; bottom: .6rem; }
.card-news .card-title a { color: var(--bs-emphasis-color); }
.card-news .card-title a:hover { color: var(--oc-bar-accent, #c0392b); text-decoration: none; }

/* ---------- Card horizontal (hero lateral) ---------- */
.card-h { display: flex; flex-direction: row; align-items: stretch; overflow: hidden; transition: box-shadow .15s ease; }
.card-h:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.12) !important; }
.card-h .card-h-cover { flex: 0 0 38%; max-width: 38%; }
.card-h .card-h-cover img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1 / 1; }
.card-h .card-h-body { padding: .75rem .9rem; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.card-h .card-h-body a:hover { color: var(--oc-bar-accent, #c0392b) !important; text-decoration: none; }

/* ---------- Sidebar "Mais lidas" ---------- */
@media (min-width: 992px) { .home-sidebar { position: sticky; top: 90px; } }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--bs-border-color); }
.rank-list li:last-child { border-bottom: 0; }
.rank-num { flex: 0 0 auto; width: 1.6rem; text-align: center; font-weight: 800; font-size: 1.35rem; line-height: 1; color: var(--oc-bar-accent, #c0392b); }
.rank-thumb { flex: 0 0 64px; width: 64px; height: 48px; border-radius: .375rem; overflow: hidden; }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-body { min-width: 0; }
.rank-body a { display: block; line-height: 1.25; font-size: .9rem; }
.rank-body a:hover { color: var(--oc-bar-accent, #c0392b); text-decoration: none; }

/* Blocos de anúncio (AdSense) — respiro nos dois temas */
.ad-slot { margin: 1.75rem 0; text-align: center; overflow: hidden; clear: both; }
.ad-slot .ad-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); margin-bottom: .35rem; }
.ad-slot ins.adsbygoogle { display: block; }
.ad-placeholder { border: 1px dashed var(--bs-border-color); border-radius: .375rem; padding: 1.75rem 1rem; color: var(--bs-secondary-color); font-size: .85rem; background-color: var(--bs-body-secondary, rgba(0,0,0,.02)); }

/* Banner de consentimento de cookies (LGPD) — barra fixa, sem layout shift */
.cookie-consent {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080;
    display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
    justify-content: center;
    padding: .85rem 1rem;
    background: var(--oc-bar-bg, #1a1d21); color: #f8f9fa;
    border-top: 4px solid var(--oc-bar-accent, #c0392b);
    box-shadow: 0 -2px 12px rgba(0,0,0,.3);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent__text { font-size: .9rem; max-width: 720px; }
.cookie-consent__text a { color: #fff; text-decoration: underline; }
.cookie-consent__actions { display: flex; gap: .5rem; flex-shrink: 0; }
@media (max-width: 575.98px) {
    .cookie-consent { justify-content: stretch; }
    .cookie-consent__actions { width: 100%; }
    .cookie-consent__actions .btn { flex: 1; }
}

/* ---------- Acessibilidade (WCAG) ---------- */
/* "Pular para o conteúdo": invisível até receber foco pelo teclado. */
.skip-link {
    position: absolute; left: .5rem; top: -4rem; z-index: 2000;
    background: var(--oc-bar-accent, #c0392b); color: #fff;
    padding: .5rem .9rem; border-radius: .375rem; text-decoration: none;
    transition: top .15s ease;
}
.skip-link:focus { top: .5rem; color: #fff; outline: 3px solid #fff; }

/* Foco de teclado sempre visível (não interfere no clique do mouse). */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.btn-bar:focus-visible,
.form-control:focus-visible,
.page-link:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--oc-bar-accent, #c0392b);
    outline-offset: 2px;
}
/* No header escuro, o contorno branco contrasta melhor. */
.site-header :focus-visible { outline-color: #fff; }

/* Alvo de toque mínimo (WCAG 2.5.5) nos botões circulares, só em telas de toque. */
@media (pointer: coarse) {
    .btn-bar { min-width: 44px; min-height: 44px; }
}

/* Respeita quem prefere menos animação. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
