/* ═══════════════════════════════════════════════════════════
   پولیش سراسری رابط گرافیکی و تجربه کاربری — نسخه ۱۰
   ظرافت تعامل‌ها، دسترس‌پذیری، موبایل‌دوستی کل سایت
   بارگذاری پس از همه استایل‌ها
   ═══════════════════════════════════════════════════════════ */

/* ── رینگ فوکوس یکدست و درشت‌تر (دسترس‌پذیری + کیبورد) ───── */
:focus-visible {
  outline: 2.5px solid rgba(13, 155, 224, .75);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn:focus-visible, .adm-btn:focus-visible { outline-offset: 3px; }

/* ── لمس نرم در موبایل: حذف فلش آبی و بهبود تپ ───────────── */
* { -webkit-tap-highlight-color: rgba(13, 155, 224, .12); }
button, .btn, a, input, select, textarea { touch-action: manipulation; }

/* ── اسکرول‌بار ظریف و هم‌رنگ تم ─────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: #c4d9ec transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #c4d9ec; border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: #a8c9e4; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── تصاویر: هرگز از قالب بیرون نزنند ────────────────────── */
img { max-width: 100%; height: auto; }

/* ── انتخاب متن هم‌رنگ تم ─────────────────────────────────── */
::selection { background: rgba(13, 155, 224, .22); }

/* ── دکمه‌ها: فیدبک لمسی بهتر ─────────────────────────────── */
.btn:active, .adm-btn:active, .db-tab:active, .captcha-refresh:active { transform: scale(.97); }

/* ── فرم‌ها: فونت ۱۶px در موبایل برای جلوگیری از زوم iOS ── */
@media (max-width: 640px) {
  input[type="text"], input[type="tel"], input[type="email"], input[type="search"],
  input[type="password"], input[type="number"], input[type="date"], input[type="time"],
  select, textarea { font-size: 16px !important; }
}

/* ── ریسپانسیو عمومی: جدول‌ها و بلوک‌های عریض ─────────────── */
@media (max-width: 720px) {
  .adm-table-wrap, .np-filter { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .section { padding: 40px 0; }
  .container { padding-inline: 16px; }
  .page-hero { padding: 34px 0 26px; }
  .page-hero h1 { font-size: clamp(20px, 5.4vw, 30px); }
  h2 { font-size: clamp(18px, 4.6vw, 26px); }
  /* کارت‌ها و فرم‌ها بدون لبه‌های تیز بزرگ */
  .success-card, .detail-card, .side-card { border-radius: 16px; }
  /* دکمه تمام‌عرض برای اقدامات اصلی موبایل */
  .success-actions .btn { flex: 1 1 100%; justify-content: center; }
  .filter-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .filter-bar .chip { white-space: nowrap; }
}

/* ── جدول‌های عمومی در موبایل: اسکرول نرم با سایه لبه ────── */
@media (max-width: 720px) {
  .article-layout { grid-template-columns: 1fr; }
  .cmt-form__row { grid-template-columns: 1fr; }
}

/* ── احترام به کاهش انیمیشن (دسترس‌پذیری) ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── حالت چاپ صفحات محتوایی ──────────────────────────────── */
@media print {
  .header, .topbar, .footer, .breadcrumb, .art-card__more, .btn, .db-nav, .db-chat__form { display: none !important; }
  body { background: #fff !important; }
  .detail-card { box-shadow: none !important; border: 1pt solid #ccc !important; }
}

/* ── لینک‌های درون‌متن: زیرخط ظریف هنگام هاور ────────────── */
.article-body p a, .db-empty a { text-underline-offset: 3px; }

/* ── بهبود کنتراست متن کم‌رنگ در موبایل ──────────────────── */
@media (max-width: 640px) {
  .art-card__meta span, .db-appt__meta { font-size: 11.5px; }
}
