/* --- Blog List --- */
.container.blog-list {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 80px;
}

.page-title {
  font-size: 22px;
  margin: 12px 0 16px;
}

.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.blog-cats .cat {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--card-bg, #121212);
  color: var(--text, #eee);
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  font-size: 13px;
}
.blog-cats .cat.active {
  background: #fdd900;
  color: #111;
  border-color: #fdd900;
}

/* Grid of cards */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

/* 1/3 width on desktop, 1/2 on tablet, 1/1 on mobile */
.post-card {
  grid-column: span 4;
  background: var(--card-bg, #0f0f0f);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,0.25);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(253, 217, 0, 0.35);
  box-shadow: 0 10px 26px rgba(0,0,0,0.30);
}

/* Thumb with fixed 16:9 */
.post-thumb {
  position: relative;
  display: block;
  background: #1a1a1a;
}
.post-thumb::before {
  content: "";
  display: block;
  aspect-ratio: 16 / 9;
  width: 100%;
}
.post-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Texts */
.post-title {
  font-size: 18px;
  line-height: 1.5;
  margin: 12px 14px 6px;
  font-weight: 700;
}
.post-title a {
  color: var(--text, #fff);
  text-decoration: none;
}
.post-title a:hover {
  text-decoration: underline;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a7a7a7;
  font-size: 12.5px;
  margin: 0 14px 6px;
}
.post-meta .dot { opacity: .6; }

.post-excerpt {
  margin: 0 14px 12px;
  color: #cfcfcf;
  font-size: 14px;
  line-height: 1.8;
}

/* Actions */
.post-actions {
  display: flex;
  justify-content: flex-start;
  padding: 0 14px 14px;
  margin-top: auto;
}
.btn-more {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fdd900;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid #fdd900;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-more:hover { transform: translateY(-1px); }

/* Pagination */
.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}
.page-btn {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--text, #eee);
  text-decoration: none;
}
.page-info { color: #a7a7a7; }

/* Responsive */
@media (max-width: 1024px) {
  .post-card { grid-column: span 6; }
}
@media (max-width: 640px) {
  .post-card { grid-column: span 12; }
}


/* ========== Blog Detail ========== */
.container.blog-detail{
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.post-header{
  margin-bottom: 18px;
}
.post-header .page-title{
  font-size: clamp(20px, 2.6vw, 34px);
  line-height: 1.35;
  margin: 0 0 8px;
}
.post-header .muted{
  color: #7a7d85;
  font-size: 13px;
}

/* کاور */
.post-hero{
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin-top: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.06);
  object-fit: cover;
}

/* بدنه مطلب */
.post-body{
  color: var(--fg, #222);
  line-height: 1.9;
  font-size: clamp(15px, 1.9vw, 18px);
  word-break: break-word;
}
.post-body p{ margin: 0 0 1em; }
.post-body h2{
  font-size: clamp(18px, 2.2vw, 26px);
  margin: 1.2em 0 .6em;
}
.post-body h3{
  font-size: clamp(16px, 2vw, 22px);
  margin: 1.1em 0 .5em;
}

/* تصاویر داخل متن */
.post-body img{
  max-width: 100%;
  height: auto !important;
  border-radius: 10px;
  display: block;
  margin: 14px auto;
}

/* نقل قول */
.post-body blockquote{
  border-right: 3px solid #f0d400;
  padding: 10px 14px;
  margin: 16px 0;
  background: #fffbed;
  border-radius: 8px;
}

/* کد */
.post-body pre{
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 10px;
  overflow: auto;
  direction: ltr;
  margin: 14px 0;
}
.post-body code{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* جدولِ اسکرول‌پذیر در موبایل */
.post-body .table-scroll{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.post-body table{
  width: 100%;
  border-collapse: collapse;
  min-width: 520px; /* تا موبایل اسکرول بخورد */
}
.post-body th, .post-body td{
  border-bottom: 1px solid #ececec;
  padding: 10px 8px;
  text-align: right;
}

/* ویدیو/iframe ریسپانسیو (یوتیوب و …) */
.embed{
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin: 14px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.embed > iframe{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* related posts */
.related-posts{
  margin-top: 28px;
}
.related-posts .h6{
  font-size: 14px; color: #7a7d85; margin: 0 0 10px;
}
.related-posts .rel-list{
  list-style: none; padding: 0; margin: 0;
}
.related-posts .rel-list li{
  margin: 6px 0; font-size: 14px;
}
.related-posts .rel-date{ color:#9aa0a6; font-size: 12px; }

/* جداساز */
.sep{
  border: 0; height: 1px; background: #eee; margin: 24px 0;
}

/* حالت تیره (اگر تم تیره داری) */
@media (prefers-color-scheme: dark){
  .post-body pre{ background:#0b1020; color:#e6edf3; }
  .post-body blockquote{ background:#1a1b1f; border-right-color:#e0c900; }
  .post-body table{ border-color:#2a2b31; }
  .related-posts .h6{ color:#a8b0b9; }
  .post-header .muted{ color:#9aa0a6; }
}


.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(320px,1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.post-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: transform .2s ease;
}
.post-card:hover {
  transform: translateY(-5px);
}

.post-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.post-body {
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0 0 .5rem;
}
.post-title a {
  color: #111;
  text-decoration: none;
}
.post-title a:hover {
  color: #fdd900;
}

.post-meta {
  font-size: .85rem;
  color: #777;
  margin-bottom: .75rem;
}

.post-summary {
  flex: 1;
  font-size: .9rem;
  line-height: 1.6;
  color: #444;
  margin-bottom: 1rem;
}

.btn-more {
  align-self: flex-start;
  padding: .5rem 1rem;
  background: #fdd900;
  color: #111;
  border-radius: .5rem;
  text-decoration: none;
  font-weight: bold;
  transition: background .2s;
}
.btn-more:hover {
  background: #ffce00;
}
