/* ==========================================================================
   News & Activities Stylesheet (styleNews.css)
   Thailand-Japan Decarbonization Award (TJDA)
   ========================================================================== */

:root {
    --news-primary: #15803d;
    --news-primary-hover: #166534;
    --news-primary-light: #22c55e;
    --news-primary-bg: #f0fdf4;
    --news-emerald: #10b981;
    --news-dark: #0f172a;
    --news-title-color: #064e3b;
    --news-text-body: #334155;
    --news-text-muted: #64748b;
    --news-card-bg: #ffffff;
    --news-border: rgba(22, 163, 74, 0.16);
    --news-radius: 20px;
    --news-shadow: 0 10px 30px -6px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(22, 163, 74, 0.10);
    --news-shadow-hover: 0 20px 42px -8px rgba(22, 163, 74, 0.22), 0 0 0 1px rgba(22, 163, 74, 0.28);
    --news-transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== News Section ==================== */
.news-section {
    padding: 30px 20px 90px;
    max-width: 1320px;
    margin: 0 auto;
    margin-top: 40px;
}

/* Filter Navigation Bar */
.news-filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0 auto 36px;
    flex-wrap: wrap;
    padding: 6px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 40px;
    border: 1px solid rgba(22, 163, 74, 0.18);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
    max-width: fit-content;
}

.news-filter-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 9px 22px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--news-transition);
}

.news-filter-btn:hover {
    color: var(--news-primary);
    background: rgba(22, 163, 74, 0.08);
}

.news-filter-btn.active {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.32);
}

/* ==================== 3-Column News Grid ==================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    width: 100%;
}

/* Individual News Card */
.news-card {
    background: var(--news-card-bg);
    border-radius: var(--news-radius);
    border: 1px solid var(--news-border);
    box-shadow: var(--news-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: var(--news-transition);
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--news-shadow-hover);
    border-color: rgba(22, 163, 74, 0.35);
}

/* Anchor highlight effect */
.news-card.targeted {
    animation: highlightPulse 2s ease-in-out infinite alternate;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 3px #16a34a, 0 16px 40px rgba(22, 163, 74, 0.3);
    }
    100% {
        box-shadow: 0 0 0 6px #22c55e, 0 20px 48px rgba(34, 197, 94, 0.45);
    }
}

/* News Cover Image */
.news-cover-wrap {
    position: relative;
    height: 220px;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.news-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

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

/* Badges on image */
.news-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(135deg, rgba(21, 128, 61, 0.95), rgba(22, 163, 74, 0.95));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.80rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.news-badge.badge-gold {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.news-badge.badge-info {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
}

.news-badge.badge-purple {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
}

.news-date-badge {
    position: absolute;
    bottom: 12px;
    right: 14px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

/* Card Body */
.news-card-body {
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--news-title-color);
    line-height: 1.5;
    margin-bottom: 12px;
    font-family: 'Kanit', sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.news-card:hover .news-card-title {
    color: #15803d;
}

.news-card-desc {
    color: var(--news-text-body);
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Highlights pill inside card */
.news-card-highlights {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f8fafc;
    border-left: 3px solid #16a34a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    color: #334155;
}

.news-card-highlights span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Card Footer */
.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px dashed rgba(226, 232, 240, 0.9);
    margin-top: auto;
}

.news-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--news-primary);
    font-weight: 600;
    font-size: 0.92rem;
    font-family: 'Kanit', sans-serif;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    transition: var(--news-transition);
}

.news-more-btn .btn-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(22, 163, 74, 0.12);
    color: var(--news-primary);
    font-size: 0.85rem;
    transition: var(--news-transition);
}

.news-card:hover .news-more-btn {
    color: #166534;
}

.news-card:hover .news-more-btn .btn-arrow {
    background: #16a34a;
    color: #ffffff;
    transform: translateX(4px);
}

.news-read-time {
    font-size: 0.80rem;
    color: var(--news-text-muted);
}

/* ==================== News Detail Modal ==================== */
.news-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.news-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.news-modal-container {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.94) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.news-modal-overlay.active .news-modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.news-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.news-modal-badge-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-modal-close {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
    transform: rotate(90deg);
}

/* Modal Body */
.news-modal-body {
    padding: 28px 32px 40px;
    overflow-y: auto;
    font-family: 'Kanit', sans-serif;
}

.news-modal-body::-webkit-scrollbar {
    width: 6px;
}

.news-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.news-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.news-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.news-modal-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #064e3b;
    line-height: 1.45;
    margin-bottom: 16px;
}

.news-modal-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    color: #64748b;
    font-size: 0.90rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
    flex-wrap: wrap;
}

.news-modal-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Modal Image Gallery */
.news-modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.news-modal-gallery img {
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    display: block;
}

/* Modal Text Formatting */
.news-modal-content {
    font-size: 1.02rem;
    line-height: 1.85;
    color: #334155;
}

.news-modal-content p {
    margin-bottom: 16px;
    text-align: justify;
}

.news-modal-content ul {
    margin: 16px 0 24px 20px;
    padding-left: 10px;
}

.news-modal-content li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.news-modal-highlight-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid rgba(22, 163, 74, 0.25);
    border-radius: 14px;
    padding: 20px 24px;
    margin: 20px 0;
}

.news-modal-highlight-box h4 {
    color: #064e3b;
    font-size: 1.10rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-modal-contact-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 24px;
    margin-top: 24px;
}

/* ==================== Responsive Breakpoints ==================== */
@media (max-width: 1120px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 26px;
    }
}

@media (max-width: 720px) {
    .news-section {
        padding: 20px 14px 70px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .news-filter-bar {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding: 6px;
        border-radius: 20px;
    }

    .news-filter-btn {
        font-size: 0.88rem;
        padding: 7px 16px;
    }

    .news-cover-wrap {
        height: 200px;
    }

    .news-card-body {
        padding: 20px;
    }

    .news-modal-body {
        padding: 20px 18px 30px;
    }

    .news-modal-title {
        font-size: 1.25rem;
    }
}
