:root {
    --white: #ffffff;
}
.page-header {
    background: transparent;
    padding: 140px 5% 0;
    text-align: center;
}
.page-header h1 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}
.content-section {
    padding: 3rem 5% 5rem;
    max-width: 1720px;
    margin: 0 auto;
}

/* Search and Filter Panel */
.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3.5rem;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid #eef2ef;
}
@media (min-width: 768px) {
    .filter-panel {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 450px;
}
.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}
.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(80, 121, 3, 0.15);
}
.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
}

.categories-filter {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none; /* Firefox */
}
.categories-filter::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.btn-filter {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.btn-filter.active, .btn-filter:hover {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(80, 121, 3, 0.2);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}
@media (min-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.news-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid #eef2ef;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(24, 80, 18, 0.08);
}

.news-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}
.news-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.news-card:hover .news-img-wrapper img {
    transform: scale(1.08);
}

.news-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    text-transform: uppercase;
}

.news-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}
.news-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.news-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}
.news-card:hover .news-title {
    color: var(--primary-color);
}

.news-excerpt {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.news-readmore {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}
.news-card:hover .news-readmore {
    gap: 0.75rem;
}

/* Modal Style */
.news-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 1rem;
}
.news-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.news-modal-content {
    background: var(--white);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 24px;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.news-modal.open .news-modal-content {
    transform: scale(1);
}

.btn-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    color: #1e293b;
}
.btn-modal-close:hover {
    background: #ef4444;
    color: var(--white);
    transform: rotate(90deg);
}

.modal-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    background: #f1f5f9;
}
.modal-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.modal-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.modal-hero-tag {
    position: absolute;
    bottom: 1.5rem;
    left: 2rem;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    text-transform: uppercase;
}

.modal-body {
    padding: 2.5rem;
}

.modal-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
}
.modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.modal-text {
    color: #334155;
    font-size: 1rem;
    line-height: 1.8;
    white-space: pre-line;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
    grid-column: 1 / -1;
    font-size: 1.1rem;
}

/* Modern Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4rem;
    padding: 1.25rem 2rem;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2ef;
    flex-wrap: wrap;
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease;
}

.pagination-info {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
}

.pagination-info span {
    color: var(--secondary-color);
    font-weight: 700;
}

.pagination-controls {
    display: flex;
    align-items: center;
    background: var(--secondary-color); /* forest dark green capsule */
    border-radius: 14px;
    padding: 0.35rem;
    box-shadow: 0 10px 30px rgba(24, 80, 18, 0.15);
}

.pag-btn {
    background: transparent;
    color: #ffffff; /* White text/arrows */
    border: none;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pag-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15); /* Light glass hover */
    color: #ffffff;
}

.pag-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.5);
}

.pag-numbers {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.pag-num {
    background: transparent;
    color: #ffffff; /* White page numbers */
    border: none;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pag-num:hover {
    background: rgba(255, 255, 255, 0.15); /* Light glass hover */
    color: #ffffff;
}

.pag-num.active {
    background: #ffffff; /* White background for active item */
    color: var(--secondary-color); /* Dark green text */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pag-dots {
    color: rgba(255, 255, 255, 0.6); /* White dots */
    width: 30px;
    text-align: center;
    font-weight: 600;
    user-select: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .pagination-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem 1.5rem;
    }
}
