/* Related Posts Section Styles */

.related-posts-section {
  margin-top: 150px;
  padding: 0 160px;
  background: #f8f7ec;
}

.related-posts-container {
  max-width: 1120px;
  margin: 0 auto;
}

/* Header */
.related-posts-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 56px;
}

.related-posts-header-text {
  max-width: 570px;
}

.related-posts-header-title {
  font-family: "Montserrat", sans-serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  color: #1f1f1f;
  margin: 0 0 32px 0;
}

.related-posts-header-description {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 27px;
  color: #484848;
  margin: 0;
}

/* Navigation */
.related-posts-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-posts-navigation.mobile-nav {
  display: none;
}

.rl-view-all-link {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #1f1f1f;
  text-decoration: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.next-btn-related,
.mobile-next-related {
  width: 24px;
  height: 24px;
  margin-left: 8px;
  background: #ffcc29;
  border: none;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* Allow clicks to pass through to parent link */
}

.next-btn-related:hover,
.mobile-next-related:hover {
  opacity: 0.8;
}

.next-btn-related svg,
.mobile-next-related svg {
  width: 10px;
  height: 12px;
  transform: rotate(0deg);
}

/* Carousel */
.related-posts-carousel-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.related-posts-carousel {
  display: flex;
  gap: 24px;
  transition: transform 0.5s ease;
}

/* Related Post Card */
.related-post-card {
  flex-shrink: 0;
  width: 357.33px;
  display: flex;
  flex-direction: column;
}

.related-post-card-image-wrapper {
  width: 100%;
  height: 219px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}

.related-post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 0 100%);
}

.related-post-card-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  height: 230px;
}

.related-post-card-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* Categories */
.related-post-card-categories {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.related-post-category-tag {
  background: #e7e5dc;
  color: #1f1f1f;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 30px;
  display: inline-block;
}

/* Title and Excerpt */
.related-post-card-title {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #1f1f1f;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.2em * 2);
}

.related-post-card-excerpt {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #484848;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(24px * 2);
}

/* Read More Link */
.related-post-read-more {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #1f1f1f;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.related-post-arrow-button {
  width: 24px;
  height: 24px;
  background: #ffcc29;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.related-post-arrow-button svg {
  width: 10px;
  height: 12px;
  transform: rotate(0deg);
}

/* No posts message */
.no-posts {
  text-align: center;
  padding: 40px;
  color: #484848;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .related-posts-section {
    padding: 0 64px;
  }
}

@media (max-width: 768px) {
  .related-posts-section {
    padding: 0;
    margin-top: 150px;
  }

  .related-posts-container {
    padding: 0 32px;
  }

  .related-posts-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 48px;
  }

  .related-posts-header-text {
    max-width: 311px;
  }

  .related-posts-header-title {
    font-size: 24px;
    margin-bottom: 24px;
  }

  .related-posts-navigation.desktop-nav {
    display: none;
  }

  .related-posts-navigation.mobile-nav {
    display: flex;
    justify-content: center;
    margin-top: 48px;
  }

  .view-all-link {
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #1f1f1f;
    text-decoration: none;
    display: flex;
    align-items: center;
    cursor: pointer;
  }

  .related-posts-carousel-wrapper {
    margin: 0 -32px;
    padding: 0 32px;
  }

  .related-posts-carousel {
    gap: 16px;
  }

  .related-post-card {
    width: 311px;
  }

  .related-post-card-image-wrapper {
    margin-bottom: 20px;
  }

  .related-post-card-content {
    height: 200px;
  }

  .related-post-category-tag {
    background: #cbcbd0;
  }

  .related-post-read-more {
    font-size: 14px;
  }
}

@media (max-width: 375px) {
  .related-posts-carousel-wrapper {
    margin: 0 -16px;
    padding: 0 16px;
  }
}
