:root {
  --primary: #DC2626;
  --primary-dark: #B91C1C;
  --background: #FFFFFF;
  --surface: #F8F9FA;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: "Vazirmatn", system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.9;
}

a { color: inherit; text-decoration: none; transition: color .2s ease, transform .2s ease, border-color .2s ease, background .2s ease; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  border-radius: 10px;
}

.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  border-radius: 10px;
}

.form-control, .form-select {
  border-color: var(--border);
  border-radius: 10px;
  padding: .75rem .9rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .12);
}

.site-header {
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.navbar { min-height: 76px; }
.navbar-brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); }
.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(220, 38, 38, .25);
}
.nav-link { font-weight: 600; color: var(--text); }
.nav-link:hover, .dropdown-item:hover { color: var(--primary); }

.hero-section { padding: 32px 0 24px; background: linear-gradient(180deg, #fff 0%, var(--surface) 100%); }
.hero-card, .post-card, .sidebar-widget, .admin-panel, .stat-card, .login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-card { min-height: 420px; }
.hero-image { width: 100%; height: 100%; min-height: 300px; object-fit: cover; background: var(--surface); }
.hero-content { padding: clamp(1.4rem, 4vw, 3.5rem); height: 100%; display: flex; flex-direction: column; justify-content: center; }
.hero-content h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 800; line-height: 1.45; margin: 1rem 0; }
.hero-content p { color: var(--muted); font-size: 1.08rem; }

.category-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: .35rem .75rem;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(220,38,38,.08);
  font-weight: 700;
  font-size: .9rem;
}
.category-pill.small { font-size: .78rem; padding: .25rem .6rem; }

.post-meta { display: flex; flex-wrap: wrap; gap: .8rem; color: var(--muted); font-size: .9rem; }
.content-section { padding: 56px 0; }
.section-heading { margin-bottom: 1.25rem; }
.section-heading span, .archive-header span { color: var(--primary); font-weight: 800; }
.section-heading h2, .archive-header h1 { font-weight: 800; margin-top: .35rem; }

.post-card { transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 22px 55px rgba(31, 41, 55, .12); }
.post-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--surface); }
.post-card-body { padding: 1.15rem; }
.post-card h3 { font-size: 1.18rem; font-weight: 800; line-height: 1.65; margin: .75rem 0; }
.post-card p { color: var(--muted); margin-bottom: 1rem; }
.post-card.compact h3 { font-size: 1rem; margin-bottom: 0; }

.sidebar-stack { display: grid; gap: 1rem; position: sticky; top: 92px; }
.sidebar-widget { padding: 1.25rem; }
.sidebar-widget h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 1rem; }
.search-form, .archive-search { display: flex; gap: .5rem; }
.list-links, .recent-list, .footer-links { list-style: none; padding: 0; margin: 0; }
.list-links a { display: flex; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.list-links strong { color: var(--primary); }
.recent-list li { padding: .7rem 0; border-bottom: 1px solid var(--border); }
.recent-list a { display: block; font-weight: 700; line-height: 1.6; }
.recent-list span { color: var(--muted); font-size: .85rem; }

.archive-header { padding: 48px 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); }
.archive-search { max-width: 640px; margin: 1.2rem 0; }
.single-post { padding: 44px 0; }
.post-header { margin-bottom: 1.5rem; }
.post-header h1 { font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.5; font-weight: 800; margin: 1rem 0; }
.single-featured { width: 100%; border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--border); }
.article-content {
  margin-top: 2rem;
  font-size: 1.08rem;
  color: #263244;
}
.article-content p { margin-bottom: 1.3rem; }
.article-content h2, .article-content h3 { font-weight: 800; margin: 2rem 0 1rem; }
.share-box {
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  background: var(--surface);
}
.share-box a, .copy-link {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: .35rem .8rem;
  color: var(--text);
}
.copy-link { font-family: inherit; cursor: pointer; }
.related-posts { margin-top: 2rem; }
.related-posts h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }

.footer-cta { padding: 42px 0; background: var(--primary); color: #fff; }
.footer-cta h2 { font-weight: 800; }
.footer-cta p { margin: 0; color: rgba(255,255,255,.82); }
.site-footer { padding: 42px 0 18px; background: #111827; color: #fff; }
.site-footer h3, .site-footer h4 { font-weight: 800; }
.site-footer p, .site-footer a { color: rgba(255,255,255,.72); }
.footer-links li { margin-bottom: .45rem; }
.social-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.social-links a { border: 1px solid rgba(255,255,255,.18); padding: .4rem .75rem; border-radius: 999px; }
.copyright { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1rem; color: rgba(255,255,255,.6); }

.pagination .page-link { color: var(--primary); border-radius: 10px; border-color: var(--border); }
.pagination .active .page-link { background: var(--primary); border-color: var(--primary); }

.admin-login-page { min-height: 100vh; background: var(--surface); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(430px, 100%); padding: 2rem; }
.login-card h1 { font-size: 1.45rem; font-weight: 800; text-align: center; margin-bottom: 1.4rem; }
.login-hint { color: var(--muted); font-size: .9rem; text-align: center; margin: 1rem 0 0; }
.admin-body { background: var(--surface); }
.admin-nav { background: #fff; border-bottom: 1px solid var(--border); padding: .85rem 0; position: sticky; top: 0; z-index: 10; }
.admin-links { display: flex; flex-wrap: wrap; gap: .8rem; }
.admin-links a { font-weight: 700; color: var(--muted); }
.admin-links a:hover { color: var(--primary); }
.admin-main { padding: 32px 12px 60px; }
.admin-title { margin-bottom: 1.5rem; }
.admin-title h1 { font-weight: 800; }
.admin-title p { color: var(--muted); margin-bottom: 0; }
.stat-card { padding: 1.4rem; }
.stat-card span { color: var(--muted); display: block; }
.stat-card strong { font-size: 2.4rem; color: var(--primary); }
.admin-panel { padding: 1.35rem; }
.admin-panel h2 { font-size: 1.25rem; font-weight: 800; }
.table-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.table-actions form { margin: 0; }
.content-editor { min-height: 360px; direction: rtl; }
.admin-preview { width: 220px; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 1rem; }

@media (max-width: 991.98px) {
  .sidebar-stack { position: static; }
  .hero-card { min-height: auto; }
  .navbar-collapse { padding-top: 1rem; }
}

@media (max-width: 575.98px) {
  .search-form, .archive-search { flex-direction: column; }
  .hero-section { padding-top: 18px; }
  .content-section { padding: 36px 0; }
  .admin-title { display: block !important; }
  .admin-title .btn { margin-top: 1rem; width: 100%; }
}
