/* Stories Section Styles */

.stories-section {
    background: white;
    width: 100%;
}

.stories-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.stories-intro {
    max-width: 900px;
    margin: 0 auto 4rem auto;
    text-align: center;
}

.stories-intro h3 {
    line-height: 1.3;
    color: #000;
}

/* Featured Story */
.featured-story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 5rem;
    align-items: start;
    padding-bottom: 4rem;
}

.featured-story .story-image {
    position: relative;
}

.featured-story .story-image img {
    width: 100%;
    height: auto;
    display: block;
}

.featured-story .story-content {
    padding-left: 2rem;
}

.featured-story h2 {
    margin-bottom: 1.5rem;
    line-height: 1.1;
    transition: color 0.3s ease;
    cursor: pointer;
}

.featured-story:hover h2 {
    color: var(--highlight-color);
}

.featured-story h3 {
    margin-bottom: 2rem;
    color: #808080; /* 50% grey for excerpt text */
    line-height: 1.3;
}

.featured-story .story-meta {
    color: #666;
    font-weight: 500;
}

/* Secondary Stories Grid */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* 2x2 Stories Grid */
.stories-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
    position: relative;
}

/* 2x2 Grid Divider Lines - Separate columns within each row */
.stories-grid-2x2 .story-item-2x2:nth-child(1)::after {
    content: '';
    position: absolute;
    top: 0;
    right: -2rem;
    width: 1px;
    height: 100%;
    background-color: #e0e0e0;
    z-index: 10;
}

.stories-grid-2x2 .story-item-2x2:nth-child(3)::after {
    content: '';
    position: absolute;
    top: 0;
    right: -2rem;
    width: 1px;
    height: 100%;
    background-color: #e0e0e0;
    z-index: 10;
}

.story-item {
    display: flex;
    flex-direction: column;
}

.story-item-2x2 {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.story-item .story-image,
.story-item-2x2 .story-image {
    position: relative;
    margin-bottom: 8px;
}

/* Force 4:3 aspect ratio for all story grid images */
.story-item .story-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.story-item .story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.story-item .caption,
.story-item-2x2 .caption,
.featured-story .caption {
    font-size: 12px;
    color: #808080;
    text-align: right;
    background: white;
    padding: 2px 0;
    margin-top: 4px;
    width: 100%;
}

.story-item-2x2 .story-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Text and image layout for 2x2 grid */
.story-item-2x2 .story-content {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.story-item-2x2 .story-image {
    flex: 0 0 60%;
    aspect-ratio: 4/3;
    overflow: hidden;
    margin-bottom: 0;
    max-width: 60%;
}

.story-item-2x2 .story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.story-item .story-content,
.story-item-2x2 .story-content {
    padding: 0;
}

.story-item h2,
.story-item-2x2 h2 {
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
    cursor: pointer;
}

.story-item:hover h2,
.story-item-2x2:hover h2 {
    color: var(--highlight-color);
}

/* Architecture section (profiles) specific headline sizing */
.profiles-section .story-item h2.serif-font-scaled {
    font-size: calc(24px * 1.23); /* Smaller headlines for 4-column layout */
}

/* Interviews section - same headline sizing as Architecture section */
.interviews-section .story-item h2.serif-font-scaled {
    font-size: calc(24px * 1.23); /* Same as Architecture section */
}

.story-item p,
.story-item-2x2 p {
    margin-bottom: 1rem;
    color: #808080; /* 50% grey for excerpt text */
}



/* Story Meta */
.story-meta {
    color: #808080;
    font-size: 16px;
}

.story-meta::after {
    content: " →";
}

.story-meta i {
    color: #000;
}

/* View All Tile */
.view-all-tile {
    background-color: rgba(57, 229, 143, 0.05); /* 5% transparency tint of highlight color */
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: border-color 0.3s ease;
    height: 250px;
    max-height: 250px;
}

.view-all-tile:hover {
    border-color: var(--highlight-color);
}

.view-all-tile .story-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none;
}

.view-all-content {
    text-align: center;
    padding: 2rem;
}

.view-all-heading {
    font-family: var(--primary-font) !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    color: #808080;
    transition: color 0.3s ease;
    margin: 0 !important;
}

.view-all-tile:hover .view-all-heading {
    color: var(--highlight-color);
}

/* More Stories Section */
.more-stories {
    max-width: 900px;
    padding-top: 3rem;
    margin: 0 auto;
}

.more-stories-title {
    margin-bottom: 2rem;
    color: #000;
    text-align: center;
}

.story-links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.story-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.story-link .link-text {
    color: #000;
    line-height: 1.2;
    font-weight: 600;
}

.story-link .link-date {
    color: #808080;
    margin: 0;
    font-weight: 400;
}

.story-link:hover .link-text {
    color: var(--highlight-color);
    transition: 0.3s ease;
}

/* Dynamic Stories - List Layout */
.stories-list {
    max-width: 900px;
    margin: 0 auto;
}

.story-list-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.story-list-item:last-child {
    border-bottom: none;
}

.story-list-item .story-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.story-list-item h2 {
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.story-list-item .story-link:hover h2 {
    color: #39e58f;
}

.story-list-item .story-excerpt {
    margin-bottom: 0.5rem;
    color: #808080; /* Updated from #666 to 50% grey */
    line-height: 1.5;
}

.story-list-item .story-meta {
    color: #808080;
    font-size: 16px;
}

/* View All Stories Link */
.view-all-stories {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.view-all-link {
    color: #39e58f;
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: #2dc776;
}

/* No Stories Message */
.no-stories-message {
    text-align: center;
    color: #666;
    font-size: 18px;
    margin: 3rem 0;
}

.no-stories-message a {
    color: #39e58f;
    text-decoration: none;
    font-weight: 500;
}

.no-stories-message a:hover {
    color: #2dc776;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .stories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
    
    .stories-grid-2x2 {
        gap: 3rem;
    }
    
    .featured-story {
        gap: 2rem;
        margin-bottom: 4rem;
        padding-bottom: 3rem;
    }
    
}

/* Small Tablet Responsive */
@media (max-width: 900px) {
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .stories-intro {
        margin-bottom: 3rem;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .featured-story {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 3rem;
        padding-bottom: 2rem;
    }
    
    .featured-story .story-content {
        padding-left: 0;
    }
    
    .stories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    
    .stories-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 3rem;
    }
    
    /* View All Tile responsive */
    .view-all-tile .story-link {
        min-height: 150px;
    }
    
    .view-all-content {
        padding: 1.5rem;
    }
    
    /* Stack text and image vertically on mobile */
    .story-item-2x2 {
        flex-direction: column;
        gap: 8px;
    }
    
    .story-item-2x2 .story-image {
        margin-bottom: 8px;
    }
    
    /* Hide divider lines on mobile */
    .stories-grid-2x2 .story-item-2x2:nth-child(1)::after,
    .stories-grid-2x2 .story-item-2x2:nth-child(3)::after {
        display: none;
    }
    
    
    .more-stories {
        padding-top: 2rem;
    }
    
    .story-link {
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .stories-intro {
        margin-bottom: 2rem;
    }
    
    .featured-story {
        gap: 1.5rem;
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .stories-grid {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stories-grid-2x2 {
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    /* Maintain vertical stacking on small mobile */
    .story-item-2x2 {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Ensure divider lines are hidden on small mobile too */
    .stories-grid-2x2 .story-item-2x2:nth-child(1)::after,
    .stories-grid-2x2 .story-item-2x2:nth-child(3)::after {
        display: none;
    }
    
    
    .more-stories {
        padding-top: 1.5rem;
    }
    
    .story-link {
        padding: 0.75rem 0;
    }
}
