/* ================= المصحف ================= */

.mushaf-hero {
  background:
    radial-gradient(900px 420px at 85% -20%, rgba(207, 168, 69, 0.18), transparent 60%),
    linear-gradient(160deg, var(--green-800) 0%, var(--green-700) 60%, var(--green-600) 100%);
  color: #F6FBF8;
  padding: 30px 0 28px;
}
.mushaf-hero h1 {
  font-family: "Amiri", serif;
  font-size: clamp(1.7rem, 4.6vw, 2.6rem);
  margin: 0 0 8px;
  color: #FFFDF7;
}
.mushaf-hero p { margin: 0; color: rgba(255, 253, 247, 0.85); font-size: 0.98rem; max-width: 62ch; }
.mushaf-hero .back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold-400); text-decoration: none; font-size: 0.9rem; margin-bottom: 12px;
}
.mushaf-hero .back:hover { text-decoration: underline; }

.mushaf-shell { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 22px 0 70px; }
@media (min-width: 900px) {
  .mushaf-shell { grid-template-columns: 320px 1fr; gap: 26px; align-items: start; }
}

.surah-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
@media (min-width: 900px) { .surah-panel { position: sticky; top: calc(var(--header-h) + 16px); } }
.surah-panel-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.surah-panel-head h2 { font-size: 1.05rem; margin: 0 0 10px; color: var(--green-900); }
.surah-search { position: relative; }
.surah-search input {
  width: 100%; padding: 11px 40px 11px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--cream); font: inherit; font-size: 0.95rem; color: var(--ink);
}
.surah-search input:focus { outline: 3px solid var(--gold-500); outline-offset: 1px; }
.surah-search svg { position: absolute; inset-inline-end: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }

.surah-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
@media (min-width: 900px) { .surah-list { max-height: calc(100vh - 250px); } }

.surah-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 0; background: transparent; border-radius: 12px;
  cursor: pointer; text-align: right; font: inherit; color: var(--ink);
  transition: background 0.15s var(--ease);
}
.surah-item:hover { background: var(--cream); }
.surah-item[aria-current="true"] { background: var(--green-800); color: #fff; }
.surah-item[aria-current="true"] .surah-meta { color: rgba(255,255,255,0.78); }
.surah-item[aria-current="true"] .surah-num { background: var(--gold-500); color: var(--green-950); border-color: transparent; }

.surah-num {
  flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  font-size: 0.78rem; color: var(--green-800); background: var(--cream);
}
.surah-texts { min-width: 0; }
.surah-name { font-weight: 600; font-size: 1rem; }
.surah-meta { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

.reader {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.reader-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--cream));
}
.reader-title { margin: 0; font-family: "Amiri", serif; font-size: 1.5rem; color: var(--green-900); }
.reader-title small { display: block; font-family: "Cairo", sans-serif; font-size: 0.76rem; color: var(--muted); margin-top: 2px; }
.reader-tools { display: flex; align-items: center; gap: 6px; }
.tool-btn {
  border: 1px solid var(--line); background: var(--white); color: var(--green-800);
  border-radius: 10px; min-width: 38px; height: 36px; padding: 0 10px;
  font: inherit; font-size: 0.85rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.tool-btn:hover { background: var(--cream); }
.tool-btn:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.tool-btn[disabled] { opacity: 0.4; cursor: default; }

.reader-body { padding: 26px 22px 34px; }
@media (min-width: 640px) { .reader-body { padding: 34px 40px 44px; } }

.bismillah {
  font-family: "Amiri", serif; text-align: center;
  font-size: calc(var(--mushaf-size, 1.55rem) * 1.02);
  color: var(--green-800); margin: 0 0 26px; padding-bottom: 18px;
  border-bottom: 1px dashed rgba(207, 168, 69, 0.6);
}

.ayat {
  font-family: "Amiri", serif; font-size: var(--mushaf-size, 1.55rem);
  line-height: 2.25; color: var(--ink); text-align: justify;
}
@media (min-width: 640px) { .ayat { line-height: 2.35; } }
.ayah { border-radius: 8px; transition: background 0.2s var(--ease); }
.ayah.is-target { background: rgba(207, 168, 69, 0.16); }
.ayah-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6em; height: 1.6em; margin: 0 0.3em; padding: 0 0.18em;
  font-family: "Amiri", serif; font-size: 0.6em; line-height: 1;
  color: var(--green-800); background: rgba(207, 168, 69, 0.14);
  border: 1px solid rgba(207, 168, 69, 0.65); border-radius: 999px;
  vertical-align: middle; user-select: none;
}

.reader-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-top: 1px solid var(--line); background: var(--cream);
}
.reader-foot .btn { font-size: 0.9rem; }
.reader-foot .pos { font-size: 0.78rem; color: var(--muted); text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* فهرس السور على الموبايل */
.surah-expand {
  display: none; width: 100%; margin-top: 8px; padding: 9px 12px;
  border: 1px dashed rgba(207,168,69,0.7); border-radius: 12px;
  background: #FFFDF8; color: var(--green-800); font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
}
.surah-panel.is-collapsed .surah-expand { display: block; }
.surah-panel.is-collapsed .surah-list { display: none; }
.surah-panel.is-collapsed .surah-panel-head { border-bottom: 0; }
@media (min-width: 900px) {
  .surah-panel.is-collapsed .surah-list { display: block; }
  .surah-panel.is-collapsed .surah-panel-head { border-bottom: 1px solid var(--line); }
}
