/*
Theme Name: Portal Vistoria Premium
Theme URI: https://vistoriafacil.ai
Description: Tema premium estilo portal, ultra rápido e otimizado para SEO, seguindo a identidade Vistoria Fácil.
Author: Vistoria Fácil
Version: 3.8.0
Text Domain: portal-vistoria
*/

:root {
    --color-primary: #3b94d9;
    --color-primary-rgb: 59, 148, 217;
    --color-navy: #1e5785;
    --color-accent: #F39C12;
    --color-dark: #1A1F2B;
    --color-bg-body: #F9FAFB;
    --color-bg-card: #FFFFFF;
    --color-text-main: #1F2937;
    --color-text-muted: #6B7280;
    --color-border: #E5E7EB;

    --container-width: 1200px;
    --header-height: 90px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. RESET & BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--color-text-main);
    background: var(--color-bg-body);
    padding-top: 120px;
    /* Ajustado para o navbar fixo do site principal */
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--color-dark);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Force container padding on blog pages */
.site-main .container,
.site-main .main-layout {
    padding-left: 24px !important;
    padding-right: 24px !important;
}

.site-main .main-layout.container {
    max-width: var(--container-width);
    margin: 0 auto;
}

/* 2. HEADER OVERRIDES (FOR UNIFIED NAVBAR) */
.navbar-landing .btn-login {
    color: var(--color-primary) !important;
    border: 2px solid var(--color-primary) !important;
}

.navbar-landing .btn-register {
    background: var(--color-primary) !important;
    color: white !important;
}

.navbar-landing .nav-link {
    color: #555 !important;
    font-weight: 500 !important;
}

.navbar-landing .nav-link.active {
    color: var(--color-primary) !important;
}

/* 3. LAYOUT GRID (UNIVERSAL) */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    /* align-items: start; REMOVIDO PARA PERMITIR STICKY */
    padding: 20px 0 80px;
}

.breadcrumb-premium {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: #64748B;
    font-family: 'Inter', sans-serif;
}

.breadcrumb-premium a {
    color: #64748B;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-premium a:hover {
    color: var(--color-primary);
}

.breadcrumb-premium i {
    font-size: 0.75rem;
    opacity: 0.5;
}

.breadcrumb-premium span {
    color: var(--color-navy);
    font-weight: 600;
}

.content-primary {
    min-width: 0;
    /* Prevents grid blowout */
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* 4. HOME PAGE ELEMENTS */
.blog-intro-section {
    padding: 60px 0 40px;
    text-align: center;
    background: transparent;
    /* UNIFIED BACKGROUND */
    margin-bottom: 40px;
    border-bottom: none;
    /* REMOVED BORDER */
}

.blog-label {
    color: var(--color-primary);
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: block;
}

.blog-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin: 0 0 15px;
    color: var(--color-dark);
}

.blog-subtitle {
    max-width: 600px;
    margin: 0 auto 30px;
    color: var(--color-text-muted);
    font-size: 1.15rem;
}

.blog-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    background: #FFFFFF;
    cursor: pointer;
}

/* Made tags white bg to pop on gray */
.filter-tag.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Hero Highlight */
.hero-highlight-card {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 80px;
    width: 100%;
}

.highlight-image {
    flex: 0 0 55%;
    /* Stable width */
    max-width: 55%;
    border-radius: 20px;
    overflow: hidden;
    border: 6px solid var(--color-primary);
    box-shadow: 0 15px 40px rgba(59, 148, 217, 0.2);
    min-height: 380px;
    background: #f1f5f9;
    position: relative;
}

.highlight-image a {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 380px;
}

.highlight-image img {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
}

.highlight-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 20px;
    min-width: 0;
}

.destaque-label {
    color: var(--color-primary);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.highlight-title {
    font-size: 2.25rem;
    color: var(--color-navy);
    line-height: 1.2;
    word-wrap: break-word;
}

.highlight-excerpt {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.continue-reading {
    color: var(--color-navy);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    cursor: pointer;
}

/* === FALLBACK IMAGE STYLE === */
.post-thumb-fallback {
    width: 100%;
    height: 100%;
    min-height: inherit;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 3rem;
}

.post-thumb-fallback i {
    opacity: 0.5;
}

/* 2-Column Grid */
.recent-posts-header {
    margin-bottom: 30px;
}

.posts-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.grid-post-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.grid-post-thumb {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 4px solid var(--color-primary);
    box-shadow: 0 10px 30px rgba(59, 148, 217, 0.1);
    background: #f1f5f9;
    position: relative;
    height: 260px;
}

.grid-post-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.grid-post-thumb img {
    width: 100%;
    height: 260px;
    object-fit: cover;
}

.grid-cat-label {
    font-weight: 800;
    font-size: 12px;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grid-post-title {
    font-size: 1.4rem;
    color: var(--color-navy);
    line-height: 1.35;
    font-weight: 700;
}

/* 5. ARTICLE PAGE ELEMENTS */
.article-column {
    width: 100%;
}

.article-container-card {
    background: white;
    padding: clamp(32px, 8vw, 64px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    margin-bottom: 40px;
}

.post-cat-tag {
    background: rgba(59, 148, 217, 0.1);
    color: var(--color-primary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.article-title {
    margin: 16px 0;
    color: var(--color-navy);
}

.article-meta {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 32px;
}

.post-content {
    color: #1F2937;
    font-size: 1.15rem;
    line-height: 1.85;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content h2 {
    margin: 48px 0 20px;
    font-size: 2rem;
    color: var(--color-navy);
}

.post-content h3 {
    margin: 32px 0 16px;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.post-content ul,
.post-content ol {
    margin-bottom: 30px;
    padding-left: 20px;
}

.post-content li {
    margin-bottom: 12px;
}

.post-content strong {
    color: var(--color-navy);
    font-weight: 700;
}

/* WP Block Button Styles */
.wp-block-button__link {
    background: var(--color-primary);
    color: white !important;
    padding: 16px 32px;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    display: inline-block;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

.wp-block-button__link:hover {
    background: var(--color-navy);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 87, 133, 0.3);
}

.post-content p {
    margin-bottom: 28px;
}

/* Author Box */
.author-section-premium {
    margin-top: 64px;
    padding: 40px;
    background: #F8FAFC;
    border-radius: 20px;
    display: flex;
    gap: 32px;
    align-items: center;
    border: 1px solid var(--color-border);
}

.author-avatar-wrap {
    flex-shrink: 0;
}

.author-avatar-wrap img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    color: var(--color-navy);
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.author-bio {
    font-size: 1rem;
    color: #64748B;
}

/* 6. SIDEBAR & WIDGETS */
.sidebar,
.sidebar-wrapper {
    display: block;
    flex: 0 0 340px;
}

.sidebar-sticky {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 48px;
    /* Ajustado para melhor visibilidade com o novo navbar */
    align-self: start;
}

.widget {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow-soft);
}

.widget-title {
    margin-bottom: 24px;
    font-size: 1.15rem;
    color: var(--color-navy);
    border-left: 4px solid var(--color-primary);
    padding-left: 12px;
}

.sidebar-post,
.popular-item-mini {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-post:last-child {
    margin-bottom: 0;
}

.sidebar-post-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #EEE;
}

.sidebar-post-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-dark);
    line-height: 1.4;
}

.widget-promo-vertical img {
    border-radius: 12px;
}

.widget-promo-cta {
    background: var(--color-navy);
    color: white;
    text-align: center;
}

.btn-white-cta {
    background: white !important;
    color: var(--color-navy) !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 800;
    display: inline-block;
}

/* 7. FOOTER */
.site-footer {
    background: var(--color-dark);
    color: #94A3B8;
    padding: 80px 0 40px;
    font-size: 15px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 64px;
    margin-bottom: 64px;
}

.footer-widget h3 {
    color: white !important;
    margin-bottom: 28px;
    font-size: 1.2rem;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget li {
    margin-bottom: 15px;
}

.footer-bottom {
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

/* 8. RESPONSIVE UPDATED */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .hero-highlight-card {
        flex-direction: column;
    }

    .highlight-image {
        flex: 0 0 100%;
        max-width: 100%;
        min-height: 300px;
    }

    .highlight-image a,
    .highlight-image img {
        height: auto;
        min-height: 300px;
    }

    .posts-grid-2col {
        grid-template-columns: 1fr;
    }

    .sidebar-wrapper,
    .sidebar {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }
}

@media (max-width: 600px) {
    .article-container-card {
        padding: 16px;
        margin: 0 -8px;
        border-radius: 12px;
    }

    .author-section-premium {
        flex-direction: column;
        text-align: center;
    }

    .site-logo img {
        height: 45px;
    }

    .blog-title {
        font-size: 2rem;
    }

    /* FIX: Reduce top padding on mobile */
    .blog-intro-section {
        padding: 30px 0 20px;
        margin-bottom: 20px;
    }

    /* FIX: Breadcrumb title truncation */
    .breadcrumb-premium {
        flex-wrap: nowrap;
        gap: 8px;
        font-size: 0.8rem;
    }

    .breadcrumb-premium span {
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* FIX: Reduce container padding on article content */
    .site-main .container {
        padding-top: 10px !important;
    }

    .article-page-container {
        padding-top: 10px !important;
    }

    .main-layout {
        padding: 0 !important;
        gap: 12px;
        margin: 0 !important;
        /* Reset margin to use full width */
    }

    /* FIX: Remove white card on mobile - content goes edge to edge */
    .article-container-card {
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 0 16px !important;
        /* Add padding here so text isn't stuck to edge */
        margin: 0 !important;
    }

    /* FIX: Article content uses full width */
    .article-column {
        width: 100%;
        padding: 0 !important;
    }

    .post-content {
        padding: 0;
        font-size: 1.05rem;
        line-height: 1.7;
    }

    /* FIX: Article header spacing */
    .article-header {
        margin-bottom: 16px !important;
        padding: 0;
    }

    .article-title {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
    }

    .article-featured-wrapper {
        margin-left: -16px;
        /* Offset parent article-container-card padding */
        margin-right: -16px;
        margin-bottom: 20px !important;
        width: calc(100% + 32px);
    }

    .article-featured-wrapper img {
        width: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
    }

    /* FIX: Breadcrumb closer to header */
    .breadcrumb-premium {
        margin-bottom: 15px;
        padding: 0 16px;
    }

    /* FIX: Reduce gap between sections */
    .recent-posts-header {
        margin-bottom: 16px;
        padding: 0 16px;
    }

    .section-title {
        font-size: 1.4rem;
    }

    /* FIX: Hero highlight card spacing */
    .hero-highlight-card {
        margin-bottom: 20px;
    }

    .highlight-body {
        padding: 20px;
    }

    /* FIX: Post category tag */
    .post-cat-tag {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    /* FIX: Author section */
    .author-section-premium {
        margin-top: 24px;
        padding: 16px 4px;
    }

    /* HIDE RankMath Stats bar for admins on mobile as it breaks fixed layout */
    #rank-math-analytics-stats-bar,
    #rank-math-analytics-stats-bar-wrapper {
        display: none !important;
    }
}

/* GLOBAL PREVENT HORIZONTAL SCROLL */
html,
body {
    width: 100%;
    position: relative;
}