/* 7-image rotator (committees/team) */
.image-rotator {
  margin: 1rem auto 0;
  width: min(520px, 88%);
  position: relative;
  border-radius: 14px;

  /* IMPORTANT: allow full images to be visible (no cropping) */
  overflow: visible;

  border: 1px solid rgba(255, 214, 98, 0.25);
  background: rgba(6, 12, 29, 0.35);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);

  /* for smooth overlay animations */
  transform: translateZ(0);
}

.image-rotator::before {
  content: '';
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 214, 98, 0.22), transparent 45%),
    radial-gradient(circle at 85% 40%, rgba(125, 170, 255, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35));
  opacity: 0.9;
  pointer-events: none;
  z-index: 1;
}

.image-rotator::after {
  content: '';
  position: absolute;

  /* shine taşmasını azalt: kutu dışına aşırı taşma yapmasın */
  inset: -8% -6%;

  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 214, 98, 0.18) 50%,
    transparent 65%
  );
  transform: translateX(-30%) rotate(12deg);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.image-rotator {
  /* JS active görsele göre height set edeceği için min-height kaldırıldı */
  height: auto;
  will-change: transform;
}

.image-rotator img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;

  /* Full visibility: don't crop */
  object-fit: contain;

  /* Keep all images in the DOM but only animate opacity/transform */
  opacity: 0;
  transform: scale(1);
  will-change: opacity, transform, filter;
  transition:
    opacity 650ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: saturate(1.04) contrast(1.02) brightness(0.98);
}

.image-rotator img.active {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1.12) contrast(1.05) brightness(1.02);
}

.image-rotator-item {
  /* rely on img transitions */
}

.image-rotator .image-rotator-item.active ~ .image-rotator-item {
  /* no-op: css selector not used, safe */
}

.image-rotator {
  --shine-duration: 1100ms;
}

/* Optional shine trigger when active changes */
.image-rotator img.active ~ img {
  /* no-op */
}

.image-rotator img.active {
  animation: rotatorGlow 1100ms ease both;
}

@keyframes rotatorGlow {
  0% {
    filter: saturate(1.06) contrast(1.03) brightness(0.98);
  }
  35% {
    filter: saturate(1.18) contrast(1.08) brightness(1.05);
  }
  100% {
    filter: saturate(1.12) contrast(1.05) brightness(1.02);
  }
}

.image-rotator--committees::after {
  animation: shineSweep 2500ms ease-in-out infinite;
}

@keyframes shineSweep {
  0% {
    opacity: 0;
    transform: translateX(-35%) rotate(12deg);
  }
  20% {
    opacity: 0.9;
  }
  55% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
    transform: translateX(35%) rotate(12deg);
  }
}

/* slight height tweak for smaller screens */
@media (max-width: 680px) {
  .image-rotator {
    height: auto;
  }
}
