/* === ELEGANT BLOG RE-DESIGN === */
/* === CRITICAL RESPONSIVE OVERRIDE === */
/* This neutralizes an old, global layout rule from style.css that is forcing a right margin */
.content-wrapper {
    display: block !important;
    margin-right: 0 !important;
}

/* Ensure the main blog container has no conflicting padding */
.blog-container {
    padding: 0 1rem !important;
}

@media (min-width: 768px) {
    .blog-container {
        padding: 0 1.5rem !important;
    }
}
/* ==================================== */
/* --- General & Typography --- */
.blog-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.blog-page-title {
    font-size: 2.8rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 1rem;
}

/* --- Main Layout (Grid) --- */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px; /* Main content and sidebar */
    gap: 2.5rem;
}

.blog-main {
    grid-column: 1 / 2;
}

.blog-sidebar {
    grid-column: 2 / 3;
}

/* --- Blog Index Page (List of Posts) --- */
.post-preview-card {
    background: #ffffff;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-preview-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

.post-preview-image-link {
    display: block;
    max-height: 300px;
    overflow: hidden;
}

.post-preview-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.post-preview-content {
    padding: 1.5rem 2rem;
}

.post-preview-title {
    margin: 0 0 0.5rem 0;
}

.post-preview-title a {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-preview-title a:hover {
    color: #3498db;
}

.post-meta {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.post-excerpt {
    color: #555;
    line-height: 1.6;
}

/* --- Single Post Page --- */
.post-full-content {
    background: #ffffff;
    padding: 2rem 3rem;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
}

.post-header .post-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    line-height: 1.2;
}

.post-header .post-meta {
    margin-bottom: 2rem;
}

.post-featured-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #34495e;
}

.post-body h2, .post-body h3 {
    margin-top: 2.5rem;
    color: #2c3e50;
}

.post-footer {
    margin-top: 3rem;
    border-top: 2px solid #ecf0f1;
    padding-top: 1.5rem;
}

.post-tags-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tags-list a {
    display: inline-block;
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.post-tags-list a:hover {
    background: #3498db;
    color: #ffffff;
}

/* --- Sidebar Widgets --- */
.sidebar-widget {
    background: #ffffff;
    padding: 1.5rem;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.sidebar-widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
    color: #2c3e50;
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-widget ul li a {
    text-decoration: none;
    color: #34495e;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f9f9f9;
    transition: color 0.3s ease;
}

.sidebar-widget ul li a:hover {
    color: #3498db;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin-top: 3rem;
}

.pagination a, .pagination span {
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    text-decoration: none;
    border: 1px solid #ecf0f1;
    border-radius: 5px;
    color: #3498db;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a:hover {
    background: #3498db;
    color: #ffffff;
}

.pagination .current {
    background: #3498db;
    color: #ffffff;
    border-color: #3498db;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr; /* Stack main content and sidebar */
    }
    .blog-sidebar {
        grid-row: 2; /* Move sidebar below main content */
    }
}

@media (max-width: 576px) {
    .blog-page-title {
        font-size: 2rem;
    }
    .post-full-content {
        padding: 1.5rem;
    }
    .post-header .post-title {
        font-size: 2rem;
    }
}
/* === ELEGANT POST HERO HEADER STYLES === */

.post-hero {
    position: relative;
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa; /* Fallback for no image */
    margin-bottom: 2rem;
}

.post-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.5); /* Darken the image so text is readable */
    z-index: 1;
}

.post-hero-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
    max-width: 800px;
}

/* Style for when there is NO background image */
.post-hero.no-image {
    background: #2c3e50; /* A dark, elegant color */
    color: #ffffff;
}
.post-hero.no-image .post-hero-content {
    color: #ffffff;
}

.post-hero .post-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.post-hero .post-meta {
    margin-top: 1rem;
    font-size: 1rem;
    opacity: 0.9;
}
/* === ENHANCED RESPONSIVE STYLES === */

@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr; /* Stack main content and sidebar */
        gap: 2rem; /* Reduce gap on tablets */
    }
    .blog-sidebar {
        grid-row: 2; /* Move sidebar below main content */
    }
    .blog-container {
        padding: 0 1rem; /* Reduce side padding */
    }
    .post-hero .post-title {
        font-size: 2.5rem; /* Slightly smaller hero title */
    }
}

@media (max-width: 576px) {
    .blog-page-title {
        font-size: 2rem;
        text-align: left;
    }
    .blog-container {
        margin-top: 1rem;
        padding: 0 0.8rem;
    }
    .post-full-content,
    .post-preview-content {
        padding: 1.2rem;
    }
    .post-preview-title a {
        font-size: 1.4rem;
    }
    .post-hero {
        min-height: 250px;
    }
    .post-hero .post-title {
        font-size: 1.8rem;
    }

    /* Fix pagination on mobile */
    .pagination-nav {
        background-color: transparent; /* Remove grey box */
        padding: 1rem 0;
    }
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    .pagination a, .pagination span {
        padding: 0.5rem 0.8rem;
    }
}
/* ================================================
   !!! CRITICAL MOBILE LAYOUT HARD RESET !!!
   This is an aggressive fix to override hidden global styles.
   ================================================ */
@media (max-width: 992px) {
    /*
     * Step 1: Force the main content area of the site to be a simple,
     * full-width block. This neutralizes any hidden 'flex' or 'grid'
     * rules from the global style.css file that are causing the empty space.
     */
    main {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /*
     * Step 2: Force the blog container itself to take up the full width,
     * with only minimal padding for screen edges.
     */
    .blog-container {
        width: 100% !important;
        max-width: none !important;
        padding: 1rem 0.8rem !important;
        margin: 0 auto !important;
    }

    /*
     * Step 3: Re-assert that the blog's internal layout should be a single
     * column stack on mobile devices.
     */
    .blog-layout {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Force single column */
        gap: 2rem !important;
    }

    /*
     * Step 4: Ensure the sidebar stacks correctly underneath the main content.
     */
    .blog-sidebar {
        grid-row: 2 !important;
        width: 100% !important;
    }
}