/* ================================================= */
/* Base Structure for Sticky Footer (Mobile First) */
/* ================================================= */

html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* ensure full viewport height */
}

.page-content {
    flex: 1; /* makes main content grow to push footer down */
}

/* ================================================= */
/* News Hero Section */
/* ================================================= */
.news-hero {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.news-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 0 1rem; /* Added for mobile safety */
}

.hero-text h1 {
    font-family: 'Montserrat', 'Arial Black', Impact, sans-serif;
    font-size: 2.9rem; /* Base desktop size */
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
}

.hero-text p {
    font-family: 'Times New Roman', serif;
    font-size: 1.3rem; /* Base desktop size */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s 0.5s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================= */
/* News Section Header */
/* ================================================= */
.news-section {
    padding: 60px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0F766E;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: #0F766E; /* Added color for clarity */
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ================================================= */
/* News Grid and Cards */
/* ================================================= */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Always 3 per row on Desktop */
    gap: 30px;
    padding: 40px 60px; /* Base padding */
    justify-items: center;
    max-width: 1300px; /* Constrain grid width */
    margin: 0 auto;
}

.news-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    height: 400px; 
    width: 100%;
    max-width: 350px;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card img {
    width: 100%;
    height: 180px; 
    object-fit: cover;
}

.news-card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    flex-grow: 0;
}

.news-card .date {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.news-card p {
    flex-grow: 1;
    font-size: 0.95rem;
    color: #444;
}

.read-more-btn {
    align-self: flex-start;
    margin-top: 15px;
    padding: 8px 14px;
    background: #0F766E; /* Used consistent teal */
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

/* ================================================= */
/* Pagination */
/* ================================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}
.pagination button {
    padding: 8px 16px;
    background: #0F766E;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ================================================= */
/* News Detail View */
/* ================================================= */
.news-detail {
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
}
.news-detail h1 {
    color: #0F766E;
    font-size: 2rem;
    margin-bottom: 10px;
}
.news-detail .date {
    color: #777;
    margin-bottom: 20px;
}
.news-detail img.detail-image {
    display: block;
    max-width: 100%; /* Ensures it fits on all screens */
    height: auto;
    max-height: 350px;
    object-fit: cover;
    margin: 0 auto 20px;
    border-radius: 10px;
}

.news-detail .full-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}
.no-news-message {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.3rem;
    color: #555;
    padding: 40px 0;
}

/* ================================================= */
/* Media Queries for Responsiveness */
/* ================================================= */

/* Tablet and Smaller Desktops (max-width: 1024px) */
@media (max-width: 1024px) {
    /* Hero */
    .news-hero {
        height: 300px;
    }
    .hero-text h1 {
        font-size: 2.5rem;
    }
    .hero-text p {
        font-size: 1.1rem;
    }

    /* Grid Layout: 2 columns */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 20px 30px;
    }

    /* Cards */
    .news-card {
        height: 350px;
    }
    .news-card img {
        height: 150px;
    }
    .news-card h3 {
        font-size: 1.1rem;
    }

    /* Section Header */
    .section-header h2 {
        font-size: 2rem;
    }
    
    /* News Detail */
    .news-detail {
        margin: 30px auto;
    }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
    /* Hero */
    .news-hero {
        height: 200px;
    }
    .hero-text h1 {
        font-size: 1.8rem;
    }
    .hero-text p {
        font-size: 1rem;
    }

    /* General Padding */
    .news-section {
        padding: 30px 10px;
    }
    
    /* Section Header */
    .section-header h2 {
        font-size: 1.6rem;
    }

    /* Grid Layout: 1 column (vertical stacking) */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 10px;
    }
    
    /* Cards */
    .news-card {
        height: auto; /* Allow height to adjust for content */
        max-width: 100%; /* Take full width */
    }
    .news-card img {
        height: 120px;
    }
    .news-card h3 {
        font-size: 1rem;
    }
    .news-card .date,
    .news-card p {
        font-size: 0.85rem;
    }

    /* News Detail */
    .news-detail {
        padding: 0 15px;
        margin: 20px auto;
    }
    .news-detail h1 {
        font-size: 1.6rem;
    }
    .news-detail .full-content {
        font-size: 0.95rem;
    }
}