/* ==========================================================================
   1. VARIÁVEIS NATIVAS E CONFIGURAÇÕES BASE
   ========================================================================== */
:root {
    --brand-primary: #002244;
    /* Azul escuro corporativo (Mottanet) */
    --brand-accent: #f7922D;
    /* Azul elétrico / Ciano tech */
    --brand-accent-hover: #f07d09;
    --text-main: #2d3748;
    /* Cinza escuro para excelente leitura */
    --text-muted: #718096;
    /* Cinza médio para metas e datas */
    --bg-light: #f7fafc;
    /* Fundo sutil para seções e blocos */
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Wrapper de segurança para os containers internos do tema */
.archive-blog .container,
.single-post-main .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Elementos globais compartilhados */
.meta-separator,
.blog-card-meta-separator {
    margin: 0 8px;
    color: var(--border-color);
}

/* ==========================================================================
   2. SEÇÃO HERO (COMPARTILHADA / ESTILOS DISTINTOS)
   ========================================================================== */
/* Hero da Listagem (Blog Roll) */
.blog-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #001122 100%);
    color: var(--bg-white);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.blog-hero-lines {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0.05;
    background-image: linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.blog-hero-content {
    max-width: 650px;
    position: relative;
    z-index: 2;
}

.blog-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--brand-accent);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.blog-eyebrow-dot {
    width: 6px;
    height: 6px;
    background-color: var(--brand-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--brand-accent);
}

.blog-hero-h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.blog-accent {
    color: var(--brand-accent);
}

.blog-hero-desc {
    font-size: 18px;
    color: #a0aec0;
    line-height: 1.5;
}

/* Hero do Single Post */
.post-hero {
    padding: 60px 0 40px;
    text-align: center;
}

.post-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.post-category-badge {
    background-color: rgba(0, 34, 68, 0.08);
    color: var(--brand-primary);
    padding: 4px 12px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-hero-title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--brand-primary);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.post-hero-excerpt {
    font-size: 18px;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================================================
   3. BARRA DE FILTROS & BUSCA (LISTAGEM)
   ========================================================================== */
.blog-filters-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.blog-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

.blog-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.blog-filter-group.flex-grow {
    flex-grow: 1;
}

.blog-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.blog-filter-select,
.blog-filter-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 15px;
    transition: var(--transition-smooth);
    outline: none;
}

.blog-filter-search-wrapper {
    position: relative;
    width: 100%;
}

.blog-filter-search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.blog-filter-search-wrapper .blog-filter-input {
    padding-left: 44px;
}

.blog-filter-select:focus,
.blog-filter-input:focus {
    border-color: var(--brand-accent);
    background-color: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.blog-filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
}

.blog-filter-btn {
    height: 48px;
    padding: 0 24px;
    background-color: var(--brand-primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.blog-filter-btn:hover {
    background-color: var(--brand-accent);
    color: var(--brand-primary);
}

.blog-filter-clear {
    color: #e53e3e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.blog-filter-clear:hover {
    background-color: #fff5f5;
}

.blog-filter-result {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ==========================================================================
   4. GRID DE POSTS E ECOSSISTEMA DE CARDS (LISTAGEM)
   ========================================================================== */
.blog-loop {
    background-color: var(--bg-light);
    padding: 60px 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.blog-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 212, 255, 0.3);
}

.blog-card-img-wrapper {
    position: relative;
    padding-top: 56.25%;
    /* Ratio 16:9 */
    overflow: hidden;
    background-color: var(--brand-primary);
}

.blog-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.blog-card:hover .blog-card-img img {
    transform: scale(1.05);
}

.blog-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-img-placeholder svg {
    width: 48px;
    height: 48px;
}

.blog-card-cat {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 34, 68, 0.85);
    backdrop-filter: blur(4px);
    color: var(--brand-accent);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.blog-card-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.blog-card-title a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.blog-card-title a:hover {
    color: var(--brand-accent-hover);
}

.blog-card-excerpt {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.blog-card-more svg {
    width: 16px;
    height: 16px;
    transition: var(--transition-smooth);
}

.blog-card:hover .blog-card-more {
    color: var(--brand-accent-hover);
}

.blog-card:hover .blog-card-more svg {
    transform: translateX(4px);
}

/* Destaque (Featured Card) */
@media (min-width: 992px) {
    .blog-card--featured {
        grid-column: span 3;
        flex-direction: row;
    }

    .blog-card--featured .blog-card-img-wrapper {
        width: 55%;
        padding-top: 0;
        min-height: 380px;
    }

    .blog-card--featured .blog-card-body {
        width: 45%;
        padding: 40px;
        justify-content: center;
    }

    .blog-card--featured .blog-card-title {
        font-size: 28px;
    }
}

/* Paginação Nativa WP */
.blog-pagination {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}

.blog-pagination ul {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 6px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.blog-pagination a:hover {
    border-color: var(--brand-accent);
    color: var(--brand-accent-hover);
}

.blog-pagination span.current {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--bg-white);
}

/* Feedback de Busca Sem Resultados */
.blog-no-results {
    text-align: center;
    padding: 60px 20px;
    max-width: 450px;
    margin: 0 auto;
}

.blog-no-results svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.blog-no-results h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.blog-no-results p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.blog-btn-primary {
    display: inline-flex;
    align-items: center;
    height: 48px;
    padding: 0 24px;
    background-color: var(--brand-primary);
    color: var(--bg-white);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.blog-btn-primary:hover {
    background-color: var(--brand-accent);
    color: var(--brand-primary);
}

/* ==========================================================================
   5. SINGLE POST INTERNA (CONFORTO TIPOGRÁFICO)
   ========================================================================== */
.single-post-main {
    background-color: var(--bg-white);
    color: var(--text-main);
    padding-bottom: 80px;
}

.post-thumb-container {
    margin-bottom: 48px;
}

.post-featured-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.post-content-col {
    max-width: 720px;
    /* Largura ideal para conforto de leitura (escanabilidade) */
}

/* Customização dos elementos vindos do editor (Gutenberg/TinyMCE) */
.entry-content {
    font-size: 17px;
    line-height: 1.8;
    color: #333f51;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: var(--brand-primary);
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.entry-content h2 {
    font-size: 28px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.entry-content h3 {
    font-size: 22px;
}

.entry-content p {
    margin-bottom: 24px;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.entry-content li {
    margin-bottom: 8px;
}

.entry-content blockquote {
    margin: 32px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--brand-accent);
    background-color: var(--bg-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    font-size: 18px;
    color: var(--text-main);
}

.entry-content .wp-block-image,
.entry-content figure {
    margin: 32px 0;
}

.entry-content .wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.entry-content figcaption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* Tags de Saída */
.post-footer-tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.post-tags a {
    display: inline-block;
    background: #edf2f7;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    margin: 0 4px 8px 0;
    transition: var(--transition-smooth);
}

.post-tags a:hover {
    background: var(--brand-primary);
    color: var(--bg-white);
}

/* ==========================================================================
   6. SIDEBAR LATERAL STICKY (SINGLE POST)
   ========================================================================== */
.post-sidebar-col {
    margin-left: 40px;
}

.post-sidebar-sticky {
    position: sticky;
    top: 100px;
    /* Previne que suma sob o cabeçalho fixo do tema */
}

/* Bloco de Conversão Mottanet */
.sidebar-cta-box {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #001122 100%);
    color: var(--bg-white);
    padding: 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}

.sidebar-cta-box h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--brand-accent);
}

.sidebar-cta-box p {
    font-size: 14px;
    color: #cbd5e0;
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-sidebar-cta {
    display: block;
    text-align: center;
    background-color: var(--brand-accent);
    color: var(--brand-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn-sidebar-cta:hover {
    background-color: var(--bg-white);
    color: var(--brand-primary);
    transform: translateY(-2px);
}

/* Widgets Internos de Posts Recentes */
.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-primary);
}

.sidebar-post-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-post-item:last-child {
    border-bottom: none;
}

.sidebar-post-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 4px;
}

.sidebar-post-title:hover {
    color: var(--brand-accent-hover);
}

.sidebar-post-item time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   7. MEDIA QUERIES (RESPONSIVIDADE COMPLETA)
   ========================================================================== */
@media (max-width: 991px) {

    /* Listagem */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    /* Single */
    .post-hero-title {
        font-size: 32px;
    }

    .post-sidebar-col {
        margin-left: 0;
        margin-top: 48px;
    }

    .post-sidebar-sticky {
        position: static;
    }
}

@media (max-width: 767px) {

    /* Listagem */
    .blog-hero {
        padding: 60px 0;
    }

    .blog-hero-h1 {
        font-size: 32px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-filter-group,
    .blog-filter-actions {
        width: 100%;
    }

    .blog-filter-btn {
        flex-grow: 1;
    }
}

@media (max-width: 575px) {

    /* Single */
    .post-hero {
        padding: 40px 0 20px;
    }

    .post-hero-title {
        font-size: 26px;
    }

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