/* ==========================================================================
   Post carousel ("Τελευταίες ενημερώσεις") — Figma node 67:417
   .post-carousel           section (uses .section-header for the title row)
   .carousel-nav            ← → buttons
   .post-carousel__track    horizontal scroller; starts at the container edge and
                            runs off the right edge of the screen
   .post-card               image, title, date (whole card is one link)
   Behaviour: js/post-carousel.js
   ========================================================================== */

.post-carousel {
  overflow-x: clip; /* the track bleeds to the screen edge */
  padding-bottom: clamp(64px, 5.2vw, 100px);
}

/* ---- Arrows --------------------------------------------------------------- */
.carousel-nav {
  display: flex;
  gap: 20px;
}

.carousel-nav__button {
  width: 30px;
  height: 30px;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.carousel-nav__button--prev img {
  transform: rotate(180deg);
}

.carousel-nav__button:hover:not(:disabled) {
  transform: translateX(3px);
}

.carousel-nav__button--prev:hover:not(:disabled) {
  transform: translateX(-3px);
}

.carousel-nav__button:disabled {
  cursor: default;
  opacity: 0.3;
}

/* ---- Track ---------------------------------------------------------------- */
.post-carousel__track {
  --card-width: 556px;

  display: grid;
  grid-auto-columns: var(--card-width);
  grid-auto-flow: column;
  gap: 35px;
  overflow-x: auto;
  margin-top: 40px;
  /* Bleed to the right edge of the viewport; the last card stops there */
  margin-right: calc(50% - 50vw);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.post-carousel__track::-webkit-scrollbar {
  display: none;
}

/* ---- Card ----------------------------------------------------------------- */
.post-card {
  scroll-snap-align: start;
}

.post-card__link {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card__media {
  overflow: hidden;
  aspect-ratio: 556 / 320;
  background: var(--color-bg-board);
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.post-card__link:hover .post-card__image {
  transform: scale(1.04);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.post-card__title {
  max-width: 477px;
  color: var(--color-heading);
  font-size: 20px;
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-snug);
  transition: color var(--transition-fast);
}

.post-card__link:hover .post-card__title {
  color: var(--color-primary);
}

.post-card__date {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-snug);
}

/* ---- Smaller screens ------------------------------------------------------ */
@media (max-width: 1100px) {
  .post-carousel__track {
    --card-width: min(440px, 70vw);

    gap: 24px;
    margin-top: 32px;
  }

  .post-card__title {
    font-size: 18px;
  }
}

@media (max-width: 700px) {
  .post-carousel__track {
    --card-width: 82vw;

    gap: 16px;
    margin-top: 24px;
  }

  .post-card__link {
    gap: 14px;
  }

  .post-card__title {
    font-size: var(--font-size-base);
  }
}
