/* Related Content / Recently Added Component Stylesheet */

.related-content-section {
  margin: 3rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid #e5e7eb;
}

.related-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.related-content-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.related-content-viewall {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #10b981;
  text-decoration: none;
  transition: color 0.2s;
}

.related-content-viewall:hover {
  color: #059669;
  text-decoration: underline;
}

/* Grid Layout */
.related-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

/* Related Card Item */
.related-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  border-color: #10b981;
}

.related-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Image Box */
.related-card-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #f3f4f6;
  overflow: hidden;
}

.related-card-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.related-card:hover .related-card-img-box img {
  transform: scale(1.04);
}

.related-card-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #9ca3af;
  font-size: 0.875rem;
}

.related-card-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  text-transform: uppercase;
}

.related-card-badge.free {
  background-color: #d1fae5;
  color: #065f46;
}

.related-card-badge.paid {
  background-color: #fef3c7;
  color: #92400e;
}

/* Card Body */
.related-card-body {
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.related-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  /* Standard box-clamp fallback for modern engines */
  line-clamp: 2;
}

.related-card:hover .related-card-title {
  color: #10b981;
}

.related-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.meta-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.meta-tag.category-tag {
  background-color: #f3f4f6;
  color: #4b5563;
}

.meta-tag.type-tag {
  background-color: #eff6ff;
  color: #1d4ed8;
  text-transform: uppercase;
}
