/*
 * Notícias — extensão do site.css.
 * Mantém a mesma paleta institucional (vars de :root em site.css).
 */

/* Cabeçalho da listagem e filtro: ver `.listing-header`/`.listing-filter` em site.css. */

/* ===== Grid de cards ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ===== Lista vertical (alternativa à grade; layout escolhido no admin) ===== */
.news-list { display: flex; flex-direction: column; }
.news-list-item {
    display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--c-border);
}
.news-list-item:first-child { padding-top: 0; }
.news-list-item .thumb {
    flex: 0 0 200px; aspect-ratio: 16 / 10; border-radius: var(--radius);
    overflow: hidden; background: var(--c-primary-light); display: block;
}
.news-list-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-list-item .thumb .placeholder-cover { width: 100%; height: 100%; background: linear-gradient(135deg, var(--c-primary-light), var(--c-accent-soft)); }
.news-list-item .list-content { flex: 1; min-width: 0; }
.news-list-item h2 a { color: var(--c-primary); text-decoration: none; }
.news-list-item h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
    .news-list-item { flex-direction: column; gap: 8px; }
    .news-list-item .thumb { flex-basis: auto; width: 100%; }
}

/* ===== Detalhe (flat, estilo Padrão Digital) ===== */
article.news-detail {
    max-width: 760px;
    margin: 8px auto 0;
    color: var(--c-text);
}
article.news-detail h1 { margin: 0 0 8px; }
article.news-detail .news-subtitle {
    margin: 0 0 12px; font-size: 1.15rem; line-height: 1.4;
    color: var(--c-text-muted); font-weight: 500;
}
article.news-detail .meta {
    color: var(--c-text-muted); font-size: 13px;
    margin: 4px 0 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
article.news-detail .meta strong { color: var(--c-text); font-weight: 600; }
article.news-detail .meta-sep { opacity: .4; }

/* Barra de compartilhar (gov.br DS — br-button circle) */
.news-share {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px 0; margin: 16px 0 0;
    border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border);
}
.news-share-label {
    font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
    font-weight: 600; color: var(--c-text-muted); margin-right: 4px;
}

/* Figura + legenda */
.news-figure { margin: 20px 0 8px; }
.news-figure img { width: 100%; height: auto; display: block; border-radius: var(--radius); background: var(--c-primary-light); }
.news-figure figcaption {
    font-size: 13px; font-style: italic; color: var(--c-text-muted);
    margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--c-accent); line-height: 1.4;
}

.news-detail .news-lead {
    font-size: 1.12rem; line-height: 1.55; font-weight: 500;
    color: var(--c-text); margin: 16px 0 16px;
}
.news-detail .body { font-size: 1rem; line-height: 1.7; }
.news-detail .body p { margin: 0 0 16px; }
.news-detail .body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.news-detail .body h2, .news-detail .body h3 { color: var(--c-primary-dark); }
.news-detail .body table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.news-detail .body th, .news-detail .body td { border: 1px solid var(--c-border); padding: 8px 12px; text-align: left; }
.news-detail .body th { background: var(--c-primary-light); font-weight: 600; }
.news-detail .body blockquote { border-left: 4px solid var(--c-accent); padding: 4px 16px; margin: 1.2em 0; color: var(--c-text-muted); font-style: italic; }

.news-tags {
    margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--c-border);
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.news-tags .label { color: var(--c-text-muted); margin-right: 4px; }

/* Galeria de fotos (br-carousel dentro do detalhe) */
.news-gallery-wrap {
    max-width: 760px;
    margin: 28px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
}
.news-gallery-title {
    font-size: 1.1rem;
    margin: 0 0 16px;
    color: var(--c-primary-dark);
}
.news-gallery {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--c-primary-light);
}
.news-gallery .carousel-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.news-gallery .carousel-page {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}
.news-gallery .carousel-page[active] {
    opacity: 1;
    pointer-events: auto;
}
.news-gallery .gallery-figure {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.news-gallery .gallery-figure img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.news-gallery .carousel-button {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 2;
}
.news-gallery .carousel-button-prev { left: 8px; }
.news-gallery .carousel-button-next { right: 8px; }
.news-gallery .carousel-step {
    position: absolute; bottom: 8px; left: 0; right: 0;
    display: flex; justify-content: center;
}
.news-gallery .step-progress { display: flex; gap: 8px; }
/* <button> de 24x24 = alvo de toque (mínimo do Lighthouse), transparente; o dot
   visível de 10px vem do ::after. O overflow de pseudo-elemento não conta na
   auditoria, por isso o alvo precisa estar no próprio botão. */
.news-gallery .step-progress-btn {
    position: relative;
    width: 24px; height: 24px;
    border: none; padding: 0;
    background: transparent;
    cursor: pointer;
}
.news-gallery .step-progress-btn::before { display: none; }
.news-gallery .step-progress-btn::after {
    display: block !important;
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,.55);
    transition: background .25s;
}
.news-gallery .step-progress-btn.active::after,
.news-gallery .step-progress-btn[active]::after {
    background: #fff;
}

/* Lightbox da galeria */
.news-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-content: center;
}
.news-lightbox.active { display: flex; }
.news-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #fff !important;
    background: rgba(255,255,255,.15) !important;
}
.lightbox-close:hover { background: rgba(255,255,255,.3) !important; }

/* Veja também */
.news-related { max-width: 760px; margin: 24px auto 0; }
.news-related > h2 { font-size: 1.15rem; margin: 0 0 12px; }
.news-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.news-related .br-card { overflow: hidden; }
.news-related .cover { display: block; aspect-ratio: 16 / 10; background: var(--c-primary-light); overflow: hidden; }
.news-related .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-related .placeholder-cover { width: 100%; height: 100%; background: linear-gradient(135deg, var(--c-primary-light), var(--c-accent-soft)); }
.news-related-date { color: var(--c-text-muted); }

@media (max-width: 720px) {
    .news-related-grid { grid-template-columns: 1fr; }
}

