/* ======================================= */
/* ✨ Fowler Slideshow – True Responsive + Animated */
/* ======================================= */

.fowler-slideshow {
  position: relative;
  width: 100%;
  height: 80vh;
  max-height: min(600px, 100vw);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;

  /* NEW: perspective for 3D transforms */
  perspective: 1000px;
}

/* === Slides === */
.fowler-slide {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  opacity: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  transition: opacity 0.8s ease;
}

.fowler-slide.disappearing {
  justify-content: inherit !important;
}

.fowler-slide.active {
  opacity: 1;
  z-index: 2;
}

/* ======================================= */
/* 🖼️ IMAGE VARIANTS */
/* ======================================= */

.slide-image {
  flex: 1;
  height: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(0.5); /* start smaller so popBoom works */
  transition: transform 0.4s ease;
}

/* Left / Right variants */
.fowler-slide.image-left,
.fowler-slide.image-right {
  gap: 0;
}

.fowler-slide.image-left .slide-image {
  order: 1;
  flex: 0 0 50%;
}

.fowler-slide.image-right .slide-image {
  order: 2;
  flex: 0 0 50%;
}

/* === Full Image Variant === */
.fowler-slide.full {
  justify-content: center;
}

.fowler-slide.full .slide-image {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.fowler-slide.full .slide-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 4rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

/* ======================================= */
/* ✍️ TEXT STYLING */
/* ======================================= */

.slide-text {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  color: #fff;
}

.fowler-slide.image-left .slide-text {
  order: 2;
  text-align: left;
}

.fowler-slide.image-right .slide-text {
  order: 1;
  text-align: right;
}

.slide-text h2,
.slide-text h1,
.slide-text h3,
.slide-text h4 {
  font-family: 'Amatic SC', serif;
  margin: 0;
  padding: 0;
}

.slider-title {
  font-family: 'Amatic SC', serif;
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  line-height: 0.5rem;
  margin: 0 0 1rem 0;
}

.slide-text p {
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  line-height: 1.6;
}

.slide-text a {
  color: #93d180;
  text-decoration: none;
}

.slide-text a:hover {
  text-decoration: underline;
}

.slider-title p {
  font-family: 'Amatic SC', serif;
  font-size: clamp(1.3rem, 3vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  line-height: 1.5rem;
  margin: 0.5rem 0;
}

/* 🌟 CTA BUTTONS - Polished and Responsive */
.buy-cta-button,
.learn-cta-button {
  font-family: 'Amatic SC', serif;
  border-radius: 9999px;
  font-weight: 600;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  text-decoration: none !important;
  color: #fff !important;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(139, 0, 69, 0.4);
  margin: 0.6rem auto;
  display: block;
  width: 100%;
}

/* 🎨 Individual Gradients */
.buy-cta-button {
  background: #E91E63;
}

.learn-cta-button {
  border: 2px solid #fff;
  color: #fff !important;
}

/* ✨ Hover Magic */
.buy-cta-button:hover,
.learn-cta-button:hover {
  transform: scale(1.08) rotate(-1deg);
  background: linear-gradient(135deg, #8b0045, #ff007c);
  box-shadow: 0 0 20px rgba(255, 0, 124, 0.6);
  letter-spacing: 0.5px;
}
/* ======================================= */
/* 🔥 ANIMATIONS */
/* ======================================= */

/* Pop-in for incoming image */
@keyframes popBoom {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

/* Text slide-in */
@keyframes blindIn {
  0%   { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Shared fade-out for both text + image */
@keyframes fade-out {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.6) translateY(10px);
  }
}

/* ======================================= */
/* 🎞️ ACTIVE SLIDE ANIMATIONS */
/* ======================================= */

.fowler-slide.active .slide-image {
  opacity: 1;
  transform: scale(1);
}

.fowler-slide.active .slide-text {
  opacity: 0;
  animation: blindIn 1s ease-out forwards;
}

/* ======================================= */
/* 💥 JS-TRIGGERED CLASSES */
/* ======================================= */

/* Incoming */
.pop-in {
  animation: popBoom 1.3s cubic-bezier(0.2,1.6,0.3,1) forwards;
}

.blind-in {
  animation: blindIn 1s ease-out forwards;
}

/* Outgoing (shared) */
.pop-out,
.fade-out {
  animation: fade-out 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: center center;
  will-change: transform, opacity;
}



/* Disable animations while disappearing to prevent flashes */
.fowler-slide.disappearing .slide-image,
.fowler-slide.disappearing .slide-text {
  opacity: 1; /* actual fade handled by JS animation */
}




/* ========================================================= */
/* 🌟 FOWLER SLIDE ANIMATIONS — FIXED FINAL VERSION          */
/* ========================================================= */

/* --------------------------------------------------------- */
/* 🔹 KEYFRAME ANIMATIONS */
/* --------------------------------------------------------- */

/* Book (image) pop-in */
@keyframes popBoom {
	0% {
		animation-timing-function: ease-in;
		opacity: 0;
		transform: scale(0);
	}

	38% {
		animation-timing-function: ease-out;
		opacity: 1;
		transform: scale(1);
	}

	55% {
		animation-timing-function: ease-in;
		transform: scale(0.7);
	}

	72% {
		animation-timing-function: ease-out;
		transform: scale(1);
	}

	81% {
		animation-timing-function: ease-in;
		transform: scale(0.84);
	}

	89% {
		animation-timing-function: ease-out;
		transform: scale(1);
	}

	95% {
		animation-timing-function: ease-in;
		transform: scale(0.95);
	}

	100% {
		animation-timing-function: ease-out;
		transform: scale(1);
	}
}

/* Text slide-in */
@keyframes blindIn {
	0% {
		opacity: 0;
		transform: translateY(250px);
	}

	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Book spin-out */
@keyframes book-out {
  0%   { opacity: 1; transform: rotate(0deg) scale(1); }
  100% { opacity: 0; transform: rotate(-540deg) scale(0); }
}

/* Text fade-down-out */
@keyframes textFadeOut {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(25px); }
}



/* --------------------------------------------------------- */
/* 🔹 ELEMENT-LEVEL ANIMATIONS (triggered by JS) */
/* --------------------------------------------------------- */

/* --- Incoming --- */
.slide-image.pop-in {
  animation: popBoom 1.3s ease 0s 1 normal forwards;
}

.slide-text.blind-in {
  animation: blindIn 1s ease-out 0.3s forwards;
}

/* --- Outgoing --- */
.slide-image.pop-out {
  animation: book-out 0.8s ease forwards;
  transform-origin: center center;
}

.slide-text.fade-out {
  animation: textFadeOut 0.8s ease forwards;
  transform-origin: center center;
}



/* --------------------------------------------------------- */
/* 🔹 SLIDE STATE CLASSES */
/* --------------------------------------------------------- */

.fowler-slide {
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  inset: 0;
}

.fowler-slide.active {
  opacity: 1;
  z-index: 2;
}

.fowler-slide.disappearing {
  z-index: 1;
}




/* --------------------------------------------------------- */
/* 🔹 SAFEGUARDS */
/* --------------------------------------------------------- */

.fowler-slide.active .slide-image,
.fowler-slide.active .slide-text,
.fowler-slide.disappearing .slide-image,
.fowler-slide.disappearing .slide-text {
  backface-visibility: hidden;
  animation-composition: replace;
}






/* ======================================= */
/* 📱 RESPONSIVE BEHAVIOUR */
/* ======================================= */

#heroleft .slide-text {
  position: relative;
  z-index: 1;
  padding: 2rem !important;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .fowler-slideshow {
    height: 80vh;
    min-height: 450px;
    flex-direction: row;
    align-items: stretch;
  }

  .fowler-slide {
    flex-direction: row;
    align-items: center;
  }

  .slide-image,
  .slide-text {
    flex: 1 1 50%;
    max-width: 50%;
  }

  .slide-image {
    height: 100%;
    width: 80%;
    background-size: cover;
    background-position: center;
  }

  .slide-text {
    padding: 0 20px;
    font-size: 0.95em;
  }

  .fowler-slide.full .slide-image {
    position: absolute;
    inset: 0;
  }

  .fowler-slide.full .slide-text {
    position: relative;
    z-index: 2;
    padding: 2rem;
    max-width: 90%;
  }

  .slider-title p {
    line-height: clamp(1rem, 2vw, 1.3rem);
  }
}

@media (max-width: 600px) {
  .fowler-slideshow {
    height: 70vh;
    min-height: 400px;
  }

  .slide-text {
    padding: 1.2rem;
  }

  #heroleft .slide-text {
    padding: 0 5px !important;
  }

  .slide-image {
    height: 84%;
  }

  .slide-text p {
    font-size: 9px;
    line-height: 1.6;
  }

  .slider-title p {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    line-height: 1rem;
  }
}



/* ========================================================= */
/* 🎯 SLIDE NAVIGATION DOTS */
/* ========================================================= */

.fowler-dots {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.fowler-slideshow:hover .fowler-dots,
.fowler-slideshow:focus-within .fowler-dots {
  opacity: 1;
  pointer-events: all;
}

.fowler-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #E91E63;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.fowler-dot:hover,
.fowler-dot:focus {
  transform: scale(1.3);
  background: #E91E63;
}

.fowler-dot.active {
  background: #E91E63;
  box-shadow: 0 0 6px #fff;
}


.fowler-slide .slide-content {
  display: flex;
  flex-direction: column; /* stack image above text */
  align-items: center;
  text-align: center;
}

.slide-image {
  width: 100%;
  max-width: 500px;
}



.flip-front,
.flip-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  backface-visibility: hidden;
  transition: transform 0.6s;
     cursor: pointer; /* 👈 shows it's interactive */
}

/* ✅ This part is the missing piece */
.flip-wrap .flip-back {
  transform: rotateY(180deg);
}

/* ✅ Wrap the two sides in a rotatable inner container */
.flip-wrap-inner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

/* ✅ Flip effect on hover/focus */
.flip-wrap:hover .flip-wrap-inner,
.flip-wrap:focus-within .flip-wrap-inner {
  transform: rotateY(180deg);
}

.slide-text {
  margin-top: 1rem;
  max-width: 500px;
}

