/* ============================================================
   BLOG v2 — listagem no layout "insights" (cabeçalho em duas colunas,
   grade 1/2/3 colunas, cards sem borda com capa 4:3, tag, título,
   resumo e rodapé de autor) sobre o tema escuro do site.
   Carregar depois de blog.css + theme-dark.css. Escopo: body.blog.has-hero-video.
   ============================================================ */

/* Header em pílula também na 404 (sem hero) */
body.blog.has-hero-video:not(.has-hero) #mainHeader {
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
}

body.blog.has-hero-video .blog-main {
    background: var(--bg-primary);
}

/* ---------- Hero do blog: mesmo hero do service.html, só que mais baixo ---------- */
.has-hero-video .blog-hero.hero-video {
    min-height: 0;
    padding: 148px clamp(20px, 5vw, 80px) 64px;
}

.has-hero-video .blog-hero .hv-subtitle {
    margin-bottom: 0;
}

.has-hero-video .blog-post-hero.hero-video {
    padding: 168px clamp(20px, 5vw, 80px) 72px;
}

.has-hero-video .blog-post-hero .hv-title {
    font-size: clamp(1.9rem, 4.2vw, 3.2rem);
    max-width: 22ch;
    margin-bottom: 0;
}

.has-hero-video .blog-post-hero .blog-breadcrumb {
    margin-bottom: 26px;
}

.has-hero-video .blog-post-hero .blog-post-meta {
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 16px;
}

.has-hero-video .blog-post-hero .blog-tags {
    justify-content: center;
    margin-top: 22px;
}

.has-hero-video .blog-back {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: none;
}

.has-hero-video .blog-back:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
    box-shadow: none;
}

.has-hero-video .blog-tag {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border);
}

/* ---------- Animação de entrada (escalonada via JS) ---------- */
.animate-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-item.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .animate-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- Cabeçalho da listagem (título à esquerda, texto + botão à direita) ---------- */
.blog-insights {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
}

.blog-insights-title {
    font-family: var(--font-display);
    font-size: 36px;
    letter-spacing: -0.02em;
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
    max-width: 32rem;
    margin: 0;
}

.blog-insights-title em {
    font-family: var(--hv-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.08em;
    letter-spacing: -0.01em;
    padding-right: 0.04em;
}

.blog-insights-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
}

.blog-insights-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 22px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    background: var(--hv-gradient);
    background-size: 200% 200%;
    animation: hv-gradient-shift 4s ease-in-out infinite;
    box-shadow: 0 8px 28px rgba(147, 51, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s;
}

.blog-insights-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(147, 51, 234, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

@media (min-width: 768px) {
    .blog-insights {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }

    .blog-insights-aside {
        align-items: flex-end;
        text-align: right;
    }
}

/* ---------- Toolbar (grade/lista) ---------- */
.has-hero-video .blog-toolbar {
    margin-bottom: 24px;
}

.has-hero-video .blog-view-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.has-hero-video .view-btn {
    color: var(--text-muted);
}

.has-hero-video .view-btn:hover {
    color: #ffffff;
}

.has-hero-video .view-btn.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fdba74;
    box-shadow: none;
}

/* ---------- Grade e cards ---------- */
.has-hero-video .blog-grid {
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 768px) {
    .has-hero-video .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .has-hero-video .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.has-hero-video .blog-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.has-hero-video .blog-card:hover {
    transform: none;
    box-shadow: none;
}

.has-hero-video .blog-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.has-hero-video .blog-card-cover {
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.blog-card-cover--placeholder {
    display: flex;
    align-items: flex-end;
    padding: 20px;
    background:
        radial-gradient(70% 60% at 20% 10%, rgba(249, 115, 22, 0.35), transparent 65%),
        radial-gradient(70% 70% at 90% 90%, rgba(147, 51, 234, 0.4), transparent 65%),
        #10152a;
}

.blog-card-cover--placeholder span {
    font-family: var(--hv-serif);
    font-style: italic;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: -0.01em;
}

.has-hero-video .blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.has-hero-video .blog-card:hover .blog-card-cover img {
    transform: scale(1.05);
}

.has-hero-video .blog-card-body {
    padding: 0;
    gap: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-tagwrap {
    margin-bottom: 16px;
}

.blog-card-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
}

.has-hero-video .blog-card-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.375;
    color: #ffffff;
    margin-bottom: 12px;
    transition: color 0.3s;
}

.has-hero-video .blog-card:hover .blog-card-title {
    color: #fdba74;
}

.has-hero-video .blog-card-excerpt {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.625;
    color: var(--text-secondary);
    margin-bottom: 24px;
    flex: 1;
}

.blog-card-author {
    display: flex;
    align-items: center;
    margin-top: auto;
}

.blog-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(140deg, #f97316, #9333ea);
    box-shadow: 0 4px 14px rgba(147, 51, 234, 0.35);
    object-fit: cover;
}

.blog-card-author-name {
    display: block;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
}

.blog-card-date {
    display: block;
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Visão lista */
.has-hero-video .is-list-view .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
}

.has-hero-video .is-list-view .blog-card-link {
    flex-direction: row;
    gap: 24px;
}

.has-hero-video .is-list-view .blog-card-cover {
    width: 240px;
    min-height: 160px;
    aspect-ratio: 4 / 3;
    margin-bottom: 0;
    flex-shrink: 0;
}

.has-hero-video .is-list-view .blog-card-body {
    padding: 4px 0;
}

@media (max-width: 600px) {
    .has-hero-video .is-list-view .blog-card-link {
        flex-direction: column;
        gap: 0;
    }

    .has-hero-video .is-list-view .blog-card-cover {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* ---------- Paginação e vazio ---------- */
.has-hero-video .blog-pager-btn {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.has-hero-video .blog-pager-btn:hover {
    background: rgba(249, 115, 22, 0.14);
    border-color: rgba(249, 115, 22, 0.5);
    color: #fdba74;
}

.has-hero-video .blog-empty {
    color: var(--text-secondary);
}

/* ---------- Post ---------- */
.has-hero-video .blog-post-cover {
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.has-hero-video .blog-post-body strong {
    color: #ffffff;
}

.has-hero-video .blog-post-body code {
    background: rgba(255, 255, 255, 0.08);
}

.has-hero-video .blog-post-body pre {
    border: 1px solid var(--border);
}

.has-hero-video .blog-post-body blockquote {
    border-left-color: #fb923c;
}

.has-hero-video .blog-post-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.has-hero-video .blog-post-body th,
.has-hero-video .blog-post-body td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.has-hero-video .blog-post-body th {
    color: #ffffff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
}

.has-hero-video .blog-post-body td {
    color: var(--text-secondary);
}

.has-hero-video .blog-bottom-nav {
    border-top-color: var(--border);
}

.has-hero-video .blog-back--solid {
    color: #ffffff;
}

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
    .has-hero-video .blog-hero.hero-video {
        padding: 112px 20px 48px;
    }

    .has-hero-video .blog-post-hero.hero-video {
        padding: 120px 20px 56px;
    }

    .blog-insights {
        margin-bottom: 36px;
    }
}
