/* ============================================================
   BarqNews Pro — 07 — Post Cards (Grid / Row / Column / Overlay)
   ============================================================ */

/* ---------- بطاقة أساسية ---------- */
.post {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--glob-border-radius);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
}

.post:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.post-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--light-bg);
  flex-shrink: 0;
}
.post-thumb img,
.post-thumb .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.post:hover .post-thumb img,
.post:hover .post-thumb .placeholder {
  transform: scale(1.05);
}

/* placeholder للصورة */
.post-thumb .placeholder {
  background:
    repeating-linear-gradient(135deg,
      rgba(0,0,0,0.04) 0 8px,
      rgba(0,0,0,0) 8px 18px),
    linear-gradient(135deg, var(--light-bg), var(--bg-color));
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ---------- التصنيف على الصورة ---------- */
.post-category {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--site-color);
  color: white;
  padding: 4px 11px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  z-index: 2;
  letter-spacing: 0.2px;
}
.ltr .post-category { right: auto; left: 12px; }

.post-category.breaking { background: var(--breaking-color); }

/* ---------- محتوى البطاقة ---------- */
.post-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.post-title h3,
.post-title {
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}
.post-link { text-decoration: none; color: inherit; display: block; }
.post-link:hover .post-title h3 { color: var(--site-color); }

.post-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.post-content .post-meta {
  margin-top: auto;
  padding-top: 8px;
}

/* ============================================================
   نمط Grid (افتراضي)
   ============================================================ */
.posts-loop.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--post-width, 280px), 1fr));
  gap: var(--post-gap);
}

/* ============================================================
   نمط Row (صورة جانبية)
   ============================================================ */
.posts-loop.style-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.posts-loop.style-row .post {
  flex-direction: row;
  align-items: stretch;
  min-height: 100px;
}
.posts-loop.style-row .post:hover { transform: none; }
.posts-loop.style-row .post-thumb {
  width: 140px;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
}
.posts-loop.style-row .post-content {
  padding: 12px 14px;
  gap: 6px;
}
.posts-loop.style-row .post-title h3 {
  font-size: 14.5px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.posts-loop.style-row .post-excerpt { display: none; }

/* ============================================================
   نمط Column (بطاقة عمودية أطول)
   ============================================================ */
.posts-loop.style-column {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--post-column-width, 250px), 1fr));
  gap: var(--post-gap);
}
.posts-loop.style-column .post-thumb {
  aspect-ratio: 3 / 4;
}

/* ============================================================
   نمط Overlay (نص فوق الصورة)
   ============================================================ */
.posts-loop.style-overlay {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--post-gap);
}
.posts-loop.style-overlay .post {
  background: transparent;
  border: none;
  aspect-ratio: 3 / 2;
}
.posts-loop.style-overlay .post-thumb {
  aspect-ratio: auto;
  position: absolute;
  inset: 0;
}
.posts-loop.style-overlay .post-content {
  position: absolute;
  inset: 0;
  padding: 18px;
  justify-content: flex-end;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.6) 35%,
    rgba(0, 0, 0, 0.1) 70%,
    transparent 100%);
  z-index: 2;
}
.posts-loop.style-overlay .post-title h3 { color: white; }
.posts-loop.style-overlay .post-link:hover .post-title h3 { color: #ffb37a; }
.posts-loop.style-overlay .post-excerpt {
  color: rgba(255, 255, 255, 0.85);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.posts-loop.style-overlay .post-meta { color: rgba(255, 255, 255, 0.75); }
.posts-loop.style-overlay .post-meta a { color: rgba(255, 255, 255, 0.75); }
.posts-loop.style-overlay .post-category { z-index: 3; }

/* ============================================================
   Featured Post (البطاقة الكبيرة في الـ hero)
   ============================================================ */
.post-featured {
  background: transparent;
  border: none;
  aspect-ratio: 16 / 9;
  position: relative;
}
.post-featured .post-thumb {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border-radius: var(--glob-border-radius);
}
.post-featured .post-content {
  position: absolute;
  inset: 0;
  padding: 32px;
  justify-content: flex-end;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.5) 40%,
    transparent 80%);
  border-radius: var(--glob-border-radius);
  z-index: 2;
  gap: 12px;
}
.post-featured .post-title h3,
.post-featured .post-title {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 800;
  color: white;
  line-height: 1.3;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.post-featured .post-link:hover .post-title h3 { color: #ffb37a; }
.post-featured .post-excerpt {
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.post-featured .post-meta { color: rgba(255, 255, 255, 0.78); }
.post-featured .post-meta a { color: rgba(255, 255, 255, 0.78); }
.post-featured .post-category {
  top: 20px;
  right: 20px;
  padding: 6px 14px;
  font-size: 12px;
  z-index: 3;
}
.ltr .post-featured .post-category { right: auto; left: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 575px) {
  .posts-loop.style-row .post {
    flex-direction: column;
    min-height: 0;
  }
  .posts-loop.style-row .post-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
  .posts-loop.style-row .post-excerpt { display: -webkit-box; }
  .post-featured .post-content { padding: 20px; }
}
