/* ===================================
   NEWS & EVENTS PAGE STYLES
   =================================== */

/* === PAGE LAYOUT === */
.news-events-page {
    background: #ffffff;
    min-height: 100vh;
}

/* === HEADER SECTION === */
.news-header {
    background: linear-gradient(135deg, #325D53 0%, #285446 100%);
    padding: 150px 20px 60px; /* UPDATED: Desktop padding-top 150px */
    position: relative;
    overflow: hidden;
}

.news-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.news-header-content {
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 40px;
}

.news-title {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.news-subtitle {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
}

/* === FILTER TABS === */
.news-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 12px 35px;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: #ffffff;
    color: #325D53;
    border-color: #ffffff;
}

.filter-tab span {
    position: relative;
}

/* === NEWS GRID SECTION === */
.news-grid-section {
    padding: 80px 20px;
    background: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    animation: fadeInUp 0.8s ease;
}

/* === NEWS CARD === */
.news-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s ease, 
                transform 0.5s ease;
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
}

.news-card.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    height: 0;
    width: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.news-card.filtering {
    opacity: 0.3;
    transform: scale(0.98);
}

.news-card:hover {
    transform: translateY(-8px) scale(1);
    box-shadow: 0 12px 40px rgba(50, 93, 83, 0.2);
}

.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* === CARD IMAGE === */
.news-card-image {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    background: #f0f0f0;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s ease;
}

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

.news-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.news-card:hover .news-card-overlay {
    opacity: 1;
}

/* === NEWS BADGE === */
.news-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 20px;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 30px;
    z-index: 2;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.news-badge.news {
    background: linear-gradient(135deg, #325D53 0%, #285446 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.news-badge.events {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* === CARD CONTENT === */
.news-card-content {
    padding: 30px;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.news-date {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-date i {
    color: #325D53;
}

.news-card-title {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    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-card-title {
    color: #325D53;
}

.news-card-excerpt {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === CARD FOOTER === */
.news-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.read-more {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #325D53;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.news-card:hover .read-more {
    gap: 12px;
}

.read-more i {
    transition: transform 0.3s ease;
}

.news-card:hover .read-more i {
    transform: translateX(4px);
}

/* === NO POSTS === */
.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.no-posts i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-posts p {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 18px;
    margin: 0;
}

/* === PAGINATION === */
.news-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.news-pagination ul {
    display: flex;
    list-style: none;
    gap: 10px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.news-pagination li {
    margin: 0;
}

.news-pagination a,
.news-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #325D53;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-pagination a:hover {
    background: #325D53;
    color: #ffffff;
    border-color: #325D53;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(50, 93, 83, 0.2);
}

.news-pagination .current {
    background: #325D53;
    color: #ffffff;
    border-color: #325D53;
    cursor: default;
}

.news-pagination .prev,
.news-pagination .next {
    gap: 8px;
}

.news-pagination .dots {
    border: none;
    background: transparent;
    color: #999;
    cursor: default;
}

.news-pagination .dots:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === RESPONSIVE DESIGN === */

/* === MOBILE STICKY FILTER BUTTONS === */
@media (max-width: 768px) {
    .news-filter-tabs {
        position: fixed;
        bottom: calc(95px + env(safe-area-inset-bottom));
        left: 20px;
        right: auto;
        background: transparent;
        box-shadow: none;
        padding: 0;
        z-index: 1000;
        flex-direction: column;
        gap: 12px;
        justify-content: flex-start;
        border: none;
    }
    
    .filter-tab {
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 6px;
        font-weight: 700;
        background: #ffffff;
        color: #325D53;
        border: 2px solid #325D53;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        transition: all 0.3s ease;
    }
    
    .filter-tab span {
        display: block;
        line-height: 1;
    }
    
    .filter-tab.active {
        background: linear-gradient(135deg, #325D53 0%, #285446 100%);
        color: #ffffff;
        border-color: #325D53;
        transform: scale(1.15);
        box-shadow: 0 6px 20px rgba(50, 93, 83, 0.4);
    }
    
    .filter-tab:active {
        transform: scale(0.95);
    }
}

/* === RESPONSIVE DESIGN === */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 30px;
    }
    
    .news-title {
        font-size: 40px;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .news-header {
        padding: 100px 20px 40px;
    }
    
    .news-title {
        font-size: 32px;
        letter-spacing: 1px;
    }
    
    .news-subtitle {
        font-size: 16px;
    }
    
    .news-filter-tabs {
        gap: 10px;
    }
    
    .filter-tab {
        padding: 10px 25px;
        font-size: 10px;
    }
    
    .news-grid-section {
        padding: 50px 15px 100px; /* Added bottom padding for mobile footer */
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .news-pagination {
        margin-top: 40px;
        margin-bottom: 80px; /* Extra space for sticky filters */
    }
    
    .news-pagination a,
    .news-pagination span {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .news-card-image {
        height: 220px;
    }
    
    .news-badge {
        top: 15px;
        left: 15px;
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .news-card-content {
        padding: 25px;
    }
    
    .news-card-title {
        font-size: 20px;
    }
    
    .news-card-excerpt {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .news-header {
        padding: 50px 15px 30px;
    }
    
    .news-title {
        font-size: 28px;
    }
    
    .news-subtitle {
        font-size: 14px;
    }
    
    .filter-tab {
        padding: 8px 20px;
        font-size: 7px;
    }
    
    .news-card-image {
        height: 200px;
    }
    
    .news-card-content {
        padding: 20px;
    }
    
    .news-card-title {
        font-size: 18px;
    }
}