/* --- News Page Banner --- */
.page-banner-clean {
    background: linear-gradient(135deg, #eaf4ff, #f6fbff); /* Sky Blossom Blue gradient */
    padding: 100px 0 60px;
    text-align: center;
    border-bottom: 10px solid var(--border);
}

body.dark-theme .page-banner-clean {
    background: linear-gradient(135deg, #111827, #0f1720);
}

.page-banner-inner {
    max-width: 700px;
    margin: 0 auto;
}

.page-banner-inner h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text);
    margin: 16px 0;
    line-height: 1.2;
}

.page-banner-inner p {
    font-size: 18px;
    color: var(--muted);
    line-height: 1.7;
}

/* --- News Grid & Cards --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding-top: 20px;
}

.news-card {
    background: var(--card);
    border: 10px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: 0.35s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong);
}

/* Image styling with zoom hover effect */
.news-image-wrap {
    height: 220px;
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.news-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image-wrap img {
    transform: scale(1.06);
}

.news-date {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1e3a8a; /* Deep Navy Blue accent */
    font-weight: 700;
    margin-bottom: 12px;
    display: inline-block;
}

body.dark-theme .news-date {
    color: #93c5fd;
}

.news-card-content h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.4;
}

.news-summary {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1; /* Pushes the 'Read More' button to the bottom of the card */
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: 0.2s ease;
}

.news-read-more:hover {
    color: #1e3a8a;
    transform: translateX(5px); /* Arrow slides to the right on hover */
}

/* --- Empty State (When no news is in database) --- */
.no-news-message {
    text-align: center;
    padding: 80px 20px;
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: 24px;
    color: var(--muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .page-banner-clean {
        padding: 80px 20px 40px;
    }

    .page-banner-inner h1 {
        font-size: 36px;
    }
    
    .news-image-wrap {
        height: 200px;
    }
}

/* --- Article Gallery Section --- */
/* --- Article Detail Page (Reading View) --- */
.article-detail-page {
    padding: 60px 20px 100px;
    background-color: var(--bg);
}

.article-container {
    max-width: 800px; /* Keeps reading width comfortable */
    margin: 0 auto;
}

.back-link-wrap {
    margin-bottom: 30px;
}

.back-to-news {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s ease;
}

.back-to-news:hover {
    color: var(--primary);
}

.article-header {
    margin-bottom: 30px;
}

.article-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin-top: 10px;
}

/* --- THE HERO IMAGE FIX --- */
.article-hero-image {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.article-hero-image img {
    width: 100%;
    height: 450px; /* Forces the image to never be taller than 450px */
    object-fit: cover; /* Crops perfectly to fit the box without distorting */
    display: block;
    object-position: center;
}

.article-body p {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .article-title {
        font-size: 32px;
    }
    .article-hero-image img {
        height: 250px; /* Smaller height for mobile phones */
    }
}

.article-gallery-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.article-gallery-section h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 24px;
    font-weight: 800;
}

.article-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Puts 2 images side-by-side */
    gap: 24px;
}

.gallery-item {
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.media-caption {
    padding: 16px;
    font-size: 18px;
    color: var(--muted);
    text-align: center;
    font-style: italic;
    background-color: var(--bg);
}

/* For video embeds if you add them later */
.video-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Mobile view: stack gallery images on top of each other */
@media (max-width: 768px) {
    .article-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Lightbox Modal (Clickable Images) --- */

/* Add a pointer cursor to any image with this class */
.lightbox-trigger {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.lightbox-trigger:hover {
    opacity: 0.85; /* Gentle visual cue on hover */
}

/* The Modal (the black background) */
.image-modal-overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place, even when scrolling */
    z-index: 2000; /* Sit on top of everything else (even header) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling the body while the image is open */
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ 90% opacity */
    opacity: 0;
    transition: opacity 0.4s ease; /* Fade-in animation */
    align-items: center;
    justify-content: center;
}

/* When active, display it and fade it in */
.image-modal-overlay.active {
    display: flex; /* Centering */
    opacity: 1;
}

/* Modal Content (The large Image itself) */
.modal-content-img {
    max-width: 90%;
    max-height: 85%;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

/* When the modal opens, the image slightly 'pops' out */
.image-modal-overlay.active .modal-content-img {
    transform: scale(1);
}

/* The Close Button (the large X) */
.modal-close-btn {
    position: absolute;
    top: 30px;
    right: 35px;
    color: #ffffff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
}

.modal-close-btn:hover {
    color: var(--primary); /* Your site primary blue */
    transform: scale(1.1);
}

/* Mobile-Specific Tweaks */
@media (max-width: 768px) {
    .modal-content-img {
        max-width: 95%;
        max-height: 80%;
    }
    .modal-close-btn {
        top: 20px;
        right: 20px;
        font-size: 40px;
    }
}