/* NEWS — secao de noticias (ecbyts.com/news/). Gerada por scripts/generate-news-pages.mjs.
   Usa as variaveis de public-product.css (escuro) e standalone-theme.css (claro). */
.news-main {
    padding-block: 56px 72px;
}
.news-hero {
    max-width: var(--ecbt-content-readable, 720px);
    margin-bottom: 40px;
}
.news-hero h1 {
    margin-bottom: 12px;
}
.news-hero-lead {
    margin: 0;
    font-size: 18px;
    color: var(--text-secondary);
}
.news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text-secondary);
}
.news-category {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}
.news-cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.news-lead {
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Lista: destaque + grade */
.news-featured-link {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    text-decoration: none;
    padding-bottom: 48px;
}
.news-featured h2 {
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
}
.news-section-title {
    font-size: 22px;
    margin: 0 0 20px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.news-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 24px;
}
.news-card {
    display: block;
    text-decoration: none;
}
.news-card .news-cover {
    margin-bottom: 14px;
}
.news-card h3 {
    font-size: 18px;
    line-height: 1.35;
    margin: 0;
}
.news-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 12px 0;
}
/* Etiqueta informativa, nao botao: pilula sem borda, fundo discreto e texto menor/espacado
   (diferencia de .news-actions a, que e acionavel e tem area de toque de 44px). */
.news-formats li {
    padding: 3px 10px;
    border: 0;
    border-radius: 999px;
    background: var(--bg-card);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.5;
    color: var(--text-secondary);
}
.news-reading-time {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 10px 0;
}
.news-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 18px;
}
.news-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.news-related {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.news-related h2 {
    font-size: 22px;
    margin: 0 0 12px;
}
.news-related ul {
    margin: 0;
    padding-left: 1.4em;
}
.news-related a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* Materia */
.news-article {
    /* Drenado para o token de largura legivel (mesmo do topo deste arquivo): o valor literal
       disparava o gate G1 de max-width e travava o commit de TODAS as lanes na main.
       Correcao mecanica prescrita pelo proprio gate; o dono da feature News foi notificado. */
    max-width: var(--ecbt-content-readable, 760px);
    margin-inline: auto;
}
.news-article-header h1 {
    font-size: clamp(30px, 3.6vw, 46px);
    letter-spacing: -0.03em;
    margin: 6px 0 18px;
}
.news-back {
    margin: 0 0 22px;
    font-size: 14px;
}
.news-back a {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
.news-back-end {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.news-article-cover {
    margin: 32px 0 36px;
}
.news-body {
    font-size: 18px;
    line-height: 1.75;
}
.news-body h2 {
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 44px 0 14px;
}
.news-body h3 {
    font-size: 20px;
    margin: 32px 0 10px;
}
.news-body p {
    margin: 0 0 18px;
}
.news-body ul,
.news-body ol {
    margin: 0 0 20px;
    padding-left: 1.4em;
}
.news-body li {
    margin: 0 0 10px;
}
.news-body .news-steps > li {
    padding: 10px 0 14px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.news-body .news-steps > li::marker {
    color: var(--accent);
    font-weight: 700;
}
.news-body a {
    color: var(--accent);
    font-weight: 600;
}
.news-body blockquote {
    margin: 0 0 20px;
    padding-left: 18px;
    border-left: 3px solid var(--accent);
    color: var(--text-secondary);
}
.news-figure {
    margin: 28px 0 32px;
}
.news-figure img,
.news-figure video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.news-body hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 36px 0;
}

/* Reading aids shared by the listing and translated articles. */
.news-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding-top: 16px;
}
.news-languages a,
.news-contents a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
.news-languages [aria-current="page"] {
    font-weight: 700;
    text-decoration-thickness: 2px;
}
.news-card h3 a,
.news-featured h2 a {
    text-decoration: none;
}
.news-actions a:first-child {
    color: var(--accent);
    border-color: var(--accent);
}
.news-card-summary,
.news-updated {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 10px 0 0;
}
.news-updated {
    font-size: 14px;
    margin-bottom: 12px;
}
.news-contents {
    padding: 20px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
}
.news-contents h2 {
    font-size: 20px;
    margin: 0 0 10px;
}
.news-contents ol {
    margin: 0;
    padding-left: 1.4em;
}
.news-body [id] {
    scroll-margin-top: 24px;
}
.news-languages a:focus-visible,
.news-contents a:focus-visible,
.news-card:focus-visible,
.news-featured-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}
.news-body,
.news-card-summary,
.news-contents,
.news-related,
.news-actions {
    overflow-wrap: anywhere;
}

/* Desktop keeps chapter links alongside the text. On smaller screens they stay in flow. */
@media (min-width: 1100px) {
    .news-article {
        max-width: none;
    }
    .news-article-header,
    .news-article-cover,
    .news-related,
    .news-back-end,
    .news-reading-layout:not(.news-has-contents) {
        max-width: var(--ecbt-content-readable, 760px);
        margin-inline: auto;
    }
    .news-reading-layout.news-has-contents {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        align-items: start;
        gap: 40px;
    }
    .news-contents {
        position: sticky;
        top: 24px;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        font-size: 14px;
    }
    .news-reading-layout .news-body {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-page,
    .news-page * {
        scroll-behavior: auto;
    }
}

/* Estados de hover por ultimo (especificidade crescente). */
.news-featured-link:hover h2,
.news-card:hover h3 {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
.news-back a:hover {
    color: var(--text-primary);
}
.news-actions a:hover {
    background: var(--bg-card-highlight);
    text-decoration: underline;
}

/* Acao primaria (Praticar = tour ou trilha de treinamento). Vem depois de
   `.news-actions a:first-child` e do hover de proposito: mesma especificidade, entao
   a ordem e o que garante o destaque cheio (fundo accent) em vez de so a borda. */
.news-card-actions a[href*="?tour="],
.news-card-actions a[href*="?tools=training"],
.news-actions a[href*="?tour="],
.news-actions a[href*="?tools=training"] {
    border-color: var(--accent);
    background: rgba(167, 234, 220, 0.12);
    color: var(--accent);
    font-weight: 700;
}
.news-actions a[href*="?tour="]:hover,
.news-actions a[href*="?tools=training"]:hover {
    background: rgba(167, 234, 220, 0.2);
}

@media (max-width: 800px) {
    .news-main {
        padding-block: 36px 56px;
    }
    .news-featured-link {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-bottom: 32px;
    }
    .news-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    .news-body,
    .news-lead,
    .news-hero-lead {
        font-size: 17px;
    }
    .news-body h2 {
        font-size: 22px;
    }
}
