/* =========================================================
   myQur'an — Gaya halaman Asmaul Husna (asmaul-husna.html)
   ---------------------------------------------------------
   File TERPISAH & mandiri. Dimuat SETELAH style.css hanya oleh
   asmaul-husna.html, jadi tidak ada satu pun halaman lain yang
   terpengaruh. Semua selector berawalan .ah- (kecuali tambahan
   kecil untuk komponen yang dipakai ulang dari style.css).
   Memakai token situs: --surface, --border, --primary, --gold,
   --text, --text-muted, --font-body, --font-arabic, dst.
   ========================================================= */

/* Kartu bacaan sedikit lebih lebar dari halaman surah supaya 3 kolom lega. */
.ah-page{ max-width: 920px; }
.ah-page .page-surah-block{ padding-left: clamp(12px, 3.5vw, 28px); padding-right: clamp(12px, 3.5vw, 28px); }

/* Judul di topbar: sebelumnya <h1>, kini <p> supaya halaman hanya punya satu <h1>
   (yaitu judul di banner). Tampilan disamakan dengan `.reader-title h1` di style.css. */
.reader-title .ah-topbar-title{
  margin: 0; font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 480px){ .reader-title .ah-topbar-title{ font-size: .92rem; } }

/* Toolbar font dihapus: hero naik ke atas, jarak dari topbar dibuat proporsional. */
#ahHero{ margin-top: clamp(14px, 3.5vw, 26px); }

/* Sub-navigasi: 2 tombol (Baca Asmaul Husna | Per Nama), rata tengah.
   Tombol aktif memakai gaya `.juz-tab.is-active` (hijau + teks putih). */
.ah-tabs{
  display: flex; justify-content: center; align-items: stretch; gap: 10px;
}
.ah-tabs .ah-tab{ flex: 0 1 220px; max-width: 220px; }
@media (max-width: 400px){
  .ah-tabs{ gap: 8px; }
  .ah-tabs .ah-tab{ flex: 1 1 0; max-width: none; }
}

/* Banner & pemutar audio: persisten (tidak dirender ulang saat ganti halaman) */
.ah-banner{ margin-bottom: 18px; }

/* Judul banner: "Asmaul Husna" (h1) + "99 Nama Allah Yang Maha Indah" (h2), 2 baris */
.ah-banner-title{
  margin: 2px 0 0; font-family: var(--font-display, var(--font-body));
  font-size: clamp(1.55rem, 5.5vw, 2.1rem); font-weight: 700;
  line-height: 1.2; letter-spacing: .02em; color: var(--text);
}
.ah-banner-subtitle{
  margin: 6px 0 10px; font-family: var(--font-body);
  font-size: clamp(.82rem, 2.8vw, .98rem); font-weight: 500;
  line-height: 1.5; letter-spacing: .06em; color: var(--primary-strong);
  overflow-wrap: break-word;
}
.ah-audio-note{
  margin: 8px 0 0; text-align: center; font-size: .72rem;
  color: var(--text-muted); font-family: var(--font-ui);
}
.ah-audio-note.is-error{ color: #C0392B; font-weight: 600; }
[data-theme="dark"] .ah-audio-note.is-error{ color: #F1948A; }
.ah-banner .jap-ayat-pos{ min-width: 0; }

/* Keutamaan: teks Arab dalil */
.pil-hero .ah-dalil-ar{
  margin: 0 0 8px; text-align: center; direction: rtl;
  font-size: calc(1.35rem * var(--arabic-scale)); line-height: 2.1; color: var(--text);
}
.pil-hero .ah-pengantar{
  margin: 14px 0 0; font-family: var(--font-body); font-size: .86rem;
  line-height: 1.7; color: var(--text-muted); text-align: left;
}
.pil-hero .pil-fadhilah-note + .pil-fadhilah-note{ margin-top: 8px; }

/* ---------- Grid Asmaul Husna ---------- */
.ah-grid{
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));  /* Mobile: 2 kolom (2x4 = 8) */
}
@media (min-width: 640px){                            /* PC/landscape: 3 kolom (3x4 = 12) */
  .ah-grid{ gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ah-card{
  position: relative; display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 14px 8px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-m);
  scroll-margin-top: 170px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ah-card:hover{ border-color: var(--primary); }

/* Nomor urut dengan angka Arab */
.ah-num{
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px;
  border: 1px solid var(--gold); color: var(--gold);
  background: var(--surface); font-family: var(--font-arabic);
  font-size: 1rem; line-height: 1; direction: rtl;
}

.ah-ar{
  margin: 6px 0 2px; width: 100%; direction: rtl; color: var(--text);
  font-size: calc(1.7rem * var(--arabic-scale)); line-height: 1.9;
  overflow-wrap: anywhere; text-rendering: optimizeLegibility;
}
.ah-latin{
  margin: 0; font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  line-height: 1.35; color: var(--text); overflow-wrap: anywhere;
}
.ah-arti{
  margin: 4px 0 0; font-family: var(--font-body); font-size: .8rem;
  line-height: 1.45; color: var(--text-muted);
}

@media (max-width: 639px){
  .ah-card{ padding: 12px 6px 12px; }
  .ah-ar{ font-size: calc(1.45rem * var(--arabic-scale)); line-height: 1.85; }
  .ah-latin{ font-size: .85rem; }
  .ah-arti{ font-size: .74rem; }
}

/* Sorotan saat "Lompat ke Nama" */
.ah-card.is-jump-target{
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--primary-tint), 0 0 0 4px var(--gold);
}

/* Tombol pager: id baru (.pil-pager sudah memberi gaya untuk #pilNextPage saja) */
.pil-pager #ahNextPage:not(:disabled){
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.pil-pager #ahNextPage:not(:disabled):hover{ background: var(--primary-strong); }

@media (prefers-reduced-motion: reduce){
  .ah-card{ transition: none; }
}
