/**
 * Frontend styles for the Infinite Scroll Gutenberg block
 */

.wp-block-immersiveagent-infinite-scroll {
  display: block;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: auto;
}

.wp-block-immersiveagent-infinite-scroll img {
  display: block;
  flex-shrink: 0;
  height: auto;
  max-height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  object-fit: cover;
  border-radius: 4px;
}

/* Height variants */
.wp-block-immersiveagent-infinite-scroll.h-16 {
  height: 4rem;
}
.wp-block-immersiveagent-infinite-scroll.h-20 {
  height: 5rem;
}
.wp-block-immersiveagent-infinite-scroll.h-24 {
  height: 6rem;
}
.wp-block-immersiveagent-infinite-scroll.h-32 {
  height: 8rem;
}
.wp-block-immersiveagent-infinite-scroll.h-40 {
  height: 10rem;
}
.wp-block-immersiveagent-infinite-scroll.h-48 {
  height: 12rem;
}
.wp-block-immersiveagent-infinite-scroll.h-56 {
  height: 14rem;
}
.wp-block-immersiveagent-infinite-scroll.h-64 {
  height: 16rem;
}

/* Pausable hover effect */
.wp-block-immersiveagent-infinite-scroll.pausable:hover .infinite-scroll-wrapper {
  animation-play-state: paused;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .wp-block-immersiveagent-infinite-scroll {
    height: auto;
    min-height: 3rem;
  }

  .wp-block-immersiveagent-infinite-scroll img {
    max-height: 3rem;
  }
}

@media (max-width: 480px) {
  .wp-block-immersiveagent-infinite-scroll {
    min-height: 2.5rem;
  }

  .wp-block-immersiveagent-infinite-scroll img {
    max-height: 2.5rem;
  }
}

/* Loading state */
.wp-block-immersiveagent-infinite-scroll.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Dark mode support */
.dark .wp-block-immersiveagent-infinite-scroll.loading {
  background: linear-gradient(90deg, #2a2a2a 25%, #1a1a1a 50%, #2a2a2a 75%);
  background-size: 200% 100%;
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .wp-block-immersiveagent-infinite-scroll,
  .wp-block-immersiveagent-infinite-scroll * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .wp-block-immersiveagent-infinite-scroll {
    overflow: visible;
    height: auto;
  }

  .wp-block-immersiveagent-infinite-scroll .infinite-scroll-wrapper {
    transform: none !important;
    animation: none !important;
  }
}
