/* --- Blog Hero Section --- */
html, body, main {
    overflow: visible !important;
}

.blog-hero-section {
    max-width: 1350px;
    margin: 0 auto;
    padding: 40px 20px 120px 20px; /* Add padding top/bottom */
    color: #FFFFFF;
}

.blog-hero-header {
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 40px;
}

.blog-page-title {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 2.5rem;
    font-weight: 400;
    margin: 0 0 30px 0;
}

.blog-filters {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow filters to wrap on smaller screens */
}

.blog-filters a {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.95rem;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.blog-filters a:hover {
    color: #FFFFFF;
}

.blog-filters a.active {
    color: #FFFFFF;
    border-bottom-color: #DDF4E7; /* Use light mint for the active underline */
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto; /* Pushes the search button to the far right */
    padding: 5px;
}

/* --- Main Blog Grid Layout --- */
.blog-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* As requested, left is 2x wider than right */
    gap: 24px;
    /* This is crucial for sticky positioning to work correctly. It aligns items to the start of the grid cell. */
    align-items: start; 
}

.blog-right-pane {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}


/* --- The Sticky Behavior --- */
.blog-left-pane {
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    /* We set top to 120px to account for your main navigation header which is ~90px tall, plus some extra space. */
    top: 120px; 
}


/* --- Blog Card Styling --- */
.featured-post-card,
.secondary-post-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background-color: transparent; /* Using a color from your existing palette for the cards */
    text-decoration: none;
    color: #FFFFFF;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-post-card:hover,
.secondary-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.card-image-container img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9; /* Ensures consistent image proportions */
    object-fit: cover;
}

.featured-post-card .card-content {
    padding: 24px;
}

.featured-post-card h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.secondary-post-card .card-content {
    padding: 20px;
}

.secondary-post-card h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.card-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    gap: 8px;
}

.blog-right-pane .card-image-container img {
    aspect-ratio: 6 / 4 ; /* Was 16/9. Try values like 1/1 (square) or 4/5 (portrait). */
}

/* --- Customer Testimonial Slider --- */
.customer-testimonial-section {
    background-color: #DDF4E7;
    padding: 100px 20px;
}

.testimonial-slider-container {
    max-width: 1350px;
    margin: 0 auto;
    background-color: #124170;
    color: #FFFFFF;
    border-radius: 16px;
    position: relative;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.testimonial-slide {
    position: absolute;
    top: 60px;
    left: 80px;
    right: 80px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(100% - 120px);
}

.testimonial-slide.active-slide {
    opacity: 1;
    visibility: visible;
}

.slide-content {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.client-logo {
    max-height: 40px;
    margin-bottom: 30px;
}

.quote {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1.75rem;
    line-height: 1.5;
    max-width: 600px;
    margin: 0;
}

.slide-author {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 500;
}

.author-title {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.testimonial-pagination {
    position: absolute;
    bottom: 80px; /* Adjust as needed */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 10px;
    /* This empty space is intentional for the slide-content to occupy */
}

.pagination-dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pagination-dot.active {
    width: 40px;
    background-color: rgba(255, 255, 255, 0.5);
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0; /* Starts at 0 width */
    background-color: #FFFFFF;
    border-radius: 4px;
}

.pagination-dot.active .progress-fill {
    width: 100%; /* Expands to full width when active */
    transition: width 5s linear; /* The 5s duration of the progress bar */
}

/* --- Stories Grid Section --- */
.stories-grid-section {
    padding: 120px 0px;
    width: 100%;
    background-color: #DDF4E7;
}

.stories-grid-wrapper {
    max-width: 1350px;
    margin: 0 auto;
}

.stories-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap; /* Allows filters to wrap on smaller screens */
    gap: 20px;
}

.stories-grid-header h2 {
    font-size: 2.5rem;
    color: #124170;
    margin: 0;
}

.stories-filters {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content:flex-start !important;
}

.stories-filters a {
    text-decoration: none;
    color: #26667F; /* Softer text color */
    font-size: 0.9rem;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.stories-filters a:not(.search-icon):hover {
    color: #124170;
}
.stories-filters a.active {
    color: #124170;
    font-weight: 500;
    border-bottom-color: #124170;
}

.stories-filters .mobile-only {
    display: none;
}

.stories-filters .search-icon svg {
    stroke: #26667F;
    transition: stroke 0.3s;
}

.stories-filters .search-icon:hover svg {
    stroke: #124170;
}

/* --- The Grid --- */
.stories-grid {
    display: grid;
    /* This creates the 3-column grid */
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 24px;
}

.story-card {
    text-decoration: none;
    color: inherit;
}

.card-image-wrapper {
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 16 / 10;
    margin-bottom: 16px;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-in-out;
}

.story-card:hover .card-image-wrapper img {
    transform: scale(1.05); /* Subtle zoom effect on hover */
}

.card-caption {
    font-size: 1rem;
    line-height: 1.5;
    color: #124170;
    margin: 0;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
    padding: 0px !important;
}

.pagination a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: #124170;
    background-color: transparent;
    border: 1px solid #d3d3d3;
    transition: background-color 0.3s, color 0.3s;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

.pagination a.active {
    background-color: #124170; /* Main dark blue */
    color: #FFFFFF;
    border-color: #124170;
    font-weight: bold;
}

/* --- Responsive Styles for Stories Grid --- */

/* For Tablets */
@media (max-width: 992px) {
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* For Mobile (as requested) */
@media (max-width: 768px) {
    .stories-filters {
        width: 100%;
        justify-content: space-between;
        gap: 16px;
        padding: 0px;
    }

    .stories-filters .desktop-only {
        display: none;
    }

    /* Show the mobile dropdown on mobile */
    .stories-filters .mobile-only {
        display: block;
        position: relative;
        flex-grow: 1;
    }

    /* Style the dropdown button */
    .filter-active {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        background-color: #f0f0f0;
        border-radius: 30px;
        padding: 10px 16px;
        border: none;
        font-size: 1rem;
        color: #124170;
        cursor: pointer;
    }

    .filter-active .arrow {
        stroke: #124170;
        transition: transform 0.3s ease;
    }

    .filter-dropdown.is-open .filter-active .arrow {
        transform: rotate(180deg);
    }

    /* Style the dropdown menu */
    .filter-options {
        display: none;
        position: absolute;
        top: calc(100% + 5px);
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        padding: 8px 0;
        z-index: 100;
    }

    .filter-dropdown.is-open .filter-options {
        display: block;
    }

    .filter-options a {
        display: block;
        padding: 12px 16px;
        border-bottom: none;
    }

    .stories-grid {
        grid-template-columns: 1fr;
    }
}