/**
 * News and Gallery Page Fixes
 * Override any conflicting styles
 */

/* ==========================================
   Page Headers - Force White Text
   ========================================== */

.page-header .page-title,
.page-header h1 {
    color: #ffffff !important;
}

.page-header .page-subtitle,
.page-header p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ==========================================
   News Cards - Proper Colors
   ========================================== */

.news-card .card-title,
.news-card .card-title a {
    color: #1f2937 !important;
    text-decoration: none;
}

.news-card .card-title a:hover {
    color: #73281E !important;
}

.news-card .card-link {
    color: #73281E !important;
    font-weight: 600;
}

.news-card .card-link:hover {
    color: #5a1f17 !important;
}

/* ==========================================
   Category Filter Buttons
   ========================================== */

.news-filter-btn,
.gallery-filter-btn {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    color: #374151 !important;
}

.news-filter-btn:hover,
.gallery-filter-btn:hover {
    background: #f3f4f6 !important;
    border-color: #73281E !important;
    color: #73281E !important;
}

.news-filter-btn.active,
.gallery-filter-btn.active {
    background: #73281E !important;
    border-color: #73281E !important;
    color: #ffffff !important;
}

/* ==========================================
   Gallery Grid Layout
   ========================================== */

.photo-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
}

@media (max-width: 1024px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   NEWS SECTION - COMPLETE FIX
   ========================================== */

/* News Grid - Equal Height Cards */
.news-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 32px !important;
    align-items: stretch !important;
}

/* News Card - Full Height */
.news-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Card Image - Fixed Height with Object Fit */
.news-card .card-image {
    position: relative !important;
    width: 100% !important;
    height: 240px !important;
    padding-top: 0 !important;
    background-color: #f3f4f6 !important;
    overflow: hidden !important;
}

.news-card .card-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.news-card:hover .card-image img {
    transform: scale(1.08) !important;
}

/* Card Content - Flex to Fill Space */
.news-card .card-content {
    padding: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    gap: 12px !important;
}

/* Card Date */
.news-card .card-date {
    display: block !important;
    font-size: 14px !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

/* Card Title - Truncate at 2 Lines */
.news-card .card-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    line-height: 1.4 !important;
    margin-bottom: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 56px !important;
}

/* Card Excerpt - Truncate at 3 Lines */
.news-card .card-excerpt {
    font-size: 15px !important;
    color: #4b5563 !important;
    line-height: 1.6 !important;
    margin-bottom: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
}

/* Card Link - Always at Bottom */
.news-card .card-link {
    display: inline-flex !important;
    align-items: center !important;
    font-weight: 600 !important;
    color: #73281E !important;
    transition: all 0.2s ease !important;
    margin-top: auto !important;
    padding-top: 8px !important;
}

.news-card .card-link:hover {
    color: #5a1f17 !important;
    gap: 8px !important;
}

/* Badge Positioning */
.news-card .card-badge {
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    padding: 6px 14px !important;
    background: linear-gradient(135deg, #73281E 0%, #9e3039 100%) !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 12px rgba(115, 40, 30, 0.4) !important;
    z-index: 10 !important;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }

    .news-card .card-image {
        height: 220px !important;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .news-card .card-image {
        height: 200px !important;
    }

    .news-card .card-title {
        font-size: 18px !important;
        min-height: 50px !important;
    }

    .news-card .card-excerpt {
        font-size: 14px !important;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .news-card .card-content {
        padding: 20px !important;
    }

    .news-card .card-image {
        height: 180px !important;
    }
}
