/* blog.css - نسخهٔ نهایی 2025 با کارت‌های آیکون‌دار، فیلتر sticky و بهبودهای موبایل */
/* خانه ربات و وب — Shahbazion.ir */

/* ===== متغیرهای CSS ===== */
:root {
  --primary-color: #c9a84c;
  --primary-dark: #b4922f;
  --primary-light: #d4b76e;
  --secondary-color: #b4922f;
  --accent-color: #c9a84c;
  --accent-light: #d4b76e;
  --text-color: #2c2c2c;
  --text-light: #5c5c5c;
  --text-lighter: #8a8a8a;
  --bg-color: #fefcf9;
  --bg-light: #fdfaf5;
  --bg-lighter: #faf8f3;
  --card-color: #ffffff;
  --border-color: #e0dcd0;
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --box-shadow: 0 8px 30px rgba(201,168,76,0.08);
  --box-shadow-hover: 0 15px 40px rgba(201,168,76,0.15);
  --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --transition-fast: 0.2s ease;
  --font-family: 'B Nazanin', Tahoma, Arial, sans-serif;

  --header-bg: #fdfaf5;
  --footer-bg: #faf8f3;
  --footer-light: #f0ede0;
  --highlight-link: #c9a84c;
  --glass-light: rgba(255, 255, 255, 0.9);
  --glass-border-light: rgba(201,168,76,0.2);
  --glass-dark: rgba(0, 0, 0, 0.04);
  --glass-border-dark: rgba(201,168,76,0.15);
  --container-max: 1200px;

  --header-scrolled-height: 58px; /* ارتفاع هدر شناور (مرجع برای sticky filters) */
}

/* ===== بهبود اسکرول بار (طلایی) ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 10px;
  border: 2px solid var(--bg-light);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent-color));
}
::-webkit-scrollbar-corner {
  background: var(--bg-light);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--bg-light);
}

/* ===== تایپوگرافی ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-color);
  margin-bottom: 1.2rem;
}
h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  position: relative;
  padding-bottom: 0.5rem;
}
h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  border-radius: 2px;
}
h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}
p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  line-height: 1.8;
}
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-dark);
}

/* ===== دسترسی ===== */
.skip-link {
  position: absolute;
  top: -50px;
  right: 0;
  background: var(--primary-color);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  z-index: 9999;
  transition: var(--transition);
}
.skip-link:focus {
  top: 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.3);
  border-radius: calc(var(--border-radius) - 2px);
}

/* ===== نوار جستجوی مدرن ===== */
.search-bar {
  margin-bottom: 3rem;
}
.search-form {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-color);
  border-radius: 50px;
  padding: 5px;
  box-shadow: var(--box-shadow);
  border: 2px solid transparent;
  transition: var(--transition);
}
.search-form:focus-within {
  border-color: var(--primary-light);
  box-shadow: var(--box-shadow-hover);
}
.search-form input {
  flex: 1;
  padding: 16px 28px;
  border: none;
  background: transparent;
  font-size: 1rem;
  outline: none;
  color: var(--text-color);
}
.search-form input::placeholder {
  color: var(--text-lighter);
}
.search-form button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 16px 36px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-form button:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201,168,76,0.3);
}

/* ===== کانتینر اصلی ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 max(1.5rem, env(safe-area-inset-left));
  width: 100%;
}

/* ===== شمارنده مقالات ===== */
.posts-counter {
  margin: 2rem 0;
  text-align: center;
}
.counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(201,168,76,0.1);
  color: var(--text-color);
  padding: 14px 28px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1rem;
  border: 1px solid rgba(201,168,76,0.2);
}
.counter-icon {
  font-size: 1.3em;
  color: var(--primary-color);
}

/* ===== فیلتر دسته‌بندی‌ها (پایه و حالت sticky) ===== */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 3rem;
  padding: 20px;
  background: var(--bg-light);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow);
  transition: all 0.3s ease;
}

/* حالت چسبنده (با کلاس sticky که توسط JS اضافه می‌شود) */
.category-filters.sticky {
  position: fixed;
  top: var(--header-scrolled-height);
  left: 0;
  right: 0;
  z-index: 998;
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  padding: 10px 20px;
  justify-content: center;
}
body.dark-mode .category-filters.sticky {
  background: rgba(30,30,30,0.92);
  border-bottom-color: rgba(201,168,76,0.4);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card-color);
  border: 2px solid var(--border-color);
  color: var(--text-color);
  padding: 12px 28px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}
.filter-btn span {
  position: relative;
  z-index: 2;
  color: var(--text-color);
  transition: color 0.3s ease;
}
.filter-btn:hover {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--box-shadow);
  color: #fff;
}
.filter-btn:hover::before {
  opacity: 1;
}
.filter-btn:hover span {
  color: #fff;
}
.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 8px 20px rgba(201,168,76,0.3);
}
.filter-btn.active::before {
  opacity: 1;
}
.filter-btn.active span {
  color: #fff;
  font-weight: 700;
}
.filter-icon {
  font-size: 1.1em;
}
.post-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-right: 4px;
  color: inherit;
}

/* ===== گرید مقالات ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
  min-height: 400px;
}

/* ===== کارت مقاله (بازطراحی‌شده: آیکون + نوار طلایی) ===== */
.post-card {
  display: flex;
  align-items: stretch;
  background: var(--card-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(201,168,76,0.25), 0 4px 10px rgba(0,0,0,0.05);
  border-color: var(--primary-light);
}

/* نوار طلایی کناری (سمت راست کارت) */
.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
  transition: width 0.3s ease;
  z-index: 2;
}
.post-card:hover::before {
  width: 10px;
}

/* بخش آیکون (ایموجی بزرگ) */
.post-card-icon {
  flex: 0 0 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(201,168,76,0.02));
  border-left: 1px solid rgba(201,168,76,0.2);
  transition: background 0.3s ease;
}
.post-card:hover .post-card-icon {
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(201,168,76,0.05));
}
.card-emoji {
  font-size: 2.8rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}
.post-card:hover .card-emoji {
  transform: scale(1.15);
}

/* محتوای کارت */
.post-card-content {
  flex: 1;
  padding: 1.5rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.post-card-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  color: var(--text-color);
  position: static;
  padding-bottom: 0;
}
.post-card-content h2::after {
  display: none; /* حذف خط زیر عنوان داخل کارت */
}
.post-card-content .excerpt {
  color: #6b7280; /* روشن‌تر برای سلسله‌مراتب بهتر */
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: justify;
}
.post-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.8rem;
}
.post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,0.12);
  color: var(--text-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(201,168,76,0.2);
  transition: var(--transition);
}
.category-badge:hover {
  background: rgba(201,168,76,0.25);
  transform: translateY(-1px);
}
.post-meta-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-lighter);
}

/* نشان «جدید» (New Badge) */
.new-badge {
  display: inline-block;
  background: #c9a84c;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 12px;
  margin-right: 8px;
  font-weight: 600;
  vertical-align: middle;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
  100% { opacity: 0.9; transform: scale(1); }
}

/* ===== حالت خالی ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-light);
  border-radius: var(--border-radius-lg);
  margin: 3rem 0;
  box-shadow: var(--box-shadow);
}
.empty-state h2 {
  color: var(--text-color);
  margin-bottom: 1rem;
}
.empty-state p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 2rem;
}
.empty-state-content {
  max-width: 500px;
  margin: 0 auto;
}
.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
  color: var(--primary-color);
}
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-color);
  color: #fff;
  padding: 16px 32px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(201,168,76,0.2);
}
.cta-button:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(201,168,76,0.3);
}

/* ===== محتوای مقاله ===== */
.blog-post {
  background: var(--card-color);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--box-shadow);
  line-height: 1.8;
  color: var(--text-color);
  font-size: 1.05rem;
  margin: 2rem auto;
  max-width: 800px;
}
.blog-post h2, .blog-post h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.blog-post p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  text-align: justify;
}
.blog-post img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--card-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}
th, td {
  padding: 1rem;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
}
th {
  background: var(--bg-light);
  font-weight: 600;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 1rem 0 2rem;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  transition: var(--transition);
  padding: 10px 20px;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
}
.back-link:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateX(-5px);
}

/* ===== FAQ ===== */
.faq details.faq-item {
  margin-bottom: 1rem;
  border: none;
}
.faq details.faq-item > summary {
  cursor: pointer;
  background: var(--bg-light);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  box-shadow: var(--box-shadow);
  position: relative;
  font-weight: 600;
  list-style: none;
}
.faq details.faq-item > summary::-webkit-details-marker {
  display: none;
}
.faq details.faq-item > summary::after {
  content: '▸';
  position: absolute;
  left: 1.5rem;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: var(--primary-color);
}
.faq details.faq-item[open] > summary::after {
  transform: rotate(90deg);
}
.faq details.faq-item .faq-content {
  padding: 1.5rem;
  border-right: 4px solid var(--primary-color);
  background: var(--bg-light);
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  color: var(--text-light);
  animation: fadeIn 0.3s ease;
}

/* ===== بخش دیدگاه‌ها ===== */
.comments-section {
  margin-top: 3rem;
  background: var(--card-color);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow);
}
.comments-section form input,
.comments-section form textarea {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  background: var(--bg-light);
  color: var(--text-color);
  font-size: 1rem;
  transition: var(--transition);
}
.comments-section form input:focus,
.comments-section form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.comments-section form button {
  background: var(--primary-color);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}
.comments-section form button:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}
.comment-card {
  background: var(--bg-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.comment-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow);
}
.comment-admin {
  border: 2px solid var(--primary-color);
  background: rgba(201,168,76,0.05);
}
.comment-admin::before {
  content: "⚙️ پاسخ ادمین";
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}
.reply-btn, .reply-form button {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 20px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}
.reply-btn:hover, .reply-form button:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}

/* ===== مودال لاگین ===== */
#loginModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}
#loginModalContent {
  background: var(--card-color);
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}
#closeLogin {
  position: absolute;
  top: 1rem;
  left: 1rem;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-light);
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
#closeLogin:hover {
  background: var(--bg-light);
  color: var(--text-color);
}
#loginTabs {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--bg-light);
}
#loginTabs button {
  flex: 1;
  border: none;
  padding: 1rem;
  cursor: pointer;
  font-weight: 600;
  background: transparent;
  color: var(--text-color);
  transition: var(--transition);
}
#loginTabs button.active {
  background: var(--primary-color);
  color: #fff;
}
#loginModalContent input {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  background: var(--bg-light);
  color: var(--text-color);
  font-size: 1rem;
}

/* ===== آیکون‌های شناور ===== */
.floating-icons {
  position: fixed;
  bottom: 30px;
  left: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1000;
}
.icon-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.icon-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: var(--box-shadow-hover);
}
.icon-btn img {
  width: 28px;
  height: 28px;
}
.insta-btn { background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D); }
.whatsapp-btn { background: #25D366; }
.telegram-btn { background: #0088cc; }

/* ===== دکمه‌های شیشه‌ای (دارک مود) ===== */
.glass-admin-btn,
.dark-toggle-btn {
  position: fixed;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--box-shadow);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  right: 20px;
  bottom: 20px;
}
.glass-admin-btn:hover,
.dark-toggle-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: var(--box-shadow-hover);
  background: white;
}

/* ===== نوار پیشرفت خواندن ===== */
#reading-progress-wrap {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: transparent;
  z-index: 9999;
}
#reading-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0%;
  transition: width 0.3s ease;
}

/* ===== نوتفیکیشن ===== */
.filter-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary-color);
  color: #fff;
  padding: 15px 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-hover);
  font-weight: 600;
  z-index: 1000;
  transform: translateY(-20px);
  opacity: 0;
  transition: var(--transition);
  max-width: 300px;
}
.filter-notification.show {
  transform: translateY(0);
  opacity: 1;
}

/* ===== انیمیشن‌ها ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.post-card {
  animation: fadeIn 0.4s ease forwards;
}

/* ===== حالت تاریک ===== */
body.dark-mode {
  --bg-color: #2b2b2b;
  --bg-light: #1a1a2e;
  --bg-lighter: #252547;
  --card-color: #1a1a2e;
  --text-color: #e0d6c2;
  --text-light: #b0a590;
  --text-lighter: #8a8a8a;
  --border-color: #2d3748;
  --box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  --box-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.6);
}
body.dark-mode .glass-admin-btn {
  background: rgba(37, 37, 71, 0.9);
  border-color: rgba(201,168,76,0.3);
  color: var(--text-color);
}
body.dark-mode .glass-admin-btn:hover {
  background: rgba(50, 50, 80, 0.9);
}
body.dark-mode ::-webkit-scrollbar-track { background: var(--bg-light); }
body.dark-mode ::-webkit-scrollbar-thumb { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: linear-gradient(135deg, var(--primary-light), var(--secondary-color)); }
body.dark-mode .filter-btn { background: var(--bg-lighter); border-color: var(--border-color); }
body.dark-mode .filter-btn.active { border-color: var(--primary-color); }
body.dark-mode .filter-btn.active span { color: #fff; }
body.dark-mode .category-filters { background: linear-gradient(135deg, var(--bg-light), var(--bg-lighter)); }
body.dark-mode .category-filters.sticky { background: rgba(30,30,30,0.92); }
body.dark-mode table { background: var(--bg-light); }
body.dark-mode th { background: linear-gradient(135deg, var(--bg-lighter), var(--bg-light)); color: var(--text-color); }
body.dark-mode td { color: var(--text-light); }
body.dark-mode .post-card,
body.dark-mode .blog-post,
body.dark-mode .comments-section { background: var(--card-color); border-color: var(--border-color); }
body.dark-mode .search-form { background: var(--bg-lighter); }
body.dark-mode .search-form input { color: var(--text-color); }
body.dark-mode .comments-section form input,
body.dark-mode .comments-section form textarea,
body.dark-mode #loginModalContent input { background: var(--bg-lighter); color: var(--text-color); border-color: var(--border-color); }

/* ===== ریسپانسیو (موبایل و تبلت) ===== */
@media (max-width: 992px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  .post-card {
    flex-direction: column; /* آیکون بالا، محتوا پایین (مناسب موبایل) */
  }
  .post-card-icon {
    flex: 0 0 auto;
    width: 100%;
    height: 100px;
    border-left: none;
    border-bottom: 1px solid rgba(201,168,76,0.2);
    background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(201,168,76,0.02));
  }
  .card-emoji {
    font-size: 2.4rem;
  }
  .post-card-content {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  html { font-size: 14px; }

  .category-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 15px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .category-filters::-webkit-scrollbar { height: 4px; }
  .category-filters::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 2px; }
  .filter-btn { white-space: nowrap; }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .post-card {
    flex-direction: row; /* برگشت به حالت ردیفی برای خوانایی بهتر در موبایل؟ بستگی به فضا دارد. */
  }
  .post-card-icon {
    flex: 0 0 80px;
    height: auto;
    border-left: 1px solid rgba(201,168,76,0.2);
    border-bottom: none;
  }
  .card-emoji { font-size: 2rem; }

  .floating-icons { left: 20px; bottom: 20px; }
  .glass-admin-btn, .dark-toggle-btn { width: 50px; height: 50px; font-size: 1.2rem; }

  body, .container, .posts-grid, .blog-post { overflow-x: hidden; }
  .blog-post img, table { max-width: 100%; height: auto; }
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* بهبود فرم جستجو */
  .search-form { flex-direction: column; border-radius: var(--border-radius); padding: 10px; }
  .search-form input, .search-form button { width: 100%; border-radius: var(--border-radius); }
  .search-form button { margin-top: 10px; }
}

@media (max-width: 480px) {
  .post-card-icon { flex: 0 0 70px; }
  .card-emoji { font-size: 1.8rem; }
  .post-card-content h2 { font-size: 1.2rem; }
  .icon-btn { width: 50px; height: 50px; }
  .icon-btn img { width: 22px; height: 22px; }
  .glass-admin-btn, .dark-toggle-btn { width: 45px; height: 45px; font-size: 1.1rem; }
}

/* ===== کاهش انیمیشن ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ===== اعداد فارسی ===== */
.farsi-numbers {
  font-variant-numeric: proportional-nums;
  unicode-bidi: bidi-override;
  direction: rtl;
}

/* ===== صفحه جستجو ===== */
.search-results-header {
  text-align: center;
  margin: 2rem 0 3rem;
  padding: 2rem;
  background: var(--bg-light);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow);
}
.search-results-header h2 { color: var(--text-color); margin-bottom: 1rem; }
.search-message { font-size: 1.1rem; color: var(--primary-color); font-weight: 600; margin-bottom: 1.5rem; }
.results-count {
  background: rgba(201,168,76,0.1);
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
  display: inline-block;
}
.search-suggestions {
  text-align: right;
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(201,168,76,0.05);
  border-radius: var(--border-radius);
  border-right: 4px solid var(--primary-color);
}
.search-suggestions p { font-weight: 600; margin-bottom: 1rem; }
.search-suggestions ul { list-style: none; padding: 0; margin: 0; }
.search-suggestions li { padding: 0.75rem 0; border-bottom: 1px solid rgba(201,168,76,0.1); }
.search-suggestions li:last-child { border-bottom: none; }
.search-suggestions a { color: var(--primary-color); text-decoration: none; font-weight: 600; }

/* جلوگیری از zoom در iOS */
@media screen and (max-width: 768px) {
  input, select, textarea { font-size: 16px; }
}