/* Perapian tampilan HP. Dimuat paling akhir. */
html, body { overflow-x: hidden; }
img, video, iframe { max-width: 100%; }
@media (max-width: 768px) {
    section h2 { font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.2; }
    table { display: block; overflow-x: auto; }
    input, select, textarea { font-size: 1rem; max-width: 100%; }
    .footer-grid { gap: 1.75rem; }
    .footer-bottom { align-items: center; text-align: center; }
}
/* Statistik: 2 kolom di HP, bukan ditumpuk 1 kolom */
@media(max-width:768px){
.statistik{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:1.75rem 0.75rem!important;padding:2.5rem 5%!important}
.statistik > *{min-width:0}
.statistik > *:last-child:nth-child(odd){grid-column:1 / -1}
}
/* Tombol mengambang: lebih kecil di HP supaya tidak menutupi teks */
@media(max-width:600px){
.social-float{right:0.625rem!important;gap:0.5rem!important}
.social-float a,.social-float button,.back-top,.ke-atas,#backTop,#keAtas{width:2.25rem!important;height:2.25rem!important;min-width:0!important;font-size:0.875rem!important;right:0.625rem!important}
}
/* Hero HP: foto di atas (wajah terlihat), teks di bawah foto */
@media(max-width:600px){
.hero{min-height:0!important;padding:calc(4.375rem + 72vw) 5% 2.75rem!important;background-color:var(--dark)}
.hero-slides{bottom:auto!important;height:calc(4.375rem + 72vw)}
.hero-slides::after{content:"";position:absolute;left:0;right:0;bottom:0;height:45%;background:linear-gradient(to bottom,rgba(0,0,0,0),var(--dark))}
.hero::before{opacity:.3!important}
}
/* Hero HP: bagian teks berlatar gelap polos, tanpa foto kedua */
@media(max-width:600px){
.hero{background:var(--dark)!important}
.hero::before,.hero::after{display:none!important}
}
/* Berita Lainnya (halaman detail): kartu di tengah, menyesuaikan jumlah berita */
.berita-terkait h2{text-align:center}
.berita-terkait .news-grid{display:flex!important;flex-wrap:wrap;justify-content:center;gap:1.375rem}
.berita-terkait .news-grid > *{flex:0 1 21.25rem;max-width:21.25rem;min-width:0}
@media(max-width:600px){
.berita-terkait .news-grid > *{flex:1 1 100%;max-width:100%}
}
/* Agenda: kegiatan yang sedang berlangsung di beranda */
.kgb-section{padding:4.375rem max(5%,calc((100% - 76.25rem)/2))}
.kgb-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:1.375rem;margin-top:2.125rem}
.kgb-card{flex:0 1 22.5rem;max-width:22.5rem;min-width:0;background:#fff;border:0.0625rem solid #e6e8ec;border-radius:1rem;overflow:hidden;box-shadow:0 0.5rem 1.5rem rgba(15,20,30,.06);display:flex;flex-direction:column}
.kgb-foto{display:block;aspect-ratio:16/9;overflow:hidden;background:#eef0f3}
.kgb-foto img{width:100%;height:100%;object-fit:cover;display:block}
.kgb-isi{padding:1.25rem 1.375rem 1.5rem;display:flex;flex-direction:column;gap:0.75rem;flex:1}
.kgb-live{display:inline-flex;align-items:center;gap:0.5rem;align-self:flex-start;background:#fdecee;color:#e30613;font-size:0.6875rem;font-weight:800;letter-spacing:0.0375rem;padding:0.375rem 0.75rem;border-radius:62.4375rem}
.kgb-live i{width:0.5rem;height:0.5rem;border-radius:50%;background:#e30613;animation:kgbKedip 1.4s ease-in-out infinite}
.kgb-isi h3{font-size:1.1875rem;line-height:1.3;margin:0}
.kgb-isi h3 a{color:inherit}
.kgb-meta{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0.5rem;font-size:0.875rem;color:#4d535d}
.kgb-meta i{width:1.125rem;color:#e30613;margin-right:0.375rem;text-align:center}
.kgb-isi .read-btn{margin-top:auto;align-self:flex-start}
@keyframes kgbKedip{0%,100%{opacity:1}50%{opacity:.25}}
@media(prefers-reduced-motion:reduce){.kgb-live i{animation:none}}
@media(max-width:600px){.kgb-section{padding:3.125rem 5%}.kgb-card{flex:1 1 100%;max-width:100%}}
/* Agenda: jarak dalam kartu dipaksa */
.kgb-card{padding:0!important}.kgb-isi{padding:1.25rem 1.375rem 1.5rem!important}
/* Agenda: huruf judul disamakan dengan Program/Layanan */
.kgb-isi h3{font-family:Poppins,sans-serif!important;font-size:1.375rem!important;font-weight:700!important;line-height:1.35!important}
.kgb-grid{justify-content:flex-start}
.kgb-grid{max-width:68.75rem;margin-left:auto;margin-right:auto}
/* Kegiatan: wadah sejajar dengan Program (740px, 3 kolom kalau ada 3) */
.kgb-grid{max-width:46.25rem;margin-left:auto;margin-right:auto}
.kgb-grid-3{max-width:var(--container,68.75rem)}
@media(min-width:901px){.kgb-grid-3 .kgb-card{flex-basis:calc((100% - 2.75rem)/3);max-width:calc((100% - 2.75rem)/3)}}
/* Kegiatan beranda: kartu bawaan halaman Kegiatan + animasi halus */
.kgb-list{max-width:68.75rem;margin:2.125rem auto 0}
.kgb-section .agenda-card{transition:transform .25s ease,box-shadow .25s ease}
.kgb-section .agenda-card:hover{transform:translateY(-0.25rem);box-shadow:0 0.875rem 2.125rem rgba(15,20,30,.12)}
.kgb-section .agenda-date{transition:transform .25s ease}
.kgb-section .agenda-card:hover .agenda-date{transform:scale(1.05)}
.kgb-section .status-berlangsung::before{content:"";display:inline-block;width:0.5rem;height:0.5rem;margin-right:0.5rem;border-radius:50%;background:currentColor;vertical-align:middle;animation:kgbDenyut 1.6s ease-out infinite}
@keyframes kgbDenyut{0%{box-shadow:0 0 0 0 rgba(150,100,0,.55)}70%{box-shadow:0 0 0 0.5rem rgba(150,100,0,0)}100%{box-shadow:0 0 0 0 rgba(150,100,0,0)}}
@media(prefers-reduced-motion:reduce){.kgb-section .agenda-card,.kgb-section .agenda-date{transition:none}.kgb-section .agenda-card:hover{transform:none}.kgb-section .status-berlangsung::before{animation:none}}
