/* =========================
   Base Styles (Desktop-first)
========================= */
.carousel-preload {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hero-carousel {
  position: relative;
  width: 100%;
  height: 85svh;
  min-height: 400px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateZ(0) scale(1.1);
  transition: opacity 500ms ease, transform 700ms ease;
  z-index: 0;
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.carousel-slide.active {
  opacity: 1;
  transform: translateZ(0) scale(1);
  z-index: 2;
}

/* actual image */
.carousel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* overlay */
.carousel-slide::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* default dark overlay */
  z-index: 0;
}

/* Make sure text sits above the overlay */
.carousel-text {
  position: relative;
  z-index: 1;
}

/* First slide overlay */
.carousel-slide:nth-child(1)::before {
  background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
}

/* Second slide overlay */
.carousel-slide:nth-child(2)::before {
  background: rgba(6, 28, 49, 0.5); /* bluish tint */
}

/* Third slide overlay */
.carousel-slide:nth-child(3)::before {
  background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.3)); /* warm golden tint */
}

.carousel-text {
  position: absolute;
  max-width: 40%;
  color: white;
  padding: 20px;
  opacity: 0;
  transition: all 1s ease;
}

.carousel-text.text-left {
  top: 30%;
  left: 5%;
}

.carousel-text.text-right {
  top: 40%;
  right: 5%;
  text-align: right;
}

.spaning {
  margin-right: -10rem;
}


.carousel-text.text-center {
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.carousel-text.show {
  opacity: 1;
}

.heading {
  font-size: 2.5rem;
  margin-bottom: 15px;
  animation: slideInHeading 1s forwards;
}

.paragraph {
  font-size: 1.2rem;
  margin-bottom: 20px;
  animation: slideInParagraph 1s forwards;
}

/* active state animations */
.carousel-slide.active .carousel-text { 
  opacity: 1; 
  transform: translateX(0) translateY(0); 
}

.cta-btn {
  display: inline-block;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 5px;
  text-decoration: none;
  color: white;
  animation: slideInCTA 1s forwards;
}

/* CTA Colors */
.cta-blue { background-color: #007bff; }
.cta-green { background-color: #28a745; }
.cta-orange { background-color: #ff9800; }


/* Animations */
@keyframes slideInHeading {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInParagraph {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInCTA {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================
   Responsive Breakpoints
========================= */

/* Tablets (iPad landscape/portrait) */
@media (max-width: 1024px) {
  .hero-carousel {
    height: 40vh; /* slightly shorter on mobile */
  }

  .carousel-text {
    max-width: 90%; /* almost full width */
    left: 50% !important; 
    right: auto !important;
    transform: translateX(-50%) !important;
    text-align: center !important;
    padding: 10px;
  }

  .heading {
    font-size: 1.6rem; /* smaller */
    line-height: 1.3;
  }

  .spaning {
    margin-right: 0;
  }

  .paragraph {
    font-size: 1rem;
    line-height: 1.5;
  }

  .cta-btn {
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: none;
  }
}




@media (max-width: 900px) {
  .hero-carousel {
    height: 40vh; /* slightly shorter on mobile */
  }

  .carousel-text {
    max-width: 90%; /* almost full width */
    left: 50% !important; 
    right: auto !important;
    transform: translateX(-50%) !important;
    text-align: center !important;
    padding: 10px;
  }

  .heading {
    font-size: 1.6rem; /* smaller */
    line-height: 1.3;
  }

  .spaning {
    margin-right: 0;
  }

  .paragraph {
    font-size: 1rem;
    line-height: 1.5;
  }

  .cta-btn {
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: none;
  }
}




/* Small tablets & large phones */
@media (max-width: 768px) {
  .hero-carousel {
    height: 60vh; /* slightly shorter on mobile */
  }

  .carousel-text {
    max-width: 90%; /* almost full width */
    left: 50% !important; 
    right: auto !important;
    transform: translateX(-50%) !important;
    text-align: center !important;
    padding: 10px;
  }

  .heading {
    font-size: 1.6rem; /* smaller */
    line-height: 1.3;
  }

  .spaning {
    margin-right: 0;
  }

  .paragraph {
    font-size: 1rem;
    line-height: 1.5;
  }

  .cta-btn {
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: none;
  }
}

/* Extra small screens (phones under 480px) */
@media (max-width: 480px) {
  .hero-carousel {
    height: 10svh;
    max-height: 10svh;
  }

  .heading {
    font-size: 1.3rem;
  }

  .spaning {
    margin-right: 0;
  }

  .paragraph {
    font-size: 0.9rem;
  }

  .cta-btn {
    font-size: 0.85rem;
    padding: 8px 15px;
    cursor: none;
  }
}