/*
 * .recent-posts — sidebar list: 100 px photo | date + title, then the
 * "Show more" .outline-button (template-parts/global/recent-posts.php).
 * Figma: Story 337:12675, Article 337:10872 / M 337:12229.
 */

.recent-posts {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 0.9167rem + 1.4219vw, 1.875rem);
}

/* .recent-posts__title — 32 → 36 px, trimmed to cap / baseline (Figma 1574:13452) */
.recent-posts__title {
  margin-top: -0.14em;
  margin-bottom: -0.14em;
  color: var(--nv-navy);
  font-weight: 500;
  font-size: clamp(2rem, 1.9111rem + 0.3792vw, 2.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* .recent-posts__list */
.recent-posts__list {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 0.9167rem + 1.4219vw, 1.875rem);
}

/* .recent-posts__link — photo | text */
.recent-posts__link {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  color: var(--nv-navy);

  /* .recent-posts__link:focus-visible */
  &:focus-visible {
    outline: 0.125rem solid var(--nv-blue);
    outline-offset: 0.25rem;
  }
}

/* .recent-posts__image — 100 px square; navy without a photo */
.recent-posts__image {
  flex-shrink: 0;
  width: 6.25rem;
  height: 6.25rem;
  border-radius: var(--nv-radius-s);
  background-color: var(--nv-navy);
  overflow: hidden;

  & img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }
}

/* .recent-posts__body — date above the title */
.recent-posts__body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* .recent-posts__date — 12 → 18 px, trimmed to cap / baseline */
.recent-posts__date {
  margin-top: -0.14em;
  margin-bottom: -0.14em;
  font-size: clamp(0.75rem, 0.6167rem + 0.5687vw, 1.125rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* .recent-posts__name — 18 → 20 px, two lines at most (Figma 1574:13452 / 1574:13035) */
.recent-posts__name {
  display: -webkit-box;
  margin-top: -0.24em;
  margin-bottom: -0.24em;
  font-weight: 500;
  font-size: clamp(1.125rem, 1.0806rem + 0.1896vw, 1.25rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
  overflow: hidden;
  overflow-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  transition: color 0.3s ease;
}

/* @media (hover: hover) .recent-posts__link:hover */
@media (hover: hover) and (pointer: fine) {
  .recent-posts__link:hover .recent-posts__name {
    color: var(--nv-blue);
  }

  .recent-posts__link:hover .recent-posts__image img {
    transform: scale(1.05);
  }
}

/* @media (prefers-reduced-motion: reduce) .recent-posts */
@media (prefers-reduced-motion: reduce) {
  .recent-posts__name,
  .recent-posts__image img {
    transition: none;
  }
}
