/* =============================================
   IPA Nasang — style.css
   Mengatur warna, ukuran, dan animasi
   ============================================= */

/* ---------- Warna utama (bisa diubah di sini) ---------- */
:root {
  --latar: #EEF3FF;
  --teks: #0F172A;
  --teks-lembut: #475569;
  --utama: #1E3A8A;
  --aksen: #FACC15;
  --radius: 24px;
  --bayangan: 0 6px 0 rgba(15, 23, 42, .12), 0 12px 28px rgba(15, 23, 42, .10);
}

/* ---------- Dasar ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 18px; }
@media (min-width: 1200px) { html { font-size: 20px; } }
@media (min-width: 1600px) { html { font-size: 22px; } }

body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--latar);
  color: var(--teks);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: "Baloo 2", "Nunito", sans-serif; line-height: 1.15; }
main { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 4px solid var(--aksen); outline-offset: 3px;
}

/* ---------- Bagian atas ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.25rem;
  background: var(--utama); color: #fff;
  box-shadow: 0 4px 0 #172554;
}
.logo { display: flex; align-items: center; gap: .6rem; font-family: "Baloo 2", sans-serif; font-size: 1.8rem; font-weight: 800; }
.logo-icon { display: grid; place-items: center; width: 3rem; height: 3rem; background: var(--aksen); border-radius: 16px; font-size: 1.6rem; }
.logo-text b { color: var(--aksen); }
.topnav { display: flex; gap: .6rem; }
.nav-btn {
  display: flex; align-items: center;
  min-height: 3.2rem; padding: .6rem 1.2rem;
  border-radius: 999px; font-weight: 800; font-size: 1.05rem;
  background: rgba(255, 255, 255, .14);
  transition: transform .15s, background .15s;
}
.nav-btn.aktif { background: var(--aksen); color: var(--utama); }
.nav-btn:active { transform: scale(.93); }

/* ---------- Banner beranda ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 32px;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(135deg, #4338CA 0%, #7C3AED 50%, #DB2777 100%);
  color: #fff; text-align: center;
  box-shadow: var(--bayangan);
}
.hero > *:not(.hero-bg) { position: relative; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 800; }
.hero p { font-size: 1.15rem; font-weight: 700; margin: .6rem auto 1.5rem; max-width: 42ch; opacity: .95; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg span { position: absolute; font-size: 3rem; opacity: .28; animation: melayang 6s ease-in-out infinite; }
.hero-bg span:nth-child(1) { top: 8%;  left: 4%; }
.hero-bg span:nth-child(2) { top: 62%; left: 8%;  animation-delay: -1s; }
.hero-bg span:nth-child(3) { top: 10%; right: 6%; animation-delay: -2s; }
.hero-bg span:nth-child(4) { bottom: 8%; right: 12%; animation-delay: -3s; }
.hero-bg span:nth-child(5) { top: 40%; right: 30%; animation-delay: -4s; }
.hero-bg span:nth-child(6) { bottom: 4%; left: 32%; animation-delay: -5s; }
@keyframes melayang {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-18px) rotate(10deg); }
}

/* ---------- Kotak pencarian ---------- */
.cari-besar {
  display: flex; gap: .6rem;
  max-width: 850px; margin: 0 auto;
  background: #fff; border-radius: 999px; padding: .45rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.cari-besar:focus-within { outline: 4px solid var(--aksen); }
.cari-besar input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: inherit; font-size: 1.2rem; color: var(--teks);
  padding: .7rem 1.2rem; min-height: 3.4rem;
}
.cari-besar button {
  border: none; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1.15rem;
  min-height: 3.4rem; padding: 0 1.6rem; border-radius: 999px;
  background: var(--aksen); color: var(--utama);
  transition: transform .15s;
}
.cari-besar button:active { transform: scale(.93); }
.cari-besar.kecil { max-width: none; margin: 0 0 1rem; box-shadow: var(--bayangan); }

/* ---------- Judul bagian ---------- */
.bagian { margin-top: 2.2rem; }
.judul-bagian { font-size: clamp(1.5rem, 2.5vw, 2.1rem); font-weight: 800; margin-bottom: 1rem; }
.kepala-bagian { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.kepala-bagian .judul-bagian { margin: 0; }

/* ---------- Kartu jenis konten ---------- */
.grid-jenis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.kartu-jenis {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  min-height: 9rem; padding: 1.2rem 1rem; text-align: center;
  background: var(--warna); color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .28);
}
.kartu-jenis .ikon { font-size: 2.8rem; transition: transform .3s; }
.kartu-jenis .nama { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.3rem; line-height: 1.1; }
.kartu-jenis .jumlah { font-size: .9rem; font-weight: 700; opacity: .92; }

/* ---------- Kartu topik ---------- */
.grid-topik { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.kartu-topik {
  display: flex; align-items: center; gap: 1rem;
  min-height: 6.5rem; padding: 1rem 1.2rem;
  background: #fff; border: 3px solid var(--warna);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--warna);
}
.kartu-topik .ikon {
  flex: none; display: grid; place-items: center;
  width: 4rem; height: 4rem; border-radius: 18px;
  background: var(--warna); font-size: 2.1rem;
}
.kartu-topik .teks { display: flex; flex-direction: column; }
.kartu-topik .nama { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.3rem; line-height: 1.15; }
.kartu-topik .jumlah { color: var(--teks-lembut); font-weight: 700; font-size: .95rem; }

/* ---------- Kartu konten ---------- */
.grid-konten { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.kartu-konten {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 3px solid #E2E8F0;
  border-radius: var(--radius);
  box-shadow: var(--bayangan);
}
.sampul {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  display: grid; place-items: center;
  background: var(--warna);
}
.sampul .ikon-besar { font-size: 4rem; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .2)); }
.sampul img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tombol-putar {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center;
  width: 4.2rem; height: 4.2rem; border-radius: 50%; padding-left: .25rem;
  background: rgba(220, 38, 38, .92); color: #fff; font-size: 1.7rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.lencana-cek {
  position: absolute; top: .6rem; right: .6rem;
  background: #FEF08A; color: #713F12;
  font-weight: 800; font-size: .85rem;
  padding: .25rem .7rem; border-radius: 999px;
}
.isi { flex: 1; display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem 1.2rem; }
.lencana-jenis {
  align-self: flex-start;
  background: var(--warna); color: #fff;
  font-weight: 800; font-size: .85rem;
  padding: .2rem .75rem; border-radius: 999px;
}
.kartu-konten h3 { font-size: 1.3rem; font-weight: 800; }
.meta { color: var(--teks-lembut); font-size: .92rem; font-weight: 700; }
.buka { margin-top: auto; padding-top: .6rem; align-self: flex-end; font-weight: 800; font-size: 1.05rem; color: var(--warna); }

/* ---------- Efek sentuh dan arahkan mouse ---------- */
.kartu-jenis, .kartu-topik, .kartu-konten, .tombol-kembali, .tombol-kecil {
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s;
}
@media (hover: hover) {
  .kartu-jenis:hover, .kartu-topik:hover, .kartu-konten:hover { transform: translateY(-6px); }
  .kartu-jenis:hover .ikon { transform: scale(1.2) rotate(-8deg); }
}
.kartu-jenis:active, .kartu-konten:active { transform: translateY(4px) scale(.97); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.kartu-topik:active { transform: translateY(4px) scale(.97); box-shadow: 0 2px 0 var(--warna); }
.tombol-kembali:active, .tombol-kecil:active { transform: scale(.93); }

/* ---------- Tombol pil (fase dan filter) ---------- */
.filter, .pilihan-fase { display: flex; flex-wrap: wrap; gap: .6rem; }
.pil {
  --warna: var(--utama);
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 3.2rem; padding: .4rem 1.2rem;
  border: 3px solid var(--warna); border-radius: 999px;
  background: #fff; color: var(--warna);
  font: inherit; font-weight: 800; font-size: 1.05rem;
  cursor: pointer; transition: transform .15s;
}
.pil b { background: var(--warna); color: #fff; border-radius: 999px; padding: 0 .55rem; font-size: .85rem; min-width: 1.8rem; text-align: center; }
.pil.aktif { background: var(--warna); color: #fff; }
.pil.aktif b { background: #fff; color: var(--warna); }
.pil:active { transform: scale(.92); }

/* ---------- Kepala halaman ---------- */
.tombol-kembali, .tombol-kecil {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 3.2rem; padding: .4rem 1.3rem;
  border-radius: 999px; font-weight: 800; font-size: 1.05rem;
}
.tombol-kembali { background: #fff; color: var(--utama); margin-bottom: 1rem; box-shadow: var(--bayangan); }
.tombol-kecil { background: var(--utama); color: #fff; }
.kepala-halaman {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1.2rem;
  padding: 1.5rem; margin-bottom: 1.2rem;
  border-radius: 28px;
  background: var(--warna); color: #fff;
  box-shadow: var(--bayangan);
}
.kepala-halaman .ikon { font-size: 3.4rem; }
.kepala-halaman h1 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 800; }
.kepala-halaman p { font-weight: 700; opacity: .92; }

/* ---------- Pesan ---------- */
.info-hasil { margin: 1rem 0 .8rem; font-weight: 800; color: var(--teks-lembut); }
.kosong {
  grid-column: 1 / -1; text-align: center;
  padding: 2.5rem 1rem; background: #fff;
  border: 3px dashed #CBD5E1; border-radius: var(--radius);
  font-size: 1.15rem; font-weight: 700; color: var(--teks-lembut);
}
.loading { text-align: center; padding: 3rem; font-size: 1.3rem; font-weight: 800; }

/* ---------- Bagian bawah ---------- */
.footer { text-align: center; padding: 1.5rem 1rem; background: var(--utama); color: #C7D2FE; font-weight: 700; }
.footer span { display: block; font-size: .9rem; opacity: .85; }

/* ---------- Animasi muncul ---------- */
.muncul {
  animation: muncul .45s cubic-bezier(.34, 1.56, .64, 1) backwards;
  animation-delay: min(calc(var(--i, 0) * 50ms), 600ms);
}
@keyframes muncul {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Layar HP ---------- */
@media (max-width: 600px) {
  .topbar { padding: .6rem .8rem; }
  .logo { font-size: 1.35rem; }
  .logo-icon { width: 2.4rem; height: 2.4rem; font-size: 1.3rem; }
  .nav-btn { padding: .5rem .8rem; font-size: .9rem; min-height: 2.8rem; }
  .grid-jenis { grid-template-columns: repeat(2, 1fr); }
  .cari-besar button { padding: 0 1rem; }
  .hero-bg span { font-size: 2rem; }
  }
/* ---------- Kelompok per jenis (halaman topik) ---------- */
.kelompok-wadah { display: flex; flex-direction: column; gap: 2.2rem; }
.judul-kelompok {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: clamp(1.4rem, 2.3vw, 1.9rem); font-weight: 800;
  background: var(--warna); color: #fff;
  padding: .4rem 1.3rem .4rem .9rem; margin-bottom: 1rem;
  border-radius: 999px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25);
}
.judul-kelompok b {
  background: #fff; color: var(--warna);
  border-radius: 999px; padding: 0 .6rem; font-size: 1rem;
}
/* ---------- Penyempurnaan untuk papan interaktif ---------- */
/* Tombol di bagian atas yang berupa <button> */
button.nav-btn { border: none; cursor: pointer; font-family: inherit; color: #fff; }

/* Ketujuh kartu jenis konten sejajar di layar lebar */
@media (min-width: 1000px) {
  .grid-jenis { grid-template-columns: repeat(7, 1fr); }
}

/* Tombol Layar Penuh disembunyikan di HP */
@media (max-width: 600px) {
  #tombolLayarPenuh { display: none; }
}