/* =====================================================
   BLOG — Recomendo Sites
   Mesmo visual do site principal (estilo.css):
   Inter, azul #2563eb, cantos arredondados e header fixo.
   ===================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --dark: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --radius: 18px;
    --shadow: 0 15px 40px rgba(15, 23, 42, .08);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
    -webkit-text-size-adjust: 100%;
}

.blog-body {
    margin: 0;
    padding-top: var(--header-h);
    background: var(--bg);
    color: var(--dark);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

.blog-body img { max-width: 100%; height: auto; display: block; }
.blog-body a { color: var(--primary-dark); }
.blog-body button { font: inherit; cursor: pointer; }

.blog-wrap { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 2000;
    background: var(--dark); color: #fff !important; padding: 10px 16px;
    border-radius: 10px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* Header e menu: ver assets/css/header.css */

:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------
   HERO DO BLOG
   --------------------------------------------------- */
.blog-hero {
    padding: 72px 0 60px;
    background: radial-gradient(circle at 85% 20%, rgba(37, 99, 235, .14), transparent 34%),
                linear-gradient(180deg, #fff 0%, #eef4ff 100%);
    border-bottom: 1px solid var(--border);
}
.blog-kicker {
    display: inline-block; color: var(--primary);
    text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800;
}
.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.12; letter-spacing: -.045em;
    max-width: 850px; margin: 14px 0 18px;
}
.blog-hero p { max-width: 720px; color: #475569; font-size: clamp(1rem, 2.2vw, 1.14rem); margin: 0; }

.blog-main { padding: 52px 0 76px; }
.blog-section-title { font-size: 1.7rem; letter-spacing: -.03em; margin: 0 0 8px; line-height: 1.25; }
.blog-lead { color: var(--muted); margin: 0 0 30px; max-width: 760px; }

/* ---------------------------------------------------
   CARDS DE ARTIGOS (com imagem)
   --------------------------------------------------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.blog-card {
    position: relative; display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: 0 8px 28px rgba(15, 23, 42, .04);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #bfdbfe; }

.card-img { aspect-ratio: 1200 / 630; background: #0f172a; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.blog-card:hover .card-img img { transform: scale(1.04); }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.card-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    font-size: .8rem; color: var(--muted); margin-bottom: 10px;
}
.tag {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    background: #dbeafe; color: #1d4ed8; font-size: .74rem; font-weight: 800;
    letter-spacing: .02em;
}
.blog-card h2 { font-size: 1.15rem; line-height: 1.4; letter-spacing: -.02em; margin: 0 0 10px; }
.blog-card h2 a { color: var(--dark) !important; text-decoration: none; }
.blog-card h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.blog-card p { font-size: .95rem; color: var(--muted); margin: 0 0 16px; }
.read-more { margin-top: auto; color: var(--primary-dark); font-weight: 750; font-size: .95rem; }
.blog-card:hover .read-more { text-decoration: underline; }

/* primeiro artigo em destaque */
.blog-card.featured { grid-column: 1 / -1; flex-direction: row; }
.blog-card.featured .card-img { flex: 0 0 56%; aspect-ratio: 1200 / 630; align-self: stretch; }
.blog-card.featured .card-body { justify-content: center; padding: 38px 40px; }
.blog-card.featured h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.25; }
.blog-card.featured p { font-size: 1.04rem; }

/* ---------------------------------------------------
   CTA + BOTÃO
   --------------------------------------------------- */
.blog-cta {
    margin-top: 46px; padding: 34px; border-radius: var(--radius);
    background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1px solid #bfdbfe;
}
.blog-cta h2 { margin: 0 0 8px; font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.3; }
.blog-cta p { margin: 0 0 20px; color: #334155; max-width: 720px; }

.blog-button {
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
    padding: 13px 22px; background: var(--primary); color: #fff !important;
    border-radius: 12px; text-decoration: none !important; font-weight: 750;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .22); transition: background .2s, transform .2s;
}
.blog-button:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ---------------------------------------------------
   ARTIGO
   --------------------------------------------------- */
.article-top { padding: 30px 0 0; }
.breadcrumbs { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.breadcrumbs a { color: var(--primary-dark); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; opacity: .6; }

.article-head { padding: 26px 0 30px; }
.article-label { font-size: .8rem; font-weight: 800; color: var(--primary-dark); text-transform: uppercase; letter-spacing: .1em; }
.article-head h1 {
    font-size: clamp(1.9rem, 4.6vw, 3.1rem); line-height: 1.15; letter-spacing: -.04em;
    max-width: 900px; margin: 10px 0 18px; text-wrap: balance;
}
.article-intro { font-size: clamp(1.05rem, 2.2vw, 1.2rem); line-height: 1.7; color: #475569; max-width: 820px; margin: 0 0 20px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; color: var(--muted); }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta svg { width: 16px; height: 16px; flex: none; }

.article-layout {
    display: grid; grid-template-columns: minmax(0, 740px) 300px; gap: 56px;
    justify-content: space-between; align-items: start; padding: 0 0 80px;
}
.article-content { min-width: 0; overflow-wrap: break-word; }

.article-cover {
    margin: 0 0 30px; border-radius: 20px; overflow: hidden;
    border: 1px solid #1e293b; box-shadow: var(--shadow); background: #0f172a;
}
.article-cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }

/* resumo rápido */
.summary-box {
    margin: 0 0 34px; padding: 22px 24px; border-radius: 16px;
    background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--primary);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .04);
}
.article-content .summary-box h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--primary-dark); margin: 0 0 10px; padding: 0; }
.summary-box ul { margin: 0; padding-left: 20px; }
.summary-box li { margin: 6px 0; color: var(--text); }

/* sumário no celular */
.toc-mobile { display: none; margin: 0 0 28px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.toc-mobile summary { padding: 15px 18px; font-weight: 750; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); }
.toc-mobile[open] summary::after { content: "−"; }
.toc-mobile ol { margin: 0; padding: 0 18px 16px 38px; }
.toc-mobile li { margin: 8px 0; font-size: .95rem; }
.toc-mobile a { text-decoration: none; }

/* texto */
.article-content h2 {
    font-size: clamp(1.4rem, 3vw, 1.7rem); line-height: 1.3; letter-spacing: -.025em;
    margin: 46px 0 14px; padding-top: 6px;
}
.article-content h3 { font-size: 1.15rem; line-height: 1.4; margin: 28px 0 8px; letter-spacing: -.01em; }
.article-content p { color: var(--text); font-size: 1.06rem; line-height: 1.82; margin: 0 0 18px; }
.article-content ul,
.article-content ol { color: var(--text); font-size: 1.06rem; line-height: 1.75; padding-left: 24px; margin: 0 0 20px; }
.article-content li { margin: 8px 0; padding-left: 4px; }
.article-content li::marker { color: var(--primary); font-weight: 700; }
.article-content strong { color: var(--dark); }
.article-content a { text-underline-offset: 3px; }

.callout {
    margin: 26px 0; padding: 18px 22px; border-radius: 14px;
    background: var(--primary-light); border: 1px solid #bfdbfe;
}
.article-content .callout p { margin: 0; font-size: 1rem; }
.callout strong.callout-title { display: block; margin-bottom: 4px; color: #1e3a8a; }
.callout.warn { background: #fffbeb; border-color: #fde68a; }
.callout.warn strong.callout-title { color: #92400e; }

.article-figure { margin: 30px 0; }
.article-figure .frame { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: 0 6px 20px rgba(15, 23, 42, .04); }
.article-figure img { width: 100%; }
.article-figure figcaption { margin-top: 10px; font-size: .88rem; color: var(--muted); text-align: center; }

.article-content ul.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 36px; }
.checklist li::before {
    content: "✓"; position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; background: #dcfce7; color: #15803d; font-size: .8rem; font-weight: 800;
}

.article-end {
    margin: 46px 0 8px; padding: 30px; border-radius: 20px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #e2e8f0;
}
.article-content .article-end h2 { margin: 0 0 10px; padding: 0; font-size: 1.45rem; color: #fff; }
.article-content .article-end p { color: #cbd5e1; margin: 0 0 20px; font-size: 1rem; line-height: 1.7; }
.article-end .blog-button { background: #fff; color: var(--primary-dark) !important; box-shadow: none; }
.article-end .blog-button:hover { background: #dbeafe; }

.article-content h2.related-title { margin-top: 50px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.related-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden; text-decoration: none !important; color: var(--dark) !important;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.related-card:hover { transform: translateY(-3px); border-color: #93c5fd; box-shadow: var(--shadow); }
.related-card .card-img { aspect-ratio: 1200 / 630; }
.related-card span { display: block; padding: 14px 16px 16px; font-weight: 700; font-size: .93rem; line-height: 1.45; }

/* aside */
.article-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.aside-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px; margin-bottom: 18px; }
.aside-card h2 { font-size: 1.02rem; margin: 0 0 12px; letter-spacing: -.01em; }
.aside-card ul, .aside-card ol { margin: 0; padding-left: 0; list-style: none; }
.aside-card li { margin: 0; font-size: .92rem; line-height: 1.5; }
.aside-card li a { display: block; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; color: #475569; text-decoration: none; }
.aside-card li a:hover { background: var(--primary-light); color: var(--primary-dark); }
.aside-card li a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.aside-card p { font-size: .92rem; color: #475569; margin: 0 0 14px; }
.aside-card .blog-button { width: 100%; }


/* tabelas comparativas */
.table-wrap { margin: 24px 0 26px; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .96rem; line-height: 1.55; }
.table-wrap th, .table-wrap td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); color: var(--text); }
.table-wrap thead th { background: #f1f5f9; color: var(--dark); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.table-wrap tbody th { color: var(--dark); font-weight: 700; width: 24%; }
.table-wrap tbody tr:last-child th, .table-wrap tbody tr:last-child td { border-bottom: 0; }

/* barra de progresso de leitura */
.read-progress { position: fixed; top: var(--header-h); left: 0; height: 3px; width: 0; z-index: 999; background: linear-gradient(90deg, #2563eb, #60a5fa); }

/* ---------------------------------------------------
   FOOTER
   --------------------------------------------------- */

/* =====================================================
   RESPONSIVO
   ===================================================== */


@media (max-width: 1000px) {
    .article-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; max-width: 760px; margin-inline: auto; }
    .article-aside { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .aside-card { margin: 0; }
    .aside-card.toc-card { display: none; }
    .toc-mobile { display: block; }
}

@media (max-width: 900px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    .blog-card.featured { flex-direction: column; }
    .blog-card.featured .card-img { flex: none; aspect-ratio: 1200 / 630; min-height: 0; }
    .blog-card.featured .card-body { padding: 24px; }
}

@media (max-width: 640px) {
    .blog-wrap { width: min(100% - 32px, 1160px); }
    .blog-hero { padding: 46px 0 42px; }
    .blog-main { padding: 36px 0 52px; }
    .blog-grid { grid-template-columns: 1fr; gap: 18px; }
    .blog-section-title { font-size: 1.45rem; }
    .blog-cta { padding: 24px 20px; }
    .blog-cta .blog-button, .article-end .blog-button { width: 100%; }

    .article-top { padding-top: 20px; }
    .article-head { padding: 20px 0 22px; }
    .article-cover { border-radius: 16px; margin-bottom: 24px; }
    .article-content h2 { margin-top: 38px; }
    .article-content p, .article-content ul, .article-content ol { font-size: 1.03rem; line-height: 1.78; }
    .article-end { padding: 24px 20px; border-radius: 16px; }
    .article-aside { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .related-card { flex-direction: row; align-items: stretch; }
    .related-card .card-img { flex: 0 0 38%; aspect-ratio: auto; }
    .related-card span { display: flex; align-items: center; padding: 12px 14px; }
    .summary-box { padding: 18px 18px; }
    .article-figure .frame { padding: 10px; }
    /* tabelas viram cartões empilhados */
    .table-wrap { overflow: visible; border: 0; background: transparent; }
    .table-wrap table { min-width: 0; display: block; }
    .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td { display: block; width: auto; }
    .table-wrap tr { background: #fff; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
    .table-wrap tbody th { width: auto; background: #f1f5f9; border-bottom: 1px solid var(--border); padding: 12px 16px; }
    .table-wrap td { border: 0 !important; padding: 10px 16px 12px; }
    .table-wrap td + td { padding-top: 0; }
    .table-wrap td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-dark); margin-bottom: 2px; }
    .table-wrap tbody tr:last-child th { border-bottom: 1px solid var(--border); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
