/* ۱. تنظیمات پایه و فونت سراسری */
html, body {
  direction: rtl;
  text-align: right;
  font-family: 'Vazirmatn', sans-serif !important;
  font-size: 17px; /* فونت پایه کل سایت درشت‌تر شد */
  line-height: 1.8;
  color: #333;
}

/* ۲. هدر و منو  */
.site-header { border-bottom: 1px solid #e8e8e8; padding: 15px 0; }
.site-title { float: right !important; font-size: 1.7rem !important; font-weight: 700 !important; }
.site-nav { float: left !important; }
.site-nav .page-link { color: #333 !important; margin-right: 20px; text-decoration: none; font-size: 1.1rem; }
.site-nav .menu-icon, .site-nav input { display: none !important; }

@media screen and (max-width: 600px) {
  .site-title { float: none !important; display: block; text-align: center; margin-bottom: 10px; }
  .site-nav { float: none !important; display: block; text-align: center; border-top: 1px solid #eee; border-bottom: 1px solid #eee; padding: 10px 0; position: static !important; }
  .site-nav .page-link { margin: 0 15px !important; display: inline-block !important; }
}

/* ۳. استایل پیشرفته صفحه بایگانی (all-posts.html) */
.archive-page {
  margin-top: 30px;
}

.year-section {
  margin-bottom: 40px;
  line-height:1.5;
  font-size:16px;
}

/* نوار رنگی کنار سال */
.year-title {
  font-size: 1.8rem !important; /* سال درشت و واضح */
  font-weight: 800 !important;
  color: #2a7ae2;
  border-right: 6px solid #2a7ae2; /* نوار عمودی ضخیم کنار سال */
  padding-right: 15px;
  margin-bottom: 20px;
  background-color: #f8f9fa; /* یک پس‌زمینه خیلی ملایم برای تمایز */
  display: block;
}

.post-list-archive {
  list-style: none !important;
  margin-right: 25px !important; /* تو رفتگی نسبت به سال */
  padding-right: 0 !important;
}

/* نوار رنگی کنار هر پست */
.post-list-archive li {
  padding: 10px 15px !important;
  margin-bottom: 10px;
  border-right: 3px solid #e8e8e8; /* نوار عمودی نازک‌تر کنار هر پست */
  transition: all 0.3s ease; /* انیمیشن نرم موقع نگه داشتن موس */
  display: flex;
  align-items: center;
}

/* تغییر رنگ نوار موقع رفتن موس روی پست */
.post-list-archive li:hover {
  border-right-color: #2a7ae2;
  background-color: #fcfcfc;
}

.archive-page .post-link {
  font-size: 1.15rem !important; /* فونت عناوین پست‌ها */
  font-weight: 500 !important;
  color: #333 !important;
  text-decoration: none;
}

.archive-page .post-link:hover {
  color: #2a7ae2 !important;
}

.archive-page .post-date {
  font-size: 0.9rem !important;
  color: #999;
  min-width: 100px;
  margin-left: 20px; /* فاصله بین تاریخ و عنوان */
  font-family: 'Tahoma', sans-serif;
}

/* ۴. متن پست‌ها و تصاویر */
.post-content, .post-content p {
  text-align: justify !important;
  line-height: 1.9 !important;
  font-size: 1rem; 
}
.post-content h2, .post-title {
	font-size: 1.5rem;
	font-weight:500 !important;
	letter-spacing: -1px;
}

.post-content img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 30px auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

/* ۵. ریسپانسیو کردن بایگانی در موبایل */
@media screen and (max-width: 600px) {
  .post-list-archive {
    margin-right: 15px !important;
  }
  .post-list-archive li {
    flex-direction: column;
    align-items: flex-start;
  }
  .archive-page .post-date {
    margin-left: 0;
    margin-bottom: 5px;
  }
}

/* contact form - نسخه بهینه و ایمن برای موبایل */

.contact-form {
  max-width: 600px;
  /* عرض را ۹۲ درصد گذاشتیم تا در موبایل از هر طرف کمی فاصله داشته باشد */
  width: 92%; 
  margin: 40px auto;
  direction: rtl;
}

.contact-form input,
.contact-form textarea {
  /* عرض ۱۰۰ درصدِ نسبت به والد (که خودش ۹۲ درصد است) */
  width: 100%;
  padding: 12px; /* کمی پدینگ بیشتر برای راحتی تایپ در موبایل */
  margin-bottom: 15px;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px; /* گوشه‌های کمی نرم‌تر */
  text-align: right;
  /* رعایت محاسبات عرض داخلی */
  box-sizing: border-box; 
  /* حذف استایل‌های پیش‌فرض موبایل که گاهی باعث باگ می‌شوند */
  -webkit-appearance: none;
}

.contact-form textarea {
  line-height: 1.8;
  min-height: 150px;
  max-width: 100%;
  resize: vertical; /* فقط اجازه تغییر ارتفاع به کاربر می‌دهد تا عرض به هم نخورد */
}

.contact-form button {
  background: #2a7ae2;
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 500;
  /* در موبایل عرض دکمه را کامل می‌کنیم تا راحت‌تر لمس شود */
  width: 100%; 
  box-sizing: border-box;
}

/* در دسکتاپ (صفحات بزرگتر از 600 پیکسل) دکمه دوباره به حالت کوچک برگردد */
@media screen and (min-width: 601px) {
  .contact-form button {
    width: auto;
  }
}

.contact-form button:hover {
  background: #1c5ec0;
}

.hidden-field {
  display: none;
}

/* ---------- navigation menu ---------- */

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

/* ---------- search box ---------- */

#search-wrapper {
  display: none;
  text-align: center;
  margin-bottom: 20px;
  animation: fadeIn 0.3s;
  direction: rtl;
}

#search-input {
  width: 80%;
  padding: 10px;
  border-radius: 25px;
  border: 1px solid #ddd;
  outline: none;
  font-family: 'Vazirmatn';
}

#results-container {
  list-style: none;
  padding: 0;
  max-width: 80%;
  margin: 10px auto;
  text-align: right;
}

#results-container li {
  margin-bottom: 5px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

/* ---------- icons ---------- */

.page-link svg,
#search-toggle svg {
  color: #555;
  transition: color 0.3s;
  vertical-align: middle;
}

.page-link:hover svg,
#search-toggle:hover svg {
  color: #2a7ae2;
}

/* ---------- animation ---------- */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
