/* Image Banner Tilted Section Styles */

.image-banner-tilted {
  position: relative;
  overflow: visible; /* Changed from hidden to prevent cutting off rotated images */
}

.image-banner-tilted__container {
  max-width: 1920px;
  margin: 0 auto;
  overflow: visible; /* Allow rotated images to extend beyond container */
}

/* Heading */
.image-banner-tilted__heading h2 {
  margin: 0;
}

/* Subheading */
.image-banner-tilted__subheading p {
  margin: 0;
}

/* Banner Wrapper - Horizontal Flexbox Layout */
.image-banner-tilted__wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0; /* Remove gap for overlap */
  flex-wrap: nowrap; /* Never wrap - keep images in a single row */
  width: 100%;
  overflow: visible; /* No scroll, allow rotated images to extend */
}

/* Removed media query gaps for overlap effect */

/* Image Wrapper - Alternating Rotations */
.image-banner-tilted__image-wrapper {
  flex-shrink: 0;
  width: 28vw; /* Sized to fit ~3 images on mobile */
  max-width: 320px;
  margin-left: -3rem; /* Overlap blocks */
}

.image-banner-tilted__image-wrapper:first-child {
  margin-left: 0; /* First block doesn't need left margin */
}

@media (min-width: 768px) {
  .image-banner-tilted__image-wrapper {
    width: 22vw;
  }
}

@media (min-width: 1024px) {
  .image-banner-tilted__image-wrapper {
    width: 18vw;
    max-width: 320px;
  }
}

/* Alternating Rotations - Applied via nth-child for Polaroid Effect */
.image-banner-tilted__image-wrapper:nth-child(odd) {
  transform: rotate(6deg);
}

.image-banner-tilted__image-wrapper:nth-child(even) {
  transform: rotate(-6deg);
}

/* Hover effect removed per user request */

/* Image Styles */
.image-banner-tilted__image-wrapper img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hover effect removed per user request */

/* Mobile Adjustments - Reduce rotation slightly */
@media (max-width: 767px) {
  .image-banner-tilted__image-wrapper:nth-child(odd) {
    transform: rotate(4deg);
  }
  
  .image-banner-tilted__image-wrapper:nth-child(even) {
    transform: rotate(-4deg);
  }
}

/* Small Mobile - Further reduce rotation */
@media (max-width: 480px) {
  .image-banner-tilted__image-wrapper:nth-child(odd) {
    transform: rotate(3deg);
  }
  
  .image-banner-tilted__image-wrapper:nth-child(even) {
    transform: rotate(-3deg);
  }
}

/* Focus States for Accessibility */
.image-banner-tilted__image-wrapper:focus-within {
  outline: 2px solid var(--clr-neutral-light);
  outline-offset: 4px;
  border-radius: var(--radius-xl);
}

.image-banner-tilted__image-wrapper:focus-within:not(:focus-visible) {
  outline: none;
}

/* Performance Optimization */
.image-banner-tilted__image-wrapper img {
  will-change: transform;
}

/* Background Image Support */
.image-banner-tilted[data-bg] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.image-banner-tilted[data-bg]::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  z-index: -1;
  opacity: 0.1;
}

/* Contain overflow at section level */
.image-banner-tilted {
  overflow-x: hidden;
  overflow-y: visible; /* Allow vertical content if needed */
}

/* Ensure wrapper doesn't cause overflow */
.image-banner-tilted__wrapper {
  overflow: hidden;
  max-width: 100%;
}

/* Make sure images are responsive */
.image-banner-tilted__image-wrapper img {
  max-width: 100%;
  height: auto;
}
