/* THE SUNNAH WAY — narrations arranged by life situation.
   Mobile-first (390px design width). Uses only the tokens from styles.css/themes.css
   so all five skins work. Compact by default: small chips, small type, no oversized buttons.

   TYPEFACE RESERVATION
   --------------------
   .sunnah-narration is the ONLY place in the app that uses --sw-narration-font.
   The brief named Georgia, but Georgia is already the app's --font-display
   (themes.css: headings, countdown, prayer times in v1-v4), so it would NOT read as
   distinct. Lora with a Charter/Sitka/Cambria fallback chain is used instead — no other
   selector in the app references any of those families. Do not reuse this variable. */

/* defined at the root because .sunnah-narration also renders on the home dashboard,
   outside the .sw view wrapper */
:root {
  --sw-narration-font: "Lora", "Charter", "Bitstream Charter", "Sitka Text", Cambria, serif;
}

.sw { padding-bottom: 24px; }

/* ---------- heads ---------- */
.sw-head { margin: 10px 0 14px; }
/* Aamir's seal (2026-08-28): the navy Muhammad-Rasul-Allah plate heads every Sunnah Way page */
.sw-head-seal { display: grid; grid-template-columns: 64px 1fr; column-gap: 14px; align-items: center; }
.sw-head-seal .sw-sub { grid-column: 1 / -1; }
.sw-head-seal-sm { grid-template-columns: 44px 1fr; column-gap: 10px; }
.sw-seal { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(4,8,40,.28)); }
.sw-head-seal-sm .sw-seal { width: 44px; height: 44px; }
.sw-h1 { font-size: 1.4rem; font-weight: 600; letter-spacing: .01em; }
.sw-sub { color: var(--text-dim); font-size: .82rem; line-height: 1.55; margin-top: 5px; }
.sw-loading { color: var(--text-dim); font-size: .9rem; padding: 40px 0; text-align: center; }
.sw-eyebrow {
  font-size: .64rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); margin: 18px 0 7px;
}

/* ---------- "What's on your mind?" quiet rows ---------- */
.sw-mind {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.sw-mind-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px 13px;
  font-size: .87rem; line-height: 1.35; color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: background .16s;
}
.sw-mind-row:last-child { border-bottom: 0; }
.sw-mind-row:hover { background: var(--surface-2); }
.sw-mind-row:active { background: var(--surface-2); }
.sw-mind-go { margin-left: auto; color: var(--gold-dim); font-size: .95rem; line-height: 1; }

/* ---------- situation grid ---------- */
.sw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.sw-sit {
  text-align: left;
  padding: 10px 11px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: background .18s, border-color .18s, transform .12s;
}
.sw-sit:hover { background: var(--surface-2); border-color: var(--gold-dim); }
.sw-sit:active { transform: scale(.98); }
.sw-sit-t { font-weight: 600; font-size: .88rem; line-height: 1.25; }
.sw-sit-b { color: var(--text-dim); font-size: .74rem; line-height: 1.4; margin-top: 3px; }
.sw-sit-n {
  display: inline-block; margin-top: 6px;
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}

/* ---------- back ---------- */
.sw-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: .78rem;
  padding: 6px 0; margin-top: 6px;
}
.sw-back:hover { color: var(--gold); }

/* ---------- entry card ---------- */
.sw-entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 13px 13px 11px;
  margin-bottom: 11px;
  scroll-margin-top: 76px;
  transition: border-color .5s, box-shadow .5s;
}
.sw-entry.hl {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 178, 94, .16);
}
/* entry titles are drawn from the narration's own wording — never transform their case */
.sw-e-title {
  font-size: .76rem; letter-spacing: .01em;
  color: var(--text-dim); line-height: 1.45; margin-bottom: 9px;
}

/* the reported words — reserved typeface, framed, larger than app copy */
.sunnah-narration {
  font-family: var(--sw-narration-font);
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--text);
  background: var(--surface-2);
  border-left: 3px solid var(--gold);
  border-radius: 4px var(--r-md) var(--r-md) 4px;
  padding: 12px 13px;
}

/* ---------- Arabic ---------- */
.sw-ar-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 9px; padding: 4px 10px;
  font-family: var(--font-ar); font-size: .88rem;
  color: var(--gold); background: transparent;
  border: 1px solid var(--line); border-radius: var(--r-pill);
}
.sw-ar-toggle:hover { border-color: var(--gold-dim); }
.sw-ar {
  font-family: var(--font-ar);
  font-size: 1.22rem; line-height: 2.05;
  direction: rtl; text-align: right;
  color: var(--gold-bright);
  margin-top: 9px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.sw-ar[hidden] { display: none; }

/* ---------- source bar: ALWAYS visible, never collapsible ---------- */
.sw-source {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin-top: 11px; padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: .74rem;
}
.sw-attr { color: var(--text-dim); }
/* grade strings come from the source and can be a whole sentence — the badge wraps
   rather than truncating, because the grading is never abbreviated or reworded */
.sw-grade {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; max-width: 100%;
  text-align: left; white-space: normal; line-height: 1.35;
  font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  color: var(--gold-bright);
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: var(--r-pill);
}
.sw-grade:hover { background: var(--surface-2); }
.sw-grade-q {
  flex: none;
  display: inline-grid; place-items: center;
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid currentColor; font-size: .52rem; line-height: 1;
}
.sw-src-link {
  margin-left: auto;
  color: var(--gold); text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  white-space: nowrap;
}
.sw-src-link:hover { color: var(--gold-bright); }

/* ---------- explanation expander ---------- */
.sw-exp { margin-top: 10px; }
.sw-exp > summary {
  list-style: none; cursor: pointer;
  font-size: .74rem; color: var(--text-dim);
  padding: 6px 0;
  display: flex; align-items: center; gap: 7px;
}
.sw-exp > summary::-webkit-details-marker { display: none; }
.sw-exp > summary::before {
  content: "+"; color: var(--gold); font-size: .9rem; line-height: 1;
  width: 12px; text-align: center;
}
.sw-exp[open] > summary::before { content: "–"; }
.sw-exp > summary:hover { color: var(--text); }
.sw-exp-body {
  font-size: .84rem; line-height: 1.65; color: var(--text-dim);
  padding: 8px 0 2px 19px;
  border-left: 1px solid var(--line);
  margin-left: 5px;
}

/* ---------- actions ---------- */
.sw-actions {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--line);
}
.sw-act {
  font-size: .74rem; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 5px;
}
.sw-act:hover { color: var(--gold); }
.sw-act svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sw-act.right { margin-left: auto; }

/* ---------- report panel ---------- */
.sw-report { margin-top: 10px; }
.sw-report[hidden] { display: none; }
.sw-report textarea {
  width: 100%; min-height: 62px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 11px; font-family: inherit; font-size: .84rem; line-height: 1.5;
  resize: vertical;
}
.sw-report textarea:focus { outline: none; border-color: var(--gold-dim); }
.sw-report-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.sw-report-msg { font-size: .74rem; color: var(--text-dim); }
.sw-report-msg.ok { color: var(--good); }
.sw-report-msg.err { color: var(--danger); }

/* ---------- footer promise line ---------- */
.sw-foot {
  color: var(--text-dim);
  font-size: .71rem; line-height: 1.6;
  margin: 18px 2px 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- grading sheet ---------- */
.sw-sheet[hidden] { display: none; }
.sw-sheet {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(4, 18, 14, .82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.sw-sheet-card {
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: var(--r-lg);
  padding: 20px 18px 16px;
  max-width: 380px; max-height: 82vh; overflow-y: auto;
}
.sw-sheet-h {
  color: var(--gold); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; margin-bottom: 12px;
}
.sw-sheet-p { font-size: .86rem; line-height: 1.65; color: var(--text); margin-bottom: 10px; }
.sw-sheet-p.dim { color: var(--text-dim); font-size: .8rem; }
.sw-sheet-card .pill { width: 100%; margin-top: 8px; }

/* ---------- Sunnah Today card on home ---------- */
.sw-today-title {
  font-size: .78rem; letter-spacing: .01em;
  color: var(--text-dim); line-height: 1.45; margin-bottom: 8px;
}
#sunnahTodayCard .sunnah-narration { font-size: .95rem; line-height: 1.68; }
.sw-today-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 10px; font-size: .73rem;
}
.sw-today-src { color: var(--text-dim); }
.sw-today-go {
  margin-left: auto; color: var(--gold); font-size: .78rem;
  border-bottom: 1px solid var(--gold-dim);
}
.sw-today-go:hover { color: var(--gold-bright); }

/* light skins: soften the tinted narration frame so cream stays cream */
html[data-theme="v1"] .sunnah-narration,
html[data-theme="v2"] .sunnah-narration,
html[data-theme="v3"] .sunnah-narration,
html[data-theme="v4"] .sunnah-narration {
  background: var(--surface-2);
  color: var(--text);
}
html[data-theme="v1"] .sw-ar,
html[data-theme="v2"] .sw-ar,
html[data-theme="v3"] .sw-ar,
html[data-theme="v4"] .sw-ar { color: var(--accent); }
html[data-theme="v1"] .sw-grade,
html[data-theme="v2"] .sw-grade,
html[data-theme="v3"] .sw-grade,
html[data-theme="v4"] .sw-grade { color: var(--accent); }
html[data-theme="v1"] .sw-sheet,
html[data-theme="v2"] .sw-sheet,
html[data-theme="v3"] .sw-sheet,
html[data-theme="v4"] .sw-sheet { background: rgba(22, 26, 38, .58); }
