/* ========================================
   BLOG ARCHIVE STYLES - ActiveCampaign Inspired
   RevBridge AI Branding
   ======================================== */

/* CSS Variables - Same as revbridge-connect */
.landing-page.revbridge-connect.archive-page,
.archive-page.landing-page.revbridge-connect {
    /* Cores herdadas do tema */
    --red-primary: var(--primary-color, #e81111);
    --red-dark: var(--primary-color-dark, #cc2d14);
    --green: var(--success-color, #10b981);
}

/* Body background - Same as revbridge-connect */
body.archive-page.revbridge-connect,
body.landing-page.revbridge-connect.archive-page {
    background: hsl(24, 43%, 98%);
}

/* Base Styles */
.archive-page {
    background: hsl(24, 43%, 98%);
}

/* Blog Hero Section */
.landing-page.revbridge-connect .blog-hero,
.archive-page.revbridge-connect .blog-hero,
.blog-hero {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Ensure all text in hero is white - override any global styles */
.landing-page.revbridge-connect .blog-hero,
.archive-page.revbridge-connect .blog-hero {
    color: #ffffff !important;
}

/* Force white text on all blog hero elements */
.landing-page.revbridge-connect .blog-hero *,
.landing-page.revbridge-connect .blog-hero h1,
.landing-page.revbridge-connect .blog-hero h2,
.landing-page.revbridge-connect .blog-hero h3,
.landing-page.revbridge-connect .blog-hero h4,
.landing-page.revbridge-connect .blog-hero h5,
.landing-page.revbridge-connect .blog-hero h6,
.landing-page.revbridge-connect .blog-hero p,
.landing-page.revbridge-connect .blog-hero span,
.landing-page.revbridge-connect .blog-hero div,
.landing-page.revbridge-connect .blog-hero a,
.archive-page.revbridge-connect .blog-hero *,
.archive-page.revbridge-connect .blog-hero h1,
.archive-page.revbridge-connect .blog-hero h2,
.archive-page.revbridge-connect .blog-hero h3,
.archive-page.revbridge-connect .blog-hero h4,
.archive-page.revbridge-connect .blog-hero h5,
.archive-page.revbridge-connect .blog-hero h6,
.archive-page.revbridge-connect .blog-hero p,
.archive-page.revbridge-connect .blog-hero span,
.archive-page.revbridge-connect .blog-hero div,
.archive-page.revbridge-connect .blog-hero a,
.blog-hero *,
.blog-hero h1,
.blog-hero h2,
.blog-hero h3,
.blog-hero h4,
.blog-hero h5,
.blog-hero h6,
.blog-hero p,
.blog-hero span,
.blog-hero div,
.blog-hero a {
    color: #ffffff !important;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.09) 0%, transparent 50%);
    pointer-events: none;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.landing-page.revbridge-connect .blog-hero-title,
.archive-page.revbridge-connect .blog-hero-title,
.landing-page.revbridge-connect h1.blog-hero-title,
.archive-page.revbridge-connect h1.blog-hero-title,
.landing-page.revbridge-connect .blog-hero h1,
.archive-page.revbridge-connect .blog-hero h1,
.landing-page.revbridge-connect .blog-hero .blog-hero-title,
.archive-page.revbridge-connect .blog-hero .blog-hero-title,
.blog-hero-title,
h1.blog-hero-title,
.blog-hero h1,
.blog-hero .blog-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff !important;
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
}

.landing-page.revbridge-connect .blog-hero-description,
.archive-page.revbridge-connect .blog-hero-description,
.landing-page.revbridge-connect .blog-hero-content p,
.archive-page.revbridge-connect .blog-hero-content p,
.landing-page.revbridge-connect .blog-hero p,
.archive-page.revbridge-connect .blog-hero p,
.landing-page.revbridge-connect p.blog-hero-description,
.archive-page.revbridge-connect p.blog-hero-description,
.landing-page.revbridge-connect .blog-hero .blog-hero-description,
.archive-page.revbridge-connect .blog-hero .blog-hero-description,
.blog-hero-description,
.blog-hero-content p,
.blog-hero p,
p.blog-hero-description,
.blog-hero .blog-hero-description {
    font-size: 1.25rem;
    color: #ffffff !important;
    opacity: 0.95 !important;
    margin: 0;
    line-height: 1.6;
}

/* Blog Content Wrapper */
.blog-content-wrapper {
    padding: 3rem 0 4rem;
    background: hsl(24, 43%, 98%);
}

/* Blog Layout */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: start;
}

/* Main Content */
.blog-main {
    min-width: 0; /* Prevents grid blowout */
}

/* Category Filter Pills */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    background: transparent;
    color: #6b7280;
    text-decoration: none;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
    background: rgba(232, 17, 17, 0.05);
}

.filter-pill.active,
a.filter-pill.active,
.landing-page.revbridge-connect .filter-pill.active,
.archive-page.revbridge-connect .filter-pill.active,
.landing-page.revbridge-connect a.filter-pill.active,
.archive-page.revbridge-connect a.filter-pill.active {
    background: var(--red-primary) !important;
    color: var(--white, #ffffff) !important;
    border-color: var(--red-primary) !important;
}

/* Force white text on active filter pills - override any global styles */
.landing-page.revbridge-connect .filter-pill.active *,
.archive-page.revbridge-connect .filter-pill.active *,
.landing-page.revbridge-connect a.filter-pill.active *,
.archive-page.revbridge-connect a.filter-pill.active * {
    color: var(--white, #ffffff) !important;
}

/* Featured Post */
.featured-post {
    background: #ffffff;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 24px 64px -32px rgba(27, 31, 45, 0.25);
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
}

.featured-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 80px -32px rgba(27, 31, 45, 0.3);
}

.featured-post-image {
    display: block;
    overflow: hidden;
    height: 100%;
    min-height: 400px;
}

.featured-post-image .featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-post:hover .featured-post-image .featured-img {
    transform: scale(1.05);
}

.featured-post-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 1rem 0 1.25rem 0;
}

.featured-post-title a {
    color: var(--gray-900, #1f2937);
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-post-title a:hover {
    color: var(--red-primary);
}

.featured-post-excerpt {
    font-size: 1.05rem;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Blog Posts Grid */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    overflow: visible;
    padding: 0.5rem 0;
    position: relative;
    z-index: 1;
}

/* Blog Post Card */
.blog-post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 24px 64px -32px rgba(27, 31, 45, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.blog-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 80px -32px rgba(27, 31, 45, 0.3);
}

.post-card-image {
    display: block;
    overflow: hidden;
    height: 220px;
}

.post-card-image .post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.post-card-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.post-category {
    background: rgba(232, 17, 17, 0.1);
    color: var(--red-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-date {
    color: #9ca3af;
    font-weight: 500;
}

/* Post Title */
.post-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 1rem 0;
}

.post-card-title a {
    color: var(--gray-900, #1f2937);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card-title a:hover {
    color: var(--red-primary);
}

/* Post Excerpt */
.post-card-excerpt {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: auto;
    flex: 1;
}

/* Post Author */
.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f3f4f6;
}

.post-author img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-900, #1f2937);
}

.read-time {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Blog Pagination */
.blog-pagination {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
}

.blog-pagination .nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-pagination a,
.blog-pagination .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.75rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.blog-pagination a:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
    background: rgba(232, 17, 17, 0.05);
}

.blog-pagination .current {
    background: var(--red-primary);
    color: #ffffff;
    border-color: var(--red-primary);
}

.blog-pagination .prev,
.blog-pagination .next {
    gap: 0.5rem;
    padding: 0 1rem;
}

.blog-pagination svg {
    width: 18px;
    height: 18px;
}

/* No Posts Found */
.no-posts-found {
    text-align: center;
    padding: 4rem 2rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.no-posts-icon {
    color: #d1d5db;
    margin: 0 auto 1.5rem auto;
}

.no-posts-found h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900, #1f2937);
    margin: 0 0 0.75rem 0;
}

.no-posts-found p {
    font-size: 1.05rem;
    color: #6b7280;
    margin: 0;
}

/* Blog Sidebar */
.blog-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* Sidebar Widget */
.sidebar-widget {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900, #1f2937);
    margin: 0 0 1.25rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

/* Search Form */
.blog-search-form {
    position: relative;
    display: flex;
}

.blog-search-form .search-field {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.blog-search-form .search-field:focus {
    outline: none;
    border-color: var(--red-primary);
}

.blog-search-form .search-submit {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.blog-search-form .search-submit:hover {
    color: var(--red-primary);
}

/* Categories List */
.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-list li {
    margin: 0 0 0.5rem 0;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.categories-list a:hover {
    background: rgba(232, 17, 17, 0.05);
    color: var(--red-primary);
}

.categories-list a.active {
    background: rgba(232, 17, 17, 0.05);
    color: var(--red-primary);
    font-weight: 600;
}

.categories-list .count {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Recent Posts List */
.recent-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-posts-list li {
    margin: 0 0 1rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.recent-posts-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-posts-list a {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.recent-posts-list a:hover .recent-post-title {
    color: var(--red-primary);
}

.recent-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--gray-900, #1f2937);
    transition: color 0.2s ease;
}

.recent-post-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    display: inline-block;
    padding: 0.5rem 0.85rem;
    background: #f9fafb;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background: var(--red-primary);
    color: #ffffff;
    border-color: var(--red-primary);
    transform: translateY(-1px);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr 280px;
        gap: 2rem;
    }

    .blog-hero-title {
        font-size: 3rem;
    }

    .featured-post-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 0 2rem;
    }

    .blog-hero-title {
        font-size: 2.5rem;
    }

    .blog-hero-description {
        font-size: 1.1rem;
    }

    .blog-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .blog-sidebar {
        position: static;
        order: -1;
    }

    .featured-post {
        grid-template-columns: 1fr;
    }

    .featured-post-image {
        min-height: 300px;
    }

    .featured-post-content {
        padding: 2rem;
    }

    .featured-post-title {
        font-size: 1.5rem;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-filters {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .filter-pill {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .blog-pagination {
        margin-top: 3rem;
    }

    .sidebar-widget {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 2rem 0 1.5rem;
    }

    .blog-hero-title {
        font-size: 2rem;
    }

    .blog-hero-description {
        font-size: 1rem;
    }

    .blog-content-wrapper {
        padding: 2rem 0 3rem;
    }

    .featured-post-image {
        min-height: 240px;
    }

    .featured-post-content {
        padding: 1.5rem;
    }

    .featured-post-title {
        font-size: 1.35rem;
    }

    .featured-post-excerpt {
        font-size: 0.95rem;
    }

    .post-card-content {
        padding: 1.5rem;
    }

    .post-card-title {
        font-size: 1.2rem;
    }

    .sidebar-widget {
        padding: 1.25rem;
    }

    .widget-title {
        font-size: 1rem;
    }

    .blog-pagination a,
    .blog-pagination .current {
        min-width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }
}

/* Print Styles */
@media print {
    .blog-sidebar,
    .blog-pagination,
    .blog-filters,
    .post-author img {
        display: none;
    }

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

    .blog-post-card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
    }
}
