/* ============================================================
   Khwaja Hasan Sarkar (Q.S.A) — Design tokens & system
   Palette drawn from the shrine itself: marble courtyards,
   emerald-and-gold domes, dusk-lit gatherings.
   ============================================================ */

:root {
  --stone:       #EFEDE6;   /* marble courtyard background */
  --stone-deep:  #E2DFD3;
  --ink:         #211D17;   /* warm near-black, not pure black */
  --ink-soft:    #4A443A;
  --emerald:     #0F4C36;   /* dome green */
  --emerald-deep:#0A342A;
  --gold:        #AD7C2B;   /* brass / lit-dome gold */
  --gold-bright: #C99640;
  --dusk:        #16314C;   /* night-sky blue */
  --rose:        #8E3A3A;   /* rose accent, used sparingly */
  --white:       #FBFAF6;

  --font-display: "Amiri", "Noto Naskh Arabic", serif;
  --font-body: "Karla", -apple-system, sans-serif;

  --max-width: 1120px;
  --arch-radius: 999px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--emerald); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--emerald-deep);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; color: var(--gold); }

p { margin: 0 0 1.1em; max-width: 68ch; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------------- Arch motif (mosque window shape) ---------------- */
/* Defined once per page as a hidden <svg><clipPath>, referenced here */
.arch {
  clip-path: url(#archClip);
  -webkit-clip-path: url(#archClip);
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--emerald-deep);
}

.arch-frame {
  position: relative;
  padding: 10px;
}
.arch-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: url(#archClip);
  -webkit-clip-path: url(#archClip);
  background: linear-gradient(160deg, var(--gold-bright), var(--gold) 55%, var(--emerald-deep));
  z-index: 0;
}
.arch-frame .arch { position: relative; z-index: 1; }

/* ---------------- Header / nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--stone-deep);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 40px; height: 40px; }
.brand span {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--emerald-deep);
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--emerald-deep);
  border-bottom-color: var(--gold);
}
.nav-cta {
  background: var(--emerald);
  color: var(--white) !important;
  padding: 0.55rem 1.1rem;
  border-radius: var(--arch-radius);
  font-size: 0.9rem !important;
  border: none !important;
}
.nav-cta:hover { background: var(--gold); color: var(--ink) !important; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--ink-soft);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  color: var(--ink);
}

@media (max-width: 1180px) {
  .nav-toggle { display: inline-block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--stone-deep);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.6rem 0; }
  .nav-cta { display: inline-block; margin-top: 0.4rem; }
}

/* ---------------- Hero (home) ---------------- */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center 65%;
  color: var(--white);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6,8,6,0.65) 0%, rgba(6,8,6,0.25) 42%, rgba(6,8,6,0.15) 100%),
    linear-gradient(180deg, rgba(8,10,7,0.5) 0%, rgba(8,10,7,0.25) 30%, rgba(8,10,7,0.55) 62%, rgba(8,10,7,0.92) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 3.5rem 0 3rem;
  width: 100%;
}
.hero-eyebrow {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}
.hero h1 { color: var(--white); max-width: 16ch; }
.hero p.lede {
  max-width: 56ch;
  font-size: 1.1rem;
  color: #F1EEE4;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.4rem; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--arch-radius);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold-bright); color: var(--ink); }
.btn-primary:hover { background: var(--gold); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(251,250,246,0.55); }
.btn-ghost:hover { background: rgba(251,250,246,0.12); color: var(--white); }
.btn-solid { background: var(--emerald); color: var(--white); }
.btn-solid:hover { background: var(--emerald-deep); color: var(--white); }

/* ---------------- Page banner (interior pages) ---------------- */
.page-banner {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  color: var(--white);
}
.page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(10,20,15,0.78) 0%, rgba(10,20,15,0.4) 65%, rgba(10,20,15,0.15) 100%);
}
.page-banner .container { position: relative; z-index: 1; padding: 3rem 1.5rem; }
.page-banner .crumb { color: var(--gold-bright); font-size: 0.95rem; margin-bottom: 0.4rem; }
.page-banner h1 { color: var(--white); margin-bottom: 0; max-width: 20ch; }

/* ---------------- Sections ---------------- */
.section { padding: 4.5rem 0; }
.section-tight { padding: 3rem 0; }
.section-alt { background: var(--white); }

.split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3rem;
  align-items: center;
}
.split.reverse .split-media { order: 2; }
.split.reverse .split-text { order: 1; }
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .split.reverse .split-media,
  .split.reverse .split-text { order: initial; }
  .arch { aspect-ratio: 4 / 3.2; }
  .hero { min-height: 78vh; }
  .footer-bottom { flex-direction: column; }
}

.split-media .arch-frame { max-width: 360px; margin: 0 auto; }

.eyebrow-quiet {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.pull-quote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--emerald-deep);
  border-left: 3px solid var(--gold);
  padding-left: 1.2rem;
  margin: 2rem 0;
  max-width: 46ch;
  line-height: 1.45;
}

/* ---------------- Cards / nav grid ---------------- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
}
.link-card {
  display: block;
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--stone-deep);
  border-radius: 4px;
  padding: 1.6rem;
  color: var(--ink);
  position: relative;
}
.link-card:hover { border-color: var(--gold); color: var(--ink); }
.link-card h3 { margin-bottom: 0.35rem; }
.link-card p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }

/* ---------------- Tables ---------------- */
.table-scroll {
  overflow-x: auto;
  margin-top: 1rem;
}
table.urs-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  background: var(--white);
}
table.urs-table th, table.urs-table td {
  text-align: left;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--stone-deep);
}
table.urs-table th {
  font-family: var(--font-display);
  color: var(--emerald-deep);
  font-weight: 700;
  border-bottom: 2px solid var(--gold);
}
table.urs-table tr:last-child td { border-bottom: none; }

/* ---------------- Wisdom list ---------------- */
.wisdom-list {
  columns: 2;
  column-gap: 2.5rem;
  list-style: none;
  counter-reset: wisdom;
  padding: 0;
  margin: 1.5rem 0 0;
}
.wisdom-list li {
  counter-increment: wisdom;
  break-inside: avoid;
  margin-bottom: 1.1rem;
  padding-left: 2.1rem;
  position: relative;
  font-size: 0.98rem;
}
.wisdom-list li::before {
  content: counter(wisdom);
  position: absolute;
  left: 0;
  top: -0.1rem;
  font-family: var(--font-display);
  color: var(--gold);
  font-weight: 700;
}
@media (max-width: 700px) { .wisdom-list { columns: 1; } }

/* ---------------- Gallery ---------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: 3px;
}
.gallery-grid img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-grid a:hover img { transform: scale(1.05); }

/* ---------------- Download cards ---------------- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}
.download-card {
  background: var(--white);
  border: 1px solid var(--stone-deep);
  border-radius: 4px;
  padding: 1.6rem;
  text-align: center;
}
.download-card .flag {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--rose);
}

.notice {
  background: #F7EFE0;
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  padding: 1rem 1.3rem;
  border-radius: 3px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 1.5rem 0;
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--emerald-deep);
  color: #DCE3DA;
  padding: 3.5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
}
.site-footer h4 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}
.site-footer a { color: #DCE3DA; text-decoration: none; }
.site-footer a:hover { color: var(--gold-bright); }
.site-footer .brand span { color: var(--white); }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  font-size: 0.85rem;
  color: #A9B4A6;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
