/* =========================================================
   News & Events / Exhibition - listing & detail
   Semua class pakai prefix "bat-" biar tidak bentrok dengan
   class tema yang sudah ada. Layout pakai flexbox, bukan CSS Grid.
   ========================================================= */

/* ---------- Reveal on scroll (shared dengan modul Research) ---------- */
.bat-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.bat-reveal.bat-reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Empty state ---------- */
.bat-news-empty {
    padding: 40px 20px;
    text-align: center;
    background: #f7f7f7;
    border-radius: 8px;
    color: #666;
}

/* =========================================================
   LISTING - Desktop: 3 kartu per baris
   ========================================================= */
.bat-news-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    margin-top: 10px;
}

.bat-news-card {
    flex: 1 1 calc(33.333% - 20px);
    max-width: calc(33.333% - 20px);
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.bat-news-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.bat-news-card__img {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: 220px; /* fallback untuk browser lama */
}

.bat-news-card__img img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.bat-news-card:hover .bat-news-card__img img {
    transform: scale(1.08);
}

/* Badge kategori di pojok foto (khusus saat badge ada DI DALAM foto card) */
.bat-news-card__img .bat-news-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
}

.bat-news-card__badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    background: #555;
}

.bat-news-card__badge--exhibition { background: #1a56db; }
.bat-news-card__badge--training   { background: #2e7d32; }
.bat-news-card__badge--others     { background: #616161; }

.bat-news-card__body {
    padding: 16px 18px 20px;
}

.bat-news-card__date {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.bat-news-card__title {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.4;
    color: #222;
    transition: color 0.3s ease;

    /* batasi 2 baris biar tinggi kartu konsisten */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bat-news-card:hover .bat-news-card__title {
    color: #d32f2f; /* sesuaikan warna brand */
}

.bat-news-card__excerpt {
    margin: 0 0 12px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #666;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bat-news-card__readmore {
    font-size: 13px;
    font-weight: 600;
    color: #d32f2f; /* sesuaikan warna brand */
}

/* =========================================================
   LISTING - Mobile: 1 kartu per baris, tampilan HORIZONTAL
   (gambar di kiri, konten di kanan) — pola feed modern.
   ========================================================= */
@media (max-width: 767px) {
    .bat-news-cards {
        flex-direction: column;
        gap: 16px;
    }

    .bat-news-card {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .bat-news-card__link {
        display: flex;
        flex-direction: row;
        align-items: stretch;
    }

    .bat-news-card__img {
        flex: 0 0 130px;
        width: 130px;
        aspect-ratio: unset;
        height: auto;
    }

    .bat-news-card__badge {
        top: 8px;
        left: 8px;
        padding: 3px 8px;
        font-size: 9px;
    }

    .bat-news-card__body {
        flex: 1 1 auto;
        padding: 12px 14px;
        min-width: 0; /* biar text-overflow/line-clamp jalan di flex child */
    }

    .bat-news-card__title {
        font-size: 15px;
        -webkit-line-clamp: 2;
    }

    .bat-news-card__excerpt {
        display: none; /* disembunyikan di mobile biar ringkas, seperti feed berita */
    }

    .bat-news-card__readmore {
        font-size: 12px;
    }
}

/* =========================================================
   DETAIL PAGE
   ========================================================= */
.bat-news-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    min-height: 485px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.bat-news-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.35) 100%);
}

.bat-news-hero .container {
    position: relative;
    z-index: 2;
}

.bat-news-hero h2 {
    color: #fff;
    margin-top: 10px;
}

.bat-news-hero .bat-news-card__badge {
    margin-bottom: 6px;
}

.bat-news-hero .breadcrumb li,
.bat-news-hero .breadcrumb a {
    color: #f1f1f1;
}

.bat-hero-fade-in {
    animation: batNewsHeroFadeIn 0.9s ease forwards;
}

@keyframes batNewsHeroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bat-news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}

.bat-news-meta__item {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.bat-news-meta__item strong {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.bat-news-content {
    line-height: 1.8;
}

.bat-news-content h3 {
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 19px;
    color: #1a3d7c; /* sesuaikan warna brand */
}

.bat-news-image-frame {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.bat-news-image-frame img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.bat-news-image-frame:hover img {
    transform: scale(1.05);
}

.bat-btn-back {
    display: inline-block;
    margin-top: 25px;
    padding: 10px 22px;
    border-radius: 30px;
    background: #d32f2f; /* sesuaikan warna brand */
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.bat-btn-back:hover {
    background: #b71c1c;
    transform: translateX(-4px);
    color: #fff;
}
