/* ===== BLOG CSS — Public Blog Pages ===== */
/* Extends style.css — adds new classes without overriding existing ones */

/* ===== BLOG HERO ===== */
.blog-hero {
    /* Mesmo espaçamento de topo do Portfólio (folga para o cabeçalho fixo) */
    padding: clamp(130px, 16vh, 200px) 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.blog-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(32,136,202,0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.blog-hero .container { position: relative; z-index: 1; }
.blog-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 16px;
    letter-spacing: -.03em;
}
.blog-hero .hero-sub {
    font-size: 1.05rem;
    color: var(--text2);
    max-width: 520px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* ===== SEARCH BAR ===== */
.blog-search-wrap {
    max-width: 560px;
    margin: 0 auto 40px;
}
.blog-search-form {
    position: relative;
}
.blog-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    pointer-events: none;
    display: flex;
    align-items: center;
}
.blog-search-input {
    width: 100%;
    background: var(--bgcard);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 14px 20px 14px 46px;
    font-family: var(--font-body), sans-serif;
    font-size: 0.9375rem;
    color: var(--text);
    outline: none;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.blog-search-input:focus {
    border-color: var(--acc);
    box-shadow: 0 0 0 3px rgba(32,136,202,.12);
}
.blog-search-input::placeholder { color: var(--text3); }
.blog-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #2088ca, #3aabf0);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 18px;
    font-family: var(--font-body), sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s ease;
}
.blog-search-btn:hover { opacity: 0.88; }

/* ===== CATEGORY FILTER PILLS ===== */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 48px;
}
.blog-filter-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid var(--border);
    color: var(--text2);
    background: transparent;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    letter-spacing: .01em;
}
.blog-filter-btn:hover {
    border-color: var(--acc);
    color: var(--acc);
    background: rgba(32,136,202,.06);
}
.blog-filter-btn.active {
    background: linear-gradient(135deg, #2088ca, #3aabf0);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(32,136,202,.3);
}

/* ===== SECTION AREA ===== */
.blog-section {
    padding: 0 0 80px;
}

/* ===== MASONRY GRID ===== */
.blog-grid {
    column-count: 3;
    column-gap: 24px;
}
@media (max-width: 900px) { .blog-grid { column-count: 2; } }
@media (max-width: 580px) { .blog-grid { column-count: 1; } }

/* ===== BLOG CARD ===== */
.blog-card {
    break-inside: avoid;
    background: var(--bgcard);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s ease, border-color .3s ease;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,.4);
    border-color: rgba(32,136,202,.25);
}
.blog-card-img-link {
    display: block;
    overflow: hidden;
}
.blog-card-img-link:hover .blog-card-img { transform: scale(1.03); }
.blog-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: var(--bg3);
    transition: transform .3s ease;
}
.blog-card-title-link {
    color: inherit;
    text-decoration: none;
}
.blog-card-title-link:hover { color: var(--acc); }
.blog-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg3), var(--bg2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text3);
}
.blog-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.blog-card-cat {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 10px;
    border: 1px solid transparent;
}
/* Blog e Perspetivas: tag da categoria como pill pequena sobre o canto da imagem
   (fundo escuro translúcido para leitura; mantém a cor da categoria no texto/borda). */
.blog-section .blog-card { position: relative; }
.blog-section .blog-card-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    margin: 0;
    max-width: calc(100% - 24px);
    padding: 5px 11px;
    background: rgba(8, 12, 18, .6) !important;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0,0,0,.28);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.blog-card-title {
    font-family: var(--font-display), sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
    letter-spacing: -.01em;
    transition: color .2s ease;
}
.blog-card:hover .blog-card-title {
    color: var(--acc);
}
.blog-card-excerpt {
    font-size: 0.875rem;
    color: var(--text2);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-bottom: 14px;
}
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text3);
    margin-bottom: 14px;
}
.blog-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.blog-card-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--acc);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap .2s ease;
    margin-top: auto;
}
.blog-card-link:hover { gap: 8px; }

/* ===== EMPTY STATE ===== */
.blog-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--text2);
}
.blog-empty-icon { font-size: 3.5rem; margin-bottom: 20px; }
.blog-empty-title {
    font-family: var(--font-display), sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}
.blog-empty-text { font-size: 0.9375rem; max-width: 420px; margin: 0 auto; }

/* ===== PAGINATION ===== */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 0 0;
}
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--border);
    color: var(--text2);
    background: transparent;
    transition: all .2s ease;
}
.pg-btn:hover {
    border-color: var(--acc);
    color: var(--acc);
    background: rgba(32,136,202,.06);
}
.pg-btn.active {
    background: linear-gradient(135deg, #2088ca, #3aabf0);
    border-color: transparent;
    color: #fff;
}
.pg-btn.disabled {
    opacity: .35;
    pointer-events: none;
}
.pg-ellipsis {
    color: var(--text3);
    padding: 0 4px;
}

/* ===== RESULTS INFO ===== */
.results-info {
    font-size: 0.875rem;
    color: var(--text2);
    margin-bottom: 28px;
    text-align: center;
}
.results-info strong { color: var(--text); }
.results-info a { color: var(--acc); text-decoration: none; }
.results-info a:hover { text-decoration: underline; }

/* ===== SINGLE ARTICLE PAGE ===== */
.article-wrap {
    padding: 140px 0 80px;
}

/* Article Header */
.article-header {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
}
.article-cat-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.article-title {
    font-family: var(--font-display), sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -.03em;
    color: var(--text);
    margin-bottom: 20px;
}
.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text2);
}
.article-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Cover Image */
.article-cover-wrap {
    max-width: 900px;
    margin: 0 auto 48px;
}
.article-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

/* Content Area */
.article-body {
    max-width: 800px;
    margin: 0 auto;
}
.article-content {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--text);
}
.article-content h2 {
    font-family: var(--font-display), sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 40px 0 16px;
    color: var(--text);
    scroll-margin-top: 100px;
}
.article-content h3 {
    font-family: var(--font-display), sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text);
    scroll-margin-top: 100px;
}
.article-content p {
    margin-bottom: 20px;
}
.article-content a {
    color: var(--acc);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-content a:hover { opacity: .8; }
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 24px auto;
}
.article-content ul,
.article-content ol {
    margin: 16px 0 20px 24px;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote {
    border-left: 3px solid var(--acc);
    padding: 12px 20px;
    background: rgba(32,136,202,.06);
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
    color: var(--text2);
    font-style: italic;
}
.article-content pre,
.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}
.article-content pre {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 20px 0;
    line-height: 1.6;
}
.article-content code {
    background: var(--bg3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}
.article-content pre code {
    background: none;
    padding: 0;
}

/* ===== ARTICLE DIVIDER ===== */
.article-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== ATTACHMENTS ===== */
.attachments-section {
    max-width: 800px;
    margin: 0 auto 48px;
}
.attachments-title {
    font-family: var(--font-display), sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}
.attachments-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.attach-img-link {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform .25s ease, border-color .25s ease;
}
.attach-img-link:hover {
    transform: scale(1.02);
    border-color: rgba(32,136,202,.3);
}
.attach-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* Video attachments */
.attach-video {
    width: 100%;
    max-width: 700px;
    border-radius: 12px;
    background: #000;
    display: block;
    margin-bottom: 12px;
}

/* Document attachments */
.attach-docs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.attach-doc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bgcard);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .25s ease, transform .2s ease;
}
.attach-doc-card:hover {
    border-color: rgba(32,136,202,.3);
    transform: translateX(4px);
}
.attach-doc-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}
.attach-doc-info { flex: 1; overflow: hidden; }
.attach-doc-name {
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attach-doc-size {
    font-size: 0.75rem;
    color: var(--text3);
    margin-top: 2px;
}
.attach-doc-dl {
    color: var(--acc);
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===== BACK LINK ===== */
.article-back {
    max-width: 800px;
    margin: 0 auto 40px;
}
.article-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text2);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s ease, gap .2s ease;
}
.article-back-link:hover {
    color: var(--acc);
    gap: 10px;
}

/* ===== BREADCRUMB ===== */
.article-breadcrumb {
    max-width: 800px;
    margin: -28px auto 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: 0.8125rem;
    color: var(--text3);
}
.article-breadcrumb a {
    color: var(--text3);
    text-decoration: none;
    transition: color .2s ease;
}
.article-breadcrumb a:hover { color: var(--acc); }
.article-breadcrumb span:last-child {
    color: var(--text2);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}
body.reading-mode .article-breadcrumb { display: none !important; }

/* ===== RELATED ARTICLES ===== */
.related-section {
    padding: 48px 0 0;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}
.related-title {
    font-family: var(--font-display), sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 28px;
    color: var(--text);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 768px) {
    .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
}

/* Related card (smaller) */
.related-card {
    background: var(--bgcard);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(0,0,0,.3);
    border-color: rgba(32,136,202,.2);
}
.related-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: var(--bg3);
}
.related-card-img-placeholder {
    width: 100%;
    height: 140px;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text3);
}
.related-card-body { padding: 16px; }
.related-card-title {
    font-family: var(--font-display), sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    transition: color .2s ease;
}
.related-card:hover .related-card-title { color: var(--acc); }
.related-card-date {
    font-size: 0.75rem;
    color: var(--text3);
}

/* Responsive adjustments for article page */
@media (max-width: 768px) {
    .article-wrap { padding: 90px 0 60px; }
    .article-breadcrumb { margin-top: 0; }
    .article-title { font-size: 1.75rem; }
    .article-content { font-size: 1rem; }
    .blog-hero { padding: clamp(104px, 15vh, 140px) 0 40px; }
    .attachments-images {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
@media (max-width: 480px) {
    .blog-filters { gap: 6px; }
    .blog-filter-btn { padding: 7px 14px; font-size: .8125rem; }
}

/* ===== TAGS BADGES ===== */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 4px;
}
.article-tag-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: lowercase;
    background: rgba(32,136,202,.1);
    color: var(--acc);
    border: 1px solid rgba(32,136,202,.25);
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease;
}
.article-tag-badge:hover {
    background: rgba(32,136,202,.2);
    border-color: rgba(32,136,202,.5);
}

/* ===== READING PROGRESS BAR ===== */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent, var(--acc));
    z-index: 9999;
    transition: width .1s linear;
    pointer-events: none;
}

/* ===== SHARE BAR ===== */
.share-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px auto 0;
    max-width: 800px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}
.share-bar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.share-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.share-bar-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text2);
    margin-right: 4px;
}
/* Botões de ícone (apenas logo colorido) */
.share-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, opacity .15s ease;
    padding: 0;
}
.share-icon-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}
.share-icon-btn:hover { transform: scale(1.15); opacity: .85; }
/* Cores de marca */
.share-wa  svg { fill: #25D366; }
.share-ig  { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); border-radius: 10px; width: 32px; height: 32px; }
.share-ig  svg { fill: #fff; width: 18px; height: 18px; }
.share-fb  svg { fill: #1877F2; }
.share-x   svg { fill: var(--text); }   /* adapta ao tema */
.share-li  svg { fill: #0A66C2; }
.share-tg  svg { fill: #2AABEE; }
/* Botão Copiar Link */
.share-btn.share-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid var(--border);
    background: var(--bgcard);
    color: var(--text2);
    transition: all .2s ease;
    font-family: var(--font-body), sans-serif;
}
.share-btn.share-copy:hover {
    border-color: var(--acc);
    color: var(--acc);
    background: rgba(32,136,202,.07);
}
.share-btn.share-copy.copied {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16,185,129,.08);
}
/* Botão Seguir no Instagram */
.share-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 20px;
    background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .2s ease, transform .15s ease;
}
.share-follow-btn:hover { opacity: .88; transform: scale(1.04); }
.share-follow-btn svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}
/* (gradiente Instagram tratado via fundo CSS em .share-ig) */

/* ===== TOC PANEL ===== */
/* ── Índice: botão fixo (FAB) ao fundo, centrado ──────────────────────────── */
.toc-fab {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 11px 20px;
    border: 1px solid color-mix(in oklch, var(--acc) 45%, var(--border));
    border-radius: 999px;
    background: color-mix(in oklch, var(--bgcard) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    z-index: 120;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.toc-fab:hover { border-color: var(--acc); transform: translateX(-50%) translateY(-2px); }
.toc-fab svg { width: 17px; height: 17px; color: var(--acc); }
/* O Índice mantém-se disponível também em Modo de Leitura (a pedido do cliente). */

/* ── Fundo escurecido da gaveta ───────────────────────────────────────────── */
.toc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4,7,11,.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 130;
}
.toc-backdrop.is-open { opacity: 1; }

/* ── Gaveta do Índice (desliza de baixo) ──────────────────────────────────── */
.toc-panel {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 100%);
    width: min(560px, 100%);
    max-height: 72vh;
    overflow-y: auto;
    background: var(--bgcard);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    padding: 8px 20px 24px;
    z-index: 140;
    font-size: 0.9rem;
    transition: transform .32s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 -12px 40px rgba(0,0,0,.4);
}
.toc-panel.is-open { transform: translate(-50%, 0); }
.toc-panel::-webkit-scrollbar { width: 4px; }
.toc-panel::-webkit-scrollbar-track { background: transparent; }
.toc-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.toc-drawer-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 0 10px;
    margin-bottom: 6px;
    background: var(--bgcard);
    border-bottom: 1px solid var(--border);
}
.toc-drawer-head .toc-title { margin-bottom: 0; }
.toc-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--text2);
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease;
}
.toc-close:hover { color: var(--acc); border-color: var(--acc); }
.toc-close svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) {
    .toc-panel, .toc-backdrop, .toc-fab { transition: none; }
}
.toc-title {
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 10px;
}
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.toc-list li a {
    display: block;
    padding: 5px 8px;
    border-radius: 6px;
    color: var(--text2);
    text-decoration: none;
    line-height: 1.4;
    transition: background .2s ease, color .2s ease;
    border-left: 2px solid transparent;
}
.toc-list li a:hover,
.toc-list li a.toc-active {
    background: rgba(32,136,202,.08);
    color: var(--acc);
    border-left-color: var(--acc);
}
.toc-list li.toc-h3 a {
    padding-left: 18px;
    font-size: 0.775rem;
}
/* Em ecra estreito a gaveta ocupa a largura toda. */
@media (max-width: 600px) {
    .toc-panel { width: 100%; border-radius: 16px 16px 0 0; padding: 8px 16px 20px; }
    .toc-fab { font-size: .8rem; padding: 10px 18px; }
}

/* ── Desktop: o Índice volta a ser barra lateral fixa (como estava). O FAB e a
   gaveta ficam só para mobile/tablet. O artigo tem 800px centrados, por isso a
   barra encaixa na goteira esquerda a partir de ~1240px. ────────────────────── */
@media (min-width: 1240px) {
    .toc-fab, .toc-backdrop { display: none !important; }
    body.has-toc .toc-panel {
        display: block !important;   /* ignora o atributo [hidden] */
        position: fixed;
        /* À DIREITA do artigo (800px centrados), com ~52px de folga. O min()
           impede que saia do ecrã em desktops mais estreitos. */
        left: min(calc(50vw + 452px), calc(100vw - 196px));
        top: 116px;
        bottom: auto;
        transform: none !important;
        width: 180px;
        max-height: calc(100vh - 156px);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: 0 8px 30px rgba(0,0,0,.18);
        transition: none;
    }
    body.has-toc .toc-panel .toc-close { display: none; }
    /* Continua acessível também em Modo de Leitura. */
    body.reading-mode.has-toc .toc-panel { display: block !important; }
}

/* ===== ANCHOR LINKS ON HEADINGS — removido visualmente, IDs mantidos para TOC ===== */
.anchor-link { display: none !important; }
.anchor-tooltip {
    position: fixed;
    background: var(--bgcard);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity .2s ease;
    font-family: var(--font-body), sans-serif;
}
.anchor-tooltip.show { opacity: 1; }

/* ===== READING MODE ===== */
.reading-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bgcard);
    color: var(--text2);
    transition: all .2s ease;
    font-family: var(--font-body), sans-serif;
}
.reading-mode-btn:hover {
    border-color: var(--acc);
    color: var(--acc);
    background: rgba(32,136,202,.07);
}
body.reading-mode #nav,
body.reading-mode footer,
body.reading-mode .article-sidebar,
body.reading-mode .related-section,
body.reading-mode .attachments-section { display: none !important; }
body.reading-mode .article-wrap { padding-top: 20px; }
body.reading-mode .article-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
}
body.reading-mode .article-back { display: none !important; }
/* Gaveta do Índice continua acessível em Modo de Leitura. */

/* ===== ARTICLE META TOOLBAR ===== */
.article-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ===== CTA BOX ===== */
.article-cta-box {
    max-width: 800px;
    margin: 48px auto;
    padding: 36px 40px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(32,136,202,.08) 0%, rgba(58,171,240,.04) 100%);
    border: 1.5px solid rgba(32,136,202,.3);
    text-align: center;
}
.article-cta-box h3 {
    font-family: var(--font-display), sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
}
.article-cta-box p {
    font-size: 0.9375rem;
    color: var(--text2);
    margin-bottom: 22px;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .article-cta-box { padding: 28px 20px; }
    .share-bar { gap: 6px; }
    .share-bar-left { gap: 4px; }
    .share-follow-btn { padding: 6px 12px; font-size: .75rem; }
}

/* ===== ALINHAMENTO QUILL (preservado na visualização do artigo) ===== */
.article-content .ql-align-center  { text-align: center; }
.article-content .ql-align-right   { text-align: right; }
.article-content .ql-align-justify { text-align: justify; }
/* Listas Quill */
.article-content .ql-indent-1 { padding-left: 2em; }
.article-content .ql-indent-2 { padding-left: 4em; }
.article-content .ql-indent-3 { padding-left: 6em; }

/* ===== ÂNCORA DE HEADING — oculta (IDs mantidos para o TOC) ===== */
.anchor-link {
    display: none !important;
}

/* ===== PLAYER SPOTIFY ===== */
.spotify-player-section {
    max-width: 800px;
    margin: 0 auto 32px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(30,215,96,.2);
    background: rgba(30,215,96,.04);
}
.spotify-player-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid rgba(30,215,96,.12);
    flex-wrap: wrap;
}
.spotify-icon {
    width: 22px;
    height: 22px;
    fill: #1ED760;
    flex-shrink: 0;
}
.spotify-player-header span {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}
.spotify-open-link {
    font-size: .8125rem;
    color: #1ED760;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.spotify-open-link:hover { text-decoration: underline; }
.toc-spotify-entry a {
    color: #1ED760 !important;
    border-left-color: #1ED760 !important;
}
.toc-spotify-entry a:hover { opacity: .8; }
.spotify-player-section iframe {
    display: block;
    border: none;
}
