/* ========================================================
   ALL NEWS PAGE (template-news.php)
   ======================================================== */
.news-page-banner {
    width: 100%;
    margin-bottom: 35px;
    margin-top: 0cap; /* Adjust this value to match your sticky header height */
}
.news-page-banner img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

/* text container for the news page */
.news-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
    font-family: 'Noto Sans Khmer', sans-serif;
}

/* Header Text Styling */
.news-page-header {
    text-align: center;
    margin-bottom: 50px;
}
.news-page-header h2 {
    color: var(--brand-green, #0fa153);
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
}
.news-page-header p {
    color: #666;
    font-size: 18px;
}

/* 3-Column Grid */
.news-page-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Card Styling & Animation */
.news-page-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.news-page-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.news-image-wrapper {
    position: relative;
    height: 240px;
    overflow: hidden;
}
.news-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.news-page-card:hover .news-image-wrapper img {
    transform: scale(1.05);
}

/* Floating Date Badge */
.news-date-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--brand-green, #0fa153);
    color: #ffffff;
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.news-page-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Pushes the button to the bottom evenly */
}
.news-page-content h3 {
    color: #333;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.5;
}
.news-page-content p {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Read More Button */
.btn-read-more {
    color: var(--brand-green, #0fa153);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}
.news-page-card:hover .btn-read-more {
    gap: 12px; /* Makes the arrow slide to the right on hover! */
    color: #0b4f2c;
}

/* ================= MOBILE RESPONSIVE FIXES ================= */
@media (max-width: 900px) {
    .news-page-banner {
        margin-top: 0cap; /* Clears your sticky header */
    }
    .news-page-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
        gap: 20px;
    }
    .news-page-header h2 {
        font-size: 32px;
    }
}
@media (max-width: 600px) {
    .news-page-grid {
        grid-template-columns: 1fr; /* 1 column on phones */
    }
    .news-image-wrapper {
        height: 200px;
    }
}
/* ========================================================
   PAGINATION BUTTONS (PAGE 1, 2, 3...)
   ======================================================== */
.custom-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 50px;
    grid-column: 1 / -1; /* Forces the pagination to span all 3 columns and sit at the bottom center */
}

.custom-pagination .page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #dddddd;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Noto Sans Khmer', sans-serif;
    transition: all 0.3s ease;
}

/* Hover Effect */
.custom-pagination .page-numbers:hover {
    background-color: #eef7ed;
    color: var(--brand-green, #0fa153);
    border-color: var(--brand-green, #0fa153);
}

/* The Current Active Page */
.custom-pagination .page-numbers.current {
    background-color: var(--brand-green, #0fa153);
    color: #ffffff;
    border-color: var(--brand-green, #0fa153);
    pointer-events: none; /* Prevents clicking the page you are already on */
}

/* Mobile Adjustments for Pagination */
@media (max-width: 600px) {
    .custom-pagination {
        gap: 5px;
    }
    .custom-pagination .page-numbers {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
        padding: 0 8px;
    }
}