﻿/* =============================================
   NEWS MODULE STYLES
   Author: Denny A Devassy
   Date: 2025-10-09
   ============================================= */

/* ==================== COMMON STYLES ==================== */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== LOADING SPINNER ==================== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 20px;
}

    .loading-spinner .spinner {
        width: 50px;
        height: 50px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #c41e3a;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 18px;
    color: #666;
}

/* ==================== NEWS LISTING PAGE ==================== */
.news-listing-page {
    padding: 0 0 60px;
    background: #f8f9fa;
    min-height: 100vh;
    margin-top: 0px;
    position: relative;
    z-index: 10;
    padding-bottom: 150px;
}

/* Search Header */
.news-search-header {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    margin-top: -50px;
    backdrop-filter: blur(10px);
}

    .news-search-header h1 {
        font-size: 42px;
        font-weight: 700;
        color: #1a1a1a;
        margin-bottom: 30px;
    }

/* Search Filters */
.search-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-bottom: 2px solid white;
    border-radius: 0;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.01) !important;
    color: black;
    height: 48px;
}
    .search-input::placeholder {
        color: black;
        opacity: 1;
    }
    .search-input:focus {
        outline: none;
        border-color: #c41e3a;
        box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
    }

.search-input-wrapper i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.filter-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    align-items: stretch;
}

.filter-select,
.filter-date {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    height: 48px;
}

    .filter-select:focus,
    .filter-date:focus {
        outline: none;
        border-color: #c41e3a;
    }

.search-btn {
    padding: 12px 30px;
    background: #c41e3a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    width: 100%;
}

    .search-btn:hover {
        background: #a01730;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
    }

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* News Card */
.news-card {
   
    border-radius: 12px;
    overflow: hidden;    
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .news-card:hover {
        transform: scale(1.05);
    }

.news-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 20px;
}

    .news-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

 

.news-category {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: #ffffff;
    color: #c41e3a;
    padding: 6px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
     
}

.news-content {
    padding: 25px 0px 0px 0px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    display: block;
    color: #999;
    font-size: 14px;
    margin-bottom: 12px;
}

.news-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-excerpt {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c41e3a;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
}

    .read-more:hover {
        gap: 12px;
    }

    .read-more i {
        transition: transform 0.3s ease;
    }

    .read-more:hover i {
        transform: translateX(5px);
    }

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 12px;
    margin:100px 0;
}

    .no-results i {
        font-size: 80px;
        color: #ddd;
        margin-bottom: 20px;
    }

    .no-results p {
        font-size: 18px;
        color: #999;
    }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn,
.pagination-number {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

    .pagination-btn:hover:not(:disabled),
    .pagination-number:hover {
        border-color: #c41e3a;
        color: #c41e3a;
    }

    .pagination-number.active {
        background: #c41e3a;
        color: #fff;
        border-color: #c41e3a;
    }

    .pagination-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }

    .filter-group {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .news-listing-page {
        padding: 40px 0;
    }

    .news-search-header {
        padding: 30px 20px;
    }

        .news-search-header h1 {
            font-size: 32px;
        }

    .filter-group {
        grid-template-columns: 1fr;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .news-search-header h1 {
        font-size: 28px;
    }

    .news-title {
        font-size: 18px;
    }

    .news-image {
        height: 200px;
    }
}

.news-page-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    margin-top: 20px;
    margin-bottom: 40px;
    width: 100%;
}

    /* News card - overlay style */
    .news-page-grid .photo-card.news-card-overlay {
        position: relative;
        overflow: hidden;
        cursor: pointer;
        border-radius: 12px;
        height: 320px;
        background: #000;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

        .news-page-grid .photo-card.news-card-overlay:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        }

        .news-page-grid .photo-card.news-card-overlay img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .news-page-grid .photo-card.news-card-overlay:hover img {
            transform: scale(1.05);
        }

        /* Overlay - hidden by default, slides up on hover */
        .news-page-grid .photo-card.news-card-overlay .photo-overlay {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            opacity: 0;
            transform: translateY(10px);
            padding: 22px 20px 18px;
            background: linear-gradient( to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.65) 55%, rgba(0, 0, 0, 0) 100% );
            z-index: 2;
            pointer-events: none;
            transition: opacity 0.3s ease, transform 0.3s ease;
        }

        .news-page-grid .photo-card.news-card-overlay:hover .photo-overlay {
            opacity: 1;
            transform: translateY(0);
        }

        .news-page-grid .photo-card.news-card-overlay .photo-overlay .photo-date {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: #ffffff !important;
            font-size: 12px;
            font-weight: 500;
            letter-spacing: 0.3px;
            margin-bottom: 8px;
        }

        .news-page-grid .photo-card.news-card-overlay .photo-overlay h4 {
            color: #ffffff !important;
            margin: 0 0 8px;
            font-size: 17px;
            line-height: 1.35;
            font-weight: 600;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .news-page-grid .photo-card.news-card-overlay .photo-overlay .news-excerpt-overlay {
            color: rgba(255, 255, 255, 0.85);
            font-size: 13px;
            line-height: 1.5;
            margin: 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* Category badge - top-left, always visible */
        .news-page-grid .photo-card.news-card-overlay .news-category-badge {
            position: absolute;
            top: 14px;
            left: 14px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            background: rgba(196, 30, 58, 0.95);
            color: #fff;
            font-size: 11px;
            font-weight: 600;
            border-radius: 20px;
            backdrop-filter: blur(4px);
            z-index: 3;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

            .news-page-grid .photo-card.news-card-overlay .news-category-badge i {
                font-size: 10px;
            }

/* RTL - swap category badge to the right */
html[dir="rtl"] .news-page-grid .photo-card.news-card-overlay .news-category-badge {
    left: auto;
    right: 14px;
}

html[dir="rtl"] .news-page-grid .photo-card.news-card-overlay .photo-overlay {
    text-align: right;
}

/* Tablet - 2 columns */
@media (max-width: 992px) {
    .news-page-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

        .news-page-grid .photo-card.news-card-overlay {
            height: 280px;
        }
}

/* Mobile - 1 column */
@media (max-width: 576px) {
    .news-page-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

        .news-page-grid .photo-card.news-card-overlay {
            height: 240px;
        }

            .news-page-grid .photo-card.news-card-overlay .photo-overlay h4 {
                font-size: 15px;
            }

            .news-page-grid .photo-card.news-card-overlay .photo-overlay .news-excerpt-overlay {
                display: none;
            }
}