/* Islam Q&A — page styles on top of the shared sakina.css
   Theming: data-theme="light" | "dark" (shared across all Islamic Projects)
   Direction: dir="ltr" | "rtl", set per language by i18n.js */

.qa-lang { font-family: var(--font-ar-ui); font-weight: 600; font-size: 15px; }
[dir="rtl"] .qa-lang { font-family: var(--font-ui); font-size: 14px; }
[dir="rtl"] .sk-brand__name { font-family: var(--font-ui); }

/* ---------- Search field + suggestions (home & browse) ---------- */
.search { position: relative; width: min(760px, 100%); }
.search .sk-field { min-height: 68px; padding-inline: 24px 10px; }
.search .sk-field > svg { color: var(--text-3); }
.search .sk-btn { min-height: 48px; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 20;
  padding: 8px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: sk-rise .25s var(--ease) both;
}
.suggest a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-radius: 16px; color: var(--text); text-align: start; }
.suggest a:hover, .suggest a.is-active { background: var(--primary-soft); color: var(--text); }
.suggest a > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.suggest strong { font-size: 16px; font-weight: 600; }
.suggest small { font-size: 13.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest svg { color: var(--primary); }
.suggest__empty { padding: 18px 16px; font-size: 15px; color: var(--text-2); }
.suggest__all { justify-content: center !important; font-weight: 600; color: var(--primary) !important; }

/* ---------- Home ---------- */
.home-hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: clamp(48px, 8vw, 96px); }
.hero-arches { position: absolute; inset: 0 0 auto 0; height: 100%; pointer-events: none; display: flex; justify-content: center; }
.hero-arches::before, .hero-arches::after {
  content: ""; position: absolute; top: 18px; width: min(720px, 94%); height: calc(100% - 18px);
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: 999px 999px 0 0;
}
.hero-arches::after { top: 42px; width: min(672px, 88%); border-style: dashed; border-color: var(--line); }
.hero-arches svg { position: absolute; top: 3px; }
.home-hero > *:not(.hero-arches) { position: relative; }
.home-hero__title { margin-top: 18px; font-size: clamp(46px, 7vw, 86px); max-width: 14ch; }
.home-hero__lede { margin: 20px 0 0; max-width: 46ch; }
.home-hero .search { margin-top: 38px; }
.try { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; max-width: 900px; }
.try__label { font-size: 13.5px; font-weight: 600; color: var(--text-3); margin-inline-end: 4px; }
.try .sk-chip { max-width: 100%; white-space: normal; text-align: start; line-height: 1.3; padding-block: 8px; }

.verse-panel { margin-top: clamp(72px, 10vw, 120px); }
.verse {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 72px) clamp(32px, 5vw, 56px); text-align: center;
  border-radius: 999px 999px var(--r-xl) var(--r-xl);
  background: var(--primary-soft); border: 1px solid var(--line);
}
.verse::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern-img); background-size: 72px; opacity: .1; pointer-events: none; }
.verse::after { content: ""; position: absolute; inset: 14px; border: 1px solid var(--line-2); border-radius: 999px 999px 24px 24px; pointer-events: none; }
.verse > * { position: relative; }
.verse__arabic { margin: 12px 0 0; font-family: var(--font-naskh); font-size: clamp(30px, 4.6vw, 52px); line-height: 1.7; color: var(--text); }
.verse__translation { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; color: var(--text-2); max-width: 30ch; }
[dir="rtl"] .verse__translation { font-family: var(--font-ar-text); font-size: clamp(19px, 2.2vw, 24px); line-height: 1.9; }
.verse__ref { margin: 0; font-size: 14px; font-weight: 600; color: var(--primary); }

.letter { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 680px); justify-content: center; gap: clamp(24px, 5vw, 72px); padding-top: clamp(72px, 10vw, 112px); }
.letter__head { display: flex; flex-direction: column; gap: 12px; }
.letter__head .sk-display { font-size: clamp(36px, 4.2vw, 52px); }
.letter__body { display: flex; flex-direction: column; gap: 18px; }
.letter__body p { margin: 0; font-size: 17.5px; line-height: 1.8; color: var(--text-2); }
[dir="rtl"] .letter__body p { font-family: var(--font-ar-text); font-size: 19px; line-height: 2; }
.letter__quote {
  position: relative; margin: 8px 0; padding: 28px 30px 24px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 12px;
}
.letter__quote > svg { position: absolute; top: -13px; inset-inline-start: 28px; }
.letter__quote-text { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.25; color: var(--text); }
[dir="rtl"] .letter__quote-text { font-family: var(--font-naskh); font-size: 25px; line-height: 1.8; }
.letter__quote-ref { font-size: 14px; font-weight: 600; color: var(--primary); }

.explore { padding-top: clamp(72px, 10vw, 112px); display: flex; flex-direction: column; gap: 28px; }
.explore__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.explore__head .sk-display { font-size: clamp(38px, 4.4vw, 52px); margin-top: 8px; }
.explore__head p { margin: 10px 0 0; max-width: 52ch; color: var(--text-2); }
.qgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.qcard { display: flex; flex-direction: column; gap: 14px; padding: 26px; color: var(--text); }
.qcard:hover { color: var(--text); }
.qcard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.qcard__q { font-family: var(--font-display); font-size: 29px; line-height: 1.1; }
[dir="rtl"] .qcard__q { font-family: var(--font-ar-text); font-weight: 700; font-size: 22px; line-height: 1.6; }
.qcard__excerpt { margin: 0; flex-grow: 1; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.qcard__foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 500; color: var(--text-3); }
.qcard__foot svg { color: var(--primary); }
.explore__cta { align-self: center; }

/* ---------- Browse ---------- */
.browse-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: clamp(36px, 6vw, 64px); }
.browse-hero .sk-display { font-size: clamp(40px, 5.4vw, 64px); }
.browse-hero .sk-lede { margin: 0; max-width: 48ch; }
.browse-hero .search { margin-top: 14px; }
.browse-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.results { width: min(880px, 100%); margin: clamp(36px, 5vw, 56px) auto 0; display: flex; flex-direction: column; gap: 14px; }
.results-status { font-size: 14px; font-weight: 600; color: var(--text-3); }
.entry-list { display: flex; flex-direction: column; gap: 12px; }
.qrow { display: flex; align-items: center; gap: 18px; padding: 20px 22px; color: var(--text); animation: sk-rise .45s var(--ease) both; }
.qrow:hover { color: var(--text); }
.qrow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.qrow__q { font-family: var(--font-display); font-size: 25px; line-height: 1.15; }
[dir="rtl"] .qrow__q { font-family: var(--font-ar-text); font-weight: 700; font-size: 20px; line-height: 1.6; }
.qrow__excerpt { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.qrow__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.qrow > svg { color: var(--primary); flex: none; }
.qrow mark { background: var(--gold-soft); color: inherit; border-radius: 4px; padding: 0 2px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 20px; text-align: center; color: var(--text-2); }
.empty-state svg { color: var(--gold-bright); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.pagination__nav { display: flex; align-items: center; gap: 10px; }
.pagination__info { font-size: 14px; font-weight: 600; color: var(--text-3); }
.per-page-select { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-3); }
.per-page-select select { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); }

/* ---------- Article ---------- */
.article-page { width: min(760px, 100%); margin-inline: auto; padding-top: clamp(28px, 5vw, 56px); }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.back-link:hover { color: var(--text); }
[dir="rtl"] .back-link svg { transform: scaleX(-1); }
.article { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.article__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.article__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--sunk); }
.lang-seg a { min-height: 32px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.lang-seg a[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.article__question { font-size: clamp(38px, 5.4vw, 60px); line-height: 1.04; }
.article__meta { font-size: 14px; color: var(--text-3); }
.prose { font-size: 18px; line-height: 1.8; color: var(--text-2); }
[dir="rtl"] .prose { font-family: var(--font-ar-text); font-size: 19px; line-height: 2; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose strong { color: var(--text); }
.prose h2, .prose h3 { margin-top: 1.6em; font-family: var(--font-display); font-weight: 400; color: var(--text); line-height: 1.15; }
.prose h2 { font-size: 32px; } .prose h3 { font-size: 26px; }
[dir="rtl"] .prose h2, [dir="rtl"] .prose h3 { font-family: var(--font-ar-text); font-weight: 700; line-height: 1.5; }
.prose ul, .prose ol { margin: 0; padding-inline-start: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.prose ol { counter-reset: n; }
.prose li { position: relative; padding-inline-start: 28px; }
.prose ul > li::before { content: ""; position: absolute; inset-inline-start: 6px; top: .72em; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--gold-bright); }
.prose ol > li { counter-increment: n; }
.prose ol > li::before { content: counter(n); position: absolute; inset-inline-start: 0; top: .1em; font-size: 14px; font-weight: 700; color: var(--primary); }
.prose blockquote {
  margin: 1.4em 0; padding: 22px 24px; border-radius: 22px; background: var(--primary-soft);
  font-family: var(--font-display); font-size: 24px; line-height: 1.35; color: var(--text);
}
.prose blockquote p { margin: 0; }
.prose blockquote em { font-style: normal; }
[dir="rtl"] .prose blockquote { font-family: var(--font-naskh); font-size: 21px; line-height: 1.9; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.prose hr { border: 0; height: 1px; background: var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; }
.prose code { font-family: var(--font-mono); font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--sunk); }

.article__end { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.feedback, .share { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feedback__label, .share__label { font-size: 15px; font-weight: 600; }
.feedback__buttons, .share__buttons { display: flex; gap: 8px; align-items: center; }
.feedback__msg { width: 100%; min-height: 1.4em; font-size: 14px; color: var(--primary); }
.share__buttons .sk-icon-btn svg { width: 18px; height: 18px; }
.share__buttons .is-copied { color: var(--primary); border-color: var(--primary); }
.article-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.article-nav a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; color: var(--text); }
.article-nav a:hover { color: var(--text); }
.article-nav small { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
[dir="rtl"] .article-nav small { letter-spacing: 0; }
.article-nav span { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.article-nav a:last-child { text-align: end; }
.loading { display: grid; place-items: center; padding: 80px 0; }
.loading svg { color: var(--gold-bright); animation: sk-spin 2.4s linear infinite; }

/* ---------- Footer ---------- */
.qa-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-block: 28px; font-size: 14px; color: var(--text-3); }
.qa-footer p { margin: 0; max-width: 60ch; line-height: 1.6; }
.lang-switcher { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-switcher__label { font-weight: 600; }
.lang-switcher a { min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-weight: 600; }
.lang-switcher a.active { background: var(--text); border-color: var(--text); color: var(--bg); }

@media (max-width: 980px) {
  .qgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .letter { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .qgrid { grid-template-columns: 1fr; }
  .search .sk-field { min-height: 60px; padding-inline: 18px 8px; }
  .search .sk-field .sk-kbd { display: none; }
  .search .sk-btn { padding: 0 16px; }
  .qrow { padding: 18px; }
  .qrow__q { font-size: 22px; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav a:last-child { text-align: start; }
  .verse { border-radius: 200px 200px var(--r-lg) var(--r-lg); }
  .verse::after { border-radius: 200px 200px 16px 16px; }
}

[dir="rtl"] .qcard__excerpt, [dir="rtl"] .qrow__excerpt { font-family: var(--font-ar-text); line-height: 1.85; }
[dir="rtl"] .prose blockquote { font-family: var(--font-naskh); }
