/* Section: Full-width blocks */

.related-container {
  width: 100%;
  margin: 0;
  padding: var(--space-sm) 0 var(--space-md);
}

.hero-container {
  width: 100%;
  background: var(--beige);
  margin: 0 0 var(--space-lg);
  padding: var(--space-lg) 0;
}

/* Section: Related posts (inner container) */

.related-inner {
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);

  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

/* Section: Related posts (header) */

.related-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  flex: 0 0 auto;
  min-width: 120px;
  max-width: 180px;
  text-align: right;
}

.related-heading {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
}

.related-leia {
  font-family: var(--font-display);
  font-size: clamp(var(--font-size-2xl), 3vw, var(--font-size-display-sm));
  line-height: 1.1;
  font-weight: 400;
  font-style: italic;
  color: var(--dark);
}

.related-mais {
  display: block;
  margin-top: 0;

  font-family: var(--font-base);
  font-size: var(--font-size-xxs);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
  color: var(--dark);
}

/* Section: Related posts (grid) */

.related-grid {
  flex: 1 1 0;
  min-width: 0;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
}

/* Section: Related posts (card) */

.related-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
  text-align: center;
}

.related-grid .related-card {
  opacity: 0;
  transform: translateY(20px);
  animation: relatedCardFadeUp 0.6s ease forwards;
}

.related-grid .related-card:nth-child(1) { animation-delay: 0.05s; }
.related-grid .related-card:nth-child(2) { animation-delay: 0.1s; }
.related-grid .related-card:nth-child(3) { animation-delay: 0.15s; }
.related-grid .related-card:nth-child(4) { animation-delay: 0.2s; }

@keyframes relatedCardFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section: Related posts (image) */

.related-thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.related-image {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transition: all 1s ease;
}

.related-thumb:hover img {
  transform: scale(1.05);
  opacity: 0.8;
}

/* Section: Related posts (title) */

.related-title {
  margin: 0;

  font-family: var(--font-base);
  font-size: var(--font-size-xxs);
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

.related-title a {
  color: var(--dark);
  font-weight: 700;
  text-decoration: none;
}

.related-title a:hover {
  opacity: 0.7;
}

/* Section: Related posts (tablet) */

@media (max-width: 1024px) {
  .related-inner {
    padding: var(--space-sm) var(--container-padding);
    gap: var(--space-lg);
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm) var(--space-md);
  }

  .related-header {
    min-width: 100px;
    max-width: 140px;
  }
}

/* Section: Related posts (mobile) */

@media (max-width: 600px) {
  .related-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
    padding-top: var(--space-sm);
    padding-bottom: var(--space-md);
  }

  .related-header {
    max-width: none;
    align-items: flex-end;
    text-align: right;
  }

  .related-heading {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: var(--space-sm);
  }

  .related-mais {
    text-align: right;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .related-grid .related-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .related-thumb img {
    transition: none;
  }

  .related-thumb:hover img {
    transform: none;
    opacity: 1;
  }
}
