/* ===================================================================
   Related Posts Component
   Editorial related-post list for blog articles
   =================================================================== */

.related-posts-section {
  background: #ffffff;
  padding: 56px 0;
  border-top: 1px solid var(--border-light);
}

.related-posts-section .container {
  max-width: 1080px;
}

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

.related-posts-title {
  color: var(--text-color);
  font-family: var(--font-primary);
  font-size: clamp(1.5rem, 2vw, 1.95rem);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  line-height: var(--line-height-tight);
  margin: 0;
}

.related-posts-list {
  border-top: 1px solid var(--border-light);
}

.related-post-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-light);
}

.related-post-copy {
  min-width: 0;
}

.related-post-heading {
  margin: 0 0 8px;
}

.related-post-heading a {
  color: var(--text-color);
  display: inline;
  font-family: var(--font-primary);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
  text-wrap: balance;
}

.related-post-heading a:hover {
  color: var(--primary-color);
}

.related-post-excerpt {
  color: #2d3748;
  font-family: var(--font-primary);
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  font-weight: var(--font-weight-normal);
  line-height: 1.45;
  margin: 0 0 12px;
  max-width: 680px;
}

.related-post-meta {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  gap: 7px;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.related-post-image {
  aspect-ratio: 16 / 9;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  display: block;
  overflow: hidden;
  text-decoration: none;
  width: 100%;
}

.related-post-image img {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
  width: 100%;
}

.related-post-image:hover img {
  transform: scale(1.03);
}

.related-post-placeholder {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: 2.25rem;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.related-posts-footer {
  display: none;
}

.related-posts-see-all {
  align-items: center;
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  color: var(--text-color);
  display: inline-flex;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  text-decoration: none;
}

.related-posts-see-all:hover {
  background: var(--border-dark);
  color: var(--text-color);
  text-decoration: none;
}

.related-posts-see-all i {
  font-size: 1.1rem;
  line-height: 1;
}

.related-posts-empty {
  color: var(--text-muted);
  font-family: var(--font-primary);
  padding: 30px 0 0;
}

.related-posts-empty p {
  margin-bottom: 18px;
}

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

  .related-posts-section .container {
    padding-left: 31px;
    padding-right: 31px;
  }

  .related-posts-header {
    margin-bottom: 18px;
  }

  .related-posts-title {
    font-size: 1.4rem;
  }

  .related-post-item {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 16px;
    padding: 22px 0;
  }

  .related-post-heading a {
    display: -webkit-box;
    font-size: clamp(1.05rem, 4.6vw, 1.25rem);
    line-height: 1.25;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .related-post-excerpt {
    display: -webkit-box;
    font-size: clamp(0.9rem, 3.8vw, 0.98rem);
    line-height: 1.4;
    margin-bottom: 10px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .related-post-meta {
    font-size: 0.72rem;
    gap: 6px;
  }

  .related-post-image {
    aspect-ratio: 1 / 1;
    margin-top: 0;
  }

  .related-posts-footer {
    display: block;
    padding-top: 24px;
  }
}

@media (max-width: 520px) {
  .related-post-item {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 14px;
  }

  .related-post-heading a {
    font-size: clamp(1rem, 5vw, 1.18rem);
  }

  .related-post-excerpt {
    font-size: 0.9rem;
  }
}
