/* رنگ‌های اصلی سایت؛ برای تغییر رنگ کل سایت همین‌جا را عوض کنید. */
:root {
  --ink: #06305c;
  --ink-2: #0a3f75;
  --ink-3: #0d4f8f;
  --glass: rgba(6, 40, 78, .6);
  --glass-soft: rgba(255, 255, 255, .09);
  --glass-line: rgba(255, 255, 255, .28);
  --gold: #d9b56a;
  --gold-soft: #f0dcae;
  --cream: #fbf6ea;
  --paper: #f4ecd9;
  --text: #17302c;
  --muted: #55695f;
  --line: rgba(217, 181, 106, .32);
  /* Eslimi tile: one quarter of vines and leaves, mirrored on both axes. */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:x='http://www.w3.org/1999/xlink' width='200' height='200' viewBox='0 0 200 200'%3E%3Cdefs%3E%3Cg id='q' fill='none' stroke='%23d9b56a' stroke-opacity='.24' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M100 100C80 78 58 86 52 66C47 49 66 38 78 50C87 60 76 72 67 65C62 61 65 55 70 56'/%3E%3Cpath d='M52 66C34 62 20 44 8 44C16 62 32 76 52 66Z'/%3E%3Cpath d='M78 50C84 34 94 24 100 10C88 14 70 28 78 50Z'/%3E%3Cpath d='M0 0C20 6 30 18 32 34C20 30 8 20 0 0Z'/%3E%3Cpath d='M32 34C38 48 28 60 16 66'/%3E%3Cpath d='M32 34C46 40 58 30 66 18'/%3E%3Cpath d='M16 66C8 62 2 72 0 82C10 82 20 76 16 66Z'/%3E%3Cpath d='M66 18C62 10 72 4 82 0C82 10 76 20 66 18Z'/%3E%3C/g%3E%3C/defs%3E%3Cuse x:href='%23q'/%3E%3Cuse x:href='%23q' transform='matrix(-1 0 0 1 200 0)'/%3E%3Cuse x:href='%23q' transform='matrix(1 0 0 -1 0 200)'/%3E%3Cuse x:href='%23q' transform='matrix(-1 0 0 -1 200 200)'/%3E%3Cpath d='M100 86C110 92 110 108 100 114C90 108 90 92 100 86Z' fill='none' stroke='%23d9b56a' stroke-opacity='.3'/%3E%3C/svg%3E");
}

/* فونت نستعلیق شعرها از پوشهٔ fonts. */
@font-face {
  font-family: IranNastaliq;
  src: url("fonts/IranNastaliq.ttf") format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font: 400 17px/1.8 Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
html[lang="ar"] body { font-family: Vazirmatn, "Noto Naskh Arabic", Tahoma, sans-serif; }
html[lang="en"] body { font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.65; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

/* نوار بالای صفحه: نام سایت، ورود، دکمهٔ کمک و زبان‌ها. */
/* Top bar */
.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 18px clamp(16px, 4vw, 48px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-soft);
  font-weight: 700;
  text-decoration: none;
}
.topbar-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.nav-give {
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.nav-give:hover { background: var(--gold-soft); }
.langs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.langs button {
  border: 0;
  border-radius: 999px;
  padding: 4px 13px;
  background: transparent;
  color: var(--gold-soft);
  font: 500 14px/1.6 Vazirmatn, Tahoma, sans-serif;
  cursor: pointer;
}
.langs button.is-active { background: var(--gold); color: var(--ink); }

/* صفحهٔ اول: عکس، تیتر، دکمهٔ پرداخت و بنر حدیث. */
/* Hero */
.hero {
  display: flex;
  justify-content: center;
  padding: 104px 16px 0;
  background: var(--pattern), radial-gradient(ellipse at 50% 35%, var(--ink-3), var(--ink) 70%);
}
.arch {
  width: min(760px, 100%);
  padding: clamp(56px, 9vw, 96px) clamp(20px, 6vw, 72px) clamp(52px, 7vw, 80px);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 380px 380px 0 0;
  background: linear-gradient(180deg, rgba(217, 181, 106, .1), rgba(7, 31, 29, 0) 75%);
  color: var(--cream);
  text-align: center;
}
.rider {
  display: block;
  width: min(300px, 72vw);
  height: auto;
  margin: 0 auto 18px;
  border: 2px solid var(--gold);
  border-radius: 150px 150px 14px 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
}
.invite { max-width: 560px; margin: 12px auto 22px; color: #dfe8e2; }
.hero-coins {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.hero-coins .coin-icon { width: 30px; height: 30px; }
.hadith {
  margin:22px 0 28px;
  padding: 22px clamp(14px, 3vw, 28px) 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 31, 29, .55);
}
.hadith-body { min-height: 208px; }
.hadith-body.is-in { animation: fade .7s ease; }
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.hadith blockquote {
  margin: 0 0 12px;
  color: var(--gold-soft);
  font: 400 clamp(21px, 3.4vw, 27px)/1.9 Amiri, "Traditional Arabic", serif;
}
.hadith-mean { color: #dfe8e2; font-size: 16px; }
.hadith figcaption { margin-top: 8px; color: var(--gold); font-size: 13px; }
.hadith-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.hadith-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-soft);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.hadith-nav button:hover { background: rgba(217, 181, 106, .16); }
.hadith-count { color: #a9bcb3; font: 500 13px Inter, sans-serif; }
.hadith-bar {
  height: 2px;
  margin-top: 12px;
  overflow: hidden;
  background: rgba(217, 181, 106, .18);
}
.hadith-bar span { display: block; width: 100%; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.hadith-bar span.is-running { animation: progress 22s linear; }
.hadith.is-paused .hadith-bar span { animation: none; }
#hadithPause { font-size: 13px; }
@keyframes progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.prayer {
  margin-bottom: 18px;
  color: var(--gold);
  font: 400 clamp(22px, 4vw, 30px)/1.9 Amiri, "Traditional Arabic", serif;
}
h1 {
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.35;
}
html[lang="en"] h1, html[lang="en"] h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
}
.lead {
  max-width: 560px;
  margin: 20px auto 32px;
  color: #cfdcd4;
}
.cta {
  display: inline-block;
  padding: 11px 34px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, transform .2s;
}
.cta:hover { background: var(--gold-soft); transform: translateY(-2px); }

/* Sections */
.wrap { width: min(1080px, 100%); margin: 0 auto; }
.band, .give { padding: clamp(60px, 9vw, 100px) 16px; }
.give { background: var(--pattern), var(--ink); color: var(--cream); }
.eyebrow { color: #96742c; font-size: 14px; font-weight: 600; }
.give .eyebrow { color: var(--gold); }
h2 { margin-top: 4px; font-size: clamp(26px, 4vw, 38px); font-weight: 700; line-height: 1.35; }
.sub { margin-top: 8px; color: #cfdcd4; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 36px;
}
.card {
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf7;
}
.num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: #96742c;
  font-weight: 700;
}
.card h3 { margin-bottom: 6px; font-size: 20px; line-height: 1.5; }
.card p { color: var(--muted); font-size: 16px; }

/* بخش پرداخت: فهرست ارزها، QR و آدرس کیف‌پول. */
/* Donate */
.donate {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 34px;
}
.coins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.coin {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--cream);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.coin:hover { background: rgba(217, 181, 106, .09); }
.coin.is-active { border-color: var(--gold); background: rgba(217, 181, 106, .16); }
.coin-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--coin);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22) inset, 0 2px 6px rgba(0, 0, 0, .3);
}
.coin-icon svg {
  width: 70%;
  height: 70%;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.coin-icon svg .solid { fill: #fff; stroke: none; }
.coin-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; text-align: left; }
.coin-label strong { font-family: Inter, "Segoe UI", sans-serif; font-size: 15px; }
.coin-label small { color: #a9bcb3; font-family: Inter, "Segoe UI", sans-serif; font-size: 12.5px; }
.coin-soon {
  margin-inline-start: auto;
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
}

.panel {
  padding: 26px 24px;
  border-radius: 18px;
  background: var(--cream);
  color: var(--text);
  text-align: center;
}
.panel-coin { font-size: 21px; font-weight: 700; }
.panel-network { color: var(--muted); font-size: 14.5px; }
.qr {
  width: min(230px, 100%);
  margin: 16px auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.qr svg { display: block; width: 100%; height: auto; }
.addr {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper);
  font: 500 13.5px/1.6 Consolas, Menlo, monospace;
  overflow-wrap: anywhere;
  text-align: left;
}
.copy {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: var(--ink-2);
  color: var(--gold-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.copy:hover { background: var(--ink-3); }
.copy.is-done { background: #1f7a5a; color: #fff; }
.warn { margin-top: 12px; color: #8a4b12; font-size: 13.5px; line-height: 1.7; text-align: start; }
.pending {
  margin-top: 18px;
  padding: 44px 16px;
  border: 1px dashed var(--gold);
  border-radius: 12px;
  color: var(--muted);
}

/* Safety */
.safe {
  display: grid;
  gap: 12px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
.safe li {
  position: relative;
  padding-inline-start: 30px;
}
.safe li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .45em;
  width: 14px;
  height: 14px;
  background: var(--gold);
  border-radius: 0 100% 0 100%;
}

.band-safe { padding-top: 0; }

/* بخش شعر: جست‌وجو، فیلترها و نمایش بیت‌ها. */
/* Poems */
.poems { padding: clamp(60px, 9vw, 100px) 16px; }
.poem-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 24px;
}
.poem-tools input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--text);
  font: inherit;
}
.poem-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.poem-filters button {
  padding: 7px 15px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-soft);
  color: var(--cream);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.poem-filters button.is-active { border-color: var(--gold); background: var(--gold); color: var(--ink); font-weight: 700; }
.poem-count { margin-top: 10px; color: var(--gold-soft); font-size: 14px; }
.poem-list { display: grid; gap: 16px; margin-top: 14px; }
.poem {
  padding: clamp(20px, 3.5vw, 34px) clamp(14px, 4vw, 40px);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: var(--glass-soft);
  text-align: center;
}
.poem-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 12px; margin-bottom: 16px; }
.poem-head h3 { color: var(--gold); font-size: 21px; }
.poem-head span { color: var(--gold-soft); font-size: 14.5px; }
.beit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  margin-bottom: 8px;
  color: #fff;
  font: 400 clamp(30px, 3.4vw, 40px)/1.75 IranNastaliq, Amiri, Tahoma, serif;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.beit span:only-child { grid-column: 1 / -1; }
.poem-toggle { margin-top: 10px; }
.poem-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; margin-top: 20px; }
.poem-more {
  padding: 9px 26px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.poem-more:hover { background: rgba(217, 181, 106, .18); }
.poem-none { padding: 30px 10px; color: var(--gold-soft); text-align: center; }

/* چالش و فرم درد دل. */
/* Visitors' words */
.talk { padding: clamp(60px, 9vw, 100px) 16px; }
.challenge {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: var(--ink-2);
  color: var(--cream);
}
.challenge-label { color: var(--gold); font-size: 14px; font-weight: 600; }
.challenge p { margin: 4px 0 8px; font-size: clamp(19px, 2.6vw, 24px); font-weight: 500; line-height: 1.6; }
.link-btn { padding: 0; border: 0; background: none; color: var(--gold-soft); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }
.talk-form { display: grid; gap: 14px; margin-top: 22px; }
.talk-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.talk-form label { display: grid; gap: 4px; font-size: 15px; font-weight: 500; }
.talk-form input[type="text"], .talk-form select, .talk-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9b78d;
  border-radius: 10px;
  background: #fffdf7;
  color: var(--text);
  font: inherit;
}
.talk-form textarea { resize: vertical; }
.talk-form .check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.talk-note { color: var(--muted); font-size: 14px; }
.talk-form .cta { justify-self: start; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.talk-form .cta:disabled { opacity: .6; cursor: default; }
.talk-status { min-height: 1.6em; color: #1f7a5a; font-size: 15px; }
.talk-status.is-error { color: #a33a22; }
.comments { display: grid; gap: 12px; margin-top: 20px; }
.comment { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf7; }
.comment.is-poem { background: var(--paper); }
.comment-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 14px; }
.comment-head span { color: var(--muted); }
.comment-text { margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.comment.is-poem .comment-text { font: 400 28px/1.9 IranNastaliq, Amiri, Tahoma, serif; }.comments-empty { color: var(--muted); }

/* پایین صفحه. */
/* Footer */
.foot {
  padding: 40px 16px;
  background: var(--ink);
  color: #cfdcd4;
  text-align: center;
  font-size: 15px;
}
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.foot-links a { color: var(--gold-soft); }
.foot-prayer { color: var(--gold); }

a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* دکمه و پنجرهٔ ورود و ثبت‌نام. */
/* Account */
.nav-account {
  padding: 5px 14px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-soft);
  color: var(--cream);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.account { width: min(92vw, 400px); padding: 26px; border: 1px solid var(--gold); border-radius: 18px; background: var(--ink); color: var(--cream); }
.account::backdrop { background: rgba(0, 12, 30, .8); backdrop-filter: blur(6px); }
.account form { display: grid; gap: 12px; }
.account h2 { margin: 0; font-size: 24px; }
.account label { display: grid; gap: 4px; font-size: 15px; }
.account input { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .95); color: var(--text); font: inherit; }
.account .cta { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.account .talk-note { color: #d5e2ec; font-size: 13.5px; }
.account .talk-status { min-height: 0; color: #ffc1ae; }

/* شبکهٔ تصویرها و نمایش بزرگ تصویر. */
/* Gallery */
.gallery { padding: 14px 16px; }
.gallery-grid {
  display: grid;
  /* A card under about 300px makes the text too small: 3 columns on desktop, 2 on tablet. */
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.gallery-grid button.is-extra { display: none; }
.gallery-grid.is-open button.is-extra { display: block; }
.gallery-more { display: block; margin: 20px auto 0; }
.gallery-grid button {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--ink);
  cursor: zoom-in;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.gallery-grid button:hover { border-color: var(--gold); box-shadow: 0 10px 26px rgba(0, 20, 50, .5); transform: translateY(-4px); }
.gallery-grid img { display: block; width: 100%; height: auto; }
.viewer { max-width: min(92vw, 640px); padding: 0; overflow: visible; border: 2px solid var(--gold); border-radius: 16px; background: var(--ink); }
.viewer::backdrop { background: rgba(0, 12, 30, .82); backdrop-filter: blur(6px); }
.viewer img { display: block; width: 100%; max-height: 86vh; object-fit: contain; border-radius: 14px; }
.viewer button {
  position: absolute;
  top: -14px;
  inset-inline-end: -10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* Modern polish: one ornament, one gold button style, soft motion. */
h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin-top: 12px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
[dir="rtl"] h2::after { background: linear-gradient(270deg, var(--gold), transparent); }
.cta, .nav-give {
  background: linear-gradient(135deg, #f0dcae, #d9b56a 55%, #c49a4a);
  box-shadow: 0 6px 18px rgba(217, 181, 106, .35);
}
.cta:hover, .nav-give:hover { background: linear-gradient(135deg, #f8ecc9, #e6c682 55%, #d9b56a); }
.card { transition: transform .25s, border-color .25s; }
.card:hover { border-color: var(--gold); transform: translateY(-4px); }
.coin:hover { border-color: var(--gold); }
.poem { transition: border-color .25s; }
.poem:hover { border-color: rgba(217, 181, 106, .75); }
.rider { box-shadow: 0 0 0 6px rgba(217, 181, 106, .16), 0 14px 40px rgba(0, 10, 30, .55); }
.brand img { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }
.brand .flag { flex: none; width: 56px; height: 32px; border-radius: 3px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-seen { opacity: 1; transform: none; }

/* Glass theme: the blue tile stays still behind frosted panels. */
body { background: var(--ink); color: var(--cream); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("pattern-blue.jpg") 0 0 / 400px;
}
.hero, .give, .band, .talk, .gallery, .poems { background: none; }
.band, .give, .talk, .gallery, .poems { padding: 14px 16px; }
.hero { padding-bottom: 14px; }
.foot { margin-top: 14px; }
.topbar, .arch, .give > .wrap, .band > .wrap, .talk > .wrap, .gallery > .wrap, .poems > .wrap {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: 0 8px 30px rgba(0, 20, 50, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.topbar { padding-block: 12px; border-bottom: 1px solid var(--glass-line); }
.arch { border: 1px solid var(--glass-line); border-radius: 380px 380px 22px 22px; }
.give > .wrap, .band > .wrap, .talk > .wrap, .gallery > .wrap, .poems > .wrap {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--glass-line);
  border-radius: 22px;
}
.eyebrow { color: var(--gold); }
.sub, .invite, .hadith-mean { color: #eef4f8; }
.hadith { border-color: var(--glass-line); background: rgba(4, 28, 58, .45); }
.hadith-count, .coin-label small { color: #cfe0ee; }
.card, .comment, .challenge { border-color: var(--glass-line); background: var(--glass-soft); }
.card p { color: #e6eef4; }
.num { color: var(--gold-soft); }
.coin { border-color: var(--glass-line); background: var(--glass-soft); }
.talk-note, .comment-head span { color: #d5e2ec; }
.talk-status { color: #9be8c4; }
.talk-status.is-error { color: #ffc1ae; }
.talk-form input[type="text"], .talk-form select, .talk-form textarea { background: rgba(255, 255, 255, .94); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(6, 40, 78, .92); }
}

@media (max-width: 820px) {
  .cards, .donate { grid-template-columns: minmax(0, 1fr); }
  .hadith-body { min-height: 290px; }
}
@media (max-width: 640px) {
  /* Phones: one full-width image per row, four at first, the rest behind the button. */
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-grid:not(.is-open) button:nth-child(n+5) { display: none; }
  .beit { grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; font-size: 30px; }
}
@media (max-width: 460px) {
  .coin { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .coin-icon { width: 32px; height: 32px; font-size: 16px; }
  .coin-soon { width: 100%; margin: 0; }
  .talk-row { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 124px; }
  .arch { border-radius: 170px 170px 18px 18px; }
}
/* Invitation to the nightly prayer: national colours with a traditional frame. */
.vigil { padding: 14px 16px; }
.vigil-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 34px 20px 28px;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(4, 28, 58, .9), rgba(6, 48, 92, .9));
  color: #fff;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 15, 40, .45), inset 0 0 0 5px rgba(217, 181, 106, .16);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
}
.vigil-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, #239f40 0 33.3%, #fff 33.3% 66.6%, #da0000 66.6%);
}
.vigil-card:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(0, 15, 40, .55), inset 0 0 0 5px rgba(217, 181, 106, .28); }
.vigil-flag { width: 84px; height: 48px; border-radius: 4px; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.vigil-title { color: var(--gold-soft); font: 700 clamp(30px, 5.4vw, 48px)/1.45 Amiri, Vazirmatn, serif; }
.vigil-when { font-size: clamp(18px, 3vw, 24px); font-weight: 700; }
.vigil-link { margin-top: 6px; padding: 6px 22px; border-radius: 999px; background: linear-gradient(135deg, #f0dcae, #d9b56a 55%, #c49a4a); color: var(--ink); font-size: 15px; font-weight: 700; }

/* Soft motion: one calm language, ignored by browsers that do not support it. */
h1, h2, h3 { text-wrap: balance; }
.lead, .invite, .card p { text-wrap: pretty; }
html { scrollbar-color: var(--gold) var(--ink); scroll-padding-top: 76px; }
.topbar { position: sticky; top: 0; inset-inline: 0; z-index: 5; }
.hero { padding-top: 22px; }
.gallery-grid img { background: var(--ink-2); animation: image-in .7s ease both; }
@keyframes image-in {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: none; }
}
.gallery-grid button, .card, .coin, .poem, .comment, .challenge, .cta, .nav-give, .nav-account, .poem-more {
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease, border-color .35s ease, background-color .35s ease, opacity .35s ease;
}
.cta:hover, .nav-give:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(217, 181, 106, .42); }
.cta:active, .nav-give:active, .coin:active, .gallery-grid button:active { transform: scale(.98); }
.hadith-body.is-in { animation: hadith-in .9s ease; }
@keyframes hadith-in {
  from { opacity: 0; filter: blur(5px); }
  to { opacity: 1; filter: none; }
}
@supports (animation-timeline: view()) {
  .gallery-grid button, .card, .poem, .comment, .challenge, .safe li {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: none; }
  }
}
dialog { opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .28s ease, transform .28s ease, overlay .28s allow-discrete, display .28s allow-discrete; }
dialog[open] { opacity: 1; transform: none; }
@starting-style {
  dialog[open] { opacity: 0; transform: translateY(14px) scale(.98); }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

/* Image viewer controls */
.viewer .viewer-prev, .viewer .viewer-next { top: 50%; inset-inline-end: auto; margin-top: -19px; background: rgba(6, 40, 78, .78); color: #fff; backdrop-filter: blur(8px); }
.viewer .viewer-prev { inset-inline-start: 10px; }
.viewer .viewer-next { inset-inline-end: 10px; }

@media (max-width: 760px) {
  .topbar { position: relative; padding-block: 10px; }
  html { scroll-padding-top: 12px; }
  .hero { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .hadith-body.is-in, .hadith-bar span.is-running { animation: none; }
  .cta { transition: none; }
}
