/* ==========================================================================
   تم‌های سایت — روشن (پیش‌فرض)، آرام (Vintage Paper)، تیره (Backloud)
   تم با ویژگی data-theme روی <html> عوض می‌شود (static/js/themes.js) و در
   مرورگر کاربر ذخیره می‌شود. همه‌ی رنگ‌های site.css و Tailwind از متغیرهای
   زیر می‌آیند، پس هر تم فقط همین متغیرها را عوض می‌کند.
   چاپ همیشه با تم روشن است (همه‌چیز داخل @media screen).
   ========================================================================== */
@font-face{ font-family:'Libre Baskerville'; font-style:normal; font-display:swap; font-weight:400;
  src:url('../fonts/libre-baskerville-latin-400-normal.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face{ font-family:'Libre Baskerville'; font-style:normal; font-display:swap; font-weight:700;
  src:url('../fonts/libre-baskerville-latin-700-normal.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }

/* انتخابگر تم (دایره‌های رنگی) */
.theme-pick{ display:inline-flex; align-items:center; gap:5px; }
.theme-pick button{ width:20px; height:20px; padding:0; border-radius:999px; cursor:pointer;
  border:2px solid rgba(255,255,255,.85); box-shadow:0 1px 4px rgba(0,0,0,.25); transition:transform .15s ease; }
.theme-pick button:hover{ transform:scale(1.12); }
.theme-pick button.on{ outline:2px solid currentColor; outline-offset:2px; }
.theme-pick [data-theme-pick="light"]{ background:linear-gradient(120deg,#ff4f81,#ffbe86); }
.theme-pick [data-theme-pick="paper"]{ background:#a67c52; }
.theme-pick [data-theme-pick="dark"]{ background:conic-gradient(#e89817 0 50%,#020817 0); }
.topbar .theme-pick{ color:var(--ink); }
.topbar .theme-pick button{ width:18px; height:18px; border-color:var(--card); }

@media screen{

/* ───────────── آرام — Vintage Paper ───────────── */
html[data-theme="paper"]{
  --ink:#4a3f35; --ink-rgb:74 63 53; --ink-2:#3b3129; --muted:#7d6b56;
  --paper:#f5f1e6; --paper-rgb:245 241 230; --card:#fffcf5; --card-rgb:255 252 245;
  --line:#dbd0ba; --line-rgb:219 208 186; --topbar:rgba(255,252,245,.9);
  --p1:#a67c52; --p1-rgb:166 124 82; --p2:#8d6743; --p3:#d4c8aa; --p4:#e2d8c3; --on-p:#fffcf5;
  --accent:#a67c52; --accent-rgb:166 124 82; --T:#b54a35; --A:#5d7a3a; --C:#a2782a; --G:#4f6f8f;
}
html[data-theme="paper"] body{ font-family:'Libre Baskerville','Vazirmatn','Tahoma',sans-serif; }
html[data-theme="paper"] .brand-word{ font-family:'Libre Baskerville','Vazirmatn',serif; }
html[data-theme="paper"] .btn,
html[data-theme="paper"] .rounded-md, html[data-theme="paper"] .rounded-lg, html[data-theme="paper"] .rounded-xl{ border-radius:.375rem; }
html[data-theme="paper"] .text-accent{ color:#8d6743; }

/* ───────────── تیره — Backloud ───────────── */
html[data-theme="dark"]{
  color-scheme:dark;
  --ink:#ffffff; --ink-rgb:255 255 255; --ink-2:#e5e7eb; --muted:#e5e7eb;
  --paper:#020817; --paper-rgb:2 8 23; --card:#737270; --card-rgb:115 114 112;
  --line:#a3a29f; --line-rgb:163 162 159; --topbar:rgba(2,8,23,.9);
  --p1:#e89817; --p1-rgb:232 152 23; --p2:#e79717; --p3:#f5b54a; --p4:#fcd9a0; --on-p:#100e0e;
  --accent:#e89817; --accent-rgb:232 152 23; --T:#ffb4a8; --A:#4ade80; --C:#fcd34d; --G:#93c5fd;
  --shadow-sm:0 1px 3px rgba(0,0,0,.4); --shadow-md:0 10px 26px -8px rgba(0,0,0,.6);
}
/* نوار بالا و منو روی زمینه‌ی سرمه‌ای، کارت‌ها خاکستری */
html[data-theme="dark"] .topbar{ border-bottom-color:#1e2a44; }
html[data-theme="dark"] .side, html[data-theme="dark"] .mnav a:not(.is-on):not(.gbtn-dark){ background:#0b1226; border-color:#1e2a44; }
html[data-theme="dark"] .site-foot{ background:#0b1226; border-color:#1e2a44; }
/* دکمه‌های تیره‌ی bg-ink-950 در تم تیره سفید نشوند */
html[data-theme="dark"] .bg-ink-950{ background-color:#100e0e; color:#fff; }
html[data-theme="dark"] .hover\:bg-ink-950:hover{ background-color:#100e0e; }
html[data-theme="dark"] .text-accent{ color:#fcd9a0; }
/* رنگ‌های معنایی خواناتر روی کارت خاکستری */
html[data-theme="dark"] .text-baseT{ color:#ffd0c8; }
html[data-theme="dark"] .text-baseA{ color:#bbf7d0; }
html[data-theme="dark"] .text-baseC{ color:#fde68a; }
html[data-theme="dark"] .text-baseG{ color:#bfdbfe; }
html[data-theme="dark"] .text-critical{ color:#fed7aa; }
/* ورودی‌ها مثل Backloud: سرمه‌ای با نوشته‌ی سفید */
html[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]),
html[data-theme="dark"] select, html[data-theme="dark"] textarea{
  background-color:#020817!important; color:#fff!important; border-color:#4b5563!important; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder{ color:rgba(255,255,255,.45)!important; }
html[data-theme="dark"] option{ background:#020817; color:#fff; }
html[data-theme="dark"] .pick-btn, html[data-theme="dark"] .pick-list, html[data-theme="dark"] .pick-opt{ background:#020817; color:#fff; }

/* برچسب‌ها روی کارت خاکستری: زمینه‌ی سرمه‌ای نیمه‌شفاف و نوشته‌ی روشن */
html[data-theme="dark"] .pill-ready{ color:#bbf7d0; background:rgba(2,8,23,.55); border-color:rgba(74,222,128,.55); }
html[data-theme="dark"] .pill-import{ color:#fde68a; background:rgba(2,8,23,.55); border-color:rgba(252,211,77,.5); }
html[data-theme="dark"] .pill-dead{ color:#ffd0c8; background:rgba(2,8,23,.55); border-color:rgba(255,180,168,.55); }
html[data-theme="dark"] .runno, html[data-theme="dark"] .expiry, html[data-theme="dark"] .expiry.is-over{ color:#ffd0c8; background:rgba(2,8,23,.55); border-color:rgba(255,180,168,.55); }
html[data-theme="dark"] .urgent-opt b{ color:#ffd0c8; }

/* ───────────── مشترک بین دو تم جدید ───────────── */
html[data-theme] .bg-white{ background-color:var(--card); }
html[data-theme] .btn-primary, html[data-theme] .mnav a.is-on{ color:var(--on-p); }
html[data-theme] .user-avatar{ background:var(--p1); color:var(--on-p); }
html[data-theme="light"] .bg-white{ background-color:#fff; }

}
