.articles-index-layout {
    max-width: 1300px;
    margin: 40px auto;
    padding: 30px 0;
}

.articles-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.articles-page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #e7212f;
    margin-bottom: 10px;
}

.articles-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 3fr; 
    gap: 40px;
}

.articles-sidebar {
    padding: 20px 0;
}

.filter-box {
    margin-bottom: 30px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-box h3 {
    font-size: 1.2rem;
    color: #f29f05;
    border-bottom: 2px solid #ffcd6f;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list a {
    display: block;
    padding: 5px 0;
    color: #555;
    text-decoration: none;
background-color: transparent;
    border-left: 3px solid transparent; /* Placeholder for active state */
    transition: all 0.2s ease;
}

.category-list a.active-filter {
    color: #f29f05;
    font-weight: bold;
    background-color: #f0f8ff;
    border-left: 3px solid #f29f05;
}

.category-list a:hover {
    color: #ffcd6f;
    text-decoration: underline;
}

.search-filter input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.search-filter button {
    width: 100%;
    padding: 10px;
    background-color: #77a892;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.articles-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px;
}

.article-card {
    display: none;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s, transform 0.3s;
}

.article-card.show {
    display: block;
}

.article-card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.card-image-wrapper {
    margin: 0;
    overflow: hidden;
    aspect-ratio: 16/9; 
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.article-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
}

.card-category {
    font-size: 0.85rem;
    color: #6b6bff;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.card-title {
    font-size: 1.4rem;
    line-height: 1.3;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
}

.card-excerpt {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
}

.card-metadata {
    font-size: 0.8rem;
    color: #999;
    margin-top: auto;
}

.pagination-section {
    text-align: center;
    padding: 40px 0;
}

.page-link {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #555;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.page-link:hover:not(.disabled):not(.active) {
    background-color: #f0f0f0;
}

.page-link.active {
    background-color: #2a6442;
    color: white;
    border-color: #2a6442;
}

.page-link.disabled {
    opacity: 0.6;
    pointer-events: none;
}


@media (max-width: 900px) {
    .articles-content-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .articles-sidebar {
        order: -1; 
        padding: 0 0 30px 0;
        border-bottom: 1px solid #eee;
        margin-bottom: 30px;
    }

    .articles-list-grid {
        grid-template-columns: 1fr; 
    }
}

.header-with-breadcrumbs {
    height: 450px;
    min-height: 200px;
    background-size: cover;
    background-position: 10% 75%;
}

.header-with-breadcrumbs .overlay {
    background-color: rgba(26, 65, 0, 0.623);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.header-with-breadcrumbs .h-100 {
    height: 100%;
}

.header-with-breadcrumbs .breadcrumbs {
    color: white;
    padding-bottom: 10px;
}

.article-pre-header {
    font-size: 2rem;
}

.header-with-breadcrumbs .breadcrumbs a {
    color: #fdfdfd;
}

.header-with-breadcrumbs .breadcrumbs a:hover {
    font-weight: bold;
    color: #FF8C00;
    text-decoration: none;
}

.header-with-breadcrumbs span {
    font-weight: bold;
    color: #fdfdfd;
}

/* --- Article Styles--- */
.article-page-layout {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    color: #333;
}

.article-title {
    color: #e7212f;
    margin-top: 0;
    margin-bottom: 10px;

}

.article-header-section p:last-of-type {
    font-size: 1.25rem;
    font-weight: 300;
    color: #555;
    margin-bottom: 0;
}

.metadata {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777;
    margin-bottom: 20px;
    border-left: 3px solid #6b6bff;
    padding-left: 10px;
    line-height: 1;
}

.article-body p {
    font-size: 1.15rem;
    line-height: 1.75;
    margin-bottom: 25px;
}

.article-body .main-intro-list{
    padding-left: 2rem;
}

.article-body h4, .article-body h2 {
    color:#2a6442
}

.article-body .project-activities-link, .funding-institution-link {
    text-decoration: none;
    color: #f29f05;
}

.article-body .project-activities-link:hover,
.funding-institution-link:hover {
    text-decoration: underline;
    font-weight: 600;
    color: #f29f05;
}

.main-intro-paragraph {
    font-size: 1.25rem;
    font-weight: 400;
    color: #222;
    padding-top: 10px;
}

.hero-photo {
    margin: 40px 0;
    width: 100%;
}

.hero-photo img {
    display: block;
    width: 100%;
    height: auto;

    object-fit: cover; 
    object-position: center; 
    border-radius: 4px;
}

.photo-source {
    font-size: 0.85rem;
    color: #999;
    text-align: right;
    margin-top: 5px;
    font-style: italic;
}

.photo-gallery-strip {
    display: flex;
    gap: 15px;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    padding-bottom: 15px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.photo-gallery-strip::-webkit-scrollbar {
    height: 8px;
}

.photo-gallery-strip::-webkit-scrollbar-track {
    background: #ffadb3;
    border-radius: 10px;
}

.photo-gallery-strip::-webkit-scrollbar-thumb {
    background: #f76b1c;
    border-radius: 10px;
}

.photo-gallery-strip figure {
    flex: 0 0 300px;
    margin: 0;
    cursor: pointer;
    transition: transform 0.2s;
    height: 200px;
    background-color: #f0f0f0;
    border-radius: 8px;
}

.photo-gallery-strip figure:hover {
    transform: scale(1.02);
}

.photo-gallery-strip img {
    width: 100%;
    height: 200px; /* Uniform height for the strip */
    object-fit: cover;
    border-radius: 8px;
}


.image-modal {
    display: none; 
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.gallery-item-dual img {
    width: 100%;
    height: 350px; /* Fixed height for symmetry */
    object-fit: cover; /* Prevents stretching */
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    border: 1px solid #eee;
}

.gallery-item-dual img:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* On mobile, let the height shrink so it doesn't look too tall */
@media (max-width: 768px) {
    .gallery-item-dual img {
        height: 250px;
    }
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    font-weight: bold;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
    z-index: 10000;
}

.nav-btn:hover {
    color: #f76b1c;
}

.prev-btn { left: 10px; }
.next-btn { right: 10px; }

#caption-container {
    text-align: center;
    width: 100%;
}

#image-counter {
    color: white;
    margin-top: 15px;
    font-family: sans-serif;
    font-size: 1rem;
    opacity: 0.8;
}

@media (max-width: 600px) {
    .nav-btn { font-size: 30px; padding: 10px; }
}

.close-modal {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Update this existing section in your CSS */
.back-to-articles-cta {
    text-align: left; 
    padding: 30px 0;
    margin-top: 40px;
    padding-left: 0; 
}

.btn-back-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #e7212f;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-weight: bold;
}

.btn-back-link:hover {
    background-color: #ffadb3;
}

.project-activities-cta {
    text-align: right; 
    padding: 30px 0;
    margin-top: 40px;
    padding-right: 0; 
}

.btn-next-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #e7212f;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-weight: bold;
}

.btn-next-link:hover {
    background-color: #ffadb3;
}