/*!
 * MASAJID.ID — halaman Al-Qur'an (/quran): daftar surah dan juz, rencana khatam, halaman surah.
 * Melengkapi mosque.css (warna, kartu, tombol). Memakai properti logis agar benar di bahasa Arab (RTL).
 */

/* ---------- Kepala halaman daftar ---------- */
.qr-title { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 30px; font-family: 'Amiri', 'Plus Jakarta Sans', serif; font-size: clamp(30px, 6vw, 46px); line-height: 1.2; }
.qr-title span { font-size: clamp(32px, 6.4vw, 50px); color: var(--gold2); font-weight: 700; line-height: 1.5; }
.ms-hero .lead { margin-top: 10px; max-width: 40em; color: #DDE5F3; font-size: clamp(16px, 2.4vw, 18px); }
.qr-continue { margin-top: 16px; }
.qr-continue .ms-btn { max-width: 100%; }
.qr-continue .ms-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.qr-quick span { margin-inline-end: 2px; color: #C9D4EA; font-size: 13px; font-weight: 700; }
.qr-quick a { padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(244, 215, 122, .4); background: rgba(255, 255, 255, .07); color: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none; transition: background .16s, border-color .16s; }
.qr-quick a:hover { background: rgba(244, 215, 122, .2); border-color: var(--gold2); color: #fff; }
[dir="rtl"] .qr-quick a { font-size: 16px; padding-block: 3px; }

/* ---------- Tab ---------- */
.qr-tabs { display: flex; gap: 4px; padding: 5px; border-radius: 16px; background: #E6EAF3; align-self: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.qr-tabs::-webkit-scrollbar { display: none; }
.qr-tabs button { flex: none; padding: 9px 18px; border: 0; border-radius: 12px; background: transparent; color: var(--ink2); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap; transition: background .16s, color .16s; }
.qr-tabs button:hover { color: var(--navy); }
.qr-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(11, 31, 68, .22); }
.qr-tabs button:focus-visible, .qr-list a:focus-visible, .qr-quick a:focus-visible, .qr-end:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.qr-panel-gap { display: flex; flex-direction: column; gap: 12px; }
[data-qr-panel][hidden] { display: none; }
[data-qr-panel] { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Daftar surah dan juz ---------- */
.qr-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qr-list li[hidden] { display: none; }
.qr-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; height: 100%; padding: 12px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; transition: border-color .16s, transform .16s, box-shadow .16s; }
.qr-list a:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 12px 26px rgba(11, 31, 68, .09); }
.qr-no { display: grid; place-items: center; width: 44px; height: 44px; flex: none; font-weight: 800; font-size: 15px; color: var(--navy); font-variant-numeric: tabular-nums; font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cg fill='%23FFF6D9' stroke='%23E2B34A' stroke-width='1.4'%3E%3Crect x='7' y='7' width='30' height='30' rx='3'/%3E%3Crect x='7' y='7' width='30' height='30' rx='3' transform='rotate(45 22 22)'/%3E%3C/g%3E%3Crect x='8.4' y='8.4' width='27.2' height='27.2' rx='2' fill='%23FFF6D9'/%3E%3C/svg%3E") center / contain no-repeat; }
.qr-no.big { width: 64px; height: 64px; font-size: 20px; }
.qr-mid { min-width: 0; }
.qr-mid b { display: block; font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; }
.qr-mid b.ar { font-family: 'Amiri', serif; font-size: 23px; line-height: 1.5; }
.qr-mid small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 1px; color: var(--mute); font-size: 13px; line-height: 1.35; }
.qr-side { display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
.qr-side small { color: var(--mute); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qr-ar { font-family: 'Amiri', serif; font-size: 24px; line-height: 1.4; color: var(--navy); white-space: nowrap; }
.qr-latin { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 13.5px; font-weight: 700; color: var(--ink2); white-space: nowrap; }
@media (max-width: 700px) { .qr-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) { .qr-list a { gap: 10px; padding-inline: 12px; } .qr-ar { font-size: 21px; } }

/* ---------- Rencana khatam ---------- */
.qr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qr-field label { font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.qr-field input, .qr-field select { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid #C9D3E6; background: #fff; color: var(--ink); font: inherit; font-size: 15.5px; }
.qr-field input:focus, .qr-field select:focus { outline: 3px solid rgba(226, 179, 74, .5); outline-offset: 1px; border-color: var(--gold); }
.qr-plan-new { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
@media (max-width: 620px) { .qr-plan-new { grid-template-columns: minmax(0, 1fr); } }
[data-qr-plan] { display: flex; flex-direction: column; gap: 12px; }
[data-qr-plan][hidden], [data-qr-plan-new][hidden] { display: none; }
.qr-plan-end { color: var(--mute); font-size: 14px; }
.qr-days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qr-days li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--rule); background: #fff; scroll-margin-block: 90px; }
.qr-days li.today { border-color: var(--gold); background: #FFF9E6; box-shadow: 0 0 0 3px rgba(226, 179, 74, .2); }
.qr-days li.done b, .qr-days li.done small { opacity: .6; }
.qr-days input { width: 22px; height: 22px; margin: 0; accent-color: #0B1F44; cursor: pointer; }
.qr-days b { display: block; font-size: 15.5px; }
.qr-days small { display: block; color: var(--mute); font-size: 13px; }
.qr-days a { padding: 6px 14px; border-radius: 10px; border: 1px solid #C9D3E6; background: #fff; color: var(--navy); font-weight: 800; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.qr-days a:hover { border-color: var(--gold); background: #FFFBEB; }
.qr-days .tag { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 999px; background: #FBE3A8; color: #6E4A0B; font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.qr-note { color: var(--mute); font-size: 14px; }

/* ---------- Halaman surah ---------- */
.qr-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-top: 28px; }
.qr-head h1 { font-family: 'Amiri', 'Plus Jakarta Sans', serif; font-size: clamp(28px, 6vw, 42px); line-height: 1.2; overflow-wrap: anywhere; }
.qr-head h1.ar { line-height: 1.5; }
.qr-meta { margin-top: 4px; color: #DDE5F3; font-size: 14.5px; }
.qr-head-ar { font-family: 'Amiri', serif; font-size: clamp(34px, 8vw, 56px); line-height: 1.5; color: var(--gold2); white-space: nowrap; }
.qr-head-side { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: clamp(16px, 3vw, 22px); font-weight: 700; color: var(--gold2); white-space: nowrap; }
@media (max-width: 520px) { .qr-head { grid-template-columns: auto minmax(0, 1fr); } .qr-head-ar, .qr-head-side { grid-column: 1 / -1; text-align: center; } }
.qr-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.qr-nav .ms-btn { max-width: 100%; }
.qr-mark { display: grid; grid-template-columns: minmax(0, 180px) auto; gap: 12px; align-items: end; justify-content: start; }
@media (max-width: 460px) { .qr-mark { grid-template-columns: minmax(0, 1fr); } }
.qr-last { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #EDF8F1; border: 1px solid #BFE3CE; color: var(--ok); font-weight: 700; font-size: 14.5px; }
.qr-last[hidden] { display: none; }

/* Teks ayat (hanya bila pembaca teks dinyalakan pengelola layanan) */
.qr-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-size { display: inline-flex; gap: 6px; }
.qr-size .ms-btn[disabled] { opacity: .45; cursor: default; transform: none; }
.qr-basmalah { text-align: center; font-family: 'Amiri', serif; font-size: calc(var(--qr-size, 30px) * 1.05); line-height: 2.2; color: var(--navy); margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.qr-text { font-family: 'Amiri', serif; font-size: var(--qr-size, 30px); line-height: 2.35; text-align: justify; color: #111927; word-spacing: .06em; }
.qr-ayah { scroll-margin-top: 90px; border-radius: 10px; transition: background .3s, box-shadow .3s; }
.qr-ayah:target, .qr-ayah.marked { background: #FFF4CF; box-shadow: 0 0 0 4px #FFF4CF; }
.qr-end { display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em; margin-inline: .7em .3em; padding: 0 .35em; border: 1.5px solid var(--gold); border-radius: 999px; background: #FFFBEB; color: var(--navy);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: .42em; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; vertical-align: middle; cursor: pointer; transition: background .16s; }
html[lang="ar"] .qr-end { font-family: 'Amiri', serif; font-size: .52em; font-weight: 700; }
.qr-end:hover { background: var(--gold2); }
.qr-juz, .qr-sajdah { display: inline-block; margin-inline: .5em; padding: .2em .8em; border-radius: 999px; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 12.5px; font-weight: 800; line-height: 1.5; vertical-align: middle; word-spacing: normal; }
html[lang="ar"] .qr-juz, html[lang="ar"] .qr-sajdah { font-family: 'Amiri', serif; font-size: 15px; }
.qr-juz { background: var(--navy); color: var(--gold2); }
.qr-sajdah { background: #E3F3EA; color: var(--ok); }
.qr-credit { color: var(--mute); font-size: 13px; text-align: center; }
.qr-credit a { font-weight: 700; }
@media (max-width: 560px) { .qr-text { text-align: start; line-height: 2.25; } }
@media print {
  .qr-nav, .qr-tools, .qr-tabs, .qr-quick, .qr-continue, .qr-mark, .mc-search { display: none !important; }
  .qr-text { font-size: 22px; }
  .qr-end { border-color: #999; background: none; }
}
@media (prefers-reduced-motion: reduce) { .qr-list a, .qr-ayah, .qr-tabs button, .qr-quick a { transition: none; } }
