/* UQNS reader. Uses only the colour tokens from styles.css, so the dark/light theme
   switch and RTL (Arabic UI) apply automatically. */

.reader { padding-top: 68px; min-height: 70vh; }
html { scroll-padding-top: 0; } /* offsets here come from scroll-margin-top on verses */
.primary-nav a.is-current { color: var(--accent); }

select {
  font: inherit; color: var(--text);
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: var(--s2) var(--s4);
  min-height: 44px;
  max-width: 100%;
  cursor: pointer;
}
select:focus-visible { border-color: var(--gold); }
select option, select optgroup { color: var(--text); background: var(--surface-input); }

/* ---- Navigation bar ---- */
.reader-bar {
  position: sticky; top: 68px; z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.reader-bar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); padding: var(--s2) 0; flex-wrap: wrap;
}

.seg { display: inline-flex; border: 1px solid var(--gold); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.seg button {
  background: transparent; border: 0; padding: var(--s1) var(--s3);
  color: var(--accent); cursor: pointer; font-size: 15px; font-weight: 600; min-height: 40px;
}
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }

.pager { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.pager .pg-select { flex: 1; min-width: 0; width: min(320px, 100%); }
.pg-btn {
  display: inline-flex; align-items: center; gap: var(--s1);
  min-height: 44px; padding: var(--s1) var(--s3);
  border: 1px solid var(--gold); border-radius: 999px;
  background: transparent; color: var(--accent); cursor: pointer;
  font-size: 15px; white-space: nowrap;
  transition: background .2s;
}
.pg-btn:hover:not(:disabled) { background: var(--btn-hover); }
.pg-btn:disabled { opacity: .35; cursor: default; }
.chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[dir="rtl"] .chev { transform: scaleX(-1); }

/* ---- Options ---- */
.reader-opts {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4);
  padding: var(--s3) 0 var(--s2);
}
.opt { display: inline-flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: 14px; }
.reader-info { margin-inline-start: auto; color: var(--muted); font-size: 14px; }

/* ---- Reading area ---- */
.reader-wrap { max-width: 860px; padding-bottom: var(--s7); }
.reader-status { text-align: center; color: var(--muted); padding: var(--s8) 0; }
.reader-status .btn { margin-top: var(--s3); }

.sura-head {
  text-align: center; margin: var(--s7) 0 var(--s4);
  padding: var(--s4) var(--s3);
  border-block: 1px solid var(--gold);
  background: radial-gradient(ellipse at 50% 0%, var(--glow), transparent 70%);
  scroll-margin-top: 150px;
}
.reader-wrap > #readerBody > .sura-head:first-child { margin-top: var(--s4); }
.sura-no { color: var(--accent); font-size: 14px; letter-spacing: .06em; }
.sura-ar { font-family: var(--font-quran); font-size: clamp(32px, 6vw, 52px); font-weight: 400; color: var(--accent); line-height: 1.6; margin-top: var(--s1); }
.sura-sub { color: var(--text); margin-top: var(--s1); }
.sura-meta { color: var(--muted); font-size: 14px; margin-top: var(--s1); }
.basmala {
  font-family: var(--font-quran); direction: rtl; text-align: center;
  font-size: clamp(26px, 4vw, 34px); line-height: 2; color: var(--text);
  margin: 0 0 var(--s3);
}
.basmala.is-simple, .ayah-ar.is-simple { font-family: "Amiri", "Noto Naskh Arabic", "Scheherazade New", serif; }

.ayah {
  padding: var(--s4) var(--s2);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 150px;
}
.ayah.is-target { background: var(--glow); border-radius: 12px; }
.ayah-meta { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.ayah-no {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 var(--s2);
  border: 1px solid var(--gold); border-radius: 999px;
  color: var(--accent); font-size: 14px; font-weight: 600;
}
.ayah-no:hover { background: var(--btn-hover); }
.ayah-tag { color: var(--accent); font-size: 13px; border: 1px dashed var(--line); border-radius: 999px; padding: 0 var(--s2); }
.ayah-ar {
  font-family: var(--font-quran); direction: rtl; text-align: start;
  font-size: clamp(28px, 4.2vw, 40px); line-height: 2.2; color: var(--text);
  margin: 0;
}
.ayah-tr { color: var(--muted); margin-top: var(--s2); font-size: 17px; line-height: 1.8; text-align: start; }
.ayah-tr[lang="bn"] { font-family: var(--font-bn); line-height: 1.9; }
.ayah-tr[lang="ar"] { font-family: var(--font-ar-ui); font-size: 20px; line-height: 2; }

.pager-bottom { justify-content: space-between; margin-top: var(--s5); }
.reader-credit { color: var(--faint); font-size: 13px; margin-top: var(--s4); text-align: center; }
.reader-credit a { color: var(--accent); text-decoration: underline; }

@media (max-width: 800px) {
  .reader-bar { position: static; }
  .reader-bar-inner { flex-direction: column; align-items: stretch; }
  .seg { align-self: stretch; }
  .seg button { flex: 1; }
  .pager { width: 100%; }
  .pg-btn span { display: none; }
  .pg-btn { padding-inline: var(--s3); }
  .pager-bottom .pg-btn span { display: inline; }
  .reader-opts { flex-direction: column; align-items: stretch; }
  .opt { justify-content: space-between; }
  .opt select { max-width: 65%; }
  .reader-info { margin-inline-start: 0; }
  .sura-head, .ayah { scroll-margin-top: 20px; }
}
