﻿/* ============================================================
   Landing page — 114 surahs listing
   ============================================================ */

:root {
  --bg: #f3e9d2;
  --fg: #2a1810;
  --primary: #0d4f3c;
  --primary-2: #166548;
  --primary-dark: #0a3d2e;
  --gold: #b8860b;
  --gold-light: #d4af37;
  --gold-dark: #8b6914;
  --card: #fffaef;
  --border: #c9a961;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Tajawal', sans-serif;
  color: var(--fg);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 10%, rgba(184, 134, 11, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 88% 90%, rgba(13, 79, 60, 0.1) 0%, transparent 45%);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.font-display {
  font-family: 'Reem Kufi', sans-serif;
}

/* ---------- Top menu bar ---------- */
.site-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  color: #fffaef;
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(212, 175, 55, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 70% 100% at 0% 100%, rgba(22, 101, 72, 0.55) 0%, transparent 50%),
    linear-gradient(125deg, #061f18 0%, #0a3d2e 38%, #0d4f3c 72%, #145a42 100%);
  box-shadow:
    0 1px 0 rgba(212, 175, 55, 0.35) inset,
    0 8px 28px rgba(4, 24, 18, 0.45);
  isolation: isolate;
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

.site-topbar.is-scrolled {
  box-shadow:
    0 1px 0 rgba(212, 175, 55, 0.28) inset,
    0 10px 32px rgba(4, 24, 18, 0.55);
}

.site-topbar-glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 250, 239, 0.04) 50%, transparent 100%);
  opacity: 0.9;
  z-index: 0;
}

.site-topbar-ornament {
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-dark) 12%,
    var(--gold-light) 50%,
    var(--gold-dark) 88%,
    transparent 100%
  );
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
  position: relative;
  z-index: 1;
}

.site-topbar-inner {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

/* Brand */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fffaef;
  min-width: 0;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.site-brand:hover {
  transform: translateY(-1px);
}

.site-brand-logo {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 14px;
  flex-shrink: 0;
  display: block;
  box-shadow:
    0 0 0 2px rgba(255, 250, 239, 0.18),
    0 0 0 4px rgba(212, 175, 55, 0.22),
    0 6px 16px rgba(0, 0, 0, 0.28);
  background: #0d4f3c;
}

/* Legacy badge fallback (if logo image missing) */
.site-brand-badge {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 25%, #f5e6c8 0%, var(--gold-light) 38%, var(--gold) 72%, var(--gold-dark) 100%);
  box-shadow:
    0 0 0 2px rgba(255, 250, 239, 0.18),
    0 0 0 4px rgba(212, 175, 55, 0.22),
    0 6px 16px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}

.site-brand-mark {
  font-family: 'Amiri Quran', serif;
  font-size: 1.35rem;
  color: #0a3d2e;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.site-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  line-height: 1.15;
}

.site-brand-text {
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff6df;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.site-brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(245, 230, 200, 0.72);
  letter-spacing: 0.04em;
}

/* Hamburger */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1.5px solid rgba(255, 250, 239, 0.28);
  border-radius: 12px;
  background: rgba(255, 250, 239, 0.08);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: rgba(212, 175, 55, 0.55);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.nav-toggle-bars {
  width: 18px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fffaef;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Nav layout */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.site-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.site-nav-sites {
  padding: 0.22rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-nav-label {
  display: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(245, 230, 200, 0.55);
  padding: 0 0.35rem;
  text-transform: none;
}

.site-nav-divider {
  width: 1px;
  height: 1.55rem;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 250, 239, 0.28),
    transparent
  );
  flex-shrink: 0;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 250, 239, 0.92);
  text-decoration: none;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  position: relative;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.site-nav-link i {
  font-size: 0.88rem;
  opacity: 0.92;
}

.site-nav-link:hover {
  background: rgba(255, 250, 239, 0.1);
  border-color: rgba(255, 250, 239, 0.16);
  color: #fff;
  transform: translateY(-1px);
}

.site-nav-link.is-active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(184, 134, 11, 0.18));
  border-color: rgba(212, 175, 55, 0.5);
  color: #fff8e7;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.12), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.site-nav-link:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.site-nav-btn {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
}

.site-nav-btn:hover i {
  transform: rotate(50deg);
  transition: transform 0.35s ease;
}

/* Sister sites */
.site-nav-external {
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.2), rgba(184, 134, 11, 0.1));
  border-color: rgba(212, 175, 55, 0.42);
  color: #fff6df;
  padding-inline-end: 0.7rem;
}

.site-nav-external:hover {
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.38), rgba(184, 134, 11, 0.2));
  border-color: rgba(245, 230, 200, 0.55);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.18);
}

.site-nav-ext-icon {
  font-size: 0.62rem !important;
  opacity: 0.65 !important;
  margin-inline-start: 0.05rem;
}

.site-nav-tools .site-nav-tool {
  background: rgba(255, 250, 239, 0.06);
  border-color: rgba(255, 250, 239, 0.14);
}

.site-nav-tools .site-nav-tool:hover {
  background: rgba(255, 250, 239, 0.14);
  border-color: rgba(255, 250, 239, 0.28);
}

/* ---------- Hero (under top menu) ---------- */
.landing-hero {
  position: relative;
  overflow: hidden;
  color: var(--fg);
  text-align: center;
  padding: 1.85rem 1rem 1.55rem;
  background:
    radial-gradient(ellipse 90% 80% at 50% -10%, rgba(13, 79, 60, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 100%, rgba(184, 134, 11, 0.1) 0%, transparent 55%),
    linear-gradient(180deg, #f7efd8 0%, var(--bg) 100%);
  border-bottom: 1px solid rgba(201, 169, 97, 0.35);
}

.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(13, 79, 60, 0.07) 1px, transparent 0);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
}

.landing-hero-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.landing-hero-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.landing-hero-ornament .ornament {
  font-family: 'Amiri Quran', serif;
  font-size: 1.55rem;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(184, 134, 11, 0.25);
}

.hero-line {
  display: block;
  width: 3.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4.5vw, 2.15rem);
  color: var(--primary-dark);
  letter-spacing: 0.01em;
}

.landing-hero p {
  margin: 0.5rem auto 0;
  color: #6b5a45;
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 28rem;
}

.landing-hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
}

.landing-hero-pills span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: rgba(255, 250, 239, 0.85);
  border: 1px solid rgba(201, 169, 97, 0.45);
  box-shadow: 0 2px 8px rgba(45, 24, 16, 0.05);
}

.landing-hero-pills i {
  color: var(--gold-dark);
  font-size: 0.75rem;
}

/* Tablet / mid widths — keep nav tidy */
@media (max-width: 980px) and (min-width: 641px) {
  .site-topbar-inner {
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
  }

  .site-brand-tag {
    display: none;
  }

  .site-nav {
    gap: 0.3rem;
  }

  .site-nav-link {
    padding: 0.42rem 0.65rem;
    font-size: 0.82rem;
    gap: 0.3rem;
  }

  .site-nav-link span {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-nav-divider {
    height: 1.3rem;
  }
}

/* ---------- Site settings modal ---------- */
.site-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(8, 46, 35, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.site-settings-overlay.is-open {
  display: flex;
}

.site-settings-card {
  width: min(420px, 100%);
  background: linear-gradient(160deg, #fffaef 0%, #f5e6c8 100%);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 1.25rem 1.15rem 1.15rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  color: var(--fg);
  text-align: right;
}

.site-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.site-settings-head h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.site-settings-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(201, 169, 97, 0.4);
  border-radius: 14px;
}

.site-settings-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.site-settings-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fffaef;
  flex-shrink: 0;
}

.site-settings-label strong {
  display: block;
  color: var(--primary-dark);
  font-size: 0.98rem;
}

.site-settings-label p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #6b5a45;
  line-height: 1.4;
}

/* Toggle switch */
.sound-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.sound-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sound-switch-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c9b896;
  border: 1px solid rgba(139, 105, 20, 0.35);
  position: relative;
  transition: background 0.2s;
}

.sound-switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.sound-switch input:checked + .sound-switch-ui {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.sound-switch input:checked + .sound-switch-ui::after {
  transform: translateX(-20px);
}

.sound-switch-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 2.5rem;
}

.site-settings-preview {
  margin-top: 0.85rem;
  width: 100%;
  border: 1.5px solid var(--gold);
  background: linear-gradient(135deg, #fff8e7, #f0d896);
  color: var(--primary-dark);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.site-settings-preview:hover {
  filter: brightness(1.03);
}

.site-settings-note {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: #6b5a45;
  text-align: center;
  line-height: 1.45;
}

/* ---------- Toolbar ---------- */
.landing-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  scroll-margin-top: 4.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  background: rgba(255, 250, 239, 0.85);
  border: 1px solid rgba(201, 169, 97, 0.45);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.toolbar-label {
  font-family: 'Reem Kufi', sans-serif;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
}

.search-wrap {
  position: relative;
  flex: 1 1 220px;
  max-width: 360px;
}

.search-wrap i {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dark);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 2.4rem 0.6rem 0.85rem;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  background: #fff;
  color: var(--fg);
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--primary);
}

.surah-count {
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Grid ---------- */
.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.85rem;
}

.surah-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(145deg, #fffaef 0%, #f7edd4 100%);
  border: 1.5px solid rgba(201, 169, 97, 0.55);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  box-shadow: 0 3px 10px rgba(45, 24, 16, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  min-height: 76px;
}

.surah-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(13, 79, 60, 0.12);
  border-color: var(--gold);
}

.surah-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.surah-card.is-available {
  border-color: rgba(13, 79, 60, 0.45);
  background: linear-gradient(145deg, #f3faf6 0%, #fffaef 55%, #f7edd4 100%);
  box-shadow: 0 4px 14px rgba(13, 79, 60, 0.12);
}

.surah-card.is-available:hover {
  border-color: var(--primary);
}

.surah-card.is-soon {
  opacity: 0.92;
}

.surah-number {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Amiri Quran', serif;
  font-size: 0.95rem;
  color: #fffaef;
  background: radial-gradient(circle, var(--gold-light) 0%, var(--gold) 65%, var(--gold-dark) 100%);
  box-shadow: 0 2px 6px rgba(139, 105, 20, 0.35);
}

.surah-card.is-available .surah-number {
  background: radial-gradient(circle, #1f7a5a 0%, var(--primary) 70%, #082e23 100%);
}

.surah-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.surah-name {
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.surah-meta {
  font-size: 0.8rem;
  color: #6b5a45;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.surah-meta .dot {
  opacity: 0.5;
}

.surah-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.surah-card.is-available .surah-badge {
  background: rgba(13, 79, 60, 0.12);
  color: var(--primary);
  border-color: rgba(13, 79, 60, 0.25);
}

.surah-card.is-soon .surah-badge {
  background: rgba(184, 134, 11, 0.12);
  color: var(--gold-dark);
  border-color: rgba(184, 134, 11, 0.3);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b5a45;
  padding: 2rem 1rem;
}

/* ---------- Toast ---------- */
.coming-soon-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: linear-gradient(135deg, #082e23 0%, var(--primary) 100%);
  color: #fffaef;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: min(92vw, 420px);
  text-align: center;
}

.coming-soon-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Footer note ---------- */
.landing-note {
  margin-top: 1.75rem;
  text-align: center;
  color: #6b5a45;
  font-size: 0.88rem;
}

.landing-note strong {
  color: var(--primary);
}

/* Phone / small-screen styles live in css/phone.css (loaded after this file) */
