/* =========================================================
style.css - Design System
Ilhaam: Purani Quran manuscripts, masjid tilework aur
mihrab (niche) ki arch shape se liya gaya design.
========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* 🟢 Ye purane naam ab "themes.css" ke naye variables se judy hain (alias).
  Jab koi theme (jese Dracula, Nord) chuni jaye, themes.css un naye
  variables (--bg, --accent wagera) ki value badal deta hai, aur
  yahan se ye poori website mein khud-ba-khud pohanch jati hai -
  humein neeche wali baqi CSS badalne ki zaroorat nahi parti. */
  --emerald-deep: var(--accent, #0B4F3F);
  --emerald-darker: var(--surface-alt, #072E25);
  --parchment: var(--bg, #F3E9D3);
  --sand: var(--border, #E8D9B8);
  --gold: var(--accent-2, #C9A227);
  --gold-soft: var(--accent-2, #E4C567);
  --ink: var(--text, #1B2E28);
  --white: var(--surface, #FFFDF8);

  --font-display: 'Fraunces', serif;
  --font-arabic: 'Amiri', serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

/* ---------- Header / Nav ---------- */
.site-header {
  /* 🟢 FIX: pehlay --accent (--emerald-deep) istemal ho raha tha, jo
     kai themes mein HALKA/bright rang hota hai (jese Catppuccin ka
     halka purple) - is par white text likhne se sab "white jaisa"
     dikhta tha. Ab --surface-alt istemal ho raha hai, jo HAR theme
     mein hamesha DARK hai (bas har theme ka apna alag shade) - is
     liye white text hamesha saaf parhega, aur har theme ka apna
     alag menu color bhi hoga. */
  background: var(--surface-alt);
  background-image:
  radial-gradient(circle at 15% 30%, rgba(201,162,39,0.10) 0, transparent 45%),
  radial-gradient(circle at 85% 70%, rgba(201,162,39,0.08) 0, transparent 45%);
  color: var(--on-surface-alt);
  padding: 18px 28px;
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-header .brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--on-surface-alt);
  text-decoration: none;
  display: flex;
  align-items: center; /* 🟢 logo/text ko nav ke sath vertically center rakhta hai */
  line-height: 1;
}

/* 🟢 Logo ko bilkul WAISA hi dikhaya jata hai jaisa uploaded file mein hai -
   agar transparent hai to transparent rahega, agar white bg hai to white
   hi rahega. Koi extra background/card force nahi kiya ja raha. */
.brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header .brand .arabic-accent {
  font-family: var(--font-arabic);
  color: var(--gold-soft);
  margin-right: 10px;
  font-size: 2.2rem; /* 🟢 pehlay se bara kiya gaya, taake Bismillah achi tarah nazar aaye */
  line-height: 1;
}

.brand-logo {
  /* 🟢 height aur width DONO "auto" rakhy hain, sirf max-height/max-width
     se "box" define kiya hai - is se browser hamesha sahi
     aspect ratio (asal shakal) maintain karta hai, kabhi bhi
     distort/squeeze/stretch nahi hoga, chahe logo lamba ho ya chora. */
  height: auto;
  width: auto;
  max-height: 84px;   /* 🟢 pehlay se kaafi bara kiya gaya */
  max-width: 320px;
  display: block;
  object-fit: contain; /* 🟢 poori image dikhati hai, kabhi crop nahi karti */
}

/* ---------- Mobile Hamburger Toggle (no JS, checkbox trick) ---------- */
.nav-toggle-checkbox { display: none; }

.nav-toggle-btn {
  display: none;
  color: var(--on-surface-alt);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* ---------- Search Bar ---------- */
.search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  overflow: hidden;
  margin-left: 4px;
  flex: 1 1 160px;
  max-width: 220px;
}

.search-form input {
  background: transparent;
  border: none;
  color: var(--on-surface-alt);
  padding: 8px 12px;
  font-size: 0.85rem;
  width: 100%;
  min-width: 90px;
  outline: none;
}

.search-form input::placeholder { color: rgba(255,255,255,0.65); }

.search-form button {
  background: transparent;
  border: none;
  color: var(--on-surface-alt);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  flex-shrink: 0;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

nav.main-nav > a {
  color: var(--on-surface-alt);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

nav.main-nav > a:hover,
nav.main-nav > a:focus-visible {
  background: rgba(255,255,255,0.12);
}

/* ---------- Dropdown (native <details>, no JS) ---------- */
.dropdown {
  position: relative;
}

.dropdown summary {
  list-style: none;
  cursor: pointer;
  color: var(--on-surface-alt);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.dropdown summary::-webkit-details-marker { display: none; }

.dropdown summary:hover,
.dropdown summary:focus-visible {
  background: rgba(255,255,255,0.12);
  outline: none;
}

.dropdown summary .caret {
  font-size: 0.7em;
  color: var(--gold-soft);
  transition: transform 0.15s ease;
}

.dropdown[open] summary .caret { transform: rotate(180deg); }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--surface) !important;  /* 🟢 direct variable (alias ke bagair), theme ke sath foran badalta hai */
  color: var(--text) !important;
  border-top: 3px solid var(--gold);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 12px 30px rgba(7,46,37,0.25);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 2px;
  min-width: 340px;
  z-index: 30;
}

.dropdown-panel a {
  color: var(--text) !important;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 0.9rem;
  transition: background 0.12s ease;
}

.dropdown-panel a:hover,
.dropdown-panel a:focus-visible {
  background: var(--bg) !important;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--emerald-darker);
  color: var(--on-surface-alt);
  padding: 56px 28px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(201,162,39,0.05) 0 2px, transparent 2px 22px);
  pointer-events: none;
}

.hero .eyebrow-arabic {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--gold-soft);
  margin-bottom: 6px;
}

.hero h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  margin: 8px 0 12px;
}

.hero p {
  color: var(--sand);
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- Container ---------- */
.container { max-width: 1140px; margin: 0 auto; padding: 40px 20px; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--emerald-deep);
  border-bottom: 2px solid var(--gold);
  display: inline-block;
  padding-bottom: 6px;
  margin-bottom: 24px;
}

/* ---------- Arch Cards (signature element) ---------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 28px 20px;
}

.post-card {
  display: block;   /* 🟢 ab .post-card khud <a> tag hai, is liye block banana zaroori hai */
  background: var(--white);
  border-radius: 50% 50% 6px 6px / 70px 70px 6px 6px;
  padding: 40px 18px 20px;
  text-align: center;
  text-decoration: none; /* 🟢 <a> ka default underline hata do */
  box-shadow: 0 6px 18px rgba(7,46,37,0.10);
  border: 1px solid var(--sand);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover, .post-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(7,46,37,0.18);
}

.post-card .card-icon {
  font-family: var(--font-arabic);
  color: var(--gold);
  font-size: 1.4rem;  /* 🟢 asal (original) size par wapas le aaya */
  line-height: 1.2;
  display: block;
  margin-bottom: 6px;
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 4px 0 10px;
  color: var(--emerald-deep);
}

.post-card p {
  font-size: 0.85rem;
  color: var(--text-muted, #5b6b64);
  margin: 3px 0;
}

.post-card .play-label {
  display: inline-block;
  margin-top: 12px;
  color: var(--on-accent);
  background: var(--emerald-deep);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.post-card:hover .play-label { background: var(--gold); color: var(--on-accent-2); }

/* ---------- Comments ---------- */
.comment {
  background: var(--white);
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 8px;
  border-left: 3px solid var(--gold);
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  margin-bottom: 20px;
}

form input, form textarea {
  padding: 10px 12px;
  border: 1px solid var(--sand);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

form button {
  background: var(--emerald-deep);
  color: var(--on-accent);
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
}

form button:hover { background: var(--gold); color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 22px;
  background: var(--emerald-darker);
  color: var(--sand);
  border-top: 3px solid var(--gold);
  font-size: 0.85rem;
}

/* ---------- Accessibility ---------- */
a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* =========================================================
RESPONSIVE - Mobile (< 768px)
Nav khud-ba-khud hamburger menu mein badal jata hai
========================================================= */
@media (max-width: 768px) {

  .site-header {
    padding: 14px 16px;
    position: relative;
  }

  /* 🟢 Mobile par bhi logo/Bismillah BARA rahay - ratio-safe rule
     (height:auto + width:auto + max-height/max-width) yahan bhi
     repeat ki hai taake koi aur rule ise chota na kar de */
  .brand-logo {
    height: auto;
    width: auto;
    max-height: 64px;
    max-width: 220px;
    object-fit: contain;
  }

  .site-header .brand .arabic-accent {
    font-size: 1.9rem;
  }

  .nav-toggle-btn {
    display: block;
    position: absolute;
    right: 16px;
    top: 14px;
  }

  nav.main-nav {
    display: none;              /* 🟢 default mein chupa rehta hai */
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    background: var(--emerald-darker);
    border-radius: 8px;
    margin-top: 14px;
    padding: 10px;
  }

  /* 🔵 :checked + selector -> BUILT-IN CSS, jab hamara chupa hua
  checkbox "checked" ho (yani hamburger click hua), tab menu dikhao */
  .nav-toggle-checkbox:checked ~ nav.main-nav {
    display: flex;
  }

  nav.main-nav > a, .dropdown summary {
    width: 100%;
    padding: 12px 10px;
  }

  .dropdown-panel {
    position: static;
    grid-template-columns: 1fr;
    min-width: 0;
    box-shadow: none;
    margin-top: 6px;
  }

  .search-form { width: 100%; max-width: 100%; margin: 6px 0 0; }
  .search-form input { flex: 1; width: auto; }

  .hero { padding: 40px 18px 46px; }
  .container { padding: 28px 14px; }
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
  .post-card { padding: 32px 12px 16px; }

  form { max-width: 100%; }
}

@media (max-width: 420px) {
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .hero h2 { font-size: 1.6rem; }

  .brand-logo {
    max-height: 52px;
    max-width: 170px;
  }

  .site-header .brand .arabic-accent {
    font-size: 1.5rem;
  }
}

/* ---------- Pagination (Prev / 1 2 3 ... 100 / Next) ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 30px 0;
}

.pagination-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.pagination-btn:hover { background: var(--gold); color: var(--on-accent-2); }

.pagination-current {
  background: var(--emerald-deep);
  color: var(--on-accent);
  border-color: var(--emerald-deep);
}

.pagination-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-dots {
  padding: 0 4px;
  color: var(--text-muted, #5b6b64);
}

@media (max-width: 500px) {
  .pagination-btn { padding: 7px 10px; font-size: 0.8rem; }
}

