/* ============================================================================
   RACKFY — páginas de notícia (/noticias e /noticias/{slug})
   HTML gerado por functions/lib/news/site-template.js. Carregado depois de /landing.css, de onde vêm as variáveis,
   as fontes, o cabeçalho, o rodapé, os botões e os cartões (.news-card, .news-grid).
   Ao mudar este arquivo, troque o ?v= em NEWS_CSS (site-template.js).
   ============================================================================ */

.news-main {
    padding-top: calc(64px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    min-height: 70vh;
}

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.news-kicker,
.news-category {
    font-family: var(--font-mono);
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.news-kicker::before,
.news-category::before { content: '// '; }

/* ============================ Lista ============================ */
.news-list { padding-bottom: 72px; }
.news-list-head { padding: 72px 0 40px; }
.news-list-head h1 {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(2.75rem, 7vw, 5.5rem);
    line-height: 0.95;
    margin-top: 16px;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.news-list-head h1:first-child { margin-top: 0; }
.news-lead {
    color: var(--color-text-secondary);
    font-size: 1rem;
    max-width: 56ch;
    margin-top: 22px;
    text-wrap: pretty;
}
.news-back { margin-top: 18px; font-size: 0.875rem; }
.news-back a,
.news-pagination a[rel="first"] { color: var(--color-text-primary); text-underline-offset: 3px; }
.news-back a:hover,
.news-pagination a[rel="first"]:hover { color: var(--color-accent); }

/* Destaque */
.news-feature {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: rgba(11, 17, 16, 0.55);
    overflow: hidden;
    transition: border-color 200ms ease;
}
.news-feature.no-media { grid-template-columns: minmax(0, 1fr); }
.news-feature:hover { border-color: rgba(151, 170, 153, 0.4); }
.news-feature:has(a:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.news-feature-media {
    position: relative;
    min-height: 340px;
    background: var(--color-bg-secondary);
    overflow: hidden;
}
.news-feature-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-feature-credit {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 6, 0.82);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #d5e0da;
    padding: 6px 12px;
}
.news-feature-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    min-width: 0;
    padding: 40px 40px 36px;
}
.news-feature h2 {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(1.875rem, 3.4vw, 2.75rem);
    line-height: 0.98;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.news-feature h2 a { color: inherit; text-decoration: none; }
.news-feature h2 a::after { content: ''; position: absolute; inset: 0; }
.news-feature h2 a:focus-visible { outline: none; }
.news-feature-summary { color: var(--color-text-secondary); font-size: 1rem; text-wrap: pretty; }
.news-feature-cta { align-self: flex-start; margin-top: 8px; }

/* Filtros por tipo */
.news-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 44px 0 28px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border);
}
.news-filters-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text-secondary);
    margin-right: 8px;
}
.news-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 1px solid rgba(151, 170, 153, 0.35);
    border-radius: 4px;
    padding: 7px 14px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 180ms ease, color 180ms ease;
}
.news-chip:hover { border-color: var(--color-accent); color: var(--color-text-primary); }
.news-chip[aria-current] {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-soft);
}

/* Grade da lista: espaço depois do destaque quando não há filtro */
.news-feature + .news-grid { margin-top: 28px; }
.news-list-head + .news-grid { margin-top: 0; }

.news-empty { color: var(--color-text-secondary); padding: 24px 0 8px; }

/* Paginação por cursor */
.news-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

/* ============================ Matéria ============================ */
.news-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 36px 0 22px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-secondary);
}
.news-crumbs a { color: inherit; text-decoration: none; }
.news-crumbs a:hover { color: var(--color-accent); }
.news-crumbs-sep { opacity: 0.5; }

.news-article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 64px;
    align-items: start;
    padding-bottom: 72px;
}
.news-article { min-width: 0; max-width: 780px; }
.news-article-head h1 {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(2.125rem, 5vw, 3.5rem);
    line-height: 0.98;
    margin: 14px 0 22px;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.news-summary {
    font-size: 1.1875rem;
    line-height: 1.6;
    color: #d5e0da;
    text-wrap: pretty;
}
.news-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
    margin: 22px 0 32px;
    padding: 14px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-secondary);
}
.news-byline > p + p::before { content: '/'; opacity: 0.5; margin: 0 10px; }

.news-cover,
.news-figure { margin: 0 0 40px; }
.news-cover img,
.news-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg-secondary);
}
.news-cover figcaption,
.news-figure figcaption {
    margin-top: 10px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

.news-correction {
    margin: 0 0 32px;
    padding: 16px 20px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background: var(--color-accent-soft);
}
.news-correction p { font-size: 0.9375rem; }
.news-correction strong { color: var(--color-accent); font-weight: 700; }

/* Corpo */
.news-body > p {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #d5e0da;
    margin: 0 0 1.25em;
    max-width: 68ch;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}
.news-body > h2 {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 1.875rem;
    line-height: 1;
    margin: 2.1em 0 0.75em;
    text-wrap: balance;
}
.news-body > :first-child { margin-top: 0; }
.news-body > ul,
.news-body > ol {
    list-style: none;
    counter-reset: news-item;
    margin: 0 0 1.5em;
    max-width: 68ch;
}
.news-body > ul > li,
.news-body > ol > li {
    position: relative;
    padding: 11px 0 11px 28px;
    border-top: 1px dashed rgba(151, 170, 153, 0.2);
    color: #d5e0da;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.news-body > ul > li:last-child,
.news-body > ol > li:last-child { border-bottom: 1px dashed rgba(151, 170, 153, 0.2); }
.news-body > ul > li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 1.2em;
    width: 8px;
    height: 8px;
    background: var(--color-accent);
}
.news-body > ol > li { counter-increment: news-item; padding-left: 40px; }
.news-body > ol > li::before {
    content: counter(news-item, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.95em;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--color-accent);
}
.news-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 28px;
    margin: 2em 0;
}
.news-stat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 3px solid var(--color-accent);
    padding-top: 18px;
}
.news-stat strong {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.25rem, 4.6vw, 3.5rem);
    line-height: 1;
    color: var(--color-accent);
    overflow-wrap: anywhere;
}
.news-stat-label { color: var(--color-text-secondary); font-size: 0.9375rem; line-height: 1.5; max-width: 34ch; }
.news-body > blockquote {
    margin: 2em 0;
    padding: 4px 0 4px 22px;
    border-left: 3px solid var(--color-accent);
    max-width: 60ch;
}
.news-body > blockquote p { font-size: 1.25rem; line-height: 1.55; overflow-wrap: anywhere; }
.news-body > blockquote footer {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-secondary);
}
.news-body > blockquote footer::before { content: '— '; }

/* Galeria: faixa com rolagem lateral e encaixe, sem script */
.news-gallery {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 2.4em 0;
    padding-bottom: 14px;
    counter-reset: news-slide;
    scrollbar-width: thin;
    scrollbar-color: rgba(151, 170, 153, 0.35) transparent;
}
.news-gallery .news-figure {
    flex: 0 0 auto;
    width: 216px;
    margin: 0;
    scroll-snap-align: start;
    counter-increment: news-slide;
}
.news-gallery .news-figure img { width: 100%; height: auto; }
.news-gallery .news-figure figcaption { font-size: 0.75rem; }
.news-gallery .news-figure figcaption::before {
    content: counter(news-slide, decimal-leading-zero);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 2px;
}

/* Fontes */
.news-sources { margin-top: 56px; scroll-margin-top: 88px; }
.news-sources h2,
.news-video h2 {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 1.875rem;
    line-height: 1;
}
.news-sources ol { list-style: none; counter-reset: news-source; margin-top: 14px; }
.news-sources li {
    counter-increment: news-source;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 4px 8px;
    padding: 13px 0;
    border-top: 1px solid var(--color-border);
}
.news-sources li:last-child { border-bottom: 1px solid var(--color-border); }
.news-sources li::before {
    content: counter(news-source, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-accent);
    padding-top: 2px;
}
.news-sources a {
    font-size: 0.9375rem;
    color: var(--color-text-primary);
    text-underline-offset: 3px;
    text-decoration-color: rgba(151, 170, 153, 0.35);
    overflow-wrap: anywhere;
}
.news-sources a:hover { color: var(--color-accent); }
.news-source-host {
    grid-column: 2;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

/* Vídeo: links, não player */
.news-video {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 28px;
    margin-top: 40px;
    padding: 26px 28px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: rgba(11, 17, 16, 0.55);
}
.news-video h2 { font-size: 1.5rem; }
.news-video-copy p { color: #d5e0da; margin-top: 8px; max-width: 44ch; }
.news-video-links { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; }
.news-video-links .cta-btn,
.news-video-links .cta-btn-outline { padding: 13px 24px; font-size: 0.875rem; }

/* Lateral */
.news-aside {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 6px;
    min-width: 0;
}
.news-aside h2 {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--color-accent);
    margin-bottom: 12px;
}
.news-aside ul { list-style: none; }
.news-aside li {
    padding: 7px 0;
    border-top: 1px dashed rgba(151, 170, 153, 0.2);
    font-size: 0.875rem;
    color: #d5e0da;
    overflow-wrap: anywhere;
}
.news-aside li:last-child { border-bottom: 1px dashed rgba(151, 170, 153, 0.2); }
.news-aside-block > a { font-size: 0.875rem; color: #d5e0da; text-underline-offset: 3px; }
.news-aside-block > a:hover { color: var(--color-accent); }
.news-share { display: flex; flex-direction: column; gap: 8px; }
.news-share a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 10px 18px;
    border: 1px solid rgba(151, 170, 153, 0.35);
    border-radius: 999px;
    color: var(--color-text-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 180ms ease, color 180ms ease;
}
.news-share a::after { content: '→'; }
.news-share a:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ============================ Chamada para o app ============================ */
.news-app { padding: 0 0 72px; }
.news-list + .news-app { padding-top: 0; }
.news-app-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 44px 44px 40px;
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    border-radius: 4px;
    background: rgba(11, 17, 16, 0.55);
}
.news-app-copy { flex: 1 1 360px; min-width: 0; }
.news-app-copy h2 {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 0.95;
    margin-top: 14px;
}
.news-app-copy > p:last-child { color: var(--color-text-secondary); font-size: 0.9375rem; margin-top: 16px; max-width: 44ch; }
.news-app-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.news-app-link { font-size: 0.875rem; color: #d5e0da; text-underline-offset: 3px; }
.news-app-link:hover { color: var(--color-accent); }
html.is-native .news-app { display: none; }

/* ============================ Leia também ============================ */
.news-related { padding: 72px 0 96px; border-top: 1px solid var(--color-border); }
.news-related .section-title { font-size: clamp(2rem, 4.5vw, 3.25rem); }
.news-related-all { padding: 10px 20px; font-size: 0.8125rem; }

/* ============================ Tela média ============================ */
@media (max-width: 968px) {
    .news-list-head { padding-top: 56px; }
    .news-feature { grid-template-columns: minmax(0, 1fr); }
    .news-feature-media { min-height: 0; aspect-ratio: 16 / 9; }
    .news-feature-body { padding: 28px 26px; }
    .news-article-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .news-article { max-width: none; }
    .news-aside {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px;
        padding-top: 32px;
        border-top: 1px solid var(--color-border);
    }
}

/* ============================ Celular ============================ */
@media (max-width: 640px) {
    .news-main { padding-top: calc(58px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))); }
    .news-list { padding-bottom: 56px; }
    .news-list-head { padding: 44px 0 32px; }
    .news-lead { font-size: 0.9375rem; }
    .news-feature-body { padding: 22px 20px 26px; gap: 12px; }
    .news-feature-cta { display: none; }
    .news-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 32px -24px 24px;
        padding: 20px 24px 4px;
        scrollbar-width: none;
    }
    .news-filters-label { display: none; }
    .news-pagination { justify-content: center; }
    .news-pagination .cta-btn-outline { width: 100%; }

    .news-crumbs { padding: 24px 0 16px; }
    .news-summary { font-size: 1.0625rem; }
    .news-article-grid { gap: 32px; padding-bottom: 48px; }
    .news-aside { grid-template-columns: minmax(0, 1fr); }
    .news-body > h2 { font-size: 1.625rem; }
    .news-body > p { font-size: 1rem; }
    .news-stats { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .news-gallery .news-figure { width: 200px; }
    .news-video { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
    .news-video-links li { flex: 1 1 100%; }
    .news-video-links .cta-btn,
    .news-video-links .cta-btn-outline { width: 100%; }
    .news-app { padding-bottom: 56px; }
    .news-app-card { padding: 30px 22px 28px; gap: 28px; }
    .news-app-actions { width: 100%; }
    .news-related { padding: 56px 0 64px; }
}

@media (max-width: 400px) {
    .news-filters { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .news-feature,
    .news-chip,
    .news-share a { transition: none; }
}
