/* Muslim Wife - design system (aniconic, halal, modern) */
:root {
  --rose-900: #881337;
  --rose-700: #be185d;
  --rose-600: #db2777;
  --rose-100: #ffe4e6;
  --amber: #B45309;
  --stone-50:  #FFFBFC;
  --stone-100: #FDF2F4;
  --stone-200: #FECDD3;
  --stone-300: #FDA4AF;
  --stone-500: #78716C;
  --stone-700: #44403C;
  --stone-900: #1C1917;

  --bg: var(--stone-50);
  --surface: #ffffff;
  --surface-2: var(--stone-100);
  --text: var(--stone-900);
  --muted: var(--stone-500);
  --border: var(--stone-200);
  --accent: var(--rose-700);
  --accent-ink: var(--rose-900);
  --hadith-bg: #FFF1F2;
  --hadith-border: #FECDD3;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --radius: 14px;
  --maxw: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1517;
    --surface: #26211e;
    --surface-2: #2f2926;
    --text: #ece9e6;
    --muted: #a8a29e;
    --border: #3a3330;
    --accent: #f472b6;
    --accent-ink: #fbcfe8;
    --hadith-bg: #2a1f24;
    --hadith-border: #4a3540;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--accent-ink); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 18px; font-size: 0.95rem; }
.nav-links a { color: var(--muted); }

.hero { padding: 44px 0 12px; text-align: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; color: var(--accent-ink); }
.hero p { color: var(--muted); max-width: 620px; margin: 0 auto; }

.search { margin: 22px auto; max-width: 560px; }
.search input {
  width: 100%; padding: 13px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 1rem;
}
.search input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.pillar { margin: 38px 0 10px; }
.pillar h2 {
  font-family: var(--serif); font-size: 1.1rem; color: var(--accent-ink);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.tile {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.06); border-color: var(--accent); }
.tile h3 { font-family: var(--serif); margin: 0 0 6px; font-size: 1.15rem; color: var(--text); }
.tile p { margin: 0 0 14px; color: var(--muted); font-size: 0.93rem; }
.tile .meta { display: flex; gap: 14px; font-size: 0.8rem; color: var(--muted); }
.tile .meta b { color: var(--accent); font-weight: 600; }

.crumbs { font-size: 0.85rem; color: var(--muted); padding: 20px 0 4px; }
.crumbs a { color: var(--muted); }

.behavior-head h1 { font-family: var(--serif); font-size: clamp(1.6rem,3.4vw,2.2rem); color: var(--accent-ink); margin: 6px 0 8px; }
.behavior-head .definition { font-size: 1.1rem; color: var(--text); max-width: 640px; }
.behavior-head .why { color: var(--muted); max-width: 640px; margin-top: 6px; }

.section-label {
  display: flex; align-items: center; gap: 10px; margin: 34px 0 14px;
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.advice-list { display: grid; gap: 10px; }
.advice {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--stone-300); border-radius: 10px; padding: 13px 16px;
  font-size: 0.97rem;
}
.advice.expandable { padding: 0; overflow: hidden; transition: border-left-color .3s ease; }
.advice.expandable.open { border-left-color: var(--accent); }
.advice-head {
  width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
  font: inherit; font-size: 0.97rem; color: var(--text); padding: 13px 16px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.advice-head:hover { color: var(--accent-ink); }
.advice-caret {
  flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .35s ease;
}
.advice.open .advice-caret { transform: rotate(-135deg); border-color: var(--accent); }
.advice-detail { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.advice-detail-inner { padding: 0 16px 15px; color: var(--muted); font-size: 0.93rem; }
.advice-detail-inner p { margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .advice-detail { transition: none; }
  .advice-caret { transition: none; }
}
.search-excerpt { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 6px;
  line-height: 1.4; font-weight: normal; }

.hadith-list { display: grid; gap: 14px; }
.hadith-card {
  display: block; background: var(--hadith-bg); border: 1px solid var(--hadith-border);
  border-radius: var(--radius); padding: 18px 20px;
}
.hadith-card:hover { text-decoration: none; border-color: var(--accent); }
.hadith-card .ref { font-size: 0.8rem; color: var(--accent); font-weight: 600; letter-spacing: 0.02em; }
.hadith-card .quote { font-family: var(--serif); font-size: 1.08rem; margin: 8px 0 0; color: var(--text); }
.hadith-card .go { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }

.source-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between;
}
.source-block .ref { font-weight: 600; color: var(--accent-ink); }
.source-block .ext { font-size: 0.85rem; }
.scripture {
  font-family: var(--serif); font-size: 1.18rem; line-height: 1.8;
  background: var(--hadith-bg); border: 1px solid var(--hadith-border);
  border-radius: var(--radius); padding: 22px 24px; margin: 16px 0;
}
.scripture.clamped .full { display: none; }
.scripture:not(.clamped) .preview { display: none; }
.scripture .more-btn {
  display: inline-block; margin-top: 10px; font-family: var(--sans); font-size: 0.85rem;
  color: var(--accent); cursor: pointer; background: none; border: none; padding: 0;
}

.behaviors-here h2 { font-family: var(--serif); font-size: 1.15rem; margin: 26px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 14px; font-size: 0.88rem; cursor: pointer;
}
.chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.link:hover { border-color: var(--accent); text-decoration: none; }

.evidence {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-top: 6px;
}
.evidence .lens { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.evidence .key-quote { font-family: var(--serif); font-size: 1.1rem; margin: 8px 0; }
.evidence .definition { color: var(--muted); font-size: 0.95rem; }
.evidence .other { margin-top: 16px; font-size: 0.9rem; color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0 10px; }
.pager a, .pager span {
  flex: 1; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); font-size: 0.9rem; color: var(--text);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .next { text-align: right; }
.pager .disabled { opacity: 0.4; pointer-events: none; cursor: default; }
.index-pager { align-items: center; }
.index-pager a { flex: 0 0 auto; cursor: pointer; }
.index-pager .page-info { flex: 1; text-align: center; border: 0; background: transparent;
  color: var(--muted); font-size: 0.85rem; padding: 0; }

.results { display: grid; gap: 10px; margin-top: 16px; }
.empty-note {
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 18px 20px; color: var(--muted); font-size: 0.95rem;
}

footer.site-footer { border-top: 1px solid var(--border); margin-top: 50px; padding: 26px 0; color: var(--muted); font-size: 0.85rem; text-align: center; }
footer.site-footer .sister-site { color: #064E3B; font-weight: 500; }
footer.site-footer .sister-site:hover { color: #047857; }
@media (prefers-color-scheme: dark) {
  footer.site-footer .sister-site { color: #6ee7b7; }
  footer.site-footer .sister-site:hover { color: #34d399; }
}

/* Share bar */
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 34px 0 4px; padding-top: 20px; border-top: 1px solid var(--border); }
.share .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-right: 2px; }
.share a, .share button.copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; padding: 0;
}
.share a:hover, .share button.copy:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.share svg { width: 18px; height: 18px; fill: currentColor; }
.share .copied { color: var(--accent); font-size: 0.78rem; padding: 0 8px; white-space: nowrap; }

.hidden { display: none !important; }

/* ---- Feedback collector -------------------------------------------------- */
.feedback-fab {
  position: fixed; bottom: 20px; right: 20px; z-index: 50;
  display: flex; align-items: center; gap: 8px;
}
.feedback-trigger {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, background 0.15s ease;
}
.feedback-trigger:hover { transform: scale(1.08); background: var(--accent-ink); }
.feedback-trigger svg { width: 16px; height: 16px; fill: currentColor; }
.feedback-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--amber); color: #fff;
  font-size: 0.75rem; font-weight: 700; line-height: 20px; text-align: center;
  cursor: pointer;
}
.feedback-badge:hover { filter: brightness(1.15); }

.feedback-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.feedback-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.feedback-dialog {
  position: relative; background: var(--surface);
  border-radius: var(--radius); padding: 20px;
  max-width: 420px; width: calc(100% - 32px);
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.feedback-dialog h2 {
  margin: 0 0 10px; font-family: var(--serif);
  font-size: 1.15rem; color: var(--accent-ink);
}
.feedback-current-meta {
  font-size: 0.82rem; color: var(--text); margin-bottom: 12px;
  padding: 8px 10px; background: var(--surface-2);
  border-radius: 6px;
}
.feedback-dialog label {
  display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 4px;
}
.feedback-dialog textarea {
  width: 100%; padding: 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: 0.9rem;
  resize: vertical; min-height: 60px;
}
.feedback-dialog textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.feedback-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: flex-end;
}
.feedback-btn-sm {
  font: inherit; font-weight: 500; font-size: 0.85rem;
  padding: 7px 14px; border-radius: 6px; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.feedback-btn-sm:hover { border-color: var(--accent); color: var(--accent); }

.feedback-preview { max-height: 200px; overflow-y: auto; margin-bottom: 16px; }
.feedback-preview p { margin: 0 0 10px; }
.feedback-preview-item {
  padding: 8px 10px; background: var(--surface-2); border-radius: 6px;
  font-size: 0.88rem; margin-bottom: 6px; color: var(--text);
}

.feedback-divider { height: 1px; background: var(--border); margin: 14px 0; }
.feedback-list-header { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.feedback-list { max-height: 160px; overflow-y: auto; margin-bottom: 10px; }
.feedback-list-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; background: var(--surface-2); border-radius: 6px;
  margin-bottom: 6px; border-left: 2px solid var(--accent);
}
.feedback-item-content { flex: 1; min-width: 0; }
.feedback-item-label { font-size: 0.75rem; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.feedback-item-msg { font-size: 0.82rem; color: var(--text); word-break: break-word; }
.feedback-item-delete {
  flex-shrink: 0; width: 20px; height: 20px; border: none; background: transparent;
  color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0;
  border-radius: 4px;
}
.feedback-item-delete:hover { background: var(--border); color: var(--text); }
.feedback-empty { color: var(--muted); font-size: 0.85rem; font-style: italic; padding: 8px 0; }
.feedback-email-hint { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; }

.feedback-meta { margin-bottom: 12px; }
.feedback-meta-row { font-size: 0.82rem; color: var(--text); padding: 2px 0; }
.feedback-meta-key { color: var(--muted); }

.feedback-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--stone-900); color: #fff; padding: 12px 20px;
  border-radius: 999px; font-size: 0.9rem; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
@media (prefers-color-scheme: dark) {
  .feedback-toast { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
}
.feedback-toast.show { opacity: 1; pointer-events: auto; }

/* ---- Quiz ---------------------------------------------------------------- */
.quiz { margin-top: 8px; }
.quiz-tabs { display: inline-flex; gap: 4px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.quiz-tab { border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-weight: 600; padding: 8px 18px; border-radius: 999px; }
.quiz-tab[aria-selected="true"] { background: var(--surface); color: var(--accent-ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.quiz-status { display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.quiz-status .quiz-acc { color: var(--accent); font-weight: 600; }
.quiz-review-toggle { margin-left: auto; display: inline-flex; align-items: center;
  gap: 6px; cursor: pointer; }

.quiz-card { position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.quiz-pillarlabel { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.quiz-scenario { font-family: var(--serif); font-size: 1.18rem; line-height: 1.5;
  margin: 0 0 18px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option { text-align: left; font: inherit; cursor: pointer; padding: 14px 16px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); transition: background-color 300ms ease, border-color 300ms ease,
  color 300ms ease; }
.quiz-option:hover:not(:disabled) { border-color: var(--accent); }
.quiz-option:disabled { cursor: default; }
.quiz-option.correct { background: var(--hadith-bg); border: 2px solid var(--accent);
  color: var(--accent-ink); font-weight: 600; }
.quiz-option.wrong { background: #fdecec; border-color: #e7b4b4; color: #7a2e2e; }
@media (prefers-color-scheme: dark) {
  .quiz-option.wrong { background: #3a2422; border-color: #6e3b38; color: #f0c4c0; }
}
.quiz-option.blink { animation: quizblink 500ms ease-in-out infinite alternate; }
@keyframes quizblink { from { opacity: 1; } to { opacity: 0.4; } }

.quiz-result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.quiz-verdict { font-weight: 700; font-size: 1.05rem; margin: 0 0 6px; }
.quiz-verdict.ok { color: var(--accent); }
.quiz-verdict.no { color: #b3261e; }
@media (prefers-color-scheme: dark) { .quiz-verdict.no { color: #f0a8a2; } }
.quiz-explanation { margin: 0 0 10px; color: var(--text); }
.quiz-hadith { margin: 10px 0; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: var(--tile-bg); font-style: italic; color: var(--muted); }
.quiz-hadith a { color: var(--accent); text-decoration: none; }
.quiz-hadith a:hover { color: var(--accent-ink); }
.quiz-learn { margin: 0; }
.quiz-next, .quiz-reset { margin-top: 18px; font: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; display: inline-block; }
.quiz-next:hover { background: var(--accent-ink); }
.quiz-reset { background: transparent; color: var(--muted); border-color: var(--border); }
.quiz-reset:hover { border-color: var(--accent); color: var(--accent); }

.quiz-stats-overall { text-align: center; padding: 14px 0 22px; }
.quiz-overall-acc { font-size: 3rem; font-weight: 700; color: var(--accent); line-height: 1; }
.quiz-overall-sub { color: var(--muted); margin-top: 4px; }
.quiz-weakest { background: var(--hadith-bg); border: 1px solid var(--hadith-border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 0.92rem; }
.quiz-bar-row { display: block; margin-bottom: 14px; }
.quiz-bar-row:hover { text-decoration: none; }
.quiz-bar-head { display: flex; justify-content: space-between; font-size: 0.9rem;
  margin-bottom: 6px; color: var(--text); }
.quiz-bar-num { color: var(--muted); }
.quiz-bar { height: 8px; border-radius: 999px; background: var(--surface-2);
  overflow: hidden; }
.quiz-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.quiz-stats-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.quiz-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.quiz-progress-track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s ease; }
.quiz-progress-text { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.quiz-round-result { text-align: center; padding: 30px 20px; }
.quiz-round-score { margin-bottom: 24px; }
.quiz-round-pct { font-size: 3rem; font-weight: 700; color: var(--accent); line-height: 1; }
.quiz-round-sub { color: var(--muted); margin-top: 6px; }
.quiz-round-done { font-size: 1.2rem; font-weight: 600; color: var(--accent-ink); margin-bottom: 8px; }
.quiz-round-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -8px; width: 8px; height: 12px; border-radius: 2px;
  opacity: 0.9; animation: confetti-fall 1.4s ease-in forwards; }
@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0); opacity: 1; }
  100% { transform: translateY(320px) rotate(540deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-option.blink { animation: none; opacity: 1; }
}

/* Mistakes pages - reuses .tile, .grid, .section from behavior styles */
.why-text { line-height: 1.7; color: var(--text); font-size: 1rem; margin: 0; }
