/* Single Post — Editorial Premium Redesign */

/* Full width override esta em pages.css (.content-area.single-full-width) */

.single-post {
    background: var(--card, #fff);
    padding: 0;
    border-radius: var(--radius, 8px);
    margin-bottom: var(--space-8, 32px);
}

/* Header do artigo — editorial, titulo grande e impactante */
.entry-header {
    text-align: center;
    margin-bottom: var(--space-8, 32px);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.entry-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: var(--space-4, 16px) 0;
    color: var(--foreground, #18181b);
}

/* Meta do artigo — discreto, clean */
.entry-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-4, 16px);
    font-size: var(--text-sm, 14px);
    color: var(--muted-foreground, #666);
}

.entry-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.entry-meta a {
    color: var(--evte-primary, #0056b3);
    font-weight: 500;
}

/* Barra de acoes: Resumir com IA + Compartilhar */
.post-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 0;
    margin-bottom: 20px;
    border-top: 1px solid var(--border, #e4e4e7);
    border-bottom: 1px solid var(--border, #e4e4e7);
}

.post-summarize,
.post-share-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.actions-label {
    font-size: 13px;
    color: var(--muted-foreground, #a1a1aa);
    font-weight: 400;
}

.post-summarize a,
.post-share-inline a {
    color: var(--muted-foreground, #a1a1aa);
    transition: color 0.15s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    padding: 4px;
}

.post-summarize a:hover,
.post-share-inline a:hover {
    color: var(--foreground, #18181b);
    transform: scale(1.15);
}

/* Featured image — borda suave, respiro generoso */
.entry-featured-image {
    margin-bottom: clamp(2rem, 4vw, 3rem);
    border-radius: var(--radius-xl, 12px);
    overflow: hidden;
}

.entry-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--foreground, #333);
    margin-bottom: 30px;
}

.entry-content p {
    margin-bottom: 1.5em;
}

.entry-content h2, .entry-content h3 {
    margin-top: 2em;
    margin-bottom: 1em;
}

.post-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.post-tags a {
    background: var(--muted, #f0f0f0);
    padding: 5px 12px;
    border-radius: var(--radius, 3px);
    font-size: 13px;
    color: var(--muted-foreground, #666);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.post-share {
    border-top: 1px solid var(--border, #e4e4e7);
    padding-top: 20px;
}

.post-share .share-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--foreground, #333);
}

.post-share a {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.share-facebook { background: #3b5998; }
.share-twitter { background: #1da1f2; }
.share-whatsapp { background: #25d366; }
.share-linkedin { background: #0077b5; }
.share-telegram { background: #0088cc; }

.author-box {
    display: flex;
    gap: 20px;
    background: var(--muted, #f4f4f5);
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    border-radius: 50%;
}

.author-info .author-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--foreground, #333);
}

.author-info p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.author-link {
    font-weight: 600;
}

.related-posts {
    margin-top: 40px;
}

.related-posts .section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--foreground, #333);
}

@media (max-width: 768px) {
    .single-post {
        padding: 0;
    }

    .entry-header {
        padding: 0 16px;
    }

    .entry-title {
        font-size: 1.5rem;
    }

    .entry-content {
        font-size: 16px;
        padding: 0 16px;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
        margin: 0 16px;
    }

    .related-posts .posts-grid {
        grid-template-columns: 1fr !important;
    }

    .post-tags {
        padding: 0 16px;
    }

    .post-share {
        padding: 16px;
    }

    .post-actions-bar {
        flex-direction: column;
        padding: 12px 16px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .entry-title {
        font-size: 1.3rem;
    }

    .entry-content {
        font-size: 15px;
        line-height: 1.7;
    }

    /* Drop cap menor no phone */
    .entry-content > p:first-of-type::first-letter {
        font-size: 3em;
    }
}

/* ============================================================
   [2.5.1] DROP CAP — Letra capitular no primeiro paragrafo
   Efeito editorial premium. CSS puro, zero performance hit.
   ============================================================ */
.entry-content > p:first-of-type::first-letter {
    float: left;
    font-size: 3.5em;
    font-weight: 700;
    line-height: 0.8;
    margin: 0.05em 0.12em 0 0;
    color: var(--evte-primary, #0056b3);
    font-family: Georgia, 'Times New Roman', serif;
}

/* ============================================================
   [3.2.1] READING PROGRESS BAR
   ============================================================ */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--evte-primary, #0056b3);
    z-index: 9999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ============================================================
   [3.2.2] TABLE OF CONTENTS
   ============================================================ */
/* ============================================================
   TOC — Compacto, numerado, colapsavel
   Override .entry-content styles que o WP/Gutenberg aplica
   ============================================================ */
.entry-content .table-of-contents,
.table-of-contents {
    background: var(--muted, #f4f4f5);
    border: none;
    border-radius: var(--radius, 8px);
    margin-bottom: 24px;
    max-width: 400px;
    overflow: hidden;
}

/* Titulo clicavel */
.toc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground, #18181b);
    margin: 0;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.15s ease;
}

.toc-title:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Seta */
.toc-title::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 1.5px solid var(--muted-foreground, #a1a1aa);
    border-bottom: 1.5px solid var(--muted-foreground, #a1a1aa);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.table-of-contents.open .toc-title::after {
    transform: rotate(-135deg);
}

/* Lista — escondida por padrao, numeracao via PHP */
.entry-content .table-of-contents ul,
.table-of-contents ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    padding-left: 0 !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.entry-content .table-of-contents.open ul,
.table-of-contents.open ul {
    max-height: 800px;
    padding: 0 14px 10px !important;
}

/* Todos os items */
.entry-content .table-of-contents li,
.table-of-contents li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    line-height: inherit !important;
}

.entry-content .table-of-contents li a,
.table-of-contents li a {
    color: var(--foreground, #18181b);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: color 0.15s ease;
}

.table-of-contents li:last-child a {
    border-bottom: none;
}

/* Numero (span gerado pelo PHP) */
.table-of-contents .toc-number {
    color: var(--muted-foreground, #a1a1aa);
    font-size: 12px;
    font-weight: 600;
    min-width: 18px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.table-of-contents li a:hover {
    color: var(--evte-primary, #0056b3);
}

/* H3 items — indentados, sub-numerados */
.table-of-contents .toc-h3 {
    padding-left: 20px !important;
}

.table-of-contents .toc-h3 a {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted-foreground, #71717a);
    border-bottom-color: rgba(0, 0, 0, 0.03);
}

.table-of-contents .toc-h3 .toc-number {
    font-weight: 400;
    min-width: 24px;
}

/* Bloquear AdSense auto ads de injetar dentro do TOC */
.table-of-contents ins.adsbygoogle,
.table-of-contents iframe,
.table-of-contents .adsbygoogle {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

/* ============================================================
   [3.2.4] MENU ANIMATION (mobile)
   ============================================================ */
.header-nav,
.site-navigation {
    transition: transform 0.3s ease, opacity 0.3s ease;
}
@media (max-width: 768px) {
    .header-nav,
    .site-navigation {
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
    }
    .header-nav.active,
    .site-navigation.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
}

/* ============================================================
   [3.2.5] SKELETON LOADING para thumbnails
   ============================================================ */
.post-thumbnail img,
.entry-featured-image img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}
.post-thumbnail img.placeholder-image {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   DARK MODE OVERRIDES — Single Post
   ============================================================ */
.dark .entry-content {
    color: var(--foreground, #fafafa);
}

.dark .entry-content a {
    color: var(--evte-primary, #60a5fa);
}

.dark .entry-content blockquote {
    border-color: var(--border, #27272a);
    color: var(--muted-foreground, #a1a1aa);
    background: var(--muted, #27272a);
}

.dark .post-tags a {
    background: var(--muted, #27272a);
    color: var(--muted-foreground, #a1a1aa);
}

.dark .post-share {
    border-color: var(--border, #27272a);
}

.dark .post-share .share-title {
    color: var(--foreground, #fafafa);
}

.dark .author-box {
    background: var(--card, #18181b);
}

.dark .author-info .author-name {
    color: var(--foreground, #fafafa);
}

.dark .related-posts .section-title {
    color: var(--foreground, #fafafa);
}

/* Drop cap */
.dark .entry-content > p:first-of-type::first-letter {
    color: var(--evte-primary, #60a5fa);
}

/* Post actions bar (AI summarize + share) */
.dark .post-actions-bar {
    background: var(--card, #18181b);
    border-color: var(--border, #27272a);
}

.dark .post-actions-bar a {
    color: var(--muted-foreground, #a1a1aa);
}

.dark .post-actions-bar a:hover {
    color: var(--foreground, #fafafa);
}
