/* صفحه‌های عمومی بازطراحی‌شده (نسخه 1.34.0): فهرست سوره‌ها، قاریان، صفحه هر قاری، مداحان، ذکرشمار، وبلاگ، حامیان و خطاها.
   همه با نشانه‌های رنگ طراحی آیات قرآنی (--ink، --muted، --line، --surface، --surface-alt، --page) و یک رنگ تأکید (--pg-ac)
   که در پوسته‌های تیره روشن‌تر است. ساختار مشترک: سربرگ صفحه، ابزار (جستجو و فیلتر)، شبکه کارت‌ها یا فهرست ردیف‌ها. */
/* نسخه 1.34.1 (بازبینی UI/UX): رنگ تأکید روشن کمی تیره‌تر شد تا متن آن روی زمینه خاکستری کنتراست ۴٫۵ به ۱ (AA) داشته باشد
   (۴٫۹۷ به ۱؛ پیش‌تر ۴٫۲۳)؛ همه دکمه‌ها، برچسب‌ها و آیکن‌های لمسی دست‌کم ۴۴ پیکسل‌اند. */
.pg {
  --pg-ac: #0f7473;
  /* طلایی متن کوچک روی زمینه روشن: ‎#80601f‎ با کنتراست AA (بازبینی UI/UX، نسخه 1.35.0؛ ‎#b8913f‎ ۲٫۷ به ۱ بود). */
  --pg-gold: #80601f;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 72px;
}
:root[data-theme="dark"] .pg,
:root[data-theme="night"] .pg {
  --pg-ac: #5fd3c6;
  --pg-gold: #e2c27a;
}
/* پوسته تیره: دکمه پر و برچسب انتخاب‌شده روی فیروزه‌ای روشن، متن تیره می‌گیرند (۸٫۹ به ۱؛ متن سفید ۱٫۸ به ۱ بود). */
:root[data-theme="dark"] .pg .pg-chip[aria-pressed="true"],
:root[data-theme="night"] .pg .pg-chip[aria-pressed="true"],
:root[data-theme="dark"] .pg .pg-btn-main,
:root[data-theme="night"] .pg .pg-btn-main {
  color: #102522;
}
.pg svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* سربرگ: مسیر، عنوان و توضیح کوتاه */
.pg-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}
.pg-crumbs li + li::before {
  content: "/";
  margin-inline-end: 6px;
  opacity: 0.6;
}
.pg-crumbs a {
  color: inherit;
  text-decoration: none;
  /* نسخه 1.59.0: ناحیه لمس دست‌کم ۲۴ پیکسل (WCAG 2.5.8)؛ در گوشی ۲۳×۲۰ بود. */
  display: inline-flex;
  align-items: center;
  min-width: 24px;
  min-height: 24px;
}
.pg-crumbs li {
  display: flex;
  align-items: center;
}
.pg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 0 18px;
}
.pg-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.4;
}
.pg-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.9;
  max-width: 62ch;
}

/* ابزار: جستجو و دکمه‌های فیلتر */
.pg-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}
.pg-search {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}
.pg-search:focus-within {
  outline: 2px solid var(--pg-ac);
}
.pg-search input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.pg-search input:focus {
  outline: none;
}
.pg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pg-chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.pg-chip[aria-pressed="true"] {
  border-color: var(--pg-ac);
  background: var(--pg-ac);
  color: #fff;
}

/* شبکه کارت سوره/جزء */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pg-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}
.pg-card:hover,
.pg-card:focus-visible {
  border-color: var(--pg-ac);
}
.pg-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--pg-ac);
  font-weight: 700;
  font-size: 14px;
}
.pg-card-text {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.pg-card-text b {
  font-size: 16px;
}
.pg-card-text small {
  color: var(--muted);
  font-size: 12.5px;
}
.pg-ar {
  flex: none;
  font-family: "UthmanicHafs", "Amiri", serif;
  font-size: 22px;
  color: var(--ink);
}
.pg-empty {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

/* قاریان: گروه سبک و کارت با عکس */
.pg-group {
  margin: 22px 0 10px;
  font-size: 17px;
}
.pg-person {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.pg-person:hover,
.pg-person:focus-visible {
  border-color: var(--pg-ac);
}
.pg-avatar {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  background: var(--surface-alt);
}
.pg-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: -2px;
}

/* سربرگ صفحه یک قاری یا مداح */
.pg-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  align-items: center;
  margin: 0 0 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.pg-profile .pg-avatar {
  width: 112px;
  height: 112px;
}
.pg-profile-text {
  flex: 1 1 280px;
  display: grid;
  gap: 6px;
}
.pg-profile-text h1 {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 30px);
}
.pg-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13.5px;
}
.pg-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--pg-ac);
  font-size: 12.5px;
  font-weight: 600;
}
.pg-bio {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 15px;
  line-height: 2;
  white-space: pre-line;
}
.pg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--pg-ac);
  border-radius: 12px;
  background: transparent;
  color: var(--pg-ac);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.pg-btn-main {
  background: var(--pg-ac);
  color: #fff;
}
.pg-btn[aria-pressed="true"] {
  background: var(--surface-alt);
}

/* فهرست ردیفی (سوره‌های یک قاری، آثار یک مداح) */
.pg-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.pg-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.pg-row:last-child {
  border-bottom: 0;
}
.pg-row .pg-card-text {
  flex: 1 1 auto;
  min-width: 0;
}
.pg-row .pg-ar {
  font-size: 19px;
}
/* ردیف با پلیر صوت (آثار مداح): پلیر در سطر دوم. */
.pg-row-wrap {
  flex-wrap: wrap;
}
.pg-row-acts {
  display: flex;
  gap: 6px;
}
.pg-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--pg-ac);
  border-radius: 50%;
  color: var(--pg-ac);
  background: transparent;
  text-decoration: none;
}
.pg-row audio {
  flex: 1 1 100%;
  width: 100%;
  height: 38px;
}

@media (max-width: 520px) {
  .pg {
    padding-top: 16px;
  }
  .pg-profile {
    padding: 16px;
  }
  .pg-profile .pg-avatar {
    width: 84px;
    height: 84px;
  }
}

/* ===== نسخه 1.35.0: ذکرشمار، متن آثار مداح و صفحه‌های خطا ===== */
/* ذکرشمار: دکمه گرد بزرگ با حلقه پیشرفت، عنصر اصلی صفحه؛ ذکر انتخابی با خط حفص بالای آن. */
.pg-tasbih {
  max-width: 720px;
  text-align: center;
}
.pg-tasbih .pg-crumbs {
  justify-content: flex-start;
}
.tb-dhikrs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 10px;
}
.tb-dhikr {
  font-family: "UthmanicHafs", "Amiri", serif;
  font-size: 17px;
}
.tb-custom {
  display: inline-flex;
  gap: 2px;
}
.tb-del {
  min-width: 44px;
  padding: 0;
  color: var(--muted);
}
.tb-add {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto 8px;
}
.tb-add .pg-search {
  flex: 1;
}
.tb-stage {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 18px 0;
}
.tb-text {
  margin: 0;
  min-height: 1.6em;
  font-family: "UthmanicHafs", "Amiri", serif;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.6;
  color: var(--ink);
}
.tb-tap {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  width: min(68vw, 260px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(14, 31, 101, 0.12), inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.08s;
}
.tb-tap:active {
  transform: scale(0.97);
}
.tb-tap:focus-visible {
  outline: 3px solid var(--pg-ac);
  outline-offset: 4px;
}
.tb-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.tb-ring circle {
  fill: none;
  stroke-width: 5;
}
.tb-ring-bg {
  stroke: var(--line);
}
.tb-ring-fg {
  stroke: var(--pg-ac);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s;
}
.tb-count {
  font-size: clamp(54px, 15vw, 78px);
  font-weight: 800;
  line-height: 1;
}
.tb-of {
  color: var(--muted);
  font-size: 16px;
}
.tb-help,
.tb-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.tb-controls {
  display: grid;
  justify-items: center;
  gap: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .tb-tap,
  .tb-ring-fg {
    transition: none;
  }
}

/* متن هر اثر مداح در بخش بازشو. */
.pg-details {
  flex: 1 1 100%;
}
.pg-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--pg-ac);
  font-weight: 600;
  cursor: pointer;
}
.pg-details .pg-bio {
  margin: 4px 0 8px;
}

/* صفحه‌های خطا (۴۰۴، ۴۰۳): پیام، جستجو و پیوندهای اصلی. */
.pg-error {
  max-width: 640px;
  text-align: center;
  padding-top: 48px;
}
.pg-error-code {
  margin: 0;
  color: var(--pg-gold);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pg-error .pg-title {
  margin: 6px 0 10px;
}
.pg-error .pg-sub {
  margin: 0 auto 22px;
}
.pg-error form {
  display: flex;
  gap: 8px;
  margin: 0 auto 22px;
}
.pg-error .pg-actions {
  justify-content: center;
}

/* ===== نسخه 1.36.0: وبلاگ و حامیان ===== */
/* برچسب گروه به شکل پیوند (aria-current برای گروه فعلی). */
.pg-chip-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.pg-chip-link[aria-current="page"] {
  border-color: var(--pg-ac);
  background: var(--pg-ac);
  color: #fff;
}
:root[data-theme="dark"] .pg .pg-chip-link[aria-current="page"],
:root[data-theme="night"] .pg .pg-chip-link[aria-current="page"] {
  color: #102522;
}
/* کارت مطلب: تصویر ۱۶:۹ بالا، گروه، عنوان، خلاصه دوخطی و تاریخ. */
.pg-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pg-post {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
}
.pg-post:hover,
.pg-post:focus-visible {
  border-color: var(--pg-ac);
}
.pg-post img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-alt);
}
.pg-post-text {
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
  justify-items: start;
}
.pg-post-text b {
  font-size: 17px;
  line-height: 1.7;
}
.pg-post-text small {
  color: var(--muted);
  font-size: 13px;
}
.pg-post-sum {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* صفحه مطلب: ستون خوانا (حدود ۷۰ نویسه)، تصویر، بند آغازین درشت‌تر و متن با فاصله سطر ۲. */
.pg-article {
  max-width: 760px;
}
.pg-article article header {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin: 0 0 16px;
}
.pg-article .pg-facts {
  margin: 0;
}
.pg-article-img {
  width: 100%;
  height: auto;
  margin: 0 0 18px;
  border-radius: 16px;
}
.pg-lead {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 2;
  color: var(--ink);
}
.pg-body {
  font-size: 16px;
  line-height: 2.05;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.pg-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}
.pg-body a {
  color: var(--pg-ac);
}
/* حامی: کارت بی‌پیوند با توضیح. */
.pg-sponsor {
  align-items: flex-start;
}
/* پیوند منبع مطلب: هدف لمسی ۴۴ پیکسلی (بازبینی UI/UX، نسخه 1.36.0). */
.pg-facts a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--pg-ac);
}
