/* Related Auto Component - Using Design System */

/* 🔁 Existing section layout */
.related-content {
  margin: 5rem auto;
  max-width: 1280px;
  padding: 0 2rem;
}

.related-content h2 {
  margin-bottom: 3rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 0 auto;
}

/* Limit to 3 columns max on large screens */
@media screen and (min-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

.related-card {
  display: block;
  text-decoration: none;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(178, 73, 52, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(178, 73, 52, 0.1);
  height: 100%;
  position: relative;
}

/* ✨ Wrapper to contain image and overlay */
.card-image-wrapper {
  position: relative;
}

.card-image-wrapper picture,
.card-image-wrapper img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ✨ Overlay styling for related-content inside image */
.card-image-wrapper .related-content {
  padding: 2rem 1.75rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(to top,
    rgba(178, 73, 52, 0.95) 0%,
    rgba(178, 73, 52, 0.85) 40%,
    rgba(178, 73, 52, 0.4) 70%,
    transparent 100%
  );
  color: white;
  margin: 0;
}

.related-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(178, 73, 52, 0.15);
  border-color: rgba(178, 73, 52, 0.2);
}

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

/* 🔁 Non-overlay content padding */
.related-card > .related-content {
  padding: 1.75rem;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  height: calc(100% - 220px);
}

/* Text content */
.related-card h3 {
  margin: 0 0 0.75rem 0;
}

.card-image-wrapper .related-content h3,
.card-image-wrapper .related-content p {
  margin: 0;
  color: white !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-image-wrapper .related-content h3 {
  margin-bottom: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-image-wrapper .related-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.98;
}

.related-card p {
  margin: 0;
  flex-grow: 1;
}

/* 📱 Responsive styles */
@media screen and (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr;
  }

  .related-content {
    margin: 3rem auto;
  }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}