﻿/* ══════════════════════════════════════════════════
   فونت‌ها
   ─────────────────────────────────────────────────
   ۱) متن فارسی  → Vazirmatn (وزیرمتن)  چون برای فارسی طراحی شده
   ۲) متن قرآنی  → Scheherazade New / Amiri  چون فونت عربی با
                    لیگاتور و اتصال صحیح است. فونت فارسی برای
                    آیه مناسب نیست (حروف جدا و نادرست دیده می‌شود).

   منبع هر فونت به ترتیب اولویت:
     الف) فایل محلی در assets/fonts/   ← سریع، آفلاین، بدون تحریم
     ب) Google Fonts                  ← برای کاربران خارج یا با VPN
     ج) فونت نصب‌بوده روی دستگاه

   اگر فایل‌های محلی را در assets/fonts/ بگذاری، گوگل اصلاً صدا زده نمی‌شود.
   ══════════════════════════════════════════════════ */

/* ---------- ۱) وزیرمتن — متن فارسی ---------- */
@font-face{
  font-family:'VazFa';
  src:url('fonts/Vazirmatn-Regular.woff2') format('woff2'),
      url('fonts/Vazir-Regular.woff2')      format('woff2'),
      local('Vazirmatn'), local('Vazir'), local('Vazir IRANSans');
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'VazFa';
  src:url('fonts/Vazirmatn-Medium.woff2') format('woff2'),
      local('Vazirmatn Medium'), local('Vazir Medium');
  font-weight:500; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'VazFa';
  src:url('fonts/Vazirmatn-Bold.woff2') format('woff2'),
      local('Vazirmatn Bold'), local('Vazir Bold');
  font-weight:700; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'VazFa';
  src:url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2'),
      local('Vazirmatn ExtraBold'), local('Vazir ExtraBold');
  font-weight:800; font-style:normal; font-display:swap;
}

/* ---------- ۲) فونت عربی/قرآنی ---------- */
/* اولویت: فونت عثمانی نصب‌بوده ← فایل محلی ← گوگل/فونت‌های جایگزین */
@font-face{
  font-family:'QuranFa';
  src:url('fonts/UthmanicHafs.woff2')           format('woff2'),
      url('fonts/UthmanTaha.woff2')            format('woff2'),
      url('fonts/OthmanTaha.ttf')               format('truetype'),
      url('fonts/ScheherazadeNew-Regular.woff2') format('woff2'),
      url('fonts/Amiri-Regular.woff2')          format('woff2'),
      local('KFGQPC Uthmanic Script HAFS'),
      local('UTHMAN TAH'),
      local('OthmanTaha'),
      local('Scheherazade New'), local('Scheherazade'),
      local('Amiri'), local('Traditional Arabic');
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'QuranFa';
  src:url('fonts/UthmanicHafs-Bold.woff2')     format('woff2'),
      url('fonts/ScheherazadeNew-Bold.woff2')   format('woff2'),
      local('KFGQPC Uthmanic Script HAFS Bold'),
      local('UTHMAN TAH Bold'),
      local('Scheherazade New Bold');
  font-weight:700; font-style:normal; font-display:swap;
}

:root{
  /* نام‌های قابل استفاده در استایل */
  --f-fa: 'VazFa','Vazirmatn','Vazir','IRANSansX','IRANSans','Segoe UI',Tahoma,'Noto Sans Arabic',sans-serif;
  --f-quran: 'QuranFa','KFGQPC Uthmanic Script HAFS','UTHMAN TAH','OthmanTaha','Scheherazade New','Amiri','Noto Naskh Arabic','Traditional Arabic',serif;

  --ink:#16202b;
  --ink-2:#3c4b5c;
  --muted:#6b7a8c;
  --bg:#f6f3ec;
  --paper:#ffffff;
  --line:#e2ddd2;
  --gold:#b8860b;
  --gold-2:#e9c46a;
  --teal:#0f6f6c;
  --teal-2:#d6ecea;
  --blue:#1d5fa8;
  --blue-2:#dfe9f7;
  --green:#2e7d4f;
  --green-2:#ddf0e3;
  --red:#b3261e;
  --red-2:#fbe3e1;
  --purple:#6b3fa0;
  --purple-2:#eae0f7;
  --orange:#c2620d;
  --orange-2:#fdeada;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--f-fa);
  font-size:17px; line-height:2.05;
  -webkit-font-smoothing:antialiased;
}
.page{max-width:1180px;margin:0 auto;padding:0 26px 90px}

/* ============ قلم عربی / آیه ============ */
.ar,.ayah{
  font-family:var(--f-quran);
  direction:rtl;
}
.ar{direction:rtl;font-size:1.5em;line-height:2.4}
.ayah{font-size:1.45em;line-height:2.6;color:#123c3a}
.ayah .a{color:#0f6f6c}

/* ============ هدر ============ */
.topbar{
  position:sticky;top:0;z-index:50;
  background:linear-gradient(90deg,#0f6f6c,#14524f 55%,#0d3f3d);
  color:#fff;box-shadow:0 2px 14px rgba(0,0,0,.18);
}
.topbar .in{max-width:1180px;margin:0 auto;padding:9px 26px;display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.topbar .brand{font-weight:800;letter-spacing:.2px;font-size:15px}
.topbar .brand span{color:var(--gold-2)}
.topbar nav{display:flex;gap:6px;flex-wrap:wrap;margin-inline-start:auto}
.topbar nav a{
  color:#dff0ef;text-decoration:none;font-size:12.5px;padding:5px 10px;border-radius:20px;
  border:1px solid rgba(255,255,255,.18);white-space:nowrap
}
.topbar nav a:hover{background:rgba(255,255,255,.14);color:#fff}
.topbar nav a.on{background:var(--gold-2);color:#20302c;border-color:var(--gold-2);font-weight:700}

/* ============ هدر صفحه ============ */
.hero{
  background:radial-gradient(1200px 300px at 20% -10%,#1b8a86,#0d3f3d 70%);
  color:#fff;padding:34px 26px 30px;margin-bottom:26px;
  border-bottom:4px solid var(--gold-2);
}
.hero .in{max-width:1180px;margin:0 auto}
.hero h1{margin:0 0 6px;font-size:31px;line-height:1.6}
.hero p{margin:0;color:#cfe7e5;font-size:15.5px}
.hero .badges{margin-top:14px;display:flex;gap:8px;flex-wrap:wrap}
.hero .badges span{
  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.25);
  padding:3px 12px;border-radius:20px;font-size:12.5px
}

/* ============ تیترها ============ */
h2.sec{
  font-size:23px;margin:40px 0 14px;padding:11px 16px;
  background:linear-gradient(90deg,var(--teal),#138a86);color:#fff;border-radius:10px;
  border-inline-start:6px solid var(--gold-2)
}
h3{font-size:19px;margin:28px 0 10px;color:var(--teal);border-bottom:2px dashed #cfd8dc;padding-bottom:5px}
h4{font-size:16.5px;margin:18px 0 7px;color:var(--ink)}
h3 .n,h2.sec .n{
  display:inline-block;background:rgba(255,255,255,.2);border-radius:8px;
  padding:0 9px;margin-inline-end:8px;font-weight:800
}
h3 .n{background:var(--teal-2);color:var(--teal)}

/* ============ کارت‌ها ============ */
.card{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:18px 20px;margin:16px 0;box-shadow:0 2px 8px rgba(0,0,0,.04)}
.card.tight{padding:12px 16px}
.grid{display:grid;gap:14px}
.g2{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
.g3{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}
.g4{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}

.box{border-radius:12px;padding:14px 17px;margin:14px 0;border:1px solid}
.box .t{font-weight:800;margin-bottom:5px;display:flex;gap:8px;align-items:center}
.box p{margin:5px 0}
.box.info{background:var(--blue-2);border-color:#b9d1ee;color:#123a6b}
.box.ok{background:var(--green-2);border-color:#b5dcc3;color:#14512f}
.box.warn{background:var(--red-2);border-color:#f0b8b4;color:#7d1a15}
.box.tip{background:var(--gold-2);border-color:#e2b757;color:#5c4108;border-color-width:2px}
.box.note{background:var(--purple-2);border-color:#cdb9ec;color:#3c2160}
.box.ex{background:#fff;border:2px dashed var(--teal);border-radius:12px;padding:14px 18px;margin:14px 0}
.box.ex .t{color:var(--teal);font-size:15px}
.box.ex .lbl{display:inline-block;background:var(--teal);color:#fff;border-radius:6px;padding:1px 9px;font-size:12px;margin-inline-end:8px}

/* ============ جدول ============ */
table{width:100%;border-collapse:collapse;margin:14px 0;background:#fff;font-size:15.5px}
th,td{border:1px solid var(--line);padding:9px 11px;text-align:center;vertical-align:middle}
th{background:var(--teal);color:#fff;font-weight:700}
tr:nth-child(even) td{background:#faf8f3}
td.l,th.l{text-align:right}
table.tight td,table.tight th{padding:6px 8px;font-size:14.5px}
.tbl-wrap{overflow-x:auto}

/* ============ لیست ============ */
ul,ol{padding-inline-start:22px;margin:9px 0}
li{margin:5px 0}
ul.tick{list-style:none;padding:0}
ul.tick li{padding-inline-start:28px;position:relative}
ul.tick li:before{content:"✔";position:absolute;inset-inline-start:0;color:var(--green);font-weight:800}
ul.cross{list-style:none;padding:0}
ul.cross li{padding-inline-start:28px;position:relative}
ul.cross li:before{content:"✘";position:absolute;inset-inline-start:0;color:var(--red);font-weight:800}

/* ============ نوار پیشرفت فاز ============ */
.steps{display:flex;gap:0;flex-wrap:wrap;margin:18px 0 6px}
.steps a{
  flex:1;min-width:112px;text-decoration:none;color:#33505e;text-align:center;
  background:#fff;border:1px solid var(--line);border-inline-start:0;padding:9px 6px;font-size:12.5px;font-weight:700
}
.steps a:first-child{border-radius:10px 0 0 10px;border-inline-start:1px solid var(--line)}
.steps a:last-child{border-radius:0 10px 10px 0}
.steps a.on{background:var(--gold-2);color:#3b2b06;border-color:#d9ae4a}
.steps a:hover{background:var(--teal-2)}

/* ============ پاورقی ============ */
.foot{max-width:1180px;margin:26px auto 0;padding:18px 26px;border-top:2px solid var(--line);color:var(--muted);font-size:13.5px;display:flex;gap:14px;flex-wrap:wrap;align-items:center}
.foot a{color:var(--teal);text-decoration:none;font-weight:700}
.foot .sp{margin-inline-start:auto}

.pill{display:inline-block;border-radius:20px;padding:2px 11px;font-size:12.5px;font-weight:700}
.pill.r{background:var(--red-2);color:var(--red)}
.pill.g{background:var(--green-2);color:var(--green)}
.pill.b{background:var(--blue-2);color:var(--blue)}
.pill.y{background:var(--gold-2);color:#6b4f06}
.pill.p{background:var(--purple-2);color:var(--purple)}
.pill.o{background:var(--orange-2);color:var(--orange)}

.hr{height:2px;background:linear-gradient(90deg,transparent,var(--line),transparent);margin:26px 0;border:0}

.muted{color:var(--muted);font-size:14px}
.big{font-size:19px;font-weight:700}
.center{text-align:center}
.small{font-size:13.5px}

@media print{
  body{background:#fff;font-size:12pt}
  .topbar{display:none}
  .page{max-width:100%;padding:0}
  .card,.box{box-shadow:none;break-inside:avoid}
  h2.sec{break-after:avoid}
  .no-print{display:none}
}

/* ============ دکمهٔ خروجی PDF ============ */
.pdfbtn{
  position:fixed; inset-block-end:22px; inset-inline-start:22px; z-index:999;
  display:flex; align-items:center; gap:8px;
  background:linear-gradient(135deg,#b8860b,#8a6308);
  color:#fff; border:0; border-radius:40px;
  padding:12px 20px 12px 18px;
  font-family:inherit; font-size:15px; font-weight:800; cursor:pointer;
  box-shadow:0 6px 20px rgba(0,0,0,.28);
  transition:transform .15s ease, box-shadow .15s ease;
}
.pdfbtn:hover{transform:translateY(-2px); box-shadow:0 10px 26px rgba(0,0,0,.34)}
.pdfbtn:active{transform:translateY(0)}
.pdfbtn .ico{font-size:19px; line-height:1}
.pdfbtn .sub{display:block; font-size:10.5px; font-weight:600; opacity:.85; line-height:1.2}

.pdfhelp{
  position:fixed; inset-block-end:82px; inset-inline-start:22px; z-index:998;
  background:#16202b; color:#fff; border-radius:12px; padding:12px 15px;
  font-size:12.5px; line-height:1.85; max-width:270px;
  box-shadow:0 8px 24px rgba(0,0,0,.3); display:none;
}
.pdfhelp.show{display:block}
.pdfhelp b{color:var(--gold-2)}
.pdfhelp .x{
  position:absolute; inset-block-start:6px; inset-inline-end:10px;
  cursor:pointer; color:#8fa0b0; font-size:16px; line-height:1
}
.pdfhelp .x:hover{color:#fff}

@media print{
  .pdfbtn,.pdfhelp{display:none !important}
  .tbl-wrap{overflow:visible !important}
  .tbl-wrap.is-scroll::after{display:none !important}
  .is-scroll{background:none !important; box-shadow:none !important}
}

/* ══════════════════════════════════════════════
   بهبود نمایش در موبایل و تبلت
   ══════════════════════════════════════════════ */
.tbl-wrap{
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  scrollbar-width:thin;
}
.tbl-wrap::-webkit-scrollbar{height:6px;width:6px}
.tbl-wrap::-webkit-scrollbar-track{background:#f1eee6;border-radius:6px}
.tbl-wrap::-webkit-scrollbar-thumb{background:#c7bfae;border-radius:6px}
.tbl-wrap.is-scroll{border-radius:10px;box-shadow:inset 0 0 0 1px #e6e0d3}
.tbl-wrap.is-scroll::after{
  content:"↔  جدول را افقی بکشید";
  display:block;text-align:center;
  font-size:11px;color:#8a7f6a;
  padding:5px 0 1px;
  background:#faf8f3;
  border-radius:0 0 10px 10px;
}

@media (max-width:820px){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}

  body{font-size:15.5px;line-height:1.95}

  /* ── فاصله و عرض ── */
  .page{padding:0 14px 96px}
  .hero{padding:24px 14px 22px}
  .hero h1{font-size:22px;line-height:1.55;margin-bottom:4px}
  .hero p{font-size:13.5px;line-height:1.85}
  .hero .badges{margin-top:10px;gap:6px}
  .hero .badges span{font-size:11px;padding:2px 9px}

  /* ── ناوبری بالا: یک ردیف قابلscroll ── */
  .topbar .in{padding:7px 12px;gap:8px}
  .topbar .brand{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar nav{
    margin-inline-start:0;width:100%;
    flex-wrap:nowrap;overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding-bottom:1px;
  }
  .topbar nav::-webkit-scrollbar{display:none}
  .topbar nav a{flex:0 0 auto;font-size:11.5px;padding:5px 10px}

  /* ── نوار مراحل: یک ردیف قابلscroll ── */
  .steps{
    display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;
    margin:12px 0 4px;padding-bottom:4px;
    -webkit-overflow-scrolling:touch;scrollbar-width:none;
  }
  .steps::-webkit-scrollbar{display:none}
  .steps a{
    flex:0 0 auto;min-width:0;padding:7px 12px;font-size:11.5px;
    border:1px solid var(--line)!important;border-radius:8px;
    white-space:nowrap;
  }

  /* ── تیترها ── */
  h2.sec{font-size:17.5px;margin:26px 0 10px;padding:9px 12px;border-radius:8px}
  h2.sec .n{font-size:14px;padding:0 7px}
  h3{font-size:16px;margin:20px 0 8px;padding-bottom:4px}
  h4{font-size:14.5px;margin:14px 0 6px}
  p{margin:8px 0}

  /* ── متون عربی ── */
  .ar{font-size:1.32em;line-height:2.15}
  .ayah{font-size:1.26em;line-height:2.2}

  /* ── کارت‌ها و کادرها ── */
  .card{padding:13px 13px;border-radius:11px;margin:12px 0}
  .card.tight{padding:10px 12px}
  .box{padding:11px 12px;border-radius:10px;margin:11px 0}
  .box.tight{padding:9px 11px}
  .box .t{font-size:14px;margin-bottom:4px}

  /* ── شبکه‌ها: تک‌ستونه ── */
  .grid{gap:10px}
  .grid.g2,.grid.g3,.grid.g4{grid-template-columns:1fr}

  /* ── جدول‌ها ── */
  table{font-size:13px}
  th,td{padding:6px 7px}
  table.tight{font-size:12px}
  table.tight td,table.tight th{padding:5px 5px}
  /* جدول‌های ۵ ستون به بالا اسکرول می‌خورند (نه له) */
  table:has(tr > :nth-child(5)){min-width:520px}
  table:has(tr > :nth-child(6)){min-width:600px}
  table:has(tr > :nth-child(7)){min-width:680px}

  /* ── لیست‌ها ── */
  ul,ol{padding-inline-start:19px}
  li{margin:4px 0}

  /* ── برچسب‌ها ── */
  .pill{font-size:11px;padding:2px 9px}
  .muted{font-size:12.5px}
  .small{font-size:12.5px;line-height:1.85}
  .big{font-size:16.5px}

  /* ── دکمهٔ PDF: جمع‌وجور و بالای نوار پایین گوشی ── */
  .pdfbtn{
    inset-block-end:calc(14px + env(safe-area-inset-bottom,0px));
    inset-inline-start:12px;
    padding:11px 15px;border-radius:34px;font-size:13px;
    box-shadow:0 4px 14px rgba(0,0,0,.26);
  }
  .pdfbtn .ico{font-size:17px}
  .pdfbtn .sub{display:none}
  .pdfhelp{
    inset-block-end:calc(62px + env(safe-area-inset-bottom,0px));
    inset-inline-start:12px;
    max-width:calc(100vw - 24px);font-size:11.5px;line-height:1.75;
    padding:10px 12px;
  }

  /* ── پاورقی ── */
  .foot{padding:14px;font-size:12px;gap:9px;line-height:1.85}

  /* ── شکستن کلمات دراز (لینک، نام فایل، عبارت عربی) ── */
  a,td,th,.ayah,.ar{overflow-wrap:break-word;word-wrap:break-word}

  /* ── فاصلهٔ لمسی بهتر ── */
  .topbar nav a,.steps a{padding-top:7px;padding-bottom:7px}
}

@media (max-width:820px){
  /* ── بانک مثال: هر نمونه یک بلوک کامل ── */
  .ex-row{
    display:block;
    padding:10px 2px;
    border-bottom:1px solid var(--line);
  }
  .ex-row:last-child{border-bottom:0}
  .ex-row .tag{display:inline-block;margin-inline-end:7px;margin-bottom:3px}
  .ex-row .txt{display:block;font-size:17.5px;line-height:2.05;margin:2px 0}
  .ex-row .rule{font-size:11.5px;padding:4px 8px;display:block;margin-top:4px}
  .ex-row .src{display:block;text-align:start;padding-top:3px;font-size:11px;line-height:1.7}

  /* ── فاز ۸: دکمهٔ شنیدن زیر متن ── */
  .play{grid-template-columns:1fr;gap:9px;padding:11px 12px}
  .play .info{font-size:13px}
  .play .info b{font-size:14.5px}
  .play .info .m{font-size:11.5px}
  .play .go a{width:auto;display:inline-block;padding:9px 20px}
  .play .go small{display:inline;margin-inline-start:6px}
  .qr{padding:12px 13px}
  .qr .n{font-size:15px}
  .qr .d{font-size:12.5px}
  .qr .tags span{font-size:11px}

  /* ── آزمون ممتاز ── */
  .step{grid-template-columns:34px 1fr;gap:10px;margin:10px 0}
  .step .n{width:34px;height:34px;font-size:15px}
  .lvl div{min-width:calc(50% - 3px);font-size:11px;padding:7px 4px}
  .lvl{flex-wrap:wrap;gap:0}
  .lvl div{border-radius:0}
  .ring{padding:10px 12px}

  /* ── آیات طلایی ── */
  .gold{padding:12px 13px;margin:12px 0}
  .gold .h{gap:5px;margin-bottom:4px}
  .gold .h .t{font-size:14px;line-height:1.75}
  .gold .h .s{font-size:11px}
  .gold .a{font-size:17.5px;line-height:2.15;margin:6px 0}
  .gold .why{font-size:12.5px;padding:7px 10px;line-height:1.9}
  .tg{font-size:10.5px;padding:2px 7px}

  /* ── برگه‌های تقلب ── */
  .sheet{padding:10px 11px;margin-bottom:11px}
  .sheet h3{font-size:14.5px}
  .sheet .hd .t{font-size:14.5px}
  .sheet .hd .n{font-size:10px}
  .sheet table{font-size:11px}
  .sheet th,.sheet td{padding:3px 4px}
  .sheet .mini td,.sheet .mini th{padding:2px 3px;font-size:10.5px}
  .sheet .rule{font-size:11.5px;padding:6px 8px}
  .sheet .grid2{grid-template-columns:1fr;gap:8px}
}

/* ── گوشی‌های خیلی کوچک ── */
@media (max-width:400px){
  body{font-size:14.5px;line-height:1.9}
  .page{padding:0 10px 92px}
  h2.sec{font-size:16px;padding:8px 10px}
  h3{font-size:15px}
  .ar{font-size:1.26em}
  .ayah{font-size:1.2em}
  table{font-size:12px}
  th,td{padding:5px 5px}
  .box,.card{padding:10px 11px}
  .ex-row .txt{font-size:16.5px}
  .gold .a{font-size:16.5px}
}


