/* =====================================
   Custom Posts Page Styles
   ===================================== */

.custom-posts-page {
  width: 100%;
  background: #222222;
  color: #ffffff;
  min-height: 100vh;
}

.custom-posts-page *,
.custom-posts-page *::before,
.custom-posts-page *::after {
  box-sizing: border-box;
}

/* Hero Section */
.custom-posts-hero {
  position: relative;
  width: 100%;
  height: 394px;
  overflow: hidden;
  margin-bottom: 0;
}

.custom-posts-hero__image-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.custom-posts-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-posts-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(34, 34, 34, 0.9) 100%
  );
}

.custom-posts-hero__content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
}

.custom-posts-hero__title {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-weight: 700;
  font-size: 48px;
  line-height: 1.2;
  color: #ffffff;
  margin: 0;
}

/* Container */
.custom-posts-container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 40px 94px 80px;
}

/* Breadcrumb */
.custom-posts-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  direction: rtl;
}

.custom-posts-breadcrumb__link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

.custom-posts-breadcrumb__link:hover {
  color: #ffffff;
}

.custom-posts-breadcrumb__separator {
  color: rgba(255, 255, 255, 0.5);
}

.custom-posts-breadcrumb__current {
  color: #ffffff;
}

/* =====================================
   Posts List Section
   ===================================== */

.posts-list {
  width: 100%;
  padding: 60px 0;
}

.posts-list__container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 94px;
}

.posts-list__title {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.3;
  color: #ffffff;
  margin: 0 0 40px 0;
  text-align: right;
  direction: rtl;
}

.posts-list__empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 18px;
}

/* Posts Grid */
.posts-list__grid {
  display: grid;
  gap: 30px;
  margin: 0;
}

/* =====================================
   Post Card
   ===================================== */

.post-card {
  background: #2a2a2a;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Post Image */
.post-card__image-link {
  display: block;
  text-decoration: none;
}

.post-card__image-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: #1a1a1a;
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card__image {
  transform: scale(1.1);
}

/* Post Content */
.post-card__content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Category */
.post-card__category {
  margin-bottom: 12px;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  direction: rtl;
}

.post-card__category-link {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-card__category-link:hover {
  color: #60a5fa;
}

.post-card__category span {
  color: #3b82f6;
}

/* Title */
.post-card__title {
  margin: 0 0 16px 0;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.4;
  text-align: right;
  direction: rtl;
}

.post-card__title-link {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__title-link:hover {
  color: #3b82f6;
}

/* Meta */
.post-card__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  direction: rtl;
}

.post-card__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-card__meta-item svg {
  opacity: 0.7;
}

/* Excerpt */
.post-card__excerpt {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
  text-align: right;
  direction: rtl;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Read More */
.post-card__read-more {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  font-weight: 600;
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.3s ease;
  text-align: right;
  direction: rtl;
  display: inline-block;
  margin-top: auto;
}

.post-card__read-more:hover {
  color: #60a5fa;
}

/* =====================================
   Responsive Design
   ===================================== */

/* Large Desktop - 4 columns become 3 */
@media (max-width: 1400px) {
  .posts-list__grid[style*="repeat(4"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .custom-posts-hero {
    height: 350px;
  }

  .custom-posts-hero__title {
    font-size: 40px;
  }

  .custom-posts-container {
    padding: 30px 50px 60px;
  }

  .custom-posts-breadcrumb {
    margin-bottom: 30px;
  }

  .posts-list {
    padding: 50px 0;
  }

  .posts-list__container {
    padding: 0 50px;
  }

  .posts-list__title {
    font-size: 32px;
    margin-bottom: 30px;
  }

  /* Force 2 columns on tablet */
  .posts-list__grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px;
  }

  .post-card__image-wrapper {
    height: 200px;
  }

  .post-card__content {
    padding: 20px;
  }

  .post-card__title {
    font-size: 18px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .custom-posts-hero {
    height: 280px;
  }

  .custom-posts-hero__title {
    font-size: 32px;
  }

  .custom-posts-container {
    padding: 20px 30px 40px;
  }

  .custom-posts-breadcrumb {
    margin-bottom: 24px;
    font-size: 13px;
  }

  .posts-list {
    padding: 40px 0;
  }

  .posts-list__container {
    padding: 0 30px;
  }

  .posts-list__title {
    font-size: 28px;
    margin-bottom: 24px;
  }

  /* Force 1 column on mobile */
  .posts-list__grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .post-card__image-wrapper {
    height: 220px;
  }

  .post-card__content {
    padding: 20px;
  }

  .post-card__title {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .post-card__meta {
    gap: 16px;
    margin-bottom: 12px;
  }

  .post-card__excerpt {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .post-card:hover {
    transform: translateY(-4px);
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .custom-posts-hero {
    height: 240px;
  }

  .custom-posts-hero__title {
    font-size: 26px;
  }

  .custom-posts-container {
    padding: 16px 20px 30px;
  }

  .custom-posts-breadcrumb {
    font-size: 12px;
    margin-bottom: 20px;
  }

  .posts-list {
    padding: 30px 0;
  }

  .posts-list__container {
    padding: 0 20px;
  }

  .posts-list__title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .posts-list__grid {
    gap: 16px;
  }

  .post-card__image-wrapper {
    height: 200px;
  }

  .post-card__content {
    padding: 16px;
  }

  .post-card__title {
    font-size: 16px;
  }

  .post-card__meta {
    font-size: 12px;
    gap: 12px;
  }

  .post-card__excerpt {
    font-size: 13px;
  }

  .post-card__read-more {
    font-size: 13px;
  }
}

/* =====================================
   Editor Styles
   ===================================== */

.posts-list-block-editor,
.category-posts-block-editor {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
}