/* Markaz Ilm — Qur'an listening page. Pair with assets/js/quran-audio.js */
[data-quran] { --q-primary: var(--mi-primary, #0251B7); --q-ink: #0B1F3A; --q-mint: #7EDDAE; --q-line: rgba(11, 31, 58, .1); }

/* continue listening */
.q-continue {
  width: 100%; display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px;
  border: 0; border-radius: 16px; background: var(--q-ink); color: #fff; text-align: left;
  box-shadow: 0 8px 22px rgba(11, 31, 58, .18);
}
.q-continue[hidden] { display: none; }
.q-continue:hover { background: #12305a; }
.q-continue-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--q-mint); color: var(--q-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.q-continue-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.q-continue-text small { font-size: .74rem; color: rgba(255, 255, 255, .7); }
.q-continue-text strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* search + reciter */
.q-tools { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
.q-field { position: relative; }
.q-field > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #6b7a90; pointer-events: none; z-index: 1; }
.q-field .form-control, .q-field .form-select { padding-left: 38px; height: 44px; border-radius: 12px; }
.q-pills { margin-bottom: 6px; }
.q-pills .dua-pill[hidden] { display: none; }
.q-count { font-size: .8rem; color: #6b7a90; margin: 6px 2px 8px; }

/* surah list */
.q-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 8px; }
.q-row {
  min-width: 0; display: flex; align-items: stretch; background: #fff; border: 1px solid var(--q-line); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.q-row:hover { border-color: var(--q-primary); box-shadow: 0 4px 14px rgba(2, 81, 183, .08); }
.q-row[hidden] { display: none; }
.q-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 6px 11px 12px; text-align: left;
  background: transparent; border: 0; border-radius: 14px 0 0 14px; color: inherit;
}
.q-main:focus-visible, .q-read:focus-visible { outline: 2px solid var(--q-primary); outline-offset: -2px; }
.q-read {
  flex-shrink: 0; width: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-left: 1px solid var(--q-line); border-radius: 0 14px 14px 0; color: var(--q-primary); text-decoration: none;
  font-size: 1.05rem; line-height: 1;
}
.q-read span { font-size: .66rem; font-weight: 700; }
.q-read:hover { background: rgba(2, 81, 183, .06); }
.q-continue-read { text-decoration: none; background: #fff; color: var(--q-ink); border: 1px solid var(--q-line); box-shadow: none; }
.q-continue-read:hover { background: #fff; border-color: var(--q-primary); color: var(--q-ink); }
.q-continue-read .q-continue-icon { background: rgba(2, 81, 183, .1); color: var(--q-primary); font-size: 1.1rem; }
.q-continue-read .q-continue-text small { color: #6b7a90; }
.q-num {
  flex-shrink: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(2, 81, 183, .09); color: var(--q-primary); font-weight: 700; font-size: .84rem;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); /* octagon, like an ayah marker */
}
.q-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.q-names strong { font-size: .95rem; color: var(--q-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-names small { font-size: .76rem; color: #6b7a90; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-ar { flex-shrink: 0; font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif; font-size: 1.25rem; color: var(--q-ink); line-height: 1.2; }
.q-icon { flex-shrink: 0; font-size: 1.6rem; color: var(--q-primary); opacity: .25; line-height: 1; transition: opacity .15s; }
.q-main:hover .q-icon, .q-row.is-current .q-icon { opacity: 1; }
.q-row.is-current { border-color: var(--q-primary); background: #f7faff; box-shadow: 0 0 0 3px rgba(2, 81, 183, .12); }
.q-row.is-current .q-num { background: var(--q-primary); color: #fff; }
.q-row.is-target { border-color: var(--q-mint); box-shadow: 0 0 0 3px rgba(126, 221, 174, .45); }
.q-row.is-playing .q-num { animation: q-pulse 1.6s ease-in-out infinite; }
@keyframes q-pulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .q-row.is-playing .q-num { animation: none; } }

.q-empty { text-align: center; padding: 32px 16px; color: #6b7a90; }
.q-empty[hidden] { display: none; }
.q-empty > i { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.q-credit { font-size: .74rem; color: #8a96a8; margin: 16px 2px 0; }
.q-credit a { color: inherit; }

/* player bar */
.q-player {
  position: fixed; left: 50%; bottom: calc(16px + var(--qp-offset, 0px)); transform: translateX(-50%); z-index: 1060;
  width: min(720px, calc(100% - 24px)); padding: 10px 14px 10px; border-radius: 18px;
  background: #0B1F3A; color: #fff; box-shadow: 0 14px 36px rgba(11, 31, 58, .32);
  display: grid; gap: 6px;
}
.q-player[hidden] { display: none; }
.q-player button, .q-player a { font-family: inherit; line-height: 1.4; }
.qp-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qp-play { flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: #0B1F3A; font-size: 1.4rem; display: inline-flex; align-items: center; justify-content: center; }
.qp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qp-title { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-sub { font-size: .74rem; color: rgba(255, 255, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-ar { flex-shrink: 0; font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif; font-size: 1.2rem; color: #7EDDAE; margin-right: 4px; }
.qp-btn { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: rgba(255, 255, 255, .85); font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; }
.qp-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .1); color: #fff; }
.qp-btn:disabled { opacity: .3; }
.qp-seek { display: flex; align-items: center; gap: 8px; }
.qp-time { flex-shrink: 0; font-size: .72rem; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .75); min-width: 34px; text-align: center; }
.qp-skip { flex-shrink: 0; position: relative; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: rgba(255, 255, 255, .8); font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; }
.qp-skip span { position: absolute; font-size: .48rem; font-weight: 700; top: 50%; left: 50%; transform: translate(-50%, -38%); }
.qp-skip:hover { color: #7EDDAE; }
.q-player input[type=range] { flex: 1; min-width: 0; height: 18px; accent-color: #7EDDAE; cursor: pointer; background: transparent; }
.qp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-chip { border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #fff; border-radius: 999px; padding: 3px 10px; font-size: .76rem; font-weight: 600; display: inline-flex; gap: 5px; align-items: center; text-decoration: none; }
.qp-chip:hover { border-color: #7EDDAE; color: #7EDDAE; }
.qp-chip.is-on { background: rgba(126, 221, 174, .16); border-color: #7EDDAE; color: #7EDDAE; }
.q-player button:focus-visible, .q-player a:focus-visible, .q-player input:focus-visible { outline: 2px solid #7EDDAE; outline-offset: 2px; }
body.has-q-player .toast-stack { bottom: calc(164px + var(--qp-offset, 0px)); }

@media (max-width: 560px) {
  .q-tools { grid-template-columns: minmax(0, 1fr); }
  .q-list { grid-template-columns: minmax(0, 1fr); }
  .q-main { padding: 10px 6px 10px 10px; gap: 10px; }
  .q-read { width: 48px; }
  .q-ar { font-size: 1.1rem; }
  .q-player { width: calc(100% - 16px); bottom: calc(8px + var(--qp-offset, 0px)); padding: 9px 10px; border-radius: 16px; }
  .qp-ar { display: none; }
  .qp-btn { width: 32px; height: 32px; }
  .qp-chip { padding: 3px 8px; font-size: .72rem; }
}
.qp-chip[hidden] { display: none; }
