/* =========================================================
   قالب وبلاگ شخصی مینیمال فارسی
   فونت: Vazirmatn | جهت: RTL
   ========================================================= */

:root{
  --bg: #fafafa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-muted: #777777;
  --link: #0d6efd;
  --border: #e5e5e5;

  /* رنگ‌های دسته‌بندی (استفاده در نوار کناری کارت‌ها) */
  --cat-aspnet: #6f42c1;
  --cat-linux: #dc6803;
  --cat-hosting: #0d9488;
  --cat-windows: #0d6efd;
  --cat-default: #999999;

  --radius: 10px;
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.04);
  --transition: all .18s ease;
}

/* ============ حالت شب ============ */
html[data-theme="dark"]{
  --bg: #14171a;
  --card-bg: #1d2125;
  --text: #e7e7e7;
  --text-muted: #9a9fa5;
  --link: #4dabf7;
  --border: #2b2f34;
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.25);
}

html[data-theme="dark"] body{ color-scheme: dark; }
html[data-theme="dark"] .about-hero img,
html[data-theme="dark"] .about-widget img{ border-color: var(--card-bg); }
html[data-theme="dark"] .form-control{
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}
html[data-theme="dark"] .form-control::placeholder{ color: var(--text-muted); }
html[data-theme="dark"] .form-control:focus{ background: var(--card-bg); color: var(--text); }
html[data-theme="dark"] .post-content code{
  background: #262b30;
  color: #e7e7e7;
}
html[data-theme="dark"] .pagination .page-link{ background: var(--card-bg); }
html[data-theme="dark"] .archive-list .count,
html[data-theme="dark"] .archive-month .badge-count{ background: #14171a; }

body{
  transition: background-color .2s ease, color .2s ease;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  font-family: vazir, "Bootstrap Icons", Tahoma, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.9;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a{
  color: var(--link);
  text-decoration: none;
  transition: var(--transition);
}
a:hover{ opacity: .75; }

::selection{ background: #cfe2ff; }

/* فوکوس قابل مشاهده برای دسترسی‌پذیری */
a:focus-visible,
button:focus-visible,
input:focus-visible{
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* ============ هدر ============ */
.site-header{
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-logo{
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -.3px;
}
.site-logo span{ color: var(--link); }
.site-logo:hover{ opacity: 1; color: var(--text); }

.main-nav .nav-link{
  color: var(--text);
  font-weight: 500;
  font-size: .95rem;
  padding: .5rem .9rem;
  border-radius: 6px;
}
.main-nav .nav-link:hover,
.main-nav .nav-link.active{
  color: var(--link);
  background: rgba(13,110,253,0.06);
}

.header-search-form{
  position: relative;
}
.header-search-form input{
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .4rem 2.2rem .4rem 1rem;
  font-size: .88rem;
  background: var(--bg);
  width: 190px;
  transition: var(--transition);
}
.header-search-form input:focus{
  width: 230px;
  background: #fff;
}
.header-search-form button{
  position: absolute;
  left: .55rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0;
  line-height: 0;
}

/* ============ مسیر صفحه (Breadcrumb) ============ */
.page-heading{
  padding: 2.2rem 0 1.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.page-heading h1{
  font-weight: 800;
  font-size: 1.7rem;
  margin: 0 0 .3rem;
}
.page-heading p{
  color: var(--text-muted);
  margin: 0;
  font-size: .95rem;
}

/* ============ eyebrow دسته‌بندی ============ */
.post-category{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--link);
  text-transform: none;
  margin-bottom: .55rem;
}
.post-category::before{
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ============ کارت مطلب ============ */
.post-card{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-inline-end: 3px solid var(--cat-default);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}
.post-card:hover{
  border-color: #dcdcdc;
  border-inline-end-color: inherit;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.post-card.cat-aspnet{ --cat-color: var(--cat-aspnet); }
.post-card.cat-linux{ --cat-color: var(--cat-linux); }
.post-card.cat-hosting{ --cat-color: var(--cat-hosting); }
.post-card.cat-windows{ --cat-color: var(--cat-windows); }
.post-card{ border-inline-end-color: var(--cat-color, var(--cat-default)); }
.post-card .post-category{ color: var(--cat-color, var(--link)); }

.post-card h2{
  font-size: 1.28rem;
  font-weight: 700;
  margin-bottom: .5rem;
  line-height: 1.6;
}
.post-card h2 a{ color: var(--text); }
.post-card h2 a:hover{ color: var(--link); opacity: 1; }

.post-meta{
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .85rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.post-meta i{ font-size: .9rem; }
.post-meta .dot{ color: var(--border); }

.post-excerpt{
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: .9rem;
}

.read-more{
  font-weight: 600;
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.read-more i{ transition: var(--transition); font-size: .8rem; }
.read-more:hover i{ transform: translateX(-3px); }

/* ============ صفحه‌بندی ============ */
.pagination{
  gap: .35rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.pagination .page-link{
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card-bg);
  border-radius: 8px;
  font-size: .88rem;
  min-width: 38px;
  text-align: center;
}
.pagination .page-item.active .page-link{
  background: var(--link);
  border-color: var(--link);
  color: #fff;
}
.pagination .page-item.disabled .page-link{
  color: #bbb;
  background: transparent;
}

/* ============ سایدبار ============ */
.widget{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1.4rem;
}
.widget-title{
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
}

.about-widget{ text-align: center; }
.about-widget img{
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: .9rem;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}
.about-widget h3{
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .35rem;
}
.about-widget p{
  color: var(--text-muted);
  font-size: .88rem;
  margin-bottom: 0;
}

.sidebar-search input{
  border: 1px solid var(--border);
  border-radius: 0px 8px 8px 0px;
  font-size: .9rem;
}
.sidebar-search button{
  border-radius: 8px 0px 0px 8px;
  background: var(--link);
  border-color: var(--link);
}

.latest-list{ list-style: none; margin: 0; padding: 0; }
.latest-list li{
  padding: .65rem 0;
  border-bottom: 1px dashed var(--border);
}
.latest-list li:last-child{ border-bottom: none; padding-bottom: 0; }
.latest-list li:first-child{ padding-top: 0; }
.latest-list a{
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  display: block;
  margin-bottom: .2rem;
}
.latest-list a:hover{ color: var(--link); opacity: 1; }
.latest-list .latest-date{
  font-size: .76rem;
  color: var(--text-muted);
}

.archive-list{ list-style: none; margin: 0; padding: 0; }
.archive-list li{
  display: flex;
  justify-content: space-between;
  padding: .55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .9rem;
}
.archive-list li:last-child{ border-bottom: none; }
.archive-list a{ color: var(--text); }
.archive-list a:hover{ color: var(--link); opacity: 1; }
.archive-list .count{
  color: var(--text-muted);
  font-size: .8rem;
  background: var(--bg);
  border-radius: 999px;
  padding: .05rem .6rem;
}

.category-badges{ display: flex; flex-wrap: wrap; gap: .5rem; }
.category-badges a{
  font-size: .82rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem .85rem;
}
.category-badges a:hover{
  border-color: var(--link);
  color: var(--link);
  opacity: 1;
}

.tag-cloud{ display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-cloud a{
  font-size: .8rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .28rem .7rem;
}
.tag-cloud a:hover{
  border-color: var(--link);
  color: var(--link);
  opacity: 1;
}

/* ============ صفحه مطلب ============ */
.post-hero-image{
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 1.8rem;
  border: 1px solid var(--border);
  object-fit: cover;
  max-height: 420px;
}
.post-title{
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.55;
  margin-bottom: 1rem;
}
.post-content{
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 2.05;
  color: var(--text);
}
.post-content h2{
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
}
.post-content h3{
  font-size: 1.18rem;
  font-weight: 700;
  margin: 1.6rem 0 .8rem;
}
.post-content p{ margin-bottom: 1.4rem; }
.post-content ul, .post-content ol{ margin-bottom: 1.4rem; padding-inline-start: 1.4rem; }
.post-content blockquote{
  border-inline-start: 3px solid var(--link);
  background: var(--card-bg);
  padding: 1rem 1.3rem;
  margin: 1.6rem 0;
  color: var(--text-muted);
  border-radius: 0 8px 8px 0;
  font-size: .98rem;
}
.post-content code{
  background: #f1f1f1;
  padding: .15rem .4rem;
  border-radius: 5px;
  font-size: .88em;
  direction: ltr;
  display: inline-block;
}
.post-content pre{
  background: #2b2b2b;
  color: #f1f1f1;
  padding: 1.1rem 1.3rem;
  border-radius: 8px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  margin-bottom: 1.4rem;
  font-size: .88rem;
}
.post-content pre code{ background: none; padding: 0; }
.post-content img{ max-width: 100%; border-radius: 8px; margin: 1rem 0; }

.post-tags-share{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
  margin: 1.6rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.share-icons a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  margin-inline-start: .4rem;
}
.share-icons a:hover{
  border-color: var(--link);
  color: var(--link);
  opacity: 1;
}

.related-posts h3{
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
}

/* ============ نظرات ============ */
.comments-section{
  margin-top: 2.4rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
}
.comments-heading{
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.4rem;
}
.comments-heading .comments-count{
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1rem;
}

.comment-list{
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}
.comment-item{
  display: flex;
  gap: .9rem;
  padding: 1.2rem 0;
  border-bottom: 1px dashed var(--border);
}
.comment-item:first-child{ padding-top: 0; }
.comment-item.is-new{
  animation: commentIn .35s ease;
}
@keyframes commentIn{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: translateY(0); }
}

.comment-avatar{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-avatar.placeholder{
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--link);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
}

.comment-body{ flex: 1; min-width: 0; }
.comment-head{
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: .35rem;
  flex-wrap: wrap;
}
.comment-name{
  font-weight: 700;
  font-size: .93rem;
  color: var(--text);
}
.comment-date{
  font-size: .78rem;
  color: var(--text-muted);
}
.comment-text{
  font-size: .93rem;
  color: var(--text);
  margin: 0;
  line-height: 1.85;
}

.comment-form-wrap{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.comment-form-title{
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
}
.comment-form label{
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: .35rem;
}
.comment-form .form-control{
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .92rem;
}
.comment-form .form-control:focus{
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.08);
}

/* ============ صفحه جستجو ============ */
.search-summary{
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  font-size: .95rem;
}
.search-summary strong{ color: var(--text); }

/* ============ صفحه آرشیو ============ */
.archive-year{
  font-size: 1.3rem;
  font-weight: 800;
  margin: 1.8rem 0 .8rem;
  color: var(--link);
}
.archive-year:first-child{ margin-top: 0; }
.archive-month-group{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: .5rem;
}
.archive-month{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1.3rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.archive-month:last-child{ border-bottom: none; }
.archive-month a{ color: var(--text); }
.archive-month a:hover{ color: var(--link); opacity: 1; }
.archive-month .badge-count{
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  padding: .25rem .75rem;
}

/* ============ صفحه درباره من ============ */
.about-hero{
  text-align: center;
  padding: 2rem 0 3rem;
}
.about-hero img{
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.3rem;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.about-hero h1{ font-weight: 800; font-size: 1.7rem; margin-bottom: .4rem; }
.about-hero p.role{ color: var(--text-muted); }
.skill-badges{ display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; margin-top: 1rem; }
.skill-badges span{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .4rem 1rem;
  font-size: .87rem;
}
.social-links{ display: flex; justify-content: center; gap: .6rem; margin-top: 1.3rem; }
.social-links a{
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.social-links a:hover{ border-color: var(--link); color: var(--link); opacity: 1; }

/* ============ فرم تماس ============ */
.contact-form label{ font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.contact-form .form-control{
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem .9rem;
  font-size: .93rem;
}
.contact-form .form-control:focus{
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.08);
}
.contact-info-item{
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  margin-bottom: 1.3rem;
}
.contact-info-item i{
  width: 38px; height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--link);
}
.contact-info-item h4{ font-size: .95rem; font-weight: 700; margin-bottom: .15rem; }
.contact-info-item p{ font-size: .87rem; color: var(--text-muted); margin: 0; }

/* ============ فوتر ============ */
.site-footer{
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3.5rem;
  font-size: .88rem;
  color: var(--text-muted);
}
.site-footer a{ color: var(--text-muted); }
.site-footer a:hover{ color: var(--link); opacity: 1; }
.footer-social{ display: flex; gap: .5rem; }
.footer-social a{
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.footer-social a:hover{ border-color: var(--link); color: var(--link); opacity: 1; }

/* ============ ریسپانسیو ============ */
@media (max-width: 991.98px){
  .header-search-form{ display: none; }
  .post-title{ font-size: 1.55rem; }
}

@media (max-width: 767.98px){
  .page-heading h1{ font-size: 1.4rem; }
  .post-card{ padding: 1.2rem 1.3rem; }
}

/* کاهش انیمیشن برای کاربرانی که ترجیح می‌دهند */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
}

/* ============ دکمه شناور تغییر حالت روز/شب ============ */
.theme-toggle{
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  z-index: 1000;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover{
  border-color: var(--link);
  color: var(--link);
  transform: translateY(-2px);
}
.theme-toggle i{ pointer-events: none; }

@media (max-width: 575.98px){
  .theme-toggle{
    width: 44px;
    height: 44px;
    bottom: 16px;
    inset-inline-end: 16px;
    font-size: 1.05rem;
  }
}
