/* =====================================================================
   Article plus - melhorias de leitura + CTA + related
   ===================================================================== */

/* ---------- Breadcrumb ---------- */
.article-breadcrumb {
    max-width: 900px;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.article-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.article-breadcrumb a:hover { color: var(--accent); }
.article-breadcrumb span[aria-hidden] { opacity: 0.4; }
.article-breadcrumb span[aria-current] {
    color: var(--text);
    font-weight: 500;
}

/* ---------- Heading anchor links ---------- */
.article-body h2,
.article-body h3 {
    position: relative;
}

.article-body h2 .anchor,
.article-body h3 .anchor {
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 400;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 0 0.25rem;
    font-size: 0.85em;
}

.article-body h2:hover .anchor,
.article-body h3:hover .anchor,
.article-body .anchor:focus-visible {
    opacity: 1;
}

.article-body .anchor:hover,
.article-body .anchor:focus-visible {
    color: var(--accent);
}

.article-body .anchor--copied {
    color: var(--success);
    opacity: 1;
}

/* ---------- Prism tweaks ---------- */
.article-body pre[class*="language-"] {
    border-radius: var(--radius);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 1.5rem 0;
    border: 1px solid var(--border-strong);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.article-body :not(pre) > code[class*="language-"],
.article-body code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.875em;
    background: var(--bg-soft);
    padding: 0.125em 0.375em;
    border-radius: 4px;
    color: var(--text);
}

[data-theme="dark"] .article-body pre[class*="language-"],
:root:not([data-theme="light"]) .article-body pre[class*="language-"] {
    background: #161D33;
}

/* ---------- CTA box inline (fim do artigo) ---------- */
.archtec-cta-box {
    margin: 3rem 0 0;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #0B1E3A 0%, #1E3A8A 100%);
    color: white;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.archtec-cta-box::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(139, 92, 246, 0.35), transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.5), transparent 60%);
}

@media (max-width: 640px) {
    .archtec-cta-box {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}

.archtec-cta-box__eyebrow {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.archtec-cta-box h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    color: white;
    line-height: 1.2;
}

.archtec-cta-box p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9375rem;
    line-height: 1.5;
    max-width: 50ch;
}

.archtec-cta-box__actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.archtec-cta-box__primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #0B1E3A;
    font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9375rem;
    white-space: nowrap;
    transition: transform 0.2s var(--ease-spring);
}

.archtec-cta-box__primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.5);
}

.archtec-cta-box__whats {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #25D366;
    color: white;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.8125rem;
    white-space: nowrap;
    transition: transform 0.2s;
}

.archtec-cta-box__whats:hover {
    transform: translateY(-1px);
    background: #1ebe57;
}

/* ---------- CTA sticky (lateral direita, no TOC) ---------- */
.archtec-cta-sticky {
    margin-top: 2rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.archtec-cta-sticky__eyebrow {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 0.375rem;
}

.archtec-cta-sticky h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0 0 0.375rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.archtec-cta-sticky p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.archtec-cta-sticky__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: transform 0.2s;
}

.archtec-cta-sticky__btn:hover {
    transform: translateY(-1px);
}

/* ---------- Related articles ---------- */
.article-related {
    max-width: 1100px;
    margin: 4rem auto 0;
    padding: 0 1.5rem;
}

.article-related h2 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
    color: var(--text);
}

.article-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.article-related__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, border-color 0.3s;
}

.article-related__card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 12px 28px -8px rgba(15, 23, 41, 0.15);
}

.article-related__cat {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.125rem;
}

.article-related__title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.015em;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-related__excerpt {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-related__meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* ---------- WhatsApp flutuante (em todas as paginas article-v2) ---------- */
.wa-float {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    z-index: 40;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s var(--ease-spring);
}

.wa-float:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.55);
}

.wa-float svg { width: 26px; height: 26px; }

@media (max-width: 1080px) {
    .wa-float { bottom: 5.5rem; right: 1rem; }
}

/* ---------- Tabelas ---------- */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
}

.article-body thead {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05));
    border-bottom: 2px solid var(--border-strong);
}

.article-body th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
}

.article-body td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    vertical-align: top;
}

.article-body tbody tr:hover {
    background: var(--bg-soft);
}

.article-body table caption {
    caption-side: bottom;
    padding-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: left;
}

/* ---------- Callouts ---------- */
.callout {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border-left: 4px solid;
    background: var(--bg-elev);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.callout--info { border-left-color: #3B82F6; background: rgba(59, 130, 246, 0.06); }
.callout--tip { border-left-color: #10B981; background: rgba(16, 185, 129, 0.06); }
.callout--warn { border-left-color: #F59E0B; background: rgba(245, 158, 11, 0.06); }
.callout--danger { border-left-color: #EF4444; background: rgba(239, 68, 68, 0.06); }

.callout strong:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 0.375rem;
}

.callout--info strong:first-child { color: #3B82F6; }
.callout--tip strong:first-child { color: #10B981; }
.callout--warn strong:first-child { color: #F59E0B; }
.callout--danger strong:first-child { color: #EF4444; }

.callout p { margin: 0.25rem 0; }
.callout p:first-of-type { display: inline; }

/* ---------- Mermaid ---------- */
.article-body .mermaid {
    margin: 2rem 0;
    text-align: center;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
}

.article-body .mermaid svg {
    max-width: 100% !important;
    height: auto !important;
}

/* ---------- Figures ---------- */
.article-body figure {
    margin: 1.5rem 0;
    text-align: center;
}

.article-body figure img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.article-body figcaption {
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ---------- iframes (vídeos) ---------- */
.article-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

/* ---------- Details/Summary (FAQs) ---------- */
.article-body details {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.article-body summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    list-style-position: inside;
}

.article-body details[open] summary {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ---------- KBD ---------- */
.article-body kbd {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.8125em;
    padding: 0.125em 0.5em;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--border-strong);
    color: var(--text);
}

/* ---------- Scroll restore indicator ---------- */
.scroll-restore {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    transition: transform 0.4s var(--ease-spring);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.scroll-restore.show {
    transform: translateX(-50%) translateY(0);
}

.scroll-restore button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.scroll-restore button.dismiss {
    background: transparent;
    color: var(--text-muted);
}
