/* Story Listings Styles */
#story-listings {
    padding: 6rem 5% 4rem;
    background: white;
    scroll-margin-top: 100px;
}

.stories-grid-container {
    max-width: 1200px;
    margin: 0 auto;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 2rem 0;
}

.story-card {
    background: var(--neutral-light);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-5px);
}

/* Image Container Fix */
.story-card-img-container {
    position: relative;
    height: 0;
    padding-top: 62.5%;
    /* 5:8 aspect ratio */
    overflow: hidden;
}

.story-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 3px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.story-card:hover img {
    transform: scale(1.05);
}

.story-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.story-card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--neutral-dark);
}

.story-card-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.story-card .cta-primary {
    margin-top: auto;
    width: fit-content;
    display: inline-flex;
    align-self: flex-start;
}

/* Hero Section Styling */
.story-hero .hero-content {
    padding-top: 7rem;
}

.story-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.story-hero h1::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: var(--secondary-color);
    margin: 1.5rem auto 0;
}

@media (max-width: 800px) {
    .story-hero .hero-content {
        padding-top: 5rem;
    }
}

@media (max-width: 768px) {
    #story-listings {
        padding: 5rem 5% 3rem;
    }

    .stories-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .story-card-img-container {
        padding-top: 75%;
        /* 4:3 aspect ratio on mobile */
    }

    .story-card-content {
        height: auto;
        min-height: 180px;
    }

    .story-card-content h3 {
        font-size: 1.2rem;
    }

    .story-hero h1 {
        font-size: 2rem;
    }

    .story-hero h1::after {
        width: 70px;
        height: 2px;
    }
}

@media (min-width: 1200px) {
    .stories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .story-card {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* Story Article Styles */
.story-page {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 0;
}

.story-hero {
    position: relative;
    margin-top: 60px;
    height: 70vh;
    overflow: hidden;
}

.story-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.story-content {
    padding: 4rem 5%;
}

.intro-section h2 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 2rem;
}

.story-section {
    margin: 3rem 0;
}

.story-section h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.story-image {
    max-width: 800px;
    margin: 2.5rem auto;
    text-align: center;
}

.story-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.caption {
    font-style: italic;
    color: #666;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.pull-quote {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--secondary-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    background: var(--neutral-light);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .story-hero {
        height: 50vh;
    }

    .intro-section h2 {
        font-size: 1.8rem;
    }

    .story-section h2 {
        font-size: 1.5rem;
    }

    .pull-quote {
        font-size: 1.1rem;
        padding: 1rem;
        margin: 2rem 0;
    }

    .story-content {
        padding: 2rem 5%;
    }
}

/* Stories Article css */
#more-articles {
    padding: 4rem 5%;
    background: var(--neutral-light);
}

#more-articles .stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

#more-articles .image-container {
    position: relative;
    height: 0;
    padding-top: 66.66%;
    overflow: hidden;
}

#more-articles img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#more-articles .story-tile {
    text-decoration: none;
    color: var(--neutral-dark);
    transition: transform 0.3s ease;
}

#more-articles .story-tile:hover {
    transform: translateY(-5px);
}

#more-articles h4 {
    margin-top: 1rem;
    font-size: 1.1rem;
    padding: 0 0.5rem;
    color: var(--primary-color);
}

.story-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.story-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* This ensures content pushes CTA down */
}

.story-card-content p {
    flex-grow: 1;
    margin-bottom: 3rem;
    /* Add consistent spacing before CTA */
}

.story-card .cta-primary {
    text-align: center;
    justify-self: flex-end;
}