/* Ahl-e-Islam v5 — professional build to the master blueprint design system:
   warm cream #FBF7EE, deep emerald #0F5132, soft gold #C9A24B, ink #1F2A24.
   Headings Lora (serif), body Inter, Arabic Amiri, Urdu Noto Nastaliq Urdu.
   Mobile first, generous spacing, soft shadows, no clutter, no superlative claims. */
:root {
  --cream: #FBF7EE;
  --surface: #ffffff;
  --ink: #1F2A24;
  --muted: #5c6b60;
  --green: #0F5132;
  --green-dark: #0a3a24;
  --green-soft: #e6efe8;
  --gold: #C9A24B;
  --gold-soft: #f5ead0;
  --line: #e7dfc9;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(15, 81, 50, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.65;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: "Lora", Georgia, "Times New Roman", serif; color: var(--green); line-height: 1.25; }
h2 { font-size: 1.85rem; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 1.02rem; }
.eyebrow { display: block; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.eyebrow.light { color: #e3c878; }
.pill { display: inline-block; margin-top: 12px; background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; }

/* ---- Header: sticky, gold top rule, clean brand row ---- */
.top { background: var(--surface); border-top: 4px solid var(--gold); border-bottom: 1px solid var(--line); padding: 16px 0 14px; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(15, 81, 50, 0.05); }
.brand-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.brand { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.brand-logo { height: 64px; width: auto; flex-shrink: 0; }
.brand-tag { margin: 0; color: var(--muted); font-size: 0.9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.brand h1 { margin: 0; font-size: 1.8rem; }
.brand p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { color: var(--green); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--green-soft); }
.search-box { position: relative; margin-top: 14px; }
.search-box input { width: 100%; padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; font-size: 1rem; background: var(--cream); font-family: inherit; }
.search-box input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.suggest { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 30; overflow: hidden; }
.suggest div { padding: 10px 16px; cursor: pointer; border-bottom: 1px solid #f0ead6; }
.suggest div:hover { background: var(--green-soft); }
.suggest small { display: block; color: var(--muted); font-size: 0.85rem; }

/* ---- Hero band: answer on top, faint geometric pattern ---- */
.today { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; margin: 26px 0 34px; }
.today-date, .next-card { border-radius: var(--radius); padding: 26px; }
.today-date { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hijri-big { font-family: "Lora", Georgia, serif; font-size: 2.1rem; color: var(--green); line-height: 1.2; }
.greg { color: var(--muted); margin-top: 4px; }
.next-card { background: var(--green); color: #fff; box-shadow: var(--shadow); }
.next-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.next-name { font-family: "Lora", Georgia, serif; font-size: 1.7rem; }
.next-time { font-size: 1.1rem; color: #e3c878; }
.countdown { font-size: 2rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; }
.progress { height: 8px; background: rgba(255,255,255,0.2); border-radius: 999px; margin: 16px 0 10px; overflow: hidden; }
.progress .bar { height: 100%; background: #e3c878; width: 0%; border-radius: 999px; }
.sehri-iftar { font-size: 0.9rem; color: #d9e6d5; }
.hero-btn { display: inline-block; margin-top: 18px; background: var(--gold); color: var(--green-dark); text-decoration: none; font-weight: 700; padding: 11px 24px; border-radius: 999px; }
.hero-btn:hover { background: #e3c878; }

/* ---- Timings widget ---- */
.timings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin: 0 0 34px; box-shadow: var(--shadow); }
.controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.controls select, .controls button { padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--cream); font-size: 0.95rem; cursor: pointer; font-family: inherit; }
.controls button.active { background: var(--green); color: #fff; border-color: var(--green); }
.times { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.time-card { background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; text-align: center; }
.time-card.next { background: var(--green-soft); border-color: var(--green); }
.time-card .label { font-size: 0.85rem; color: var(--muted); }
.time-card .val { font-size: 1.2rem; font-weight: 700; color: var(--green); }
.method { color: var(--muted); font-size: 0.9rem; margin: 18px 0 0; }

/* ---- Converter card ---- */
.converter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin: 0 0 34px; box-shadow: var(--shadow); }
.conv-box { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.conv-box label { font-weight: 600; }
.conv-box input { padding: 11px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 1rem; font-family: inherit; }
.conv-box button { padding: 11px 24px; border-radius: 999px; border: none; background: var(--green); color: #fff; font-size: 1rem; cursor: pointer; font-family: inherit; }
.conv-box button:hover { background: var(--green-dark); }
.conv-result { width: 100%; font-family: "Lora", Georgia, serif; font-size: 1.6rem; color: var(--green); }
.note { color: var(--muted); font-size: 0.9rem; width: 100%; margin: 0; }

/* ---- Featured hadith ---- */
.hadith-feat { background: var(--green-soft); border-radius: var(--radius); padding: 28px; margin: 0 0 34px; border-left: 4px solid var(--gold); }
.hadith-feat .arabic { font-family: "Amiri", serif; font-size: 1.8rem; direction: rtl; text-align: right; margin: 8px 0; color: var(--green); line-height: 1.9; }
.hadith-text { font-size: 1.08rem; margin: 8px 0; }
.ref { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ---- Sections grid ---- */
.grid-wrap { margin: 0 0 34px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 1.3rem; }
.card p { margin: 0 0 8px; color: var(--muted); }
.card .edge { color: var(--green); font-size: 0.92rem; }
.tag { display: inline-block; margin-top: 12px; background: var(--gold-soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; color: var(--green); font-weight: 600; }

/* ---- Ramadan banner ---- */
.ramadan { background: var(--green); color: #fff; border-radius: var(--radius); padding: 32px 28px; margin: 0 0 34px; text-align: center; box-shadow: var(--shadow); }
.ramadan h2 { color: #fff; margin-bottom: 8px; }
.ramadan p { color: #d9e6d5; margin: 0 auto 8px; max-width: 640px; }
.ramadan .ram-note { color: #e3c878; font-size: 0.92rem; }

/* ---- Trust strip ---- */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 34px; }
.trust div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.trust strong { display: block; color: var(--green); }
.trust span { color: var(--muted); font-size: 0.9rem; }

/* ---- Footer: dark, three columns ---- */
footer { background: var(--green-dark); color: #cfe0d4; padding: 36px 0 24px; font-size: 0.92rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 28px; margin-bottom: 24px; }
.foot-grid h3 { color: #fff; font-size: 1.15rem; margin: 0 0 10px; }
.foot-grid p { margin: 0; }
.foot-grid nav { display: flex; flex-direction: column; gap: 6px; }
.foot-grid nav a { color: #cfe0d4; text-decoration: none; }
.foot-grid nav a:hover { color: #fff; text-decoration: underline; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 16px; color: #9db8a6; font-size: 0.85rem; }
.foot-bottom p { margin: 0; }

@media (max-width: 820px) {
  .today { grid-template-columns: 1fr; }
  .times { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: 1fr 1fr; }
  .trust { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .countdown { font-size: 1.5rem; }
}
@media (max-width: 520px) {
  .times { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .brand h1 { font-size: 1.5rem; }
}

/* ---- Language toggle + Urdu (RTL) mode ---- */
.lang-toggle { display: flex; gap: 4px; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.lang-toggle button { border: none; background: transparent; padding: 8px 16px; border-radius: 999px; font-size: 0.95rem; cursor: pointer; color: var(--green); font-weight: 600; font-family: inherit; }
.lang-toggle button.active { background: var(--green); color: #fff; }
html[dir="rtl"] body { font-family: "Noto Nastaliq Urdu", "Amiri", serif; line-height: 2; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { font-family: "Noto Nastaliq Urdu", serif; }
html[dir="rtl"] .countdown { letter-spacing: 0; }
html[dir="rtl"] .search-box input, html[dir="rtl"] .controls select { text-align: right; }
html[dir="rtl"] .hadith-feat { border-left: none; border-right: 4px solid var(--gold); }
