/* ============================================
   گرید مقالات — سبک کار
   assets/posts-grid.css
   ============================================ */

*, *::before, *::after { box-sizing: border-box; }

.skk-grid {
  display: grid;
  gap: 20px;
  direction: rtl;
}

/* ── کارت ─────────────────────────────────── */
.skk-post-card {
  background: #fff;
  border: 1px solid #e8e8f5;
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}
.skk-hover-shadow .skk-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(108,92,231,0.13);
}

/* ── تصویر ────────────────────────────────── */
.skk-card-img-wrap {
  display: block;
  position: relative;
  text-decoration: none;
  overflow: hidden;
  /* مهم: باید contain باشه تا overlay داخلش بمونه */
  contain: layout;
}
.skk-card-img {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f0f0fa;
  /* نسبت تصویر با padding-bottom تنظیم می‌شه */
  display: block;
}
.skk-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.skk-post-card:hover .skk-card-img img {
  transform: scale(1.04);
}
.skk-no-img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #f0f0fa, #e8e8f5);
}

/* ── بج تاریخ ─────────────────────────────── */
.skk-date-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
  line-height: 1.3;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  min-width: 42px;
}
.skk-date-day {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #1a1a2e;
}
.skk-date-month {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #6c5ce7;
  margin-top: 1px;
}

/* ── نوار اطلاعات ─────────────────────────── */
.skk-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #1dbfbf;
  flex-wrap: wrap;
}
.skk-meta-cats {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.skk-cat-icon {
  font-size: 13px;
  flex-shrink: 0;
}
.skk-meta-cat {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.skk-meta-cat:hover { text-decoration: underline; }

.skk-meta-author-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.skk-author-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  object-fit: cover;
  flex-shrink: 0;
}
.skk-meta-author {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.skk-meta-author:hover { text-decoration: underline; }

/* ── بدنه کارت ────────────────────────────── */
.skk-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.skk-post-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  margin: 0 0 8px;
}
.skk-post-title a {
  color: #1a1a2e;
  text-decoration: none;
  transition: color .2s;
}
.skk-post-title a:hover { color: #6c5ce7; }

.skk-post-excerpt {
  font-size: 13px;
  color: #6b6b8a;
  line-height: 1.7;
  margin: 0 0 12px;
  flex: 1;
}

/* ── دکمه بیشتر بخوانید ───────────────────── */
.skk-read-more {
  display: inline-block;
  background: #6c5ce7;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: auto;
  align-self: flex-start;
  transition: opacity .2s;
}
.skk-read-more:hover { opacity: .85; color: #fff; }

/* ── حالت overlay: نوار روی تصویر ───────────── */
.skk-meta-overlay .skk-card-img-wrap {
  position: relative;
  display: block;
  overflow: hidden;
}
/* نوار داخل card-img-wrap با position absolute */
.skk-meta-overlay .skk-card-img-wrap .skk-meta-bar {
  position: absolute;
  bottom: 0;
  z-index: 2;
  /* وسط‌چین پیش‌فرض — با left/right:auto و margin:auto */
  left: 50%;
  transform: translateX(-50%);
  /* اگه عرض از المنتور نیاد، پیش‌فرض ۱۰۰٪ */
  min-width: 0;
}
/* در حالت عادی */
.skk-post-card:not(.skk-meta-overlay) .skk-meta-bar {
  position: static;
  transform: none;
  left: auto;
}

/* ── پیام خالی ────────────────────────────── */
.skk-grid-empty {
  padding: 40px;
  text-align: center;
  color: #9191b0;
  font-size: 14px;
  background: #f4f4fb;
  border-radius: 14px;
}
