/* News and Events Page Styles */

.news-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border: 1px solid #e9ecef;
    cursor: pointer;
    position: relative;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.news-card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none;
    color: inherit;
}

.news-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.news-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 200px);
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}

.news-title:hover {
    color: #14899a;
}

.news-summary {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.news-date {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin-top: auto;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
}

.news-category {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: #495057;
}

/* Pagination Styles */
.pagination {
    margin-top: 30px;
    margin-bottom: 0;
}

/* Responsive pagination improvements */
@media (max-width: 767.98px) {
    .pagination {
        margin-top: 20px !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    
    .pagination .page-link {
        padding: 8px 12px !important;
        font-size: 14px !important;
        min-width: 44px !important;
        text-align: center !important;
    }
    
    .pagination .page-item {
        margin: 2px !important;
    }
}

    .pagination .page-link {
        color: #14899a;
        border: 1px solid #dee2e6;
        padding: 8px 12px;
        margin: 0 2px;
        border-radius: 4px;
        transition: all 0.2s ease;
    }

    .pagination .page-item.active .page-link {
        background-color: #14899a;
        border-color: #14899a;
        color: white;
    }

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #007bff;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Filter and Search Section */
.news-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

/* Responsive improvements for search and filter section */
@media (max-width: 767.98px) {
    .news-filters {
        padding: 15px !important;
        margin-bottom: 20px !important;
    }
    
    .filter-group .d-flex.flex-column.flex-md-row {
        gap: 10px !important;
    }
    
    .filter-group .flex-grow-1 {
        margin-bottom: 0 !important;
    }
    
    .filter-group .d-flex.align-items-end {
        margin-top: 10px !important;
    }
    
    .filter-group .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0;
}

.filter-group select,
.filter-group input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Loading State */
.news-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.news-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty State */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

/* Responsive improvements for empty and loading states */
@media (max-width: 767.98px) {
    .news-empty {
        padding: 40px 15px !important;
    }
    
    .news-empty i {
        font-size: 3rem !important;
        margin-bottom: 15px !important;
    }
    
    .news-empty h4 {
        font-size: 1.25rem !important;
        margin-bottom: 8px !important;
    }
    
    .news-empty p {
        font-size: 0.9rem !important;
    }
    
    .news-loading {
        padding: 30px 15px !important;
    }
    
    .news-loading .spinner-border {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    .news-loading p {
        font-size: 0.9rem !important;
        margin-top: 15px !important;
    }
}

.news-empty i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.news-empty h4 {
    color: #495057;
    margin-bottom: 10px;
}

/* ===================================
   RESPONSIVE DESIGN FOR NEWS & EVENTS
   =================================== */
/* 
   Mobile Strategy: Hide description on mobile devices to prioritize image display
   - This ensures images are properly visible and sized on small screens
   - Title and meta information remain visible for context
   - Description is hidden to save vertical space
*/

/* Tablet and small desktop (768px and below) */
@media (max-width: 768px) {
    .news-card {
        margin-bottom: 20px;
        height: auto !important;
    }
    
    .news-content {
        padding: 15px !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .news-title {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        -webkit-line-clamp: 3 !important;
        line-height: 1.3 !important;
    }
    
    .news-summary {
        font-size: 13px !important;
        margin-bottom: 12px !important;
        -webkit-line-clamp: 4 !important;
        line-height: 1.4 !important;
    }
    
    .news-image {
        height: 150px !important;
    }
    
    .filter-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .filter-group label {
        margin-bottom: 5px !important;
    }

    .news-filters {
        padding: 15px !important;
        margin-bottom: 20px !important;
    }

    .news-meta {
        margin-top: 8px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .news-date, .news-category {
        font-size: 11px !important;
    }
}

/* Mobile (576px and below) */
@media (max-width: 576px) {
    .news-card {
        margin-bottom: 15px !important;
        border-radius: 6px !important;
    }
    
    .news-image {
        height: 140px !important; /* Increased height for better image display */
    }
    
    .news-content {
        padding: 10px !important; /* Reduced padding to save space */
        height: auto !important;
        min-height: auto !important;
    }
    
    .news-title {
        font-size: 13px !important;
        margin-bottom: 8px !important; /* Increased margin since no description */
        -webkit-line-clamp: 2 !important;
        line-height: 1.3 !important;
        font-weight: 600 !important;
    }
    
    /* Hide description on mobile to save space for image */
    .news-summary {
        display: none !important;
    }
    
    .news-meta {
        margin-top: 8px !important; /* Increased margin since no description */
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .news-date, .news-category {
        font-size: 10px !important;
    }

    .news-category {
        align-self: flex-start !important;
        margin-top: 2px !important;
    }
    
    .pagination .page-link {
        padding: 6px 10px !important;
        font-size: 14px !important;
    }

    .news-filters {
        padding: 12px !important;
        margin-bottom: 15px !important;
        border-radius: 6px !important;
    }

    .filter-group {
        gap: 8px !important;
    }

    .filter-group input,
    .filter-group select {
        padding: 8px 10px !important;
        font-size: 14px !important;
    }

    .filter-group .btn {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .news-card {
        margin-bottom: 12px !important;
        border-radius: 4px !important;
    }
    
    .news-image {
        height: 120px !important; /* Increased height for better image display */
    }
    
    .news-content {
        padding: 8px !important; /* Reduced padding to save space */
    }
    
    .news-title {
        font-size: 12px !important;
        margin-bottom: 6px !important; /* Increased margin since no description */
        -webkit-line-clamp: 2 !important;
    }
    
    /* Hide description on small mobile to save space for image */
    .news-summary {
        display: none !important;
    }
    
    .news-meta {
        margin-top: 6px !important; /* Increased margin since no description */
        gap: 3px !important;
    }

    .news-date, .news-category {
        font-size: 9px !important;
    }

    .news-filters {
        padding: 10px !important;
        margin-bottom: 12px !important;
    }

    .filter-group {
        gap: 6px !important;
    }

    .filter-group input,
    .filter-group select {
        padding: 6px 8px !important;
        font-size: 13px !important;
    }

    .filter-group .btn {
        padding: 6px 12px !important;
        font-size: 13px !important;
    }

    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .col-lg-4.col-md-6.mb-4 {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}

/* Very small mobile (360px and below) */
@media (max-width: 360px) {
    .news-card {
        margin-bottom: 10px !important;
    }
    
    .news-image {
        height: 100px !important; /* Increased height for better image display */
    }
    
    .news-content {
        padding: 6px !important; /* Reduced padding to save space */
    }
    
    .news-title {
        font-size: 11px !important;
        margin-bottom: 5px !important; /* Increased margin since no description */
        -webkit-line-clamp: 2 !important;
    }
    
    /* Hide description on very small mobile to save space for image */
    .news-summary {
        display: none !important;
    }
    
    .news-meta {
        margin-top: 5px !important; /* Increased margin since no description */
        gap: 2px !important;
    }

    .news-date, .news-category {
        font-size: 8px !important;
    }

    .news-filters {
        padding: 8px !important;
        margin-bottom: 10px !important;
    }

    .filter-group {
        gap: 4px !important;
    }

    .filter-group input,
    .filter-group select {
        padding: 5px 6px !important;
        font-size: 12px !important;
    }

    .filter-group .btn {
        padding: 5px 10px !important;
        font-size: 12px !important;
    }

    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .col-lg-4.col-md-6.mb-4 {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
}

/* ===================================
   RESPONSIVE GRID IMPROVEMENTS
   =================================== */

/* Ensure proper grid behavior on different screen sizes */
@media (max-width: 767.98px) {
    .col-lg-4.col-md-6.mb-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .col-lg-4.col-md-6.mb-4 {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
    }
}

@media (min-width: 992px) {
    .col-lg-4.col-md-6.mb-4 {
        width: 33.333333% !important;
        max-width: 33.333333% !important;
        flex: 0 0 33.333333% !important;
    }
}

/* Animation for card entrance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.6s ease-out;
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }
.news-card:nth-child(6) { animation-delay: 0.6s; }
.news-card:nth-child(7) { animation-delay: 0.7s; }
.news-card:nth-child(8) { animation-delay: 0.8s; }
.news-card:nth-child(9) { animation-delay: 0.9s; }
.news-card:nth-child(10) { animation-delay: 1.0s; }
.news-card:nth-child(11) { animation-delay: 1.1s; }
.news-card:nth-child(12) { animation-delay: 1.2s; } 