/* Base styles for hero section */
.hero-section {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  padding-top: 64px; /* Height of the header */
}


/* Keyframes for Ken Burns Effect */
@keyframes kenBurns {
  0% {
      opacity: 0;
      transform: scale(1);
  }
  5% {
      opacity: 1;
  }
  25% {
      opacity: 1;
  }
  30% {
      opacity: 0;
      transform: scale(1.2);
  }
  100% {
      opacity: 0;
      transform: scale(1.2);
  }
}

/* Common Styles for Hero Images */
.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform-origin: center;
  will-change: transform, opacity;
  z-index: 1; /* Lower z-index than header */
}

/* Individual Images with Timings */
/* JPEG fallback for browsers that don't support WebP */
.bg-image1 {
  background-image: url('../images/automotive-robotics.jpg');
  animation: kenBurns 20s infinite;
}

.bg-image2 {
  background-image: url('../images/cnc-machining.jpg');
  animation: kenBurns 20s infinite 5s;
}

.bg-image3 {
  background-image: url('../images/female-engineer.jpg');
  animation: kenBurns 20s infinite 10s;
}

.bg-image4 {
  background-image: url('../images/design-engineer-in-office.jpg');
  animation: kenBurns 20s infinite 15s;
}

/* WebP override for browsers that support it (detected via JS) */
html.webp .bg-image1 {
  background-image: url('https://sunboltgroup.com/resources/img/Automotive-Robotics.webp');
}

html.webp .bg-image2 {
  background-image: url('https://sunboltgroup.com/resources/img/CNC-Machining.webp');
}

html.webp .bg-image3 {
  background-image: url('https://sunboltgroup.com/resources/img/Female-Engineer.webp');
}

html.webp .bg-image4 {
  background-image: url('https://sunboltgroup.com/resources/img/Design-Engineer-in-Office.webp');
}

/* Hero background for about-us and expertise pages */
.hero-bg-about {
  background-image: url('../images/design-engineer-in-office.jpg');
}

html.webp .hero-bg-about {
  background-image: url('https://sunboltgroup.com/resources/img/Design-Engineer-in-Office.webp');
}

.hero-bg-expertise {
  background-image: url('../images/automotive-robotics.jpg');
}

html.webp .hero-bg-expertise {
  background-image: url('https://sunboltgroup.com/resources/img/Automotive-Robotics.webp');
}

/* Overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2;
}

/* Content Styles */
.hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

/* Responsive text sizes */
@media (max-width: 640px) {
  .hero-content h1 {
      font-size: 2rem;
  }
  .hero-content p {
      font-size: 1.25rem;
  }
}
