/* Awwab Qibla finder: /qibla, the country pages (/qibla/<country>) and the Qibla
   section of the country guides. On top of styles.css (the site's night palette). */

.qb-hero { padding: 56px 0 34px; }
.qb-hero h1 { font-size: clamp(34px, 6vw, 54px); }
.qb-lede { font-size: clamp(17px, 2.2vw, 20px); color: #d7d2c4; max-width: 620px; margin: 16px 0 0; line-height: 1.6; }
.qc-hero .cta-row { margin-top: 24px; }
.qc-answer { font-family: var(--serif); font-size: clamp(19px, 2.5vw, 23px); color: var(--ink); }
.qc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: #a9b6aa; margin-bottom: 26px; }
.qc-crumbs a { color: #c4b58f; text-decoration: none; }
.qc-crumbs a:hover { color: #f4efe3; }
.qc-crumbs .sep { opacity: .5; }

.qb-combo { position: relative; }
.qb-combo input, .qb-builder select, .qb-builder textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong); border-radius: 14px; padding: 13px 15px; outline: none; }
.qb-combo input:focus, .qb-builder select:focus, .qb-builder textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226,196,119,0.18); }
.qb-search-label { display: block; font-size: 14px; color: var(--ink-soft); margin: 0 0 7px; font-weight: 500; }
.qb-results { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(0,0,0,0.7); max-height: 320px; overflow: auto; }
.qb-result { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; min-height: 44px; border-radius: 10px; cursor: pointer; }
.qb-result[aria-selected="true"], .qb-result:hover { background: rgba(226,196,119,0.12); }
.qb-result-name { color: var(--ink); font-weight: 600; }
.qb-result-sub { color: var(--ink-faint); font-size: 13.5px; }
.qb-result-msg { padding: 10px 12px; color: var(--ink-soft); font-size: 14.5px; }
.qb-map { margin: 6px 0 22px; }
.qb-map svg { width: 100%; height: auto; display: block; border-radius: 14px; }
.qb-map figcaption { margin-top: 10px; font-size: 13.5px; color: var(--ink-faint); line-height: 1.6; }
.qb-key { display: inline-block; width: 22px; height: 0; vertical-align: middle; margin-inline-end: 6px; }
.qb-key-gc { border-top: 2.5px solid var(--gold); }
.qb-key-flat { border-top: 1.5px dashed var(--ink-soft); margin-inline-start: 10px; }

/* ========================================================================
   The app screen (/qibla above the fold): mirrors the Awwab app's Qibla
   screen. Palette, sizes and motion from QiblaCompassView.swift; light with
   the system's light mode, dark with its dark mode (the app's two looks).
   ======================================================================== */
.qibla-app { --qa-bg: #FFFFFF; --qa-elev: #F7F7F5; --qa-ink: #0F1411; --qa-soft: #6B7570; --qa-accent: #C8A046; --qa-accent-soft: #F8F1DF;
  --qa-primary: #0E5E3D; --qa-primary-deep: #0B4A2F; --qa-line: rgba(15,20,17,0.10); --qa-shadow: 0 18px 50px -24px rgba(15,20,17,0.35); }
@media (prefers-color-scheme: dark) {
  .qibla-app { --qa-bg: #0A0F0C; --qa-elev: #1F2D24; --qa-ink: #F0EAD8; --qa-soft: #9AA8A0; --qa-accent: #E0B868; --qa-accent-soft: #3F3520;
    --qa-primary: #3FA56F; --qa-primary-deep: #2A8055; --qa-line: rgba(240,234,216,0.12); --qa-shadow: 0 18px 50px -24px rgba(0,0,0,0.8); }
}
.qa { position: relative; background: var(--qa-bg); color: var(--qa-ink); padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); display: flex; overflow: hidden; }
.qa::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease;
  background: radial-gradient(60% 45% at 50% 42%, color-mix(in srgb, var(--qa-accent) 26%, transparent), transparent 70%); }
.qa.is-facing::before { opacity: 1; }
.qa-inner { position: relative; width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.qa-head { width: 100%; }
.qa-title { margin: 2px 0 2px; font: 700 22px/1.2 "Fraunces Qibla", var(--serif); color: var(--qa-ink); letter-spacing: .2px; }
:lang(ar) .qa-title, :lang(ur) .qa-title { font-family: var(--serif); }
.qa-sub { margin: 0; font-size: 15px; line-height: 1.4; color: var(--qa-soft); }
.qa-place { margin: 4px 0 0; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--qa-primary); min-height: 22px; }
.qa-place[hidden] { display: flex; visibility: hidden; } /* keeps its height: no jump when the place arrives */
.qa-place svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.qa-stage { position: relative; width: min(100%, 360px, max(230px, calc(100vh - 460px))); width: min(100%, 360px, max(230px, calc(100dvh - 460px))); aspect-ratio: 1; margin: 2px auto 0; display: grid; place-items: center; }
.qa-dial { width: 100%; height: 100%; }
.qa-dial[hidden] { display: none; }
.qa-mapmode { width: 100%; height: 100%; display: grid; grid-template-rows: auto auto; align-content: center; justify-items: center; gap: 10px; }
.qa-mapmode[hidden] { display: none; }
.qa-northup { width: 44%; height: auto; }
.qa-worldmap { width: 100%; height: auto; border-radius: 14px; }
.qa-live { position: absolute; inset-inline-start: 2px; top: 6px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font: 700 11px/1 -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 1.2px; text-transform: uppercase; color: var(--qa-primary);
  background: color-mix(in srgb, var(--qa-primary) 12%, var(--qa-bg)); border: 1px solid color-mix(in srgb, var(--qa-primary) 30%, transparent); }
.qa-live[hidden] { display: none; }
.qa-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--qa-primary); animation: qa-pulse 1.6s ease-in-out infinite; }
@keyframes qa-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
.qa-readout { min-height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.qa-deg { margin: 0; display: flex; align-items: baseline; justify-content: center; gap: 2px; flex-wrap: wrap; }
.qa-deg[hidden] { display: none; }
.qa-deg-num { font: 600 40px/1 "Fraunces Qibla", Fraunces, var(--serif); color: var(--qa-ink); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.qa-deg-unit { font: 600 22px/1 "Fraunces Qibla", var(--serif); color: var(--qa-soft); }
.qa-dir { margin-inline-start: 8px; font-size: 16px; font-weight: 600; color: var(--qa-ink); }
.qa-line { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--qa-soft); min-height: 1.45em; }
.qa-line.qa-soft { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.qa-note { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--qa-ink); max-width: 340px; }
.qa-note[hidden], .qa-link[hidden] { display: none; }
.qa-link { appearance: none; border: 0; background: none; padding: 6px 8px; min-height: 44px; color: var(--qa-primary); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.qa-primary { appearance: none; border: 0; cursor: pointer; width: min(100%, 340px); min-height: 52px; margin-top: 4px; padding: 0 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 600 17px/1 var(--sans); color: #fff;
  background: linear-gradient(180deg, var(--qa-primary), var(--qa-primary-deep)); box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--qa-primary) 70%, transparent);
  transition: transform .15s ease, background .3s ease, color .3s ease, box-shadow .3s ease; }
.qa-primary:active { transform: scale(.98); }
.qa-primary:focus-visible, .qa-chip:focus-visible, .qa-link:focus-visible, .qs-btn:focus-visible, .qs-x:focus-visible { outline: 3px solid var(--qa-accent); outline-offset: 2px; }
.qa-primary[disabled] { cursor: progress; opacity: .85; }
.qa-primary-dot { display: none; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.qa-primary.is-live { background: color-mix(in srgb, var(--qa-primary) 12%, var(--qa-bg)); color: var(--qa-primary); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--qa-primary) 40%, transparent); }
.qa-primary.is-live .qa-primary-dot { display: inline-block; animation: qa-pulse 1.6s ease-in-out infinite; }
.qa[data-mode="finding"] .qa-primary-dot { display: inline-block; animation: qa-pulse 1s ease-in-out infinite; }
.qa-private { margin: 4px 0 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--qa-soft); }
.qa-private svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.qa-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.qa-chip { appearance: none; cursor: pointer; min-height: 44px; padding: 0 15px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
  font: 600 14px/1 var(--sans); color: var(--qa-ink); background: var(--qa-elev); border: 1px solid var(--qa-line); transition: background .2s ease, opacity .2s ease; }
.qa-chip svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.qa-chip-icon { width: 44px; padding: 0; justify-content: center; }
.qa-row { flex-wrap: nowrap; }
.qa-chip[disabled] { opacity: .45; cursor: default; }
.qa-chip[hidden] { display: none; }
.qa-more { margin-top: auto; padding: 14px 10px 2px; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--qa-soft); text-decoration: none; }
.qa-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; animation: qa-nudge 2.4s ease-in-out infinite; }
@keyframes qa-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.qa-noscript { color: var(--qa-ink); }
.qa[data-mode="map"] .qa-private { display: none; }
.qibla-app .nav-links a.nav-cta { white-space: nowrap; }
@media (max-width: 380px) { .qibla-app .nav-links a.nav-cta { padding: 8px 12px; font-size: 13.5px; } }
@media (max-height: 760px) { .qa-northup { width: 36%; } .qa-worldmap { width: 88%; } }
@media (max-height: 700px) { .qa-title { font-size: 19px; } .qa-sub { font-size: 14px; } .qa-readout { min-height: 60px; } .qa-primary { min-height: 48px; } }
@media (min-width: 820px) {
  .qa { min-height: 0; background: transparent; padding: 40px 16px 34px; }
  .qa-inner { background: var(--qa-bg); border-radius: 28px; padding: 26px 30px 18px; box-shadow: var(--qa-shadow); max-width: 460px; }
  .qa-stage { width: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .qa::before, .qa-primary { transition: none; }
  .qa-live-dot, .qa-primary-dot, .qa-more svg { animation: none !important; }
}

/* ---- bottom sheets (qibla/sheet.mjs) */
.qs-root { position: fixed; inset: 0; z-index: 200; color: var(--qa-ink); }
.qs-backdrop { position: absolute; inset: 0; background: rgba(4, 10, 7, 0.55); opacity: 0; transition: opacity .24s ease; }
.qs-sheet { position: absolute; inset-inline: 0; bottom: 0; max-height: 90vh; max-height: 90dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--qa-bg); border-radius: 22px 22px 0 0; padding: 6px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -18px 50px -20px rgba(0,0,0,.45);
  transform: translateY(104%); transition: transform .34s cubic-bezier(.2,.8,.2,1); outline: none; text-align: start; }
.qs-root.is-open .qs-backdrop { opacity: 1; }
.qs-root.is-open .qs-sheet { transform: none; }
.qs-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--qa-line); margin: 4px auto 6px; }
.qs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qs-title { margin: 8px 0 6px; font: 700 20px/1.3 var(--sans); color: var(--qa-ink); }
.qs-x { appearance: none; border: 0; cursor: pointer; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--qa-elev); color: var(--qa-ink); }
.qs-x svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.qs-lead { margin: 0 0 10px; font-size: 15.5px; line-height: 1.55; color: var(--qa-soft); }
.qs-h { margin: 16px 0 8px; font: 700 14px/1.3 var(--sans); color: var(--qa-ink); letter-spacing: .2px; }
.qs-steps { margin: 0 0 6px; padding-inline-start: 1.35em; display: grid; gap: 7px; font-size: 15px; line-height: 1.5; color: var(--qa-ink); }
.qs-steps li::marker { color: var(--qa-accent); font-weight: 700; }
.qs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.qs-btn { appearance: none; cursor: pointer; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; font: 600 16px/1 var(--sans);
  color: #fff; background: linear-gradient(180deg, var(--qa-primary), var(--qa-primary-deep)); }
.qs-btn-ghost { color: var(--qa-ink); background: var(--qa-elev); box-shadow: inset 0 0 0 1px var(--qa-line); }
.qs-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--qa-soft); }
.qs-manual { display: grid; gap: 14px; }
.qs-manual input { width: 100%; min-height: 48px; font: inherit; font-size: 16px; color: var(--qa-ink); background: var(--qa-elev);
  border: 1px solid var(--qa-line); border-radius: 14px; padding: 12px 14px; outline: none; }
.qs-manual input:focus { border-color: var(--qa-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--qa-accent) 25%, transparent); }
.qs-manual .qb-results { position: static; margin-top: 6px; background: var(--qa-bg); border-color: var(--qa-line); box-shadow: none; max-height: 40vh; }
.qs-manual .qb-result-name { color: var(--qa-ink); }
.qs-manual .qb-result-sub, .qs-manual .qb-result-msg { color: var(--qa-soft); }
.qs-manual .qb-result[aria-selected="true"], .qs-manual .qb-result:hover { background: color-mix(in srgb, var(--qa-accent) 16%, transparent); }
.qs-coords-row { display: flex; gap: 8px; }
.qs-coords-row input { flex: 1; text-align: left; }
.qs-coords-row .qs-btn { flex: none; }
.qs-error { margin: 6px 0 0; min-height: 1.2em; font-size: 13.5px; color: #c0392b; }
@media (min-width: 700px) {
  .qs-sheet { inset: auto; left: 50%; top: 50%; bottom: auto; width: min(520px, 92vw); max-height: 86vh; border-radius: 24px; padding-bottom: 24px;
    transform: translate(-50%, -46%); opacity: 0; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease; }
  .qs-root.is-open .qs-sheet { transform: translate(-50%, -50%); opacity: 1; }
  .qs-grip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .qs-sheet, .qs-root.is-open .qs-sheet { transition: opacity .15s ease; transform: none; }
  .qs-sheet { opacity: 0; } .qs-root.is-open .qs-sheet { opacity: 1; }
  @media (min-width: 700px) { .qs-sheet, .qs-root.is-open .qs-sheet { transform: translate(-50%, -50%); } }
}

/* ---- article: tables, lists, verse, widget builder ---- */
.qb-article .post-body > h2:first-child { margin-top: 0; }
.qb-verse .qb-arabic { font-size: clamp(22px, 2.8vw, 27px); line-height: 2.1; color: var(--gold-soft); margin: 0 0 10px; text-align: right; }
.qb-verse .verse-cite { margin-top: 8px; font-size: 14px; color: var(--ink-faint); }
.qb-table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 16px; }
.qb-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.qb-table th, .qb-table td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.qb-table thead th { font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--gold); font-weight: 700; background: rgba(255,255,255,0.03); }
.qb-table tbody th { font-weight: 600; color: var(--ink); }
.qb-table tbody td { color: var(--ink-soft); }
.qb-table tbody tr:last-child th, .qb-table tbody tr:last-child td { border-bottom: 0; }
.qb-table a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(226,196,119,0.35); }
.qb-table a:hover { border-bottom-color: var(--gold); }
.qb-table small { display: block; color: var(--ink-faint); font-weight: 400; font-size: 12.5px; }
.qb-table .num, .qc-index .num { font-variant-numeric: tabular-nums; }
.qb-country-links, .qc-index { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 18px; }
.qb-country-links li, .qc-index li { margin: 0; display: flex; justify-content: space-between; gap: 8px; }
.qc-index .num { color: var(--ink-faint); font-size: 14px; }
.post-body .qb-country-links a, .post-body .qc-index a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(226,196,119,0.3); }
.qc-facts { padding-inline-start: 1.2em; }
.qc-facts li { margin-bottom: 10px; }
.qc-others { line-height: 2.1; }
.post-body .qc-others a { margin-inline-end: 14px; white-space: nowrap; }
.qb-small { font-size: 14.5px !important; color: var(--ink-faint) !important; }
.qb-promo .store-badges { --badge-h: 44px; display: flex; flex-wrap: wrap; gap: 14px; }
.post-body .qb-promo a.store-badge { border-bottom: 0; }

.qb-builder { display: grid; gap: 22px; margin: 18px 0 14px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper-2); }
.qb-builder fieldset { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.qb-builder legend { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; padding: 0; font-weight: 500; }
.qb-radio { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 15.5px; cursor: pointer; }
.qb-radio input { accent-color: var(--gold); width: 17px; height: 17px; }
.qb-w-combo { margin-bottom: 16px; }
.qb-w-combo[hidden] { display: none; }
.qb-builder textarea { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; direction: ltr; margin-bottom: 12px; }
.qb-preview { min-height: 120px; display: grid; place-items: center; color: var(--ink-faint); font-size: 14.5px; margin-bottom: 16px; }
.qb-preview-frame { width: 100%; max-width: 340px; height: 440px; border: 0; border-radius: 16px; background: #fff; }
@media (min-width: 820px) { .qb-builder { grid-template-columns: 1fr 1fr; } }

.qb-code { direction: ltr; text-align: left; overflow-x: auto; margin: 0 0 20px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(0,0,0,0.25); color: var(--gold-soft); font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; color: var(--gold-soft); }

/* the Qibla section of a country guide */
.qc-guide .cta-row { gap: 10px; }


/* ---- the article below the fold */
.qb-h2-lead { margin-top: 0 !important; }
.qb-lede { margin-bottom: 18px; }
@media (max-width: 560px) {
  .qb-table th, .qb-table td { padding: 9px 10px; font-size: 14.5px; }
}
