/* BLOG — Shared Stylesheet — Complementa style.css */

/* --- Blog Hero --- */
.blog-hero {
    padding: 130px 0 60px;
    background: var(--bg-darker);
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
    text-align: center;
    position: relative;
}
.blog-hero.has-image {
    border-bottom: none;
}
.blog-hero.has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8,18,32,0.72) 0%, rgba(8,18,32,0.55) 100%);
}
.blog-hero.has-image > * { position: relative; z-index: 1; }
.blog-hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; color: #fff; margin-bottom: 0.8rem; text-shadow: 0 2px 20px rgba(0,0,0,0.85), 0 1px 6px rgba(0,0,0,0.6); }
.blog-hero h1 span { color: var(--accent); }
.blog-hero .lead { color: rgba(255,255,255,0.88); max-width: 560px; margin: 0 auto; text-shadow: 0 1px 8px rgba(0,0,0,0.7); }

/* --- Article Hero --- */
.article-hero {
    padding: 130px 0 50px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    position: relative;
}
.article-hero.has-image > * { position: relative; z-index: 1; }
.article-hero .breadcrumb { background: none; padding: 0; margin-bottom: 1rem; font-size: 0.85rem; }
.article-hero .breadcrumb a { color: var(--gray-mid); text-decoration: none; }
.article-hero .breadcrumb a:hover { color: var(--accent); }
.article-hero .breadcrumb-sep { margin: 0 0.4rem; color: var(--gray-mid); opacity: 0.5; }
.article-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; color: #fff; line-height: 1.25; margin-bottom: 1rem; text-shadow: 0 2px 20px rgba(0,0,0,0.85), 0 1px 6px rgba(0,0,0,0.6); }
.article-hero h1 span { color: var(--accent); }
.article-hero .breadcrumb, .article-hero .article-meta { text-shadow: 0 1px 6px rgba(0,0,0,0.8); }

/* Category badge */
.category-badge {
    display: inline-block;
    background: rgba(26,184,200,0.12);
    color: var(--accent);
    border: 1px solid rgba(26,184,200,0.3);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}
.category-badge.pais { background: rgba(100,200,120,0.12); color: #64c878; border-color: rgba(100,200,120,0.3); }
.category-badge.curso { background: rgba(200,160,80,0.12); color: #c8a050; border-color: rgba(200,160,80,0.3); }
.category-badge.dica { background: rgba(160,100,220,0.12); color: #a064dc; border-color: rgba(160,100,220,0.3); }

/* Article meta (date, read time) */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--gray-mid);
    font-size: 0.88rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}
.article-meta i { margin-right: 0.35rem; color: var(--accent); }

/* --- Article Body --- */
.article-body { padding: 4rem 0 5rem; }

.article-content {
    color: rgba(255,255,255,0.82);
    line-height: 1.85;
    font-size: 1rem;
}
.article-content .lead {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.75;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.article-content h2 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 2.8rem 0 1rem;
    padding-left: 0.8rem;
    border-left: 3px solid var(--accent);
}
.article-content h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2rem 0 0.7rem;
}
.article-content p { margin-bottom: 1.2rem; }
.article-content ul, .article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}
.article-content li { margin-bottom: 0.5rem; }
.article-content strong { color: #fff; }
.article-content a { color: var(--accent); text-decoration: none; }
.article-content a:hover { text-decoration: underline; }

/* Highlight / info box */
.highlight-box {
    background: rgba(26,184,200,0.07);
    border: 1px solid rgba(26,184,200,0.22);
    border-left: 4px solid var(--accent);
    border-radius: 0 10px 10px 0;
    padding: 1.2rem 1.5rem;
    margin: 1.8rem 0;
}
.highlight-box p:last-child { margin-bottom: 0; }
.highlight-box strong { color: var(--accent); }

/* Warning box */
.warning-box {
    background: rgba(255,180,50,0.07);
    border: 1px solid rgba(255,180,50,0.22);
    border-left: 4px solid #ffb432;
    border-radius: 0 10px 10px 0;
    padding: 1.2rem 1.5rem;
    margin: 1.8rem 0;
}
.warning-box p:last-child { margin-bottom: 0; }

/* Stats grid inside article */
.article-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin: 1.8rem 0;
}
.article-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}
.article-stat .num { font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.article-stat .label { font-size: 0.78rem; color: var(--gray-mid); margin-top: 0.2rem; }

/* Comparison table */
.compare-table-scroll {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
    border-radius: 8px;
}
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9rem;
}
.compare-table th {
    background: var(--bg-card);
    color: #fff;
    font-weight: 700;
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}
.compare-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: rgba(255,255,255,0.8);
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: rgba(255,255,255,0.02); }
.compare-table .highlight-td { color: var(--accent); font-weight: 700; }

/* CTA box inside article */
.article-cta-box {
    background: linear-gradient(135deg, rgba(26,184,200,0.1), rgba(10,22,40,0.8));
    border: 1px solid rgba(26,184,200,0.25);
    border-radius: 14px;
    padding: 2rem;
    text-align: center;
    margin: 2.5rem 0;
}
.article-cta-box h3 { color: #fff; font-size: 1.2rem; margin-bottom: 0.6rem; }
.article-cta-box p { color: var(--gray-mid); margin-bottom: 1.2rem; font-size: 0.95rem; }

/* --- Sidebar --- */
.blog-sidebar { position: sticky; top: 90px; }
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.4rem;
    margin-bottom: 1.5rem;
}
.sidebar-widget h4 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

/* TOC */
.toc-list { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    counter-increment: toc;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.toc-list li:last-child { border-bottom: none; }
.toc-list li::before {
    content: counter(toc, decimal-leading-zero);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.toc-list a {
    color: var(--gray-mid);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: color 0.2s;
}
.toc-list a:hover { color: var(--accent); }

/* Related articles list */
.related-list { list-style: none; padding: 0; margin: 0; }
.related-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.related-list li:last-child { border-bottom: none; }
.related-list a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    transition: color 0.2s;
}
.related-list a i { color: var(--accent); flex-shrink: 0; margin-top: 2px; font-size: 0.8rem; }
.related-list a:hover { color: var(--accent); }

/* Sidebar CTA */
.sidebar-cta-widget {
    background: linear-gradient(135deg, rgba(26,184,200,0.12), rgba(10,22,40,0.8));
    border: 1px solid rgba(26,184,200,0.25);
    border-radius: 12px;
    padding: 1.4rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.sidebar-cta-widget p { color: var(--gray-mid); font-size: 0.88rem; margin-bottom: 1rem; }

/* --- Blog Cards (index) --- */
.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.blog-card:hover {
    border-color: rgba(26,184,200,0.35);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.blog-card-img-wrap {
    height: 180px;
    overflow: hidden;
    position: relative;
}
.blog-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.blog-card:hover .blog-card-img-wrap img { transform: scale(1.04); }
.blog-card-img-placeholder {
    height: 180px;
    background: linear-gradient(135deg, var(--bg-darker) 0%, rgba(26,184,200,0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.6;
}
.blog-card-body {
    padding: 1.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.blog-card-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.blog-card-category.pais { color: #64c878; }
.blog-card-category.curso { color: #c8a050; }
.blog-card-category.dica { color: #a064dc; }
.blog-card-title {
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.7rem;
}
.blog-card-excerpt {
    color: var(--gray-mid);
    font-size: 0.85rem;
    line-height: 1.6;
    flex: 1;
}
.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--gray-mid);
}
.blog-card-footer .read-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.82rem;
}

/* --- Filter tabs --- */
.blog-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}
.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 18px;
    color: var(--gray-mid);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Article tags */
.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ---- Responsiveness ---- */

/* Mobile: table cells wrap text but col headers need min-width */
@media (max-width: 767px) {
    .compare-table th,
    .compare-table td {
        padding: 0.6rem 0.7rem;
        font-size: 0.83rem;
    }
    /* Sidebar stacks below content on mobile */
    .blog-sidebar {
        position: static;
    }
}
.article-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    color: var(--gray-mid);
    text-decoration: none;
    transition: all 0.2s;
}
.article-tag:hover { border-color: var(--accent); color: var(--accent); }
