/* Panduan Ibadah — Sunnah Travel
   Palet mengikuti logo PT Berkah Hidayah Sunnah: hitam & emas. */

@font-face {
  font-family: "Amiri";
  src: url("../fonts/Amiri-Regular.woff") format("woff");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --skala: 1;
  --emas: #B39B5E;          /* emas logo */
  --emas-tua: #7A6430;      /* emas untuk teks di latar terang (kontras ≥ 5:1) */
  --hitam: #141210;         /* hitam logo */

  --bg: #F7F3EA;
  --surface: #FFFFFF;
  --surface-2: #F1EBDD;
  --ink: #1A1814;
  --muted: #554D40;
  --line: #E2D8C3;
  --accent: var(--emas-tua);
  --accent-bg: #F3EBD6;
  --btn: var(--hitam);
  --btn-ink: #FFFFFF;
  --ok: #2F6B3A;
  --warn-bg: #FFF4D6;
  --warn-line: #D9A520;
  --warn-ink: #5A4100;
  --bebas-bg: #E9F0F7;
  --bebas-ink: #1F4466;
  --shadow: 0 1px 2px rgba(20,18,16,.06), 0 4px 16px rgba(20,18,16,.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0E0C; --surface: #1B1916; --surface-2: #24211C; --ink: #F3EEE4; --muted: #C2B8A6;
    --line: #36312A; --accent: #D6BF84; --accent-bg: #2A2519; --btn: #D6BF84; --btn-ink: #141210;
    --ok: #7FC48C; --warn-bg: #2E2614; --warn-line: #B88A1C; --warn-ink: #F2D88E;
    --bebas-bg: #172534; --bebas-ink: #A9CBEB; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0E0C; --surface: #1B1916; --surface-2: #24211C; --ink: #F3EEE4; --muted: #C2B8A6;
  --line: #36312A; --accent: #D6BF84; --accent-bg: #2A2519; --btn: #D6BF84; --btn-ink: #141210;
  --ok: #7FC48C; --warn-bg: #2E2614; --warn-line: #B88A1C; --warn-ink: #F2D88E;
  --bebas-bg: #172534; --bebas-ink: #A9CBEB; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: calc(18px * var(--skala)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
img, svg { display: block; }
a { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--emas); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--btn); color: var(--btn-ink); padding: 12px; z-index: 99; }
.skip:focus { left: 8px; }

/* ---------- Bar atas ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--hitam); color: #fff;
  border-bottom: 3px solid var(--emas);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-logo {
  flex: none; width: 46px; height: 46px; border-radius: 12px; background: #fff;
  display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--emas);
}
.brand-logo img { width: 34px; height: auto; }

/* Logo lengkap di beranda — selalu di atas latar terang agar bagian hitam logo terlihat */
.logo-beranda {
  display: flex; justify-content: center; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 18px 16px 14px; margin-bottom: 14px;
}
.logo-beranda img { width: 150px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; }
.brand-text small { font-size: 13px; color: var(--emas); letter-spacing: .06em; text-transform: uppercase; }
.tools { display: flex; gap: 6px; }
.tool {
  min-width: 46px; height: 46px; padding: 0 8px; border-radius: 12px;
  border: 1px solid #4A4234; background: #221F1A; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.tool svg { width: 22px; height: 22px; fill: none; stroke: var(--emas); stroke-width: 2; stroke-linecap: round; }
.tool .i-moon { display: none; }
:root[data-theme="dark"] .tool .i-sun { display: none; }
:root[data-theme="dark"] .tool .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tool .i-sun { display: none; }
  :root:not([data-theme="light"]) .tool .i-moon { display: block; }
}

/* ---------- Tata letak ---------- */
main { outline: none; }
.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 32px; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }

/* ---------- Beranda ---------- */
.hero {
  background: var(--hitam); color: #fff; border-radius: 20px; padding: 22px 20px;
  position: relative; overflow: hidden; margin-bottom: 18px;
}
.hero h1 { color: #fff; }
.hero p { color: #E6DCC6; margin: 0; }
.hero .salam { font-family: "Amiri", serif; font-size: 1.6rem; color: var(--emas); direction: rtl; margin-bottom: 6px; }

.jalur { display: grid; gap: 12px; }
.jalur a {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 18px;
  min-height: 92px; box-shadow: var(--shadow);
}
.jalur a:active { transform: scale(.99); }
.jalur .ic {
  flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--hitam);
  display: grid; place-items: center;
}
.jalur .ic svg { width: 30px; height: 30px; fill: none; stroke: var(--emas); stroke-width: 1.8; stroke-linejoin: round; }
.jalur strong { display: block; font-size: 1.2rem; }
.jalur span { color: var(--muted); font-size: .92rem; }
.jalur .go { margin-left: auto; font-size: 1.6rem; color: var(--accent); }

.pemberitahuan {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink);
  border-radius: 14px; padding: 14px 16px; margin: 18px 0; font-weight: 600; font-size: .95rem;
}
.pemberitahuan svg { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; margin-top: 2px; }

.grid-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-menu a {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-height: 96px;
  font-weight: 600; font-size: .95rem; line-height: 1.3;
}
.grid-menu svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.offline-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ok); font-weight: 600; margin-top: 14px; }
.offline-badge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 28px; }

/* ---------- Langkah ---------- */
.progress-wrap { position: sticky; top: calc(69px + env(safe-area-inset-top)); z-index: 10; background: var(--bg); padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.progress-inner { max-width: 640px; margin: 0 auto; }
.progress-label { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 700; margin-bottom: 8px; }
.progress-label span:last-child { color: var(--muted); font-weight: 600; }
.progress-bar { display: grid; grid-auto-flow: column; gap: 5px; }
.progress-bar i { height: 8px; border-radius: 4px; background: var(--line); }
.progress-bar i.done { background: var(--emas); }
.progress-bar i.now { background: var(--accent); }

.step-nav {
  position: fixed; left: 0; right: 0; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 15;
  background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 14px 16px 10px;
}
.step-nav .inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.has-stepnav { padding-bottom: 110px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 58px; padding: 0 20px; border-radius: 16px; border: 2px solid var(--btn);
  background: var(--btn); color: var(--btn-ink); font-size: 1.05rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 46px; font-size: .95rem; padding: 0 14px; border-radius: 12px; }
.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.paragraf p { font-size: 1rem; }
.callout {
  border-left: 5px solid var(--emas); background: var(--accent-bg); padding: 12px 14px; border-radius: 0 12px 12px 0;
  margin: 14px 0; font-weight: 600;
}
.belum-box {
  border: 2px dashed var(--line); border-radius: 14px; padding: 12px 14px; margin: 16px 0; color: var(--muted); font-size: .93rem;
}
.belum-box strong { color: var(--ink); }

/* ---------- Kartu bacaan ---------- */
.bacaan {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin: 14px 0;
  box-shadow: var(--shadow);
}
.bacaan-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.pill { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .03em; padding: 4px 10px; border-radius: 999px; }
.pill.tuntun { background: var(--hitam); color: var(--emas); }
:root[data-theme="dark"] .pill.tuntun { background: var(--emas); color: var(--hitam); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.tuntun { background: var(--emas); color: var(--hitam); } }
.pill.bebas { background: var(--bebas-bg); color: var(--bebas-ink); }
.pill.opsional { background: var(--surface-2); color: var(--muted); }
.pill.verif { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }

.arab {
  font-family: "Amiri", "Scheherazade New", "Traditional Arabic", serif;
  direction: rtl; text-align: right; font-size: 1.85rem; line-height: 2.15;
  margin: 10px 0 12px; padding: 14px 4px 6px; border-top: 1px solid var(--line);
  word-spacing: .05em;
}
.latin { font-style: italic; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.arti { margin-bottom: 10px; }
.teks-bebas { font-size: 1.02rem; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 6px; }
.kosong { color: var(--muted); font-style: italic; font-size: .9rem; }
.meta { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.meta div { margin-bottom: 2px; }
.meta b { color: var(--ink); font-weight: 700; }
.catatan { margin: 10px 0 0; padding: 0; list-style: none; font-size: .92rem; }
.catatan li { position: relative; padding-left: 18px; margin-bottom: 4px; }
.catatan li::before { content: ""; position: absolute; left: 3px; top: .65em; width: 7px; height: 7px; border-radius: 50%; background: var(--emas); }
.verif-box { margin-top: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: .92rem; }
.bacaan-actions { display: flex; gap: 8px; margin-top: 12px; }
.bacaan-actions .btn { flex: 1; }
.btn.saved { background: var(--accent-bg); color: var(--accent); border-color: var(--emas); }
.btn.saved svg { fill: currentColor; }

/* tabel niat */
.tabel-niat { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 12px 0; }
.tabel-niat caption { text-align: left; font-weight: 700; padding: 0 0 8px; }
.tabel-niat td, .tabel-niat th { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.tabel-niat tr:last-child td, .tabel-niat tr:last-child th { border-bottom: 0; }
.tabel-niat th { font-size: .92rem; width: 34%; font-weight: 700; }
.tabel-niat .arab { font-size: 1.5rem; line-height: 1.9; border: 0; margin: 0; padding: 0; }
.tabel-niat .latin { font-size: .9rem; margin: 4px 0 0; text-align: right; }
.tabel-niat .meta { border: 0; padding: 0; }

/* ---------- Penghitung ---------- */
.counter {
  background: var(--hitam); color: #fff; border-radius: 22px; padding: 18px 16px 16px; margin: 18px 0;
  text-align: center;
}
.counter .label { color: var(--emas); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .82rem; }
.counter .angka { font-size: 4.2rem; font-weight: 800; line-height: 1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.counter .angka small { font-size: 1.4rem; color: #A99E88; font-weight: 600; }
.counter .arah { min-height: 1.6em; color: #E6DCC6; font-size: .98rem; margin-bottom: 12px; }
.counter .dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.counter .dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--emas); }
.counter .dots i.on { background: var(--emas); }
.counter .row { display: grid; grid-template-columns: 1fr 2.2fr; gap: 10px; }
.counter .plus {
  min-height: 84px; border-radius: 18px; border: 0; background: var(--emas); color: var(--hitam);
  font-size: 1.9rem; font-weight: 800; cursor: pointer;
}
.counter .plus:active { transform: scale(.98); }
.counter .plus[disabled] { background: #3A352C; color: #A99E88; }
.counter .reset { min-height: 84px; border-radius: 18px; border: 2px solid #4A4234; background: transparent; color: #fff; font-weight: 700; cursor: pointer; }
.counter .selesai { color: #9FDDA9; font-weight: 700; }
.counter .minus { background: none; border: 0; color: #A99E88; text-decoration: underline; margin-top: 10px; font-size: .9rem; cursor: pointer; min-height: 40px; }

/* ---------- Checklist ---------- */
.filter { display: flex; gap: 8px; margin: 12px 0 6px; flex-wrap: wrap; }
.chip {
  min-height: 46px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 700; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.ck-progress { font-weight: 700; margin: 8px 0 4px; }
.ck-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.ck-bar i { display: block; height: 100%; background: var(--emas); transition: width .2s; }
.ck-group { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin: 14px 0; overflow: hidden; }
.ck-group h3 { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; margin: 0; background: var(--surface-2); font-size: 1rem; }
.tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.tag.pria { color: #1F4466; background: #E3EDF7; border-color: #B9D0E8; }
.tag.wanita { color: #6B2350; background: #F7E6F0; border-color: #E6BFD6; }
:root[data-theme="dark"] .tag.pria, :root[data-theme="dark"] .tag.wanita { background: transparent; }
.ck-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 60px; border-top: 1px solid var(--line); cursor: pointer; }
.ck-item input { appearance: none; -webkit-appearance: none; flex: none; width: 30px; height: 30px; border: 2px solid var(--muted); border-radius: 8px; display: grid; place-items: center; margin: 0; background: var(--surface); cursor: pointer; }
.ck-item input:checked { background: var(--emas); border-color: var(--emas); }
.ck-item input:checked::after { content: ""; width: 8px; height: 15px; border: solid var(--hitam); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px,-2px); }
.ck-item input:checked + span { text-decoration: line-through; color: var(--muted); }
.ck-note { padding: 10px 16px 14px; font-size: .9rem; color: var(--warn-ink); background: var(--warn-bg); border-top: 1px solid var(--warn-line); font-weight: 600; }

/* ---------- Cari ---------- */
.search { position: relative; margin: 10px 0 16px; }
.search input {
  width: 100%; min-height: 60px; font-size: 1.1rem; padding: 0 16px 0 52px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
}
.search input:focus { border-color: var(--emas); outline: none; }
.search svg { position: absolute; left: 16px; top: 18px; width: 24px; height: 24px; fill: none; stroke: var(--muted); stroke-width: 2; }
.hasil { list-style: none; padding: 0; margin: 0; }
.hasil a { display: block; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; text-decoration: none; color: var(--ink); }
.hasil small { display: block; color: var(--accent); font-weight: 700; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.hasil strong { display: block; }
.hasil span { color: var(--muted); font-size: .9rem; }
.kosong-box { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- Info ---------- */
.info-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 14px 0; }
.info-sec h2 { margin: 0 0 8px; font-size: 1.08rem; }
.info-sec ul { margin: 0; padding-left: 20px; }
.info-sec li { margin-bottom: 6px; }
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; }
details.faq summary { padding: 16px; font-weight: 700; cursor: pointer; min-height: 56px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); line-height: 1; }
details.faq[open] summary::after { content: "−"; }
details.faq p { padding: 0 16px 16px; margin: 0; }
dl.kamus { margin: 0; }
dl.kamus div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
dl.kamus dt { font-weight: 800; color: var(--accent); }
dl.kamus dd { margin: 2px 0 0; }

/* Haji */
.timeline { list-style: none; padding: 0; margin: 16px 0; }
.timeline li { position: relative; padding: 0 0 18px 28px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--emas); border: 3px solid var(--bg); }
.timeline .hari { font-size: .8rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }

.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; margin-bottom: 6px; }

/* ---------- Navigasi bawah ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 72px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 700;
}
.bottomnav svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bottomnav a[aria-current="page"] { color: var(--ink); }
.bottomnav a[aria-current="page"] svg { stroke: var(--accent); }
.bottomnav a[aria-current="page"]::after { content: ""; width: 26px; height: 3px; border-radius: 2px; background: var(--emas); margin-top: 2px; }

.toast {
  position: fixed; left: 50%; top: calc(80px + env(safe-area-inset-top)); transform: translateX(-50%) translateY(-12px);
  background: var(--hitam); color: #fff; border: 1px solid var(--emas); padding: 12px 18px; border-radius: 12px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; width: max-content; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 700px) {
  .jalur { grid-template-columns: 1fr 1fr; }
  .grid-menu { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
