/* Easy Quran Wa Hadees - new look (prototype, 22-Nov-2026)
   Idea: the page borrows from the program and from the mushaf itself:
   an ayat inside a ruled frame with its translations stacked beneath, and a catalogue set like a book's fihrist. */

:root {
  --ink: #17212b;        /* text */
  --lapis: #1e4a72;      /* headings, links: the blue of Quran illumination */
  --lapis-deep: #12314e;
  --gold: #b08a2e;       /* frame rules */
  --green: #1d6b4c;      /* the action colour: the dome green of the logo */
  --green-deep: #14503a;
  --rubric: #a32a2a;     /* manuscript red, used only for sura and section marks */
  --paper: #f3f6f8;      /* page */
  --leaf: #ffffff;       /* panels */
  --tint-green: #e3eed9; /* the two panel tints of the program itself */
  --tint-blue: #d6e9f2;
  --rule: #c9d3dc;
  --muted: #55636f;
  --latin: "Alegreya Sans", "Segoe UI", Tahoma, sans-serif;
  --display: "Alegreya", Georgia, serif;
  --urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Alvi Nastaleeq", "Urdu Typesetting", serif;
  --arabic: "Amiri", "Traditional Arabic", "Scheherazade New", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--latin); font-size: 18px; line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: var(--lapis); text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.ur { font-family: var(--urdu); direction: rtl; line-height: 2.3; }
.ar { font-family: var(--arabic); direction: rtl; }

h1, h2, h3 { font-family: var(--display); color: var(--lapis-deep); line-height: 1.15; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.18rem; max-width: 34em; color: #2b3944; }

/* ---------- header ---------- */
.site-head { background: var(--leaf); border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--lapis-deep); margin-right: auto; }
.brand img { height: 44px; width: auto; display: block; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 2px; }
.nav a { padding: 8px 12px; border-radius: 4px; text-decoration: none; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--paper); color: var(--lapis-deep); }
.nav a[aria-current="page"] { color: var(--green-deep); box-shadow: inset 0 -3px 0 var(--green); border-radius: 0; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 18px; }
.hero .ur-line { font-size: 1.35rem; color: var(--lapis); margin: 0 0 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 6px; text-decoration: none; font-weight: 700;
  border: 2px solid var(--green); color: var(--green-deep); background: transparent; font-family: var(--latin); font-size: 1.05rem;
}
.btn:hover { background: #e7f1ec; color: var(--green-deep); }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn small { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.9; }

/* the framed ayat: a double gold rule like the frame of a mushaf page */
.mushaf { background: var(--leaf); padding: 10px; border: 1px solid var(--gold); box-shadow: 0 18px 40px -22px rgba(18, 49, 78, 0.55); }
.mushaf-in { border: 3px double var(--gold); padding: 22px 22px 18px; }
.sura-mark { text-align: center; color: var(--rubric); font-size: 1.05rem; margin: 0 0 4px; }
.ayat { text-align: center; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.9; color: #0f1a24; margin: 0 0 14px; }
.tarjuma { margin: 0; padding: 0; list-style: none; }
.tarjuma li { padding: 6px 14px 10px; border-top: 1px solid #fff; }
.tarjuma li:nth-child(odd) { background: var(--tint-blue); }
.tarjuma li:nth-child(even) { background: var(--tint-green); }
.tarjuma .book { display: block; font-size: 0.82rem; color: var(--muted); line-height: 2; }
.tarjuma .text { display: block; font-size: 1.2rem; line-height: 2.1; }
.tarjuma li.en { direction: ltr; }
.tarjuma li.en .book { font-family: var(--latin); font-size: 0.85rem; line-height: 1.5; padding-top: 6px; }
.tarjuma li.en .text { font-family: var(--display); font-size: 1.15rem; line-height: 1.5; padding-bottom: 4px; }
.mushaf-note { font-size: 0.92rem; color: var(--muted); margin: 12px 4px 0; }

/* ---------- sections ---------- */
.band { padding: 60px 0; }
.band.leaf { background: var(--leaf); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band h2 { margin-bottom: 10px; }
.band .intro { max-width: 40em; color: #2b3944; margin-bottom: 28px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }

/* fihrist: a contents list with dotted leaders, as in a printed index */
.fihrist { list-style: none; margin: 0; padding: 0; }
.fihrist li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.fihrist li::after { content: ""; order: 2; flex: 1; border-bottom: 2px dotted #9aa8b3; transform: translateY(-5px); }
.fihrist .what { order: 1; }
.fihrist .what small { display: block; color: var(--muted); font-size: 0.9rem; }
.fihrist .count { order: 3; font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--lapis-deep); white-space: nowrap; }

/* the three periods of tafaseer: a real sequence in time */
.eras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; border-top: 3px solid var(--lapis); }
.eras li { padding: 16px 18px 6px 0; position: relative; }
.eras li::before { content: ""; position: absolute; top: -9px; left: 0; width: 15px; height: 15px; background: var(--leaf); border: 3px solid var(--lapis); border-radius: 50%; }
.eras .name { font-size: 1.35rem; color: var(--lapis-deep); margin: 0; text-align: left; }
.eras .when { color: var(--muted); margin: 0; }

.plain-list { margin: 0; padding-left: 1.1em; }
.plain-list li { margin-bottom: 0.5em; }

/* ---------- catalogue table ---------- */
.catalogue-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.catalogue-tools input {
  flex: 1 1 260px; max-width: 420px; padding: 10px 14px; font-size: 1.05rem; border: 1px solid #8fa0ad; border-radius: 6px;
  font-family: var(--urdu); direction: rtl; background: #fff; color: var(--ink);
}
.catalogue-tools .count-note { color: var(--muted); }
.table-box { max-height: 560px; overflow: auto; border: 1px solid var(--rule); background: #fff; }
table.books { width: 100%; border-collapse: collapse; direction: rtl; font-family: var(--urdu); font-size: 1rem; line-height: 2.2; }
table.books th, table.books td { padding: 4px 12px; text-align: right; border-bottom: 1px solid #e3e9ee; }
table.books th { position: sticky; top: 0; background: var(--lapis-deep); color: #fff; font-weight: 400; z-index: 1; white-space: nowrap; }
table.books td.num { font-family: var(--latin); direction: ltr; text-align: left; font-variant-numeric: tabular-nums; line-height: 1.5; white-space: nowrap; }
table.books th.num { text-align: left; }
table.books tbody tr:nth-child(even) { background: #f5f8fa; }
table.books td.kind-tafseer { color: var(--green-deep); }
table.books td.kind-other { color: var(--rubric); }

/* ---------- get it ---------- */
.get { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.get li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.get .where { flex: 1 1 320px; }
.get .where strong { font-family: var(--display); font-size: 1.3rem; color: var(--lapis-deep); display: block; }
.get .where span { color: var(--muted); }

.permit { border-inline-start: 4px solid var(--gold); padding: 6px 22px; background: transparent; font-size: 1.15rem; margin: 0; }

/* ---------- download page ---------- */
.page-title { padding: 44px 0 8px; }
.steps { margin: 0 0 8px; padding-left: 1.3em; }
.steps li { margin-bottom: 0.55em; padding-left: 4px; }
.steps li::marker { font-family: var(--display); font-weight: 700; color: var(--lapis); }
.latest { background: var(--leaf); border: 1px solid var(--gold); padding: 10px; margin: 22px 0 36px; }
.latest-in { border: 3px double var(--gold); padding: 26px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.latest .file { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--lapis-deep); margin: 0 0 4px; }
table.files { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--rule); }
table.files th, table.files td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #e3e9ee; vertical-align: middle; }
table.files th { background: #e9eef2; font-weight: 700; color: var(--lapis-deep); }
table.files td.ur { text-align: right; font-size: 1rem; }
table.files a.get-link { font-weight: 700; white-space: nowrap; }
details.older { margin-top: 18px; }
details.older summary { cursor: pointer; font-weight: 700; color: var(--lapis-deep); padding: 8px 0; }

/* ---------- About: a page of Urdu to be read ---------- */
.mushaf.reading { max-width: 900px; margin: 0 auto; box-shadow: none; }
.prose-ur { font-size: 1.22rem; line-height: 2.6; text-align: right; padding: 30px 36px 26px; }
.prose-ur p { margin: 0 0 1.1em; text-align: justify; }
.prose-ur h3 { font-family: var(--urdu); font-weight: 400; font-size: 1.7rem; line-height: 2.2; color: var(--rubric); text-align: center; margin: 0 0 12px; }
.prose-ur strong { color: var(--lapis-deep); }
.prose-ur a { direction: ltr; unicode-bidi: isolate; }

/* ---------- contact ---------- */
.big-link { font-family: var(--display); font-size: clamp(1.2rem, 3.2vw, 1.7rem); font-weight: 700; overflow-wrap: anywhere; }
.table-box.tall { max-height: 72vh; }

/* ---------- footer ---------- */
.site-foot { background: var(--lapis-deep); color: #dbe6ef; padding: 40px 0 26px; margin-top: 0; }
.site-foot a { color: #fff; }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-foot h3 { color: #fff; font-size: 1.1rem; margin-bottom: 8px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 4px; }
.site-foot .fine { border-top: 1px solid rgba(255, 255, 255, 0.2); margin-top: 26px; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; font-size: 0.95rem; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  body { font-size: 17px; }
  .hero { padding: 32px 0 40px; }
  .hero .wrap, .split, .latest-in { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .eras { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: 3px solid var(--lapis); }
  .eras li { padding: 0 0 14px 20px; }
  .eras li::before { top: 6px; left: -9px; }
  .site-foot .cols { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .band { padding: 40px 0; }
  .brand span { font-size: 1.1rem; }
  .nav a { padding: 6px 9px; }
  table.files th, table.files td { padding: 8px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
