/* ============================================================
   پوسته همسریاب — راست‌چین، فارسی، روشن (پیش‌فرض) + تاریک
   توکن‌های طراحی بر پایه متغیرهای CSS برای سفارشی‌سازی ساده از Customizer
   ============================================================ */

:root {
  --mc-primary: #c0275b;
  --bg: #faf6f1;
  --surface: #ffffff;
  --muted-bg: #f3ede5;
  --border: #eae1d4;
  --text: #211a2b;
  --text-muted: #71647c;
  --ring: rgba(192, 39, 91, 0.4);
  --radius: 18px;
  --font: "Vazirmatn", "Tahoma", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #161021;
  --surface: #201930;
  --muted-bg: #2a2039;
  --border: #3a2d4f;
  --text: #f4eff9;
  --text-muted: #aba0bd;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  direction: rtl;
  transition: background .2s ease, color .2s ease;
}
img { max-width: 100%; height: auto; }
a { color: var(--mc-primary); text-decoration: none; }
.wrap { margin-inline: auto; max-width: 1200px; padding-inline: 1rem; }

/* ------------------------------- سربرگ ------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px;
  background: linear-gradient(135deg, var(--mc-primary), #a11d4a); color: #fff;
}
.main-nav { display: flex; gap: .25rem; margin-inline-start: 1rem; }
.main-nav a { padding: .4rem .8rem; border-radius: 10px; color: var(--text-muted); font-weight: 600; font-size: .92rem; }
.main-nav a:hover { color: var(--text); background: var(--muted-bg); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }

/* ------------------------------- دکمه‌ها ------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
  padding: .6rem 1.2rem; border-radius: 14px; font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; cursor: pointer; transition: all .18s ease; white-space: nowrap;
}
.btn.primary { background: linear-gradient(135deg, var(--mc-primary), #a11d4a); color: #fff; box-shadow: 0 6px 18px -6px var(--ring); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.outline { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn.outline:hover { border-color: var(--mc-primary); color: var(--mc-primary); }
.btn.ghost { color: var(--text-muted); }
.btn.ghost:hover { background: var(--muted-bg); color: var(--text); }
.btn.sm { padding: .4rem .8rem; font-size: .85rem; }
.btn.lg { padding: .9rem 1.8rem; font-size: 1.05rem; }

/* ------------------------------- کارت‌ها ------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: 0 1px 2px rgba(88, 42, 70, .08);
}
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-block: 1.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .8rem; border-radius: 999px;
  background: var(--muted-bg); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--text-muted);
}
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 8px; font-size: .75rem; font-weight: 700; }
.badge.ok { background: #e5f4ea; color: #15803d; }
.badge.gold { background: #f7eedb; color: #b08427; }
.badge.err { background: #fdebec; color: #cf2e3f; }

/* -------------------------------- هیرو -------------------------------- */
.hero { padding-block: 4rem; background:
  radial-gradient(44rem 24rem at 90% -10%, color-mix(in srgb, var(--mc-primary) 12%, transparent), transparent 60%),
  radial-gradient(32rem 20rem at 5% 15%, #f3d9a224, transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; line-height: 1.4; margin: 1rem 0; }
.grad { background: linear-gradient(120deg, var(--mc-primary), #b08427); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--text-muted); font-size: 1.05rem; max-width: 34rem; }
.quick-search { display: flex; gap: .5rem; padding: .75rem; margin-top: 1.5rem; }
.hero-art { padding: 0; overflow: hidden; position: relative; min-height: 300px; }
.hero-art img { width: 100%; height: 320px; object-fit: cover; display: block; }
.hero-art-note {
  position: absolute; inset-inline: 0; bottom: 0; margin: 0; padding: .9rem 1.25rem;
  background: linear-gradient(to top, rgba(20,12,20,.72), transparent); color: #fff;
}
::selection { background: var(--mc-primary); color: #fff; }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.card { box-shadow: 0 1px 2px rgba(88,42,70,.07), 0 8px 24px -18px rgba(88,42,70,.18); }
.card:hover { box-shadow: 0 2px 4px rgba(88,42,70,.08), 0 16px 40px -20px rgba(88,42,70,.25); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mc-primary); box-shadow: 0 0 0 3px var(--ring); }
.profile-card .avatar { box-shadow: 0 6px 16px -8px rgba(0,0,0,.3); }
.brand strong { background: linear-gradient(120deg, var(--mc-primary), #b08427); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ------------------------------ فیلتر/کارت‌های جست‌وجو ---------------- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-block: 1.25rem; }
input, select, textarea {
  font-family: inherit; padding: .6rem .9rem; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: .95rem; width: 100%;
}
input:focus, select:focus { outline: 3px solid var(--ring); border-color: var(--mc-primary); }
.profile-card { display: flex; flex-direction: column; gap: .5rem; }
.avatar {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: #fff;
  font-weight: 900; font-size: 1.2rem;
  background: linear-gradient(135deg, hsl(var(--h, 335) 65% 52%), hsl(calc(var(--h, 335) + 40) 60% 42%));
}
.page-title { font-size: 1.8rem; font-weight: 900; margin-bottom: .5rem; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.big { font-size: 1.6rem; font-weight: 900; margin: .25rem 0; }

/* ------------------------------- پابرگ -------------------------------- */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 65%, transparent); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-block: 2.5rem; }
.footer-grid h3 { font-size: .95rem; margin-bottom: .5rem; }
.footer-grid a { display: block; color: var(--text-muted); padding-block: .2rem; font-size: .9rem; }
.footer-grid a:hover { color: var(--mc-primary); }
.legal-note { border-top: 1px solid var(--border); padding-block: 1.25rem; }

/* -------------------------------- صفحات -------------------------------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-block: 2rem; }
.cta { margin-block: 3rem; }
.cta-box { text-align: center; padding: 2.5rem; }
.auth-wrap { display: flex; justify-content: center; padding-block: 3rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 1rem; }
.auth-card p { margin-block: .75rem; }
.dashboard { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pagination { display: flex; gap: .4rem; justify-content: center; margin-block: 2rem; }
.pagination a { padding: .4rem .9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pagination a.active { background: var(--mc-primary); border-color: var(--mc-primary); color: #fff; }
.entry { margin-block: 1.25rem; overflow: hidden; }
.entry-thumb img { border-start-start-radius: var(--radius); border-start-end-radius: var(--radius); }
.entry-body { padding: 1rem 1.25rem; }
.entry-title { margin: .25rem 0; font-size: 1.3rem; }
.entry-title a { color: var(--text); }
.entry-title a:hover { color: var(--mc-primary); }

/* ------------------------------ صفحه اصلی ----------------------------- */
.hero-stats { display: flex; gap: 2rem; margin-top: 1.5rem; }
.hero-stats strong { display: block; font-size: 1.5rem; font-weight: 900; }
.hero-stats span { font-size: .8rem; color: var(--text-muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-block: 2rem 1rem; flex-wrap: wrap; }
.section-title { font-size: 1.5rem; font-weight: 900; margin: 0; }
.post-card { display: block; padding: 0; overflow: hidden; color: var(--text); }
.post-card:hover h3 { color: var(--mc-primary); }
.post-thumb img { width: 100%; height: 140px; object-fit: cover; display: block; }
.post-thumb { margin: 0; }
.post-body { padding: 1rem 1.25rem 1.25rem; }
.breadcrumb { display: flex; gap: .4rem; flex-wrap: wrap; margin-block: 1rem; }
.article-title { font-size: 1.7rem; font-weight: 900; margin: .25rem 0 .5rem; }
.article-body h2 { font-size: 1.3rem; font-weight: 800; margin-block: 1.5rem .5rem; }
.article-body ul { padding-inline-start: 1.5rem; }

/* ----------------------------- واکنش‌گرا ----------------------------- */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
}
