/* ==========================================================================
   Blog Bittencourt Leon Denis · camada editorial sobre o design system do site
   Tokens iguais aos do index.html (navy #081021 · dourado #F2A968)
   ========================================================================== */

:root {
    --bg: #081021;
    --card: #111A30;
    --gold: #F2A968;
    --gold-soft: rgba(242, 169, 104, 0.14);
    --line: #1E2A47;
    --ink: #0B1426;
    --ink-soft: #475569;
    --paper: #ffffff;
    --measure: 44rem;
}

html { overflow-x: clip; scroll-behavior: smooth; }
body { background-color: var(--bg); color: #E5E5E5; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Navegação (mesma linguagem do site principal)
   -------------------------------------------------------------------------- */
.nav-link { position: relative; padding-bottom: 4px; }
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    height: 2px; width: 100%;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--gold); }

.burger-line {
    display: block;
    width: 26px; height: 2px;
    background: currentColor;
    margin: 6px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
#mobile-menu-btn.is-open .burger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#mobile-menu-btn.is-open .burger-line:nth-child(2) { opacity: 0; }
#mobile-menu-btn.is-open .burger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Barra de progresso de leitura
   -------------------------------------------------------------------------- */
.reading-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient(90deg, var(--gold), #f6c795);
    z-index: 70;
    will-change: transform;
}

/* --------------------------------------------------------------------------
   Capas editoriais (sem foto de banco de imagem: padrão + tipografia)
   -------------------------------------------------------------------------- */
.cover {
    position: relative;
    overflow: hidden;
    background: var(--card);
    isolation: isolate;
}
.cover::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.35;
}

/* Fundo de cabeçalho com texto por cima: sem trama, só o halo.
   A textura fica reservada às capinhas dos cartões, onde não disputa com leitura. */
.cover-quiet::before { content: none; }
.cover-lines::before {
    background-image: repeating-linear-gradient(135deg, rgba(242,169,104,0.14) 0 1px, transparent 1px 22px);
}
.cover-grid::before {
    background-image:
        linear-gradient(to right, rgba(242,169,104,0.13) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(242,169,104,0.13) 1px, transparent 1px);
    background-size: 34px 34px;
}
.cover-arcs::before {
    background-image:
        radial-gradient(circle at 15% 120%, rgba(242,169,104,0.20) 0 1px, transparent 1px 2px),
        repeating-radial-gradient(circle at 15% 120%, rgba(242,169,104,0.16) 0 1px, transparent 1px 26px);
}
.cover-glow {
    position: absolute;
    width: 16rem; height: 16rem;
    right: -4rem; top: -4rem;
    background: radial-gradient(circle, rgba(242,169,104,0.22), transparent 65%);
    filter: blur(12px);
    z-index: 0;
    pointer-events: none;
}
.cover-mark {
    position: absolute;
    right: 1rem; bottom: -1.6rem;
    font-family: "Playfair Display", serif;
    font-size: 7.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.05);
    z-index: 0;
    user-select: none;
    pointer-events: none;
}

/* No mobile a capa tem 10rem de altura, então o número de 7.5rem sangrando
   para baixo era cortado pelo overflow e ainda batia no selo de prazo, que
   fica no mesmo canto. Sobe para o topo, menor e inteiro. */
@media (max-width: 767px) {
    .cover-mark {
        font-size: 4.25rem;
        top: 0.25rem;
        bottom: auto;
        right: 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   Cartão de matéria
   -------------------------------------------------------------------------- */
.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), border-color 0.35s ease, box-shadow 0.35s ease;
}
.post-card:hover {
    transform: translateY(-6px);
    border-color: rgba(242,169,104,0.35);
    box-shadow: 0 24px 45px -22px rgba(0,0,0,0.85);
}
.post-card:hover .post-card-title { color: var(--gold); }
.post-card-title { transition: color 0.3s ease; }

/* --------------------------------------------------------------------------
   Corpo da matéria (papel claro, leitura longa)
   -------------------------------------------------------------------------- */
.prose {
    max-width: var(--measure);
    color: #334155;
    font-weight: 300;
    font-size: 1.0625rem;
    line-height: 1.85;
}
.prose > * + * { margin-top: 1.5rem; }
.prose p { text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a {
    color: #a3712f;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease;
}
.prose a:hover { color: var(--ink); }

.prose h2 {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.65rem, 1.2rem + 1.6vw, 2.25rem);
    line-height: 1.2;
    color: var(--ink);
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    scroll-margin-top: 7rem;
}
.prose h3 {
    font-family: "DM Sans", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    margin-top: 2.5rem;
    letter-spacing: -0.01em;
    scroll-margin-top: 7rem;
}
.prose h2 + p, .prose h3 + p { margin-top: 1rem; }

.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose ul > li, .prose ol > li { position: relative; padding-left: 1.75rem; margin-top: 0.85rem; }
.prose ul > li::before {
    content: '';
    position: absolute;
    left: 0.25rem; top: 0.82em;
    width: 6px; height: 6px;
    border-radius: 999px;
    background: var(--gold);
}
.prose ol { counter-reset: item; }
.prose ol > li { counter-increment: item; }
.prose ol > li::before {
    content: counter(item);
    position: absolute;
    left: 0; top: 0.15em;
    font-family: "DM Sans", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    border: 1px solid rgba(242,169,104,0.5);
    border-radius: 999px;
    width: 1.25rem; height: 1.25rem;
    display: flex; align-items: center; justify-content: center;
}

.prose blockquote {
    border-left: 3px solid var(--gold);
    padding: 0.25rem 0 0.25rem 1.5rem;
    font-family: "Playfair Display", serif;
    font-size: 1.35rem;
    line-height: 1.5;
    font-style: italic;
    color: var(--ink);
}

/* Lead (linha de abertura) */
.prose-lead {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #1e293b;
    font-weight: 400;
}

/* --------------------------------------------------------------------------
   Blocos de apoio dentro da matéria
   -------------------------------------------------------------------------- */
.callout {
    background: #fffaf3;
    border: 1px solid rgba(242,169,104,0.45);
    border-left: 4px solid var(--gold);
    border-radius: 0 0.9rem 0.9rem 0;
    padding: 1.5rem 1.6rem;
}
.callout-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: "DM Sans", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #a3712f;
    margin-bottom: 0.65rem;
}
.callout p { margin-top: 0; font-size: 0.975rem; color: #44403c; }

.factbox {
    background: var(--bg);
    border: 1px solid rgba(242,169,104,0.22);
    border-radius: 1.1rem;
    padding: 1.75rem;
    color: #E5E5E5;
}
.factbox h4 {
    font-family: "DM Sans", sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.1rem;
}
.factbox dl { display: grid; gap: 0.9rem; }
.factbox dt {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94A3B8;
}
.factbox dd { font-size: 1rem; color: #fff; font-weight: 500; margin-top: 0.15rem; }

/* Tabela: sempre rola dentro do próprio container, nunca empurra a página */
.table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    -webkit-overflow-scrolling: touch;
    /* sombra nas bordas enquanto houver conteúdo fora da vista (indica que rola) */
    background:
        linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) left center,
        linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) right center,
        radial-gradient(farthest-side at 0 50%, rgba(15,23,42,0.18), rgba(15,23,42,0)) left center,
        radial-gradient(farthest-side at 100% 50%, rgba(15,23,42,0.18), rgba(15,23,42,0)) right center;
    background-repeat: no-repeat;
    background-size: 44px 100%, 44px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 34rem; font-size: 0.9rem; }
.table-wrap th {
    background: #f8fafc;
    text-align: left;
    font-family: "DM Sans", sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.table-wrap td { padding: 0.9rem 1rem; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { color: var(--ink); font-weight: 500; }

/* Linha do tempo */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 0.32rem; top: 0.4rem; bottom: 0.4rem;
    width: 1px;
    background: linear-gradient(to bottom, var(--gold), rgba(242,169,104,0.15));
}
.timeline-item { position: relative; padding-bottom: 1.6rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.6rem; top: 0.45rem;
    width: 9px; height: 9px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(242,169,104,0.15);
}
.timeline-date {
    font-family: "DM Sans", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a3712f;
}

/* FAQ */
.faq-item { border-bottom: 1px solid #e2e8f0; }
.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 1.15rem 2.5rem 1.15rem 0;
    position: relative;
    font-weight: 500;
    color: var(--ink);
    font-size: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0.35rem; top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--gold);
    transition: transform 0.25s ease;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding-bottom: 1.25rem; margin-top: 0; font-size: 0.975rem; color: #475569; }

/* Índice do artigo */
.toc a {
    display: block;
    padding: 0.4rem 0 0.4rem 0.9rem;
    border-left: 2px solid #e2e8f0;
    color: #64748b;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.toc a:hover { color: var(--ink); border-color: var(--gold); }

/* Fontes */
.sources li { font-size: 0.85rem; color: #64748b; line-height: 1.6; }
.sources a { color: #a3712f; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }

/* --------------------------------------------------------------------------
   Reveal (mesma mecânica do site: só com JS ativo, nada some sem JS)
   -------------------------------------------------------------------------- */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .post-card:hover { transform: none; }
}
