/* ============================================================
   Islamify v2 — shared components
   Buttons, cards, chips, sidebar shell, forms, details/summary.
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 46px; padding: 0 22px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 500; font-size: 15px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--brand) 92%, white) 0%,
    var(--brand) 100%);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(0, 52, 58, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--brand-hover) 92%, white) 0%,
    var(--brand-hover) 100%);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}
.btn-primary:active { transform: translateY(0); }
[data-theme="dark"] .btn-primary { color: #0a1518; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--text-muted); text-decoration: none; }

.btn-brand-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.btn-brand-outline:hover {
  background: var(--brand-soft);
  text-decoration: none;
}
[data-theme="dark"] .btn-brand-outline { color: var(--brand); }

.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }

/* ---------- Chips / pills ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 13px; color: var(--text);
  font-family: var(--font-body);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}
.chip:hover { border-color: var(--brand); text-decoration: none; }
.chip .arrow { color: var(--text-subtle); font-size: 12px; }

.pill {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid color-mix(in oklab, var(--brand) 20%, transparent);
}
.pill-live::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%; background: var(--brand);
  margin-right: 8px;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 25%, transparent);
}

/* ---------- Wordmark (header / sidebar brand) ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-sans); font-weight: 600;
  font-size: 18px; letter-spacing: -0.015em;
  color: var(--text);
  text-decoration: none;
}
.wordmark img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.wordmark:hover { text-decoration: none; }
.wordmark-lg { font-size: 22px; gap: 14px; }
.wordmark-lg img { width: 44px; height: 44px; border-radius: 11px; }

/* ---------- Cards (generic surface) ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.15s ease;
}
.card-soft {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card-dashed {
  background: var(--brand-soft);
  border: 1px dashed var(--brand);
  border-radius: var(--radius-lg);
  padding: 28px;
}
[data-theme="dark"] .card-dashed { background: var(--brand-soft); }

/* Glass surface — frosted + teal hint. Use for overlays (hero preview,
   login card, settings modal) */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* ---------- Top navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.topbar.scrolled {
  border-bottom-color: var(--glass-border);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  box-shadow: 0 4px 20px -8px rgba(0, 52, 58, 0.08);
}
.topbar .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
.topbar nav.primary {
  display: flex; gap: 28px; align-items: center;
}
.topbar nav.primary a {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
  text-decoration: none;
}
.topbar nav.primary a:hover,
.topbar nav.primary a.on { color: var(--text); text-decoration: none; }
.topbar .right { display: flex; align-items: center; gap: 14px; }

@media (max-width: 860px) {
  .topbar nav.primary { display: none; }
  .topbar .inner { padding: 0 20px; height: 64px; }
}

/* ---------- Sidebar shell (for Legal, About, Pricing, Admin, etc.) ---------- */
.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.side {
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 28px 20px 20px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.side .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 6px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.side .brand img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.side .brand .t { font-family: var(--font-sans); font-weight: 600; font-size: 17px; letter-spacing: -0.015em; color: var(--text); }
.side nav.side-nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1;
  margin-top: 4px;
}
.side nav.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font-sans);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.side nav.side-nav a:hover { background: var(--bg-card); color: var(--text); text-decoration: none; }
.side nav.side-nav a.on {
  background: linear-gradient(180deg,
    var(--bg-card) 0%,
    color-mix(in oklab, var(--bg-card) 95%, var(--teal-500)) 100%);
  color: var(--brand-ink);
  box-shadow: var(--shadow);
}
.side nav.side-nav a .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: transparent; flex-shrink: 0;
}
.side nav.side-nav a.on .dot { background: var(--brand); }
.side .divider { height: 1px; background: var(--border); margin: 12px 6px; }
.side-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--brand) 92%, white) 0%,
    var(--brand) 100%);
  color: #fff !important;
  font-family: var(--font-sans); font-weight: 500;
  font-size: 14px; letter-spacing: -0.005em;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow:
    0 1px 2px rgba(0, 52, 58, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.side-cta:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}
[data-theme="dark"] .side-cta { color: #0a1518 !important; }

.side .foot {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid; gap: 12px;
  margin-top: 16px;
}
.side .foot .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 6px;
  gap: 10px;
}
.side .foot .row label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; color: var(--text-subtle);
  text-transform: uppercase;
}
/* Language row — stack label above pills so 5 flags + label fit the 280px sidebar */
.side .foot .row.row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.side .foot .row.row-stack label {
  padding-left: 2px;
}
.side .foot .row.row-stack .lang-switch {
  width: 100%;
  justify-content: space-between;
}
.side .foot .row.row-stack .lang-switch button {
  flex: 1;
  padding: 6px 4px;
}

/* ---------- Language flag pills (flags-as-emoji, full fidelity) ---------- */
.lang-switch {
  display: inline-flex; gap: 2px;
  padding: 3px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.lang-switch button {
  padding: 4px 8px; border-radius: 6px;
  font-size: 18px; line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease;
  cursor: pointer;
  border: none; background: none;
}
.lang-switch button:hover { opacity: 0.8; }
.lang-switch button.on {
  opacity: 1;
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
}

/* ---------- Icon button (theme toggle, close etc.) ---------- */
.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  background: none; border: none; cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }

/* ---------- Sidebar shell — mobile collapse ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: static; height: auto;
    flex-direction: row; flex-wrap: wrap;
    overflow-x: auto;
    padding: 14px 16px;
    gap: 6px;
  }
  .side .brand { border: none; padding: 0; margin: 0 12px 0 0; }
  .side nav.side-nav {
    display: flex; flex-direction: row; gap: 2px;
    margin: 0; flex: 0;
  }
  .side nav.side-nav .divider,
  .side .divider,
  .side .foot { display: none; }
  .side-cta { margin: 0 0 0 auto; padding: 8px 14px; font-size: 13px; }
}

/* ---------- Footer (main site footer) ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 72px 0 48px;
  margin-top: 120px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-soft);
}
.site-footer .grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
  max-width: var(--container);
  margin-left: auto; margin-right: auto;
  padding: 0 32px;
}
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer ul a { color: var(--text); font-size: 13.5px; text-decoration: none; }
.site-footer ul a:hover { color: var(--brand); text-decoration: none; }
.site-footer .brand-col p {
  max-width: 320px; margin: 16px 0 0; color: var(--text-muted);
  font-size: 13px; line-height: 1.6;
}
.site-footer .bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin: 0 32px;
  max-width: var(--container); margin-left: auto; margin-right: auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-subtle);
  font-family: var(--font-mono); letter-spacing: 0.04em;
  flex-wrap: wrap; gap: 16px;
}
@media (max-width: 860px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; gap: 32px; padding: 0 20px; }
}

/* ---------- Feature card (home page grid) ---------- */
.feature {
  padding: 28px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg,
    var(--bg-card) 0%,
    color-mix(in oklab, var(--bg-card) 96%, var(--teal-500)) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.18s ease, border-color 0.15s ease;
  position: relative;
}
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.9;
}
[data-theme="dark"] .feature::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
}
.feature:hover {
  border-color: color-mix(in oklab, var(--brand) 30%, var(--border));
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.feature .num {
  display: block;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-subtle); letter-spacing: 0.12em;
  margin-bottom: 24px;
}
.feature h3 { font-size: 20px; margin-bottom: 12px; letter-spacing: -0.015em; }
.feature p { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; margin: 0; }

/* ---------- Ayah pull-quote — calm solid teal, no fake spotlights ---------- */
.ayah-strip {
  padding: 96px 24px;
  background: var(--teal-800);
  color: #e6f4f6;
  text-align: center;
  margin: 96px 0;
  border-radius: var(--radius-xl);
  box-shadow:
    0 30px 80px -30px rgba(0, 52, 58, 0.35),
    inset 0 1px 0 rgba(129, 251, 255, 0.1);
}
[data-theme="dark"] .ayah-strip {
  background: #0c2b31;
  border: 1px solid var(--border);
  box-shadow:
    0 30px 80px -30px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(129, 251, 255, 0.05);
}
.ayah-strip .ayah-arabic {
  font-family: var(--font-quran);
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.9; direction: rtl;
  margin-bottom: 24px;
  color: #fff;
}
.ayah-strip .ayah-translation {
  font-size: 18px;
  font-style: italic;
  max-width: 60ch;
  margin: 0 auto 14px;
  line-height: 1.55;
  opacity: 0.82;
  padding: 0 24px;
}
.ayah-strip .ayah-ref {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.12em;
  opacity: 0.6;
  text-transform: uppercase;
}

/* Ayah inline (for subpages — left-border style) */
.ayah-pull {
  margin: 40px 0;
  padding: 28px 32px;
  background: var(--bg-soft);
  border-inline-start: 2px solid var(--brand);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.ayah-pull .ar {
  font-family: var(--font-quran); font-size: 28px;
  direction: rtl; line-height: 1.9; margin-bottom: 10px;
}
.ayah-pull .tr { font-style: italic; color: var(--text-muted); margin-bottom: 8px; }
.ayah-pull .rf { font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); letter-spacing: 0.08em; }

/* ---------- Details / FAQ accordion ---------- */
details.faq {
  border-bottom: 1px solid var(--border);
  padding: 20px 4px;
}
details.faq > summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  font-family: var(--font-sans); font-weight: 500; font-size: 16px;
  letter-spacing: -0.01em; color: var(--text);
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after {
  content: "+"; font-family: var(--font-mono); font-size: 22px;
  color: var(--text-subtle); font-weight: 300;
  transition: transform 0.2s ease;
  line-height: 1;
}
details.faq[open] > summary::after { content: "−"; }
details.faq > div {
  padding-top: 14px;
  color: var(--text-muted);
  font-size: 15px; line-height: 1.65;
  max-width: 65ch;
}

/* ---------- Form inputs ---------- */
.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  outline: none;
}
.label {
  display: block; font-size: 13px;
  font-weight: 500; color: var(--text);
  margin-bottom: 6px;
}

/* ---------- Crumb / breadcrumb in sidebar-shell pages ---------- */
.crumb {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-subtle); letter-spacing: 0.08em;
  margin-bottom: 24px; text-transform: uppercase;
}
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--text); }

/* ---------- Obfuscated mail reveal button ---------- */
.mail-reveal {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 14px;
  color: var(--brand);
  cursor: pointer; text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mail-reveal:hover { border-color: var(--brand); text-decoration: none; }

/* ---------- Screen-reader utility ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
