/* Assimetrix Guia — Blog Enhancements v1
 * Injetado em todos os artigos via enhancements.js.
 * Design tokens alinhados com o tema teal Assimetrix.
 */

:root {
    --asm-primary: #2d5f5d;
    --asm-primary-light: #3a7673;
    --asm-accent: #5fa7a3;
    --asm-accent-light: #7bc4c0;
    --asm-text: #1f2937;
    --asm-text-muted: #6b7280;
    --asm-bg-card: #ffffff;
    --asm-bg-soft: #f7fafa;
    --asm-border: rgba(45, 95, 93, 0.15);
    --asm-radius: 12px;
    --asm-radius-lg: 16px;
    --asm-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --asm-shadow: 0 4px 12px rgba(45, 95, 93, 0.08);
    --asm-shadow-lg: 0 12px 32px rgba(45, 95, 93, 0.12);
}

/* ============================================
 * Article Meta Bar (byline + date + reading + share)
 * Aparece logo depois do hero
 * ============================================ */
.asm-meta-bar {
    background: var(--asm-bg-soft);
    border-top: 1px solid var(--asm-border);
    border-bottom: 1px solid var(--asm-border);
    padding: 16px 0;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    color: var(--asm-text-muted);
}
.asm-meta-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.asm-meta-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.asm-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.asm-meta-item strong { color: var(--asm-text); font-weight: 600; }
.asm-meta-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--asm-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.asm-meta-cat-badge:hover { background: var(--asm-primary-light); }

.asm-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.asm-share-btn {
    width: 34px; height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--asm-border);
    border-radius: 8px;
    color: var(--asm-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.asm-share-btn:hover {
    background: var(--asm-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--asm-shadow);
}
.asm-share-btn svg { width: 16px; height: 16px; }
.asm-share-copied {
    position: absolute;
    background: var(--asm-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: -34px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.asm-share-copied.show { opacity: 1; }

/* ============================================
 * TOC + mini-CTA (dentro do aside existente do layout)
 * Desktop: aside já tem posição na coluna 320px; TOC vira sticky
 * Mobile (<901px): aside esconde inteiro (mobile TOC substitui)
 * ============================================ */

/* Aside "resetado" pelo enhancements.js — tira estilos do sidebar-card antigo */
.article-layout > aside.asm-aside-reset,
.article-layout > aside.asm-injected-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: flex-start;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    font-family: 'Inter', sans-serif;
}

/* Some no mobile (mobile TOC no topo do artigo já cobre) */
@media (max-width: 900px) {
    .article-layout > aside.asm-aside-reset,
    .article-layout > aside.asm-injected-aside {
        display: none !important;
    }
}

.asm-toc-desktop {
    padding: 20px;
    background: var(--asm-bg-card);
    border: 1px solid var(--asm-border);
    border-radius: var(--asm-radius);
    box-shadow: var(--asm-shadow-sm);
    font-size: 14px;
}
.asm-toc-desktop::-webkit-scrollbar { width: 4px; }
.asm-toc-desktop::-webkit-scrollbar-thumb { background: var(--asm-border); border-radius: 2px; }

/* Mini-CTA trial dentro da sidebar */
.asm-mini-cta {
    background: linear-gradient(135deg, var(--asm-primary) 0%, var(--asm-primary-light) 100%);
    color: #fff;
    padding: 18px;
    border-radius: var(--asm-radius);
    text-align: center;
    box-shadow: var(--asm-shadow);
}
.asm-mini-cta-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}
.asm-mini-cta-desc {
    font-size: 13px;
    opacity: 0.92;
    line-height: 1.45;
    margin-bottom: 14px;
}
.asm-mini-cta-btn {
    display: inline-block;
    background: #fff;
    color: var(--asm-primary);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.asm-mini-cta-btn:hover {
    background: var(--asm-bg-soft);
    transform: translateY(-1px);
}
.asm-toc-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--asm-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.asm-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.asm-toc-list li { margin-bottom: 6px; }
.asm-toc-list a {
    color: var(--asm-text-muted);
    text-decoration: none;
    display: block;
    padding: 4px 8px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    border-radius: 4px;
    line-height: 1.4;
}
.asm-toc-list a:hover {
    color: var(--asm-primary);
    background: var(--asm-bg-soft);
    border-left-color: var(--asm-accent);
}
.asm-toc-list a.asm-toc-active {
    color: var(--asm-primary);
    border-left-color: var(--asm-primary);
    background: var(--asm-bg-soft);
    font-weight: 600;
}

/* Mobile TOC (collapsible) */
.asm-toc-mobile {
    display: block;
    margin: 24px 0;
    padding: 16px;
    background: var(--asm-bg-soft);
    border: 1px solid var(--asm-border);
    border-radius: var(--asm-radius);
    font-family: 'Inter', sans-serif;
}
@media (min-width: 1080px) {
    .asm-toc-mobile { display: none; }
}
.asm-toc-mobile summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--asm-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    font-size: 14px;
}
.asm-toc-mobile summary::-webkit-details-marker { display: none; }
.asm-toc-mobile summary::after {
    content: "▾";
    transition: transform 0.2s;
    font-size: 16px;
}
.asm-toc-mobile[open] summary::after { transform: rotate(180deg); }
.asm-toc-mobile .asm-toc-list { margin-top: 12px; }

/* asm-with-toc: legado — o layout grid original (1fr 320px) faz o trabalho */

/* ============================================
 * Related Articles (aparece antes do CTA final)
 * ============================================ */
.asm-related {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 48px 24px;
    background: var(--asm-bg-soft);
    border-radius: var(--asm-radius-lg);
    font-family: 'Inter', sans-serif;
}
.asm-related h2 {
    color: var(--asm-primary);
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    text-align: center;
}
.asm-related-sub {
    color: var(--asm-text-muted);
    text-align: center;
    margin: 0 0 32px;
    font-size: 15px;
}
.asm-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.asm-related-card {
    background: var(--asm-bg-card);
    border: 1px solid var(--asm-border);
    border-radius: var(--asm-radius);
    padding: 20px;
    text-decoration: none;
    color: var(--asm-text);
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.asm-related-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--asm-shadow-lg);
    border-color: var(--asm-accent);
}
.asm-related-cat {
    font-size: 11px;
    font-weight: 700;
    color: var(--asm-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.asm-related-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--asm-text);
    margin: 0;
    line-height: 1.3;
    font-family: 'Sora', 'Inter', sans-serif;
}
.asm-related-card p {
    color: var(--asm-text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}
.asm-related-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--asm-text-muted);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--asm-border);
}

/* ============================================
 * Contextual mid-article CTA box (opcional, injetado uma vez)
 * ============================================ */
.asm-inline-cta {
    background: linear-gradient(135deg, var(--asm-primary) 0%, var(--asm-primary-light) 100%);
    color: #fff;
    padding: 24px 28px;
    border-radius: var(--asm-radius);
    margin: 32px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--asm-shadow);
}
.asm-inline-cta-text {
    flex: 1;
    min-width: 240px;
}
.asm-inline-cta-text strong {
    display: block;
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}
.asm-inline-cta-text span {
    font-size: 14px;
    opacity: 0.92;
    line-height: 1.5;
}
.asm-inline-cta a {
    background: #fff;
    color: var(--asm-primary);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.15s;
}
.asm-inline-cta a:hover {
    background: var(--asm-bg-soft);
    transform: translateY(-1px);
}

/* ============ TOPICAL TRAIL (pillar association) ============ */
.asm-topical-trail {
    margin: 20px 0 24px 0;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(45, 95, 93, 0.06), rgba(45, 95, 93, 0.02));
    border-left: 3px solid var(--asm-primary);
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
}
.asm-topical-trail-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.asm-topical-trail-label {
    color: var(--asm-text-muted, #6b7c7a);
}
.asm-topical-trail-label strong {
    color: var(--asm-primary);
    font-weight: 600;
}
.asm-topical-trail-sep {
    color: var(--asm-text-muted, #6b7c7a);
    opacity: 0.5;
}
.asm-topical-trail-link {
    color: var(--asm-primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
.asm-topical-trail-link:hover {
    border-bottom-style: solid;
}

/* ============ INLINE RELATED BOXES ============ */
.asm-inline-related {
    margin: 32px 0;
    padding: 16px 20px;
    background: var(--asm-bg-soft, #f6f8f8);
    border-radius: 10px;
    border: 1px solid rgba(45, 95, 93, 0.12);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.asm-inline-related-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: var(--asm-primary);
    flex-shrink: 0;
    padding-right: 16px;
    border-right: 1px solid rgba(45, 95, 93, 0.15);
}
.asm-inline-related-link {
    flex: 1;
    min-width: 220px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s;
}
.asm-inline-related-link:hover {
    transform: translateX(3px);
}
.asm-inline-related-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--asm-primary);
    line-height: 1.35;
    margin-bottom: 4px;
}
.asm-inline-related-link:hover .asm-inline-related-title {
    text-decoration: underline;
}
.asm-inline-related-meta {
    font-size: 12px;
    color: var(--asm-text-muted, #6b7c7a);
}
@media (max-width: 640px) {
    .asm-inline-related {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .asm-inline-related-label {
        border-right: none;
        padding-right: 0;
        padding-bottom: 4px;
    }
}
