/* =====================================================================
   JADWAL SHOLAT (beranda) — tema religi: hijau zamrud + emas
   Kartu selalu gelap (zamrud) di tema terang maupun gelap, supaya
   emas & krem tetap terbaca. Semua permukaan memakai warna SOLID /
   gradasi, tanpa backdrop-filter (ringan di HP).
   ===================================================================== */
.sholat-section { padding: clamp(36px, 6vw, 72px) 0 clamp(8px, 2vw, 24px); }

.sholat-card {
  --sh-900: #04201a; --sh-800: #06352b; --sh-700: #0a4a3b; --sh-600: #0f6150;
  --sh-gold: #e6c36a; --sh-gold-soft: #f3d98c; --sh-cream: #f8efd6; --sh-muted: rgba(248, 239, 214, .72);
  --sh-line: rgba(230, 195, 106, .22);
  position: relative; isolation: isolate; overflow: hidden; contain: paint;
  width: 100%; margin: 0;
  border-radius: 28px; border: 1px solid rgba(230, 195, 106, .34);
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(230, 195, 106, .16), transparent 55%),
    linear-gradient(165deg, var(--sh-700) 0%, var(--sh-800) 52%, var(--sh-900) 100%);
  color: var(--sh-cream);
  box-shadow: 0 30px 60px -28px rgba(2, 22, 17, .75), inset 0 1px 0 rgba(255, 255, 255, .08);
}
/* bingkai emas tipis di dalam kartu */
.sholat-card::after {
  content: ""; position: absolute; inset: 8px; z-index: 0; pointer-events: none;
  border-radius: 21px; border: 1px solid rgba(230, 195, 106, .18);
}

/* ---------- dekor latar ---------- */
.sholat-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sholat-pattern {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23e6c36a' stroke-opacity='.11' stroke-width='1'%3E%3Crect x='14' y='14' width='36' height='36'/%3E%3Crect x='14' y='14' width='36' height='36' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 60%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 60%, transparent 100%);
}
.sholat-moon {
  position: absolute; top: 18px; right: clamp(16px, 4vw, 44px); width: clamp(64px, 10vw, 104px); height: auto;
  filter: drop-shadow(0 0 18px rgba(243, 217, 140, .55)); animation: shFloat 7s ease-in-out infinite;
}
.sholat-moon-star { transform-box: fill-box; transform-origin: center; animation: shTwinkle 3.2s ease-in-out infinite; }
.sholat-twinkle {
  position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--sh-gold-soft);
  box-shadow: 0 0 8px 2px rgba(243, 217, 140, .6); animation: shTwinkle 3.6s ease-in-out infinite;
}
.sholat-twinkle.t1 { top: 14%; left: 8%;  animation-delay: .2s; }
.sholat-twinkle.t2 { top: 30%; left: 30%; animation-delay: 1.1s; width: 3px; height: 3px; }
.sholat-twinkle.t3 { top: 9%;  right: 24%; animation-delay: .7s; width: 4px; height: 4px; }
.sholat-twinkle.t4 { top: 42%; right: 7%;  animation-delay: 1.8s; width: 3px; height: 3px; }
.sholat-twinkle.t5 { top: 22%; left: 55%; animation-delay: 2.4s; width: 3px; height: 3px; }
.sholat-mosque { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(90px, 16vw, 160px); }
@keyframes shFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shTwinkle { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

/* ---------- isi ---------- */
.sholat-inner { position: relative; z-index: 1; padding: clamp(22px, 4vw, 44px); padding-bottom: clamp(70px, 12vw, 120px); }
.sholat-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-right: clamp(72px, 12vw, 130px); }
.sholat-date { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sholat-date strong { font-size: clamp(1rem, 2.4vw, 1.25rem); font-weight: 700; color: #fff; }
.sholat-date span { font-size: .88rem; color: var(--sh-gold-soft); font-weight: 500; }
.sholat-loc {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: var(--sh-gold-soft);
  background: rgba(4, 32, 26, .72); border: 1px solid var(--sh-line);
}

/* ---------- sholat berikutnya ---------- */
.sholat-hero { display: flex; align-items: center; gap: clamp(16px, 4vw, 40px); margin-top: clamp(20px, 3.4vw, 32px); }
.sholat-ring { position: relative; flex: 0 0 auto; width: clamp(122px, 22vw, 176px); aspect-ratio: 1; }
.sholat-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.sholat-ring circle { fill: none; stroke-width: 7; }
.sholat-ring-bg { stroke: rgba(230, 195, 106, .16); }
.sholat-ring-fg {
  stroke: var(--sh-gold); stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  filter: drop-shadow(0 0 6px rgba(230, 195, 106, .7)); transition: stroke-dashoffset .9s linear;
}
.sholat-ring-core {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.sholat-ring-core b { font-size: clamp(1.05rem, 3.2vw, 1.6rem); font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sholat-ring-core small { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sh-muted); }

.sholat-next { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.sholat-next-label { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sh-gold); }
.sholat-next-name { font-size: clamp(2rem, 6.4vw, 3.4rem); font-weight: 800; line-height: 1.05; color: #fff; }
.sholat-next-ar { font-family: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif; font-size: clamp(1.4rem, 4vw, 2.1rem); line-height: 1.3; color: var(--sh-gold-soft); }
.sholat-next-time { margin-top: 6px; font-size: .95rem; color: var(--sh-muted); }
.sholat-next-time i { margin-right: 4px; color: var(--sh-gold); }
.sholat-next-time b { color: #fff; font-size: 1.15em; font-variant-numeric: tabular-nums; }

/* ---------- Imsyak & Terbit ---------- */
.sholat-extras { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(18px, 3vw, 26px); }
.sholat-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-size: .85rem; color: var(--sh-muted); background: rgba(4, 32, 26, .6); border: 1px dashed var(--sh-line);
}
.sholat-chip i { color: var(--sh-gold); }
.sholat-chip b { color: #fff; font-variant-numeric: tabular-nums; }

/* ---------- lima waktu ---------- */
.sholat-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.sholat-item {
  position: relative; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 4px 14px;
  padding: 12px 16px; border-radius: 16px;
  background: rgba(4, 32, 26, .62); border: 1px solid var(--sh-line);
  transition: transform .25s ease, border-color .25s ease, background-color .25s ease, box-shadow .25s ease;
}
.sholat-ico {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--sh-gold); font-size: 1.05rem;
  background: radial-gradient(circle at 30% 25%, rgba(243, 217, 140, .26), rgba(230, 195, 106, .08));
  border: 1px solid var(--sh-line);
}
.sholat-name { display: flex; flex-direction: column; min-width: 0; }
.sholat-name b { font-size: 1.05rem; font-weight: 700; color: #fff; }
.sholat-name em { font-style: normal; font-family: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif; font-size: 1.15rem; line-height: 1.3; color: var(--sh-gold-soft); text-align: left; }
.sholat-time { font-size: 1.45rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sholat-state {
  position: absolute; top: -9px; right: 14px; padding: 2px 10px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sh-900); background: var(--sh-gold); opacity: 0; transform: translateY(3px); transition: opacity .25s ease, transform .25s ease;
}
.sholat-state:empty { display: none; }

.sholat-item.is-past { opacity: .6; }
.sholat-item.is-past .sholat-time { color: var(--sh-muted); }
.sholat-item.is-past .sholat-state { opacity: 1; transform: none; background: rgba(248, 239, 214, .16); color: var(--sh-cream); }
.sholat-item.is-now {
  background: linear-gradient(135deg, rgba(15, 97, 80, .95), rgba(10, 74, 59, .95));
  border-color: rgba(230, 195, 106, .6);
}
.sholat-item.is-now .sholat-state { opacity: 1; transform: none; background: #3ddc97; color: #04201a; }
.sholat-item.is-next {
  border-color: var(--sh-gold); background: linear-gradient(135deg, rgba(230, 195, 106, .2), rgba(4, 32, 26, .7));
  box-shadow: 0 0 0 1px rgba(230, 195, 106, .35), 0 12px 28px -14px rgba(230, 195, 106, .55);
}
.sholat-item.is-next .sholat-ico { background: var(--sh-gold); color: var(--sh-900); }
.sholat-item.is-next .sholat-state { opacity: 1; transform: none; }

/* ---------- ayat & catatan ---------- */
.sholat-ayat { margin: clamp(22px, 4vw, 34px) 0 0; text-align: center; }
.sholat-ayat blockquote {
  margin: 0; font-family: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  font-size: clamp(1.35rem, 3.6vw, 1.95rem); line-height: 1.9; color: var(--sh-gold-soft);
}
.sholat-ayat figcaption { margin-top: 6px; font-size: .9rem; line-height: 1.6; color: var(--sh-muted); }
.sholat-ayat cite { display: block; margin-top: 2px; font-style: normal; font-weight: 700; color: var(--sh-gold); }
.sholat-foot { margin: 14px 0 0; text-align: center; font-size: .78rem; color: rgba(248, 239, 214, .55); }

.sholat-error { margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; text-align: center; font-size: .92rem; background: rgba(4, 32, 26, .7); border: 1px solid var(--sh-line); }
.sholat-retry {
  margin-left: 8px; padding: 6px 14px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 .85rem/1 inherit; font-family: inherit; color: #04201a; background: var(--sh-gold);
}
.sholat-retry:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- keadaan memuat / gagal ---------- */
.sholat-section[data-state="loading"] .sholat-time,
.sholat-section[data-state="loading"] .sholat-next-name,
.sholat-section[data-state="loading"] .sholat-ring-core b { animation: shPulse 1.4s ease-in-out infinite; }
@keyframes shPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.sholat-section[data-state="error"] .sholat-hero,
.sholat-section[data-state="error"] .sholat-extras,
.sholat-section[data-state="error"] .sholat-grid { opacity: .35; }

/* ---------- layar lebar: lima kartu sejajar ---------- */
@media (min-width: 760px) {
  .sholat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
  .sholat-item { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 20px 8px 16px; gap: 6px; }
  .sholat-name { align-items: center; }
  .sholat-name em { text-align: center; }
  .sholat-time { font-size: 1.5rem; }
  .sholat-state { right: 50%; transform: translate(50%, 3px); }
  .sholat-item.is-past .sholat-state, .sholat-item.is-now .sholat-state, .sholat-item.is-next .sholat-state { transform: translate(50%, 0); }
  .sholat-item.is-next { transform: translateY(-4px); }
}
@media (max-width: 420px) {
  .sholat-card { border-radius: 22px; }
  .sholat-card::after { border-radius: 15px; }
  .sholat-hero { gap: 14px; }
  .sholat-next-name { font-size: 1.9rem; }
  .sholat-top { padding-right: 70px; }
}

/* ---------- hemat daya / aksesibilitas ---------- */
:root[data-perf="low"] .sholat-moon,
:root[data-perf="low"] .sholat-moon-star,
:root[data-perf="low"] .sholat-twinkle { animation: none; }
:root[data-perf="low"] .sholat-moon, :root[data-perf="low"] .sholat-ring-fg { filter: none; }
@media (prefers-reduced-motion: reduce) {
  .sholat-moon, .sholat-moon-star, .sholat-twinkle, .sholat-section[data-state="loading"] * { animation: none !important; }
  .sholat-ring-fg, .sholat-item { transition: none; }
}

/* desktop: blok "sholat berikutnya" di tengah agar seimbang */
@media (min-width: 760px) {
  .sholat-hero { justify-content: center; }
  .sholat-extras { justify-content: center; }
}

/* judul section mengikuti tema (pola sama dengan "Berita Terkini") */
.sholat-section .section-heading h2 { color: var(--navy); }
:root[data-theme="dark"] .sholat-section .section-heading .tag,
:root[data-theme="dark"] .sholat-section .section-heading h2,
:root[data-theme="dark"] .sholat-section .section-heading p { color: #fff !important; }
:root[data-theme="dark"] .sholat-section .section-heading .tag { color: var(--sh-gold, #e6c36a) !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sholat-section .section-heading h2,
  :root:not([data-theme="light"]) .sholat-section .section-heading p { color: #fff !important; }
  :root:not([data-theme="light"]) .sholat-section .section-heading .tag { color: #e6c36a !important; }
}
