/* ===== NEWS PAGE STYLES ===== */

/* Page Header Styles */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-gray) 100%);
    color: var(--text-light);
    padding: 80px 20px 40px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.05;
    pointer-events: none;
}

.page-header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-light);
}

.page-subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

/* News Grid Section */
.news-grid-section {
    padding: 80px 0;
    background-color: var(--light-bg);
    position: relative;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 50px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    min-height: 500px;
}

.news-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.news-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.news-image-container {
    position: relative;
    height: 280px;
    overflow: hidden;
    width: 100%;
}

.news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

.news-category {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--accent-color);
    color: var(--text-dark);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-content {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.news-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.news-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-excerpt {
    color: var(--medium-gray);
    line-height: 1.7;
    margin-bottom: 25px;
    flex: 1;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .read-more {
    margin-top: auto;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Enhanced Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 60px;
    flex-wrap: wrap;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

.pagination-btn {
    min-width: 45px;
    height: 45px;
    border-radius: 8px;
    background-color: white;
    border: 1px solid var(--medium-gray);
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-dark);
    font-weight: 600;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(248, 195, 0, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: var(--medium-gray);
    padding: 0 8px;
    user-select: none;
    font-size: 1.2rem;
}

/* Loading state */
.news-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 60px;
    color: var(--medium-gray);
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.loading-spinner i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.news-grid.loading + .loading-spinner {
    display: block;
}

/* Page Info */
.page-info {
    text-align: center;
    margin-top: 30px;
    color: var(--medium-gray);
    font-size: 1rem;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

#bottom-page-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ===== RESPONSIVE STYLES ===== */

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .news-grid {
        width: 98%;
        gap: 35px;
    }

    .pagination {
        width: 98%;
    }

    .page-info {
        width: 98%;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .page-title {
        font-size: 2.2rem;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
        width: 95%;
    }

    .news-card {
        height: auto;
    }

    .news-grid-section {
        padding: 60px 0;
    }

    .pagination {
        width: 95%;
        margin-top: 50px;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .page-header {
        padding: 60px 20px 30px;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .news-grid-section {
        padding: 40px 0;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        width: 90%;
    }

    .news-card {
        max-width: 100%;
    }

    .news-image-container {
        height: 240px;
    }

    .news-content {
        padding: 25px;
    }

    .news-title {
        font-size: 1.4rem;
    }

    .pagination {
        gap: 8px;
        width: 90%;
        margin-top: 40px;
    }

    .pagination-btn {
        min-width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .page-title {
        font-size: 1.6rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    .news-grid-section {
        padding: 30px 0;
    }

    .news-grid {
        width: 95%;
        gap: 25px;
    }

    .news-image-container {
        height: 200px;
    }

    .news-content {
        padding: 20px;
    }

    .news-title {
        font-size: 1.3rem;
    }

    .news-meta {
        flex-direction: row;
        gap: 15px;
        font-size: 0.85rem;
    }

    .news-excerpt {
        font-size: 0.95rem;
    }

    .news-category {
        top: 15px;
        left: 15px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
        width: 95%;
    }

    .pagination-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
}
