/* =================================================================== */
/* === BLOG PAGE STYLES (FINAL, CORRECTED VERSION) =================== */
/* =================================================================== */

.content-under-header {
    margin-top: var(--header-height); 
}

.blog-hero {
    background: var(--layout-green-bg);
    color: #fff;
    padding: 4rem 5%;
    text-align: center;
}
.blog-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    transform: scaleY(1.4);
    margin-bottom: 0.5rem;
}
.blog-hero .tagline {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    max-width: 600px;
    margin: 0 auto 2rem;
    color: rgba(255, 255, 255, 0.9);
}
.search-bar-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}
.search-bar-container input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(0,0,0,0.2);
    color: #fff;
    font-size: 1rem;
}
.search-bar-container input::placeholder { color: rgba(255, 255, 255, 0.6); }
.search-bar-container .fa-magnifying-glass {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
}

/* --- Featured Post --- */
.featured-post-section {
    padding: 4rem 5%;
    background: #f9f9f9;
}
.featured-post-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}
.featured-post-image img {
    width: 100%;
    height: 480px; /* Increased from 400px */
    border-radius: 8px;
    object-fit: cover;
    object-position: top; 
    aspect-ratio: 16 / 10;
}

.featured-post-content .category-tag {
    background: var(--accent-orange);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1rem;
}
.featured-post-content h2 {
    font-family: var(--font-headline);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    line-height: 1.2;
}
.featured-post-content .excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* --- Main Blog Layout --- */
.blog-layout-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch; /* Ensures all cards in a row stretch to the same height */
}

/* =================================================================== */
/* === THIS IS THE NEW, CORRECT, AND COMPLETE CARD STYLING BLOCK ===== */
/* =================================================================== */

.article-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    text-decoration: none;
    
    /* --- The Unbreakable Structure --- */
    display: grid;
    grid-template-rows: auto 1fr;
}

.article-card .g-card-image-wrapper {
    height: 260px; /* Increased from 220px */
}

.article-card .article-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    color: #333;
}

.article-card .article-card-meta {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.8rem;
    color: #888;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.article-card-content .category-tag {
    background: var(--headline-accent-color);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.8rem;
}
.article-card-content h3 {
    font-family: var(--font-headline);
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    color: #333;
}
.article-card-content .excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 1rem;
}

/* =================================================================== */
/* === END OF NEW CARD STYLING BLOCK ================================= */
/* =================================================================== */

.load-more-btn {
    display: block;
    margin: 3rem auto 0;
    padding: 12px 30px;
    background: var(--layout-green-bg);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-family: var(--font-headline);
    cursor: pointer;
}

/* --- Sidebar --- */
.blog-sidebar .widget-title {
    font-family: var(--font-headline);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-orange);
    padding-bottom: 0.5rem;
    display: inline-block;
}
.sidebar-widget {
    margin-bottom: 3rem;
}
.categories-list li {
    margin-bottom: 0.8rem;
}
.categories-list a {
    text-decoration: none;
    color: #555;
    font-weight: 600;
}
.popular-posts-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 1.5rem;
}
.popular-posts-list .post-img img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    object-position: center top;
    border-radius: 5px;
}
.popular-posts-list .post-title {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}
.newsletter-widget input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.newsletter-widget button {
    width: 100%;
    padding: 10px;
    background: var(--accent-orange);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* --- Article Detail Page Styles (`blog-post.html`) --- */
.article-header {
    padding: 2rem 5% 3rem;
    text-align: center;
    background: #f4f4f4;
}
.breadcrumbs {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.breadcrumbs a { color: var(--accent-orange); }
.article-header h1 {
    font-family: var(--font-headline);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    max-width: 800px;
    margin: 0 auto 1.5rem;
    line-height: 1.2;
}
.article-meta-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 2rem;
}
.article-featured-image {
    max-width: 1000px;
    margin: 0 auto;
}
.article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.article-body-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}
.article-content {
    max-width: 750px;
}
.article-content p, .article-content li {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #333;
}
.article-content h2, .article-content h3 {
    font-family: var(--font-headline);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}
.article-content h2 { font-size: 2rem; }
.article-content h3 { font-size: 1.6rem; }

.article-sidebar {
    position: sticky;
    top: 120px;
}
.social-share-widget .share-buttons {
    display: flex;
    gap: 10px;
}
.share-buttons a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #fff;
    border-radius: 50%;
    font-size: 1.1rem;
}
.share-fb { background: #3b5998; }
.share-x { background: #000; }
.share-li { background: #0077b5; }
.author-box {
    margin-top: 4rem;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}
.author-box h3 {
    margin-top: 0;
}

/* --- Responsive Styles --- */
@media (max-width: 992px) {
    .blog-layout-container, .article-body-layout {
        grid-template-columns: 1fr;
    }
    .blog-sidebar, .article-sidebar {
        margin-top: 3rem;
        position: static;
    }
}
@media (max-width: 768px) {
    .featured-post-card {
        grid-template-columns: 1fr;
    }
}

/* =================================================================== */
/* === FINAL IMAGE DISPLAY FIX (OVERRIDE) ========================== */
/* =================================================================== */

/* 1. Force the new height on the large featured image */
/* === HEADLINE IMAGE GREY BAR FIX === */
/* This new rule sets a fixed height on the container DIV */
.featured-post-image {
    height: 480px !important;
}

/* This rule tells the image to stretch to fill that container */
.featured-post-image img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: top !important;
}

/* 2. Force the new height on the smaller card images */
.article-card .g-card-image-wrapper {
    height: 360px !important;
}

/* 3. Force the image inside the smaller cards to show from the top */
.article-card .g-card-image-wrapper img {
    object-position: top !important;
}

/* Hides articles for the "Load More" feature */
.article-card.hidden {
    display: none !important;
}

/* =================================================================== */
/* === DYNAMIC BLOG FEATURES FIX =================================== */
/* =================================================================== */

/* Hides articles for the "Load More" feature */
.article-card.hidden {
    display: none !important;
}

/* Hides articles that don't match the search term */
.article-card.search-hidden {
    display: none !important;
}

.category-link.active {
    color: var(--sage); /* Or your brand orange */
    font-weight: bold;
    text-decoration: underline;
}