/* Modern Blog Styles for Solis Consultoria */

:root {
    --blog-bg: #f8fafc;
    --card-bg: #ffffff;
    --primary-blue: #4161ae;
    --text-main: #334155;
    --text-muted: #64748b;
    --accent-orange: #ef7d1a;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.blogPrincipal {
    background-color: var(--blog-bg);
    padding: 60px 0;
    min-height: 100vh;
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 40px;
}

.blog-main-content {
    flex: 1;
    display: flex;
    gap: 15px;
    padding: 15px;
}

/* Featured Post Styling */
.featured-post {
    margin-bottom: 50px;
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: row;
    min-height: 400px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-post:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

/* Featured Post (No Image) */
.featured-post-wrapper.no-image .featured-post {
    background: linear-gradient(135deg, #4161ae 0%, #1e3a8a 100%);
    color: white;
    text-align: center;
}

.featured-post-wrapper.no-image .featured-content {
    width: 100%;
    align-items: center;
    padding: 60px;
}

.featured-post-wrapper.no-image .post-title,
.featured-post-wrapper.no-image .post-summary,
.featured-post-wrapper.no-image .post-meta,
.featured-post-wrapper.no-image .post-date {
    color: rgba(255, 255, 255, 0.9);
}

.featured-post-wrapper.no-image .post-date {
    background: rgba(255, 255, 255, 0.1);
}

.featured-post-wrapper.no-image .read-more {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 25px;
    border-radius: 50px;
    margin-top: 30px;
}

.featured-image-placeholder {
    width: 45%;
    background: linear-gradient(135deg, #4161ae 0%, #2563eb 100%);
    position: relative;
    overflow: hidden;
}

.featured-image-placeholder::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 20px 20px;
}

.featured-content {
    width: 55%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Grid Styling */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* Card Styling */
.blog-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

/* Card (No Image) */
.blog-card.no-image {
    border-top: 4px solid var(--primary-blue);
}

.blog-card.no-image .card-body {
    padding: 30px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

.blog-card.no-image .post-title {
    font-size: 1.5rem;
}

.card-image-placeholder {
    height: 200px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-image-placeholder i {
    font-size: 3rem;
    color: #94a3b8;
    opacity: 0.5;
}

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

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-date {
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 50px;
}

.post-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-views img {
    height: 14px;
    opacity: 0.6;
}

.post-title {
    font-family: 'Glegoo', serif;
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 12px;
    line-height: 1.3;
    font-weight: 700;
}

.featured-content .post-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.post-summary {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 20px;
}

.featured-content .post-summary {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    font-size: 1.1rem;
}

.read-more {
    margin-top: auto;
    color: var(--primary-blue);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Single Post View */
.blog-single-post {
    padding: 60px 0;
    background-color: var(--blog-bg);
}

.post-content {
    background: #fff;
    padding: 60px;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    flex: 1;
    max-width: 850px;
    /* Optimal reading width */
}

.breadcrumb {
    margin: 30px;
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.breadcrumb a:hover {
    padding-left: 5px;
}

/* Enhancing parsed HTML output from blog files */
.post-content h1 {
    font-family: 'Glegoo', serif;
    font-size: 2.5rem;
    color: var(--text-main);
    /* margin-bottom: 30px; */
    text-align: center;
}

.post-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 20px;
    text-align: justify;
}

.post-content p.subtitulo {
    color: #F44336;
    text-align: center;
}

.post-content img {
    max-width: 100%;
    height: auto;
    /* border-radius: 16px; */
    /* margin: 30px 0; */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.post-footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Sidebar Clean-up */
.agrupamentos {
    width: 350px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* border-radius: 20px; */
    height: fit-content;
    position: sticky;
    top: auto;
    /* box-shadow: var(--card-shadow); */
    padding: 30px;
}

.agrupamentos h2 {
    font-family: 'Glegoo', serif;
    font-size: 1.1rem;
    color: var(--primary-blue);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.agrupamentos a {
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
}

.agrupamentos a:hover {
    background: #f1f5f9;
    color: var(--primary-blue);
    padding-left: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-container {
        flex-direction: column;
    }

    .agrupamentos {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .featured-post {
        flex-direction: column;
    }

    .featured-image-placeholder,
    .featured-content {
        width: 100%;
    }

    .featured-content {
        padding: 30px;
    }
}

/* Advertising / Landing Page Style Posts */
.blog-single-post.is-ad .post-content {
    padding: 0;
    overflow: hidden;
    max-width: 1000px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.ad-hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #1e3a8a 100%);
    color: white !important;
    padding: 100px 40px;
    text-align: center;
    position: relative;
    border-bottom: 6px solid var(--accent-orange);
}

.ad-hero h1 {
    color: white !important;
    font-size: 26px !important;
    margin-bottom: 25px !important;
    line-height: 1.15 !important;
    font-weight: 800;
}

.ad-hero .ad-badge {
    background: var(--accent-orange);
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 30px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(245, 124, 0, 0.4);
    letter-spacing: 1px;
}

.ad-hero p.ad-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    max-width: 800px;
    margin: 0 auto 40px !important;
    text-align: center !important;
    line-height: 1.6;
}

.ad-content-body {
    padding: 60px 5vw;
}

.ad-section-title {
    font-family: 'Glegoo', serif;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--primary-blue);
    margin: 50px 0 40px;
    text-align: center;
    font-weight: 700;
}

.ad-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 50px 0;
}

.ad-service-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 6px solid var(--primary-blue);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.ad-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.ad-service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-blue);
}

.ad-service-card i {
    font-size: 3rem;
    color: var(--accent-orange);
    margin-bottom: 25px;
    display: block;
    position: relative;
    z-index: 2;
}

.ad-service-card h3 {
    font-family: 'Glegoo', serif;
    font-size: 1.4rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.ad-service-card p {
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
    color: #4b5563 !important;
    margin-bottom: 0 !important;
    text-align: center !important;
    position: relative;
    z-index: 2;
}

.ad-cta-large {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 80px 5vw;
    margin-top: 80px;
    text-align: center;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.ad-cta-large h2 {
    font-family: 'Glegoo', serif;
    font-size: 21px;
    margin-bottom: 20px;
    color: var(--primary-blue);
    font-weight: 700;
}

.ad-cta-large p {
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 30px;
}

.btn-whatsapp-ad {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: #25d366;
    color: white !important;
    padding: 20px 40px;
    border-radius: 60px;
    font-weight: 800;
    font-size: clamp(1.2rem, 3vw, 1.4rem);
    text-decoration: none;
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.btn-whatsapp-ad:hover {
    transform: translateY(-3px) scale(1.02);
    background: #20ba59;
    box-shadow: 0 20px 40px rgba(37, 211, 102, 0.4);
}

.ad-featured-image {
    margin: 50px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ad-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 450px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ad-featured-image:hover img {
    transform: scale(1.03);
}

.ad-featured-image figcaption {
    padding: 15px 20px;
    text-align: center;
    font-size: 0.95rem;
    color: #64748b;
    font-style: italic;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.ad-featured-image.inline-image {
    margin: 40px auto;
    max-width: 90%;
}

.ad-highlight {
    background: rgba(245, 158, 11, 0.05);
    border-left: 5px solid #f59e0b;
    padding: 30px !important;
    font-style: italic;
    font-size: 1.0rem !important;
    color: #4b5563 !important;
    border-radius: 0 16px 16px 0;
    margin: 50px 0 !important;
    line-height: 1.7 !important;
}

.ad-guarantee {
    margin-top: 20px !important;
    font-size: 0.95rem !important;
    font-weight: 600;
    color: #64748b !important;
}

/* Mobile Adjustments for Ad Layout */
@media (max-width: 768px) {
    .ad-hero {
        padding: 60px 20px;
    }

    .ad-content-body {
        padding: 40px 20px;
    }

    .ad-cta-large {
        padding: 60px 20px;
        margin-top: 50px;
        border-radius: 20px;
    }

    .ad-service-card {
        padding: 30px 20px;
    }

    .btn-whatsapp-ad {
        padding: 18px 30px;
        font-size: 1.1rem;
    }
}

/* New Sidebar Styles */
.agrupamentos {
    max-width: 280px;
    width: 100%;
    margin-left: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    height: auto;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.015);
}

.sidebar-section h2 {
    font-family: 'Glegoo', serif !important;
    font-size: 1rem !important;
    color: var(--primary-blue) !important;
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-align: left !important;
}

/* Sidebar Search */
.sidebar-search .search-form {
    display: flex;
    background: #f8fafc;
    border-radius: 50px;
    padding: 2px 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.sidebar-search .search-form:focus-within {
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(65, 97, 174, 0.1);
}

.sidebar-search input {
    border: none;
    background: transparent;
    padding: 10px;
    flex: 1;
    font-size: 0.9rem;
    outline: none;
    color: var(--text-main);
}

.sidebar-search button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popular Posts */
.popular-posts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-post-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    align-items: flex-start;
}

.popular-post-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1;
    transition: color 0.3s ease;
    min-width: 25px;
}

.popular-post-item:hover .popular-post-number {
    color: var(--accent-orange);
}

.popular-post-info {
    flex: 1;
}

.popular-post-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-views {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Topics */
.sidebar-topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-tag {
    background: #f1f5f9;
    color: var(--text-main);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.topic-tag:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-blue);
}

/* CTA Card */
.sidebar-cta-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #4161ae 100%);
    color: white !important;
    text-align: center;
    padding: 25px 15px;
    position: relative;
    overflow: hidden;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-cta-card h3 {
    font-family: 'Glegoo', serif;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: white !important;
}

.sidebar-cta-card p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 15px;
    line-height: 1.4;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center !important;
}

.sidebar-cta-card .btn-sidebar {
    background: var(--accent-orange);
    color: white !important;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.sidebar-cta-card .btn-sidebar:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1024px) {

    .blog-container,
    .blogPrincipal .blog-container {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        gap: 30px !important;
        padding: 0 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .agrupamentos {
        max-width: 100% !important;
        width: 100% !important;
        order: 2 !important;
        position: static !important;
        margin-left: 0 !important;
        padding: 0 !important;
        height: auto !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        display: block !important;
        overflow: visible !important;
    }

    .sidebar-topics-grid {
        justify-content: center !important;
    }

    .sidebar-section {
        margin-bottom: 25px !important;
        border-radius: 15px !important;
    }

    /* Hide sidebar CTA on mobile to avoid overlap */
    .sidebar-cta-card {
        display: none !important;
    }
}