/* === ONE UMMAH === */
/* Clean editorial — cream paper, forest green, warm ink */

:root {
  --cream:        #faf7f2;
  --cream-mid:    #f2ede3;
  --cream-dark:   #e8e0d0;
  --ink:          #1a1612;
  --ink-mid:      #3d3529;
  --ink-light:    #6b5f4e;
  --ink-muted:    #9c8e7a;
  --green:        #1e5c3a;
  --green-mid:    #2e7d52;
  --green-light:  #e8f2ec;
  --green-pale:   #f0f7f2;
  --gold:         #b8860b;
  --gold-light:   #f5f0e0;
  --border:       rgba(26, 22, 18, 0.1);
  --border-mid:   rgba(26, 22, 18, 0.18);
  --font-display: 'Lora', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-arabic:  'Noto Naskh Arabic', 'Traditional Arabic', serif;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --shadow-card:  0 2px 12px rgba(26, 22, 18, 0.07), 0 1px 3px rgba(26, 22, 18, 0.05);
  --shadow-modal: 0 24px 80px rgba(26, 22, 18, 0.18), 0 4px 16px rgba(26, 22, 18, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Background pattern --- */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image:
    repeating-linear-gradient(
      45deg,
      var(--ink) 0px,
      var(--ink) 1px,
      transparent 1px,
      transparent 40px
    );
}

/* --- Header --- */
.site-header {
  position: relative;
  z-index: 10;
  background: var(--green);
  color: white;
  padding: 3.5rem 2rem 0;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 60px;
  left: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  pointer-events: none;
}

.header-content {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 2.5rem;
}

.header-bismillah {
  font-family: var(--font-arabic);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  color: rgba(255,255,255,0.65);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
  line-height: 2;
  direction: rtl;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 600;
  color: white;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.site-desc {
  font-size: 1rem;
  color: rgba(255,255,255,0.72);
  font-weight: 300;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* --- Verse of day --- */
.verse-of-day {
  max-width: 760px;
  margin: 0 auto;
  background: rgba(255,255,255,0.1);
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1.75rem 2rem;
  position: relative;
  z-index: 1;
}

.vod-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
}

.vod-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  color: rgba(255,255,255,0.9);
  text-align: right;
  direction: rtl;
  line-height: 2;
  margin-bottom: 0.85rem;
}

.vod-translation {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.vod-ref {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* Loading pulse */
.pulse-line {
  height: 14px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  margin-bottom: 10px;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* --- Theme Nav --- */
.theme-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.theme-nav::-webkit-scrollbar { display: none; }

.theme-nav-inner {
  display: flex;
  gap: 0.25rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0.6rem 0;
}

.theme-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--ink-light);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.theme-pill .pill-icon {
  font-size: 0.6rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.theme-pill:hover {
  border-color: var(--green-mid);
  color: var(--green);
  background: var(--green-pale);
}

.theme-pill.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
  font-weight: 500;
}

.theme-pill.active .pill-icon { opacity: 1; }

/* --- Main --- */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* --- Theme Header --- */
.theme-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.theme-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.theme-desc {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 0.85rem;
}

.theme-stat {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* --- Loading state --- */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.loader-ring {
  width: 32px;
  height: 32px;
  border: 2px solid var(--cream-dark);
  border-top-color: var(--green-mid);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Verses Grid --- */
.verses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* --- Verse Card --- */
.verse-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.4s ease both;
}

.verse-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--green);
  border-radius: 3px 0 0 3px;
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.verse-card:hover {
  border-color: var(--green-mid);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.verse-card:hover::before { transform: scaleY(1); }

.verse-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.verse-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.7rem;
  background: var(--green-pale);
  border: 1px solid rgba(30, 92, 58, 0.15);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.verse-surah-name {
  font-family: var(--font-arabic);
  font-size: 0.9rem;
  color: var(--ink-light);
  text-align: right;
  direction: rtl;
  line-height: 1.6;
}

.verse-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  color: var(--ink);
  text-align: right;
  direction: rtl;
  line-height: 2.1;
  margin-bottom: 1.1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.verse-translation {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.97rem;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 1.1rem;
}

.verse-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.verse-theme-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  background: var(--gold-light);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.verse-expand-hint {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 400;
}

/* Error state */
.error-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--ink-light);
}

.error-state p { margin-bottom: 0.5rem; font-size: 0.9rem; }
.error-state .error-ref { font-size: 0.75rem; color: var(--ink-muted); }

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 18, 0.55);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(3px);
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease forwards;
}

.modal {
  background: var(--cream);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  position: relative;
  animation: scaleIn 0.25s ease forwards;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: white;
  color: var(--ink-light);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.modal-close:hover {
  background: var(--cream-dark);
  color: var(--ink);
}

.modal-header {
  background: var(--green);
  padding: 2.5rem 2rem 2rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: rgba(255,255,255,0.95);
  text-align: right;
  direction: rtl;
  line-height: 2.1;
  margin-bottom: 1rem;
}

.modal-ref {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-body {
  padding: 2rem;
}

.modal-section-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.modal-translation {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-transliteration {
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.8;
  margin-bottom: 2rem;
  font-style: italic;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-reflection {
  background: var(--green-pale);
  border: 1px solid rgba(30, 92, 58, 0.12);
  border-left: 3px solid var(--green-mid);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem 1.5rem;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink-mid);
}

.modal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-meta-item {
  padding: 0.85rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.modal-meta-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.3rem;
}

.modal-meta-value {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 500;
}

/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--cream-mid);
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.site-footer a {
  color: var(--green-mid);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover { text-decoration: underline; }

.footer-credit { opacity: 0.65; }

/* --- Animations --- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Stagger cards */
.verse-card:nth-child(1)  { animation-delay: 0.04s; }
.verse-card:nth-child(2)  { animation-delay: 0.08s; }
.verse-card:nth-child(3)  { animation-delay: 0.12s; }
.verse-card:nth-child(4)  { animation-delay: 0.16s; }
.verse-card:nth-child(5)  { animation-delay: 0.20s; }
.verse-card:nth-child(6)  { animation-delay: 0.24s; }
.verse-card:nth-child(7)  { animation-delay: 0.28s; }
.verse-card:nth-child(8)  { animation-delay: 0.32s; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--cream-mid); }
::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }

/* Responsive */
@media (max-width: 600px) {
  .site-header { padding: 2.5rem 1.25rem 0; }
  .verse-of-day { padding: 1.5rem 1.25rem; }
  .verse-card { padding: 1.25rem; }
  .modal-body { padding: 1.5rem; }
  .modal-meta { grid-template-columns: 1fr; }
  .theme-nav { padding: 0 0.5rem; }
}
