/* _blog.css - Styles specific to the blog listing page */

/* --- General Blog Layout --- */
.blog-content-area {
    padding: 60px 0; /* Adjust padding for overall section */
    background-color: #f9f9f9; /* Light background for the content area */
}

.blog-grid-container {
    display: grid;
    grid-template-columns: 3fr 1fr; /* Main content 3 parts, sidebar 1 part */
    gap: 40px; /* Space between main content and sidebar */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 992px) {
    .blog-grid-container {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
    .blog-sidebar {
        margin-top: 40px; /* Add space between main content and stacked sidebar */
    }
}

/* --- Blog Hero Section --- */
.blog-hero-section {
    background: linear-gradient(rgba(10, 61, 98), rgba(0, 86, 179)), url('/assets/images/blog-hero-bg.jpg') no-repeat center center/cover; /* Placeholder background image, replace with a real one */
    color: #fff;
    text-align: center;
    padding: 100px 20px;
    position: relative;
    overflow: hidden; /* Ensures search bar doesn't overflow */
}

.blog-hero-section h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.2em;
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.blog-hero-section p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 30px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Breadcrumb Styling (assuming _header.css or style.css has base for this) */
.blog-hero-section .breadcrumb {
    margin-top: 25px;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.8);
}

.blog-hero-section .breadcrumb ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.blog-hero-section .breadcrumb ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-hero-section .breadcrumb ul li a:hover {
    color: var(--primary-color, #0A3D62); /* Use primary color if defined in root */
}

.blog-hero-section .breadcrumb ul li:not(:last-child)::after {
    content: '/';
    margin-left: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* Search Blog Posts within Hero */
.search-blog-posts {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.search-blog-posts input[type="text"] {
    flex-grow: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    outline: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.search-blog-posts input[type="text"]:focus {
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid var(--primary-color, #0A3D62);
}

.search-blog-posts button {
    background-color: var(--primary-color, #0A3D62);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-blog-posts button:hover {
    background-color: var(--primary-hover-color, #072a47); /* Darker shade of primary */
    transform: translateY(-2px);
}

/* --- Blog Intro Text --- */
.blog-intro-text {
    margin-bottom: 40px;
    text-align: center;
    padding: 0 20px;
}

.blog-intro-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
}

.blog-intro-text p {
    font-size: 1.1em;
    color: #555;
    line-height: 1.7;
    max-width: 800px;
    margin: 0 auto;
}

/* --- Blog Filters & Sorting --- */
.blog-filters {
    display: flex;
    justify-content: flex-end; /* Align filters to the right */
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    padding: 0 20px; /* Ensure padding on smaller screens */
}

@media (max-width: 768px) {
    .blog-filters {
        justify-content: center; /* Center filters on mobile */
    }
}

.blog-filters label {
    font-weight: 600;
    color: #333;
    margin-right: 5px;
    display: inline-block; /* Keep label and select on same line */
}

.blog-filters select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

.blog-filters select:hover,
.blog-filters select:focus {
    border-color: var(--primary-color, #0A3D62);
}

/* --- Blog Posts Grid --- */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: 30px;
}

/* --- Blog Post Card --- */
.blog-post-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden; /* Ensures image corners are rounded with card */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column; /* Stack image and content */
}

.blog-post-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.blog-post-card figure {
    margin: 0;
    width: 100%;
    height: 220px; /* Fixed height for consistent image size */
    overflow: hidden;
}

.blog-post-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures images fill the space without distortion */
    transition: transform 0.5s ease;
}

.blog-post-card:hover img {
    transform: scale(1.05); /* Subtle zoom effect on hover */
}

.blog-post-card figcaption {
    display: none; /* Hide figcaption for a cleaner card look, can be re-enabled if needed */
}

.blog-post-card .post-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows info section to grow and push button to bottom */
}

.blog-post-card .post-category {
    background-color: var(--primary-color, #0A3D62);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.blog-post-card .post-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    line-height: 1.3;
    font-family: 'Playfair Display', serif;
    color: #333;
}

.blog-post-card .post-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.blog-post-card .post-title a:hover {
    color: var(--primary-color, #0A3D62);
}

.blog-post-card .post-excerpt {
    font-size: 0.95em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1; /* Allows excerpt to take available space */
}

.blog-post-card .post-meta {
    font-size: 0.8em;
    color: #888;
    margin-top: auto; /* Pushes meta and button to bottom */
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

.blog-post-card .post-meta i {
    margin-right: 5px;
    color: var(--primary-color, #0A3D62);
}

.blog-post-card .read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    color: var(--primary-color, #0A3D62);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.blog-post-card .read-more-btn:hover {
    color: var(--primary-hover-color, #072a47);
}

.blog-post-card .read-more-btn i {
    transition: transform 0.3s ease;
}

.blog-post-card .read-more-btn:hover i {
    transform: translateX(5px);
}

/* --- Pagination Controls --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
    gap: 20px;
    padding: 0 20px;
}

.pagination-btn {
    background-color: var(--primary-color, #0A3D62);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(.disabled) {
    background-color: var(--primary-hover-color, #072a47);
    transform: translateY(-2px);
}

.pagination-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.page-numbers {
    font-size: 1.1em;
    color: #555;
    font-weight: 600;
}

.page-numbers .current-page {
    color: var(--primary-color, #0A3D62);
}

/* --- Blog Sidebar --- */
.blog-sidebar {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    padding: 30px;
}

.sidebar-block {
    margin-bottom: 40px;
}

.sidebar-block:last-child {
    margin-bottom: 0;
}

.sidebar-block h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color, #0A3D62);
    display: inline-block; /* Makes border-bottom fit text */
}

/* Popular Posts */
.popular-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-posts-list li {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.popular-posts-list li:last-child {
    margin-bottom: 0;
}

.popular-posts-list li img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.popular-posts-list li a {
    font-size: 0.95em;
    color: #555;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.3s ease;
    font-weight: 500;
}

.popular-posts-list li a:hover {
    color: var(--primary-color, #0A3D62);
}

/* Blog Categories */
.blog-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-categories ul li {
    margin-bottom: 12px;
}

.blog-categories ul li a {
    color: #555;
    text-decoration: none;
    font-size: 1em;
    padding: 8px 15px;
    display: block;
    background-color: #f0f0f0;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-categories ul li a:hover {
    background-color: var(--primary-color, #0A3D62);
    color: #fff;
}

.blog-categories ul li a span {
    font-weight: 600;
    color: var(--primary-color, #0A3D62);
}

.blog-categories ul li a:hover span {
    color: #fff;
}

/* Subscribe Newsletter */
.subscribe-newsletter p {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.subscribe-newsletter form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subscribe-newsletter input[type="email"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease;
}

.subscribe-newsletter input[type="email"]:focus {
    border-color: var(--primary-color, #0A3D62);
}

.subscribe-newsletter .btn {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary-color, #0A3D62);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.subscribe-newsletter .btn:hover {
    background-color: var(--primary-hover-color, #072a47);
    transform: translateY(-2px);
}

/* --- Call to Action (CTA) Section --- */
.cta-blog-page {
    background-color: var(--primary-color, #0A3D62);
    color: #fff;
    text-align: center;
    padding: 60px 20px;
    margin-top: 60px; /* Space from the main blog content */
}

.cta-blog-page h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8em;
    margin-bottom: 15px;
    line-height: 1.2;
}

.cta-blog-page p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.cta-blog-page .btn {
    background-color: #fff;
    color: var(--primary-color, #0A3D62);
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cta-blog-page .btn:hover {
    background-color: var(--primary-hover-color, #072a47);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .blog-hero-section h1 {
        font-size: 2.5em;
    }
    .blog-hero-section p {
        font-size: 1em;
    }
    .blog-intro-text h2 {
        font-size: 2em;
    }
    .blog-filters {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .blog-filters select {
        width: 100%;
        max-width: 300px;
    }
    .blog-posts-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    .cta-blog-page h2 {
        font-size: 2em;
    }
    .cta-blog-page .btn {
        padding: 12px 25px;
    }
}

@media (max-width: 480px) {
    .blog-grid-container {
        padding: 0 15px;
    }
    .blog-hero-section {
        padding: 80px 15px 60px;
    }
    .blog-hero-section h1 {
        font-size: 2em;
    }
    .blog-hero-section p {
        font-size: 0.9em;
    }
    .search-blog-posts {
        flex-direction: column;
    }
    .search-blog-posts button {
        width: 100%;
    }
    .blog-post-card .post-title {
        font-size: 1.2em;
    }
    .pagination-controls {
        flex-direction: column;
        gap: 15px;
    }
}

/* Defining CSS Variables (place these in your main style.css or a variables file) */
/*
:root {
    --primary-color: #0A3D62;
    --primary-hover-color: #072a47;
    --secondary-color: #f7b731; // Example secondary color for accents
    --text-color-dark: #333;
    --text-color-light: #555;
    --light-bg: #f9f9f9;
    --card-bg: #fff;
    --border-color: #eee;
}
*/