/* ============================================================
   CalculaSTL — Estilo das páginas de conteúdo (Guia / Blog)
   Tema escuro da marca, foco em leitura. Independente do Tailwind.
   ============================================================ */

:root {
    --bg: #0f172a;
    --bg-2: #0b1120;
    --card: rgba(255, 255, 255, 0.04);
    --card-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.10);
    --text: #e2e8f0;
    --heading: #ffffff;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --accent-2: #6366f1;
    --green: #4ade80;
    --yellow: #facc15;
    --maxw: 1120px;
    --article: 720px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(900px 500px at -10% 10%, rgba(56, 189, 248, 0.12), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.72);
    border-bottom: 1px solid var(--border);
}
.site-header .bar {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--heading);
}
.brand:hover { text-decoration: none; }
.brand .logo {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 18px;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25);
}
.brand b { color: var(--accent); }
.site-nav { display: flex; gap: 8px; align-items: center; }
.site-nav a {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 10px;
}
.site-nav a:hover { background: var(--card); text-decoration: none; }
.site-nav a.cta {
    background: #0369a1;
    color: #fff;
}
.site-nav a.cta:hover { background: #0284c7; }

/* ---------- Layout ---------- */
.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 28px 20px 60px;
}
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
}
@media (min-width: 1040px) {
    .layout.with-aside { grid-template-columns: minmax(0, 1fr) 300px; }
}

.article { max-width: var(--article); width: 100%; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Typography ---------- */
h1 {
    color: var(--heading);
    font-size: clamp(28px, 5vw, 40px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
}
.lead {
    font-size: 19px;
    color: #cbd5e1;
    margin: 0 0 8px;
}
.meta {
    font-size: 13px;
    color: var(--muted);
    margin: 14px 0 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
h2 {
    color: var(--heading);
    font-size: clamp(22px, 3.5vw, 28px);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 42px 0 14px;
    padding-top: 8px;
}
h3 {
    color: #e2e8f0;
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 10px;
}
p { margin: 0 0 18px; }
ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 8px; }
strong { color: #f1f5f9; font-weight: 600; }
.article a { font-weight: 500; }

/* ---------- Callouts ---------- */
.note, .formula, .example {
    border-radius: 14px;
    padding: 18px 20px;
    margin: 22px 0;
    border: 1px solid var(--border);
    background: var(--card);
}
.note { border-left: 3px solid var(--accent); }
.note .tag,
.example .tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}
.example { border-left: 3px solid var(--green); }
.example .tag { color: var(--green); }
.formula {
    border-left: 3px solid var(--accent-2);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 15px;
    color: #e0e7ff;
    overflow-x: auto;
}
.note p:last-child, .formula p:last-child, .example p:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 22px 0; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    min-width: 420px;
}
th, td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.03);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tr.total td { font-weight: 700; color: var(--heading); border-top: 2px solid var(--border); }

/* ---------- CTA box ---------- */
.cta-box {
    margin: 40px 0;
    padding: 26px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(3, 105, 161, 0.35), rgba(99, 102, 241, 0.25));
    border: 1px solid rgba(56, 189, 248, 0.3);
    text-align: center;
}
.cta-box h3 { margin-top: 0; color: #fff; }
.cta-box p { color: #dbeafe; }
.btn {
    display: inline-block;
    margin-top: 6px;
    padding: 13px 26px;
    border-radius: 12px;
    background: #0ea5e9;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
}
.btn:hover { background: #0284c7; text-decoration: none; }

/* ---------- Related / cards ---------- */
.related { margin-top: 56px; }
.related h2 { font-size: 20px; margin-bottom: 16px; }
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    color: var(--text);
    transition: border-color .15s, background .15s, transform .15s;
}
.card:hover {
    background: var(--card-hover);
    border-color: rgba(56, 189, 248, 0.4);
    text-decoration: none;
    transform: translateY(-2px);
}
.card .k {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--accent); font-weight: 700;
}
.card h3 { margin: 8px 0 6px; font-size: 17px; color: var(--heading); }
.card p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------- Aside / ad slot ---------- */
.aside { width: 100%; }
.aside .sticky { position: sticky; top: 90px; }
.ad-slot {
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--border);
    border-radius: 12px;
    min-height: 250px;
    display: flex; align-items: center; justify-content: center;
    color: #475569; font-size: 12px; letter-spacing: .05em;
    overflow: hidden;
}
.ad-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
    color: #475569; text-align: center; margin: 24px 0 6px;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
}
.site-footer .inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 18px; }

/* ---------- TOC (index) ---------- */
.hero { margin-bottom: 36px; }
.hero h1 { margin-bottom: 10px; }
.hero p { font-size: 19px; color: #cbd5e1; max-width: 640px; }

@media (max-width: 640px) {
    body { font-size: 16px; }
    .site-nav a { padding: 7px 10px; font-size: 14px; }
    .wrap { padding: 20px 16px 48px; }
}
