/* ==========================================================================
   Proposta360 — Páginas públicas (marketing)
   Compartilhado pela landing, pelas páginas de conteúdo e pelas legais:
   cabeçalho com menu móvel, rodapé, trilha de navegação, tipografia de artigo
   e blocos editoriais. Depende de tokens.css, base.css e components.css.

   Direção (docs/REFORMULACAO-2026-11.md §3): fundo areia, verde profundo,
   grafite; Fraunces só em títulos; bordas finas no lugar de sombra.
   ========================================================================== */

.mk {
    /* Cor sólida dos botões de ação. No escuro, --brand fica claro demais para
       texto branco (≈3:1); green-600 mantém ≥ 4.5:1. */
    --mk-cta-bg: var(--green-800);
    --mk-cta-hover: var(--green-900);
    --mk-header-h: 64px;
    background: var(--bg);
}

:root[data-theme='dark'] .mk {
    --mk-cta-bg: var(--green-600);
    --mk-cta-hover: var(--green-700);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .mk {
        --mk-cta-bg: var(--green-600);
        --mk-cta-hover: var(--green-700);
    }
}

/* Botão principal plano: sem gradiente nem sombra colorida. */
.mk .btn-primary,
.mk .btn-primary:hover:not(:disabled) {
    background: var(--mk-cta-bg);
    box-shadow: none;
    filter: none;
    color: #fff;
}

.mk .btn-primary:hover:not(:disabled) { background: var(--mk-cta-hover); }

.mk .btn-lg { white-space: normal; text-align: center; }

.mk .brand-mark {
    background: var(--mk-cta-bg);
    box-shadow: none;
}

.mk-arrow { transition: transform var(--duration-fast) var(--ease-out); }
a:hover > .mk-arrow { transform: translateX(3px); }

/* Link de texto com seta — usado em chamadas secundárias. */
.mk-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    font-weight: var(--weight-semibold);
    color: var(--brand);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.mk-link:hover { color: var(--brand-hover); }

/* --- Cabeçalho ------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    padding-top: var(--safe-top);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: var(--mk-header-h);
}

.site-header .brand,
.site-footer .brand {
    padding: 0;
    font-size: var(--text-md);
    gap: var(--space-2);
}

.site-header .brand-mark,
.site-footer .brand-mark { width: 30px; height: 30px; }

.site-header .brand-mark .icon,
.site-footer .brand-mark .icon { width: 18px; height: 18px; }

.site-menu {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-left: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
}

.site-nav a:hover { color: var(--text); background: var(--bg-subtle); }
.site-nav a[aria-current='page'] { color: var(--text); text-decoration: underline; text-underline-offset: 6px; }

.site-actions { display: flex; align-items: center; gap: var(--space-2); }

.site-menu-toggle { display: none; }
.site-menu-toggle .icon-close { display: none; }
.site-menu-toggle[aria-expanded='true'] .icon-open { display: none; }
.site-menu-toggle[aria-expanded='true'] .icon-close { display: block; }

/* Menu recolhido: só quando há JS (classe `js` em <html>). Sem JS, os links
   continuam visíveis em linha, quebrando abaixo da marca. */
@media (max-width: 1023px) {
    .site-menu-toggle { display: inline-flex; }
    .site-theme { margin-left: auto; }

    .js .site-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
        margin: 0;
        padding: var(--space-4) var(--space-5) var(--space-6);
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        max-height: calc(100dvh - var(--mk-header-h));
        overflow-y: auto;
    }

    .js .site-menu.is-open { display: flex; }

    .js .site-nav { flex-direction: column; align-items: stretch; gap: 0; }

    .js .site-nav a {
        width: 100%;
        padding: 0 var(--space-2);
        font-size: var(--text-md);
        color: var(--text);
        border-bottom: 1px solid var(--border-subtle);
        border-radius: 0;
    }

    .js .site-actions { flex-direction: column; align-items: stretch; }
    .js .site-actions .btn { min-height: 48px; font-size: var(--text-base); }

    html:not(.js) .site-header__inner { flex-wrap: wrap; padding-block: var(--space-2); }
    html:not(.js) .site-menu { width: 100%; flex-wrap: wrap; gap: var(--space-2); }
    html:not(.js) .site-nav { flex-wrap: wrap; }
    html:not(.js) .site-menu-toggle { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .js .site-menu { padding-inline: var(--space-8); }
}

@media (min-width: 1024px) {
    .site-theme { order: 3; }
}

/* --- Rodapé ---------------------------------------------------------------- */
.site-footer {
    padding: var(--space-16) 0 calc(var(--space-8) + var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: var(--space-10);
}

.site-footer__about p {
    margin-top: var(--space-4);
    max-width: 36ch;
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
}

.site-footer__title {
    margin-bottom: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--text-muted);
}

.site-footer ul { display: flex; flex-direction: column; }

.site-footer ul a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: var(--text);
    font-size: var(--text-base);
}

.site-footer ul a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

.site-footer__legal {
    margin-top: var(--space-12);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
}

@media (max-width: 900px) {
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
    .site-footer__about { grid-column: 1 / -1; }
}

@media (max-width: 479px) {
    .site-footer__grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- Blocos editoriais ------------------------------------------------------ */
.mk-eyebrow {
    display: block;
    margin-bottom: var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--brand);
}

.mk-title {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-optical-sizing: auto;
    font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.625rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
}

.mk-lead {
    margin-top: var(--space-4);
    max-width: 62ch;
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--text-muted);
}

.mk-section {
    padding-block: clamp(3.5rem, 2rem + 6vw, 6rem);
    border-top: 1px solid var(--border);
}

.mk-section--surface { background: var(--surface); }

.mk-section__head { max-width: 760px; margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }

/* Faixa "Exemplo fictício": rótulo visível, não decorativo. */
.mk-fiction {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--accent);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--accent-soft-text);
    background: var(--accent-soft);
}

/* Chamada final compartilhada (landing e artigos). */
.mk-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-6) var(--space-10);
    align-items: center;
    padding: clamp(1.75rem, 1rem + 3vw, 3rem);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.mk-cta h2 {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2rem);
    line-height: 1.15;
}

.mk-cta p { margin-top: var(--space-2); color: var(--text-muted); line-height: var(--leading-relaxed); max-width: 56ch; }
.mk-cta__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

@media (max-width: 767px) {
    .mk-cta { grid-template-columns: minmax(0, 1fr); }
    .mk-cta__actions .btn { flex: 1 1 100%; }
}

/* --- Trilha de navegação ----------------------------------------------------- */
.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.breadcrumb li { display: inline-flex; align-items: center; gap: var(--space-2); }
.breadcrumb li + li::before { content: '/'; color: var(--text-subtle); }
.breadcrumb a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb [aria-current='page'] { color: var(--text); }

/* --- Artigo ------------------------------------------------------------------ */
.article { padding: var(--space-8) 0 var(--space-20); }

.article__header {
    max-width: 820px;
    padding: var(--space-10) 0 var(--space-10);
    border-bottom: 1px solid var(--border);
}

.article__header h1 {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-optical-sizing: auto;
    font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.article__meta {
    margin-top: var(--space-5);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.article__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: var(--space-16);
    align-items: start;
    padding-top: var(--space-10);
}

.article__aside {
    position: sticky;
    top: calc(var(--mk-header-h) + var(--space-6));
    order: 2;
}

.toc {
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.toc__title {
    margin-bottom: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--text-muted);
}

.toc ol { display: flex; flex-direction: column; gap: var(--space-1); counter-reset: toc; }

.toc a {
    display: block;
    padding: var(--space-1) 0;
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
    color: var(--text-muted);
}

.toc a:hover { color: var(--brand); }

@media (max-width: 1023px) {
    .article__layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
    .article__aside { position: static; order: 0; }
}

/* Corpo do texto: coluna de leitura confortável. */
.prose-mk {
    max-width: 70ch;
    font-size: var(--text-md);
    line-height: 1.75;
    color: var(--text);
}

.prose-mk > * + * { margin-top: var(--space-5); }

.prose-mk h2 {
    margin-top: var(--space-16);
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2rem);
    line-height: 1.18;
    letter-spacing: -0.015em;
    scroll-margin-top: calc(var(--mk-header-h) + var(--space-6));
}

.prose-mk h2:first-child { margin-top: 0; }

.prose-mk h3 {
    margin-top: var(--space-10);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
    scroll-margin-top: calc(var(--mk-header-h) + var(--space-6));
}

.prose-mk h2 + *,
.prose-mk h3 + * { margin-top: var(--space-3); }

.prose-mk a:not(.btn) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.prose-mk ul,
.prose-mk ol { padding-left: 1.4em; }
.prose-mk ul { list-style: disc; }
.prose-mk ol { list-style: decimal; }
.prose-mk li + li { margin-top: var(--space-2); }
.prose-mk li::marker { color: var(--brand); }

.prose-mk strong { font-weight: var(--weight-semibold); }

.prose-mk blockquote,
.mk-note {
    padding: var(--space-5) var(--space-6);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--surface);
    color: var(--text);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

.mk-note--warn { border-left-color: var(--accent); }
.mk-note strong { display: block; margin-bottom: var(--space-1); }

/* Tabela de leitura: borda fina, sem zebra pesada. Rola dentro da própria
   caixa em telas estreitas, sem empurrar a página. */
.mk-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.mk-table {
    width: 100%;
    font-size: var(--text-base);
    line-height: var(--leading-normal);
}

.mk-table caption {
    padding: var(--space-4) var(--space-5) 0;
    text-align: left;
    font-weight: var(--weight-semibold);
    caption-side: top;
}

.mk-table th,
.mk-table td {
    padding: var(--space-3) var(--space-5);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-subtle);
}

.mk-table thead th {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    border-bottom-color: var(--border);
}

.mk-table tbody tr:last-child > * { border-bottom: 0; }

/* Lista de verificação com caixas desenhadas. */
.checklist { list-style: none !important; padding-left: 0 !important; }

.checklist li {
    position: relative;
    padding-left: 2rem;
}

.checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.3em;
    width: 1.05rem;
    height: 1.05rem;
    border: 1.5px solid var(--brand);
    border-radius: var(--radius-xs);
}

/* Estrutura de um modelo: seções numeradas em linha fina. */
.structure {
    list-style: none !important;
    padding-left: 0 !important;
    border-top: 1px solid var(--border);
    counter-reset: bloco;
}

.structure li {
    counter-increment: bloco;
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: var(--space-3);
    margin: 0 !important;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.structure li::before {
    content: counter(bloco, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-muted);
    padding-top: 0.15em;
}

.structure b { font-weight: var(--weight-semibold); }
.structure span { display: block; font-size: var(--text-base); color: var(--text-muted); }

/* "Leia também" no fim dos artigos. */
.related {
    margin-top: var(--space-16);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border);
}

.related h2 {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
}

.related ul { display: grid; gap: 0; border-top: 1px solid var(--border-subtle); }

.related a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text);
    font-weight: var(--weight-semibold);
}

.related a span { display: block; font-weight: var(--weight-regular); font-size: var(--text-sm); color: var(--text-muted); }
.related a:hover { color: var(--brand); }
.related .icon { color: var(--brand); flex-shrink: 0; }

/* Componentes reaproveitados dentro do artigo não herdam o ritmo da prosa. */
.prose-mk > .mk-cta { margin-top: var(--space-16); }
.prose-mk .mk-cta h2,
.prose-mk .related h2 { margin-top: 0; }
.prose-mk .mk-cta h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); }
.prose-mk .related h2 { font-size: var(--text-xl); }
.prose-mk .related ul { list-style: none; padding-left: 0; }
.prose-mk .related li + li { margin-top: 0; }
.prose-mk .related a { text-decoration: none; }
.prose-mk .mk-cta p { margin-top: var(--space-2); }
.prose-mk .mk-table-wrap + p,
.prose-mk .structure + p { margin-top: var(--space-5); }
.prose-mk .mk-cta { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
