/* app/assets/stylesheets/hero_animation.css */

#animated-hero-background {
  display: flex;
  flex-direction: column;
  justify-content: space-between; 
  align-items: center; 
  position: absolute;
  inset: 0;
  overflow: hidden !important; 
  /* Performance optimizations */
  transform: translateZ(0); /* Force hardware acceleration */
  backface-visibility: hidden;
  perspective: 1000px;
}

.masonry-row {
  position: relative; 
  will-change: transform;
  /* Performance optimizations */
  transform: translateZ(0) rotate(-5deg); /* Force hardware acceleration + rotation */
  backface-visibility: hidden;
  width: 140%;
  left: -20%;
  top: -5vh;
  /* Use actual hero section height: 100% / 4 rows = 25% each */
  /* Add slight overlap with 30% to ensure no gaps (mimics the 1.2x factor) */
  height: 30%;
}

.masonry-row .scrolling-content {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  animation-name: scrollHorizontal;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
  height: 100%;
}

/* Row-specific animation styles */
.row-1 .scrolling-content {
  animation-duration: 70s;
  animation-direction: normal;
}

.row-2 .scrolling-content {
  animation-duration: 85s;
  animation-direction: reverse;
  margin-left: 3%;
}

.row-3 .scrolling-content {
  animation-duration: 60s;
  animation-direction: normal;
  margin-left: -2%;
}

.row-4 .scrolling-content {
  animation-duration: 75s;
  animation-direction: reverse;
  margin-left: 1.5%;
}

/* Updated styles to handle both picture elements and img elements */
.masonry-row picture,
.masonry-row img {
  flex-shrink: 0; 
  /* Performance optimizations */
  transform: translateZ(0);
  backface-visibility: hidden;
  box-sizing: border-box;
  margin-right: 0px;
  display: inline-block;
  /* Make images square based on row height */
  height: 100%;
  width: auto;
}

.masonry-row picture {
  /* Ensure picture element doesn't interfere with sizing */
  height: 100%;
  width: auto;
}

.masonry-row picture img,
.masonry-row img {
  object-fit: cover;
  image-rendering: optimizeSpeed;
  border: 2px solid white;
  aspect-ratio: 1;
  height: 100%;
  width: auto;
}

@keyframes scrollHorizontal {
  0% {
    transform: translateX(0%);
  }
  100% {
    /* Scroll one full set of original images (half of total duplicated content) */
    transform: translateX(-50%); 
  }
}

/* 
  The styles for #hero-content-overlay are already applied directly 
  in the HTML with Tailwind classes, so these are commented out to avoid redundancy. 
  #hero-content-overlay {
    position: relative; 
    z-index: 10; 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
  } 
*/