/* Destination: /home/ale/p2a/static/css/about.css
   Purpose: Premium responsive carousel (Plymouth To Airport)
   Update for Al:
   - Carousel width behaves like booking form container:
        -> full width but capped with a max-width, centred
        -> NOT fixed 50vw anymore
   - Height is NOT fixed. Each image sets its own natural height.
   - Every image must fit 100% inside (no crop, show whole photo),
     portrait stays portrait, landscape stays landscape.
   Style: executive airport transfer / discreet luxury / British tone
*/

/* =========================================================
   GLOBAL UTIL
========================================================= */

/* Full opacity with priority */
.opacity-100 { opacity: 1 !important; }

/* ===== Fixed background layer (GPU-friendly) =====
   Layer full-screen behind the About page.
*/
#fixed-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
}

/* pseudo-element for performance on mobile */
#fixed-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/static/img/about50.jpg"); /* update if needed */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: translateZ(0); /* GPU hint */
}

/* ===== Transparent overlay above background =====
   You can darken under the carousel if contrast is weak.
*/
#overlay-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

#overlay-bg .bg-overlay {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.0); /* tweak if you want it dimmer */
  z-index: 2;
  pointer-events: none;
  transition: background 0.7s cubic-bezier(.4,0,.2,1);
}


/* =========================================================
   CAROUSEL OUTER
   NEW RULE:
   - Works like the booking form container.
   - width: 100% but capped by max-width (desktop comfort width).
   - always centred with auto margins.
   - NO fixed height. Height comes from current slide image.
========================================================= */
#carousel-outer {
  position: relative;

  /* booking-style sizing */
  width: 100%;
  max-width: 64rem;   /* ~1024px, same vibe as Tailwind max-w-5xl */
  min-width: 320px;
  margin-left: auto;
  margin-right: auto;

  /* breathing space under */
  margin-bottom: 2rem;

  border-radius: 1.5rem;
  overflow: hidden;

  /* Glass / VIP card aesthetic */
  background: radial-gradient(
      circle at 20% 20%,
      rgba(255,255,255,0.12) 0%,
      rgba(0,0,0,0) 60%
    ),
    rgba(20,20,20,0.5);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    0 60px 120px rgba(0,0,0,0.9),
    0 20px 40px rgba(0,0,0,0.8),
    0 0 120px rgba(255,255,255,0.08);
}

/* Slightly tighter radius/shadow on smaller screens */
@media (max-width: 1024px) {
  #carousel-outer {
    border-radius: 1.25rem;
    box-shadow:
      0 50px 100px rgba(0,0,0,0.9),
      0 20px 40px rgba(0,0,0,0.8),
      0 0 100px rgba(255,255,255,0.07);
  }
}

@media (max-width: 640px) {
  #carousel-outer {
    border-radius: 1rem;
    box-shadow:
      0 40px 80px rgba(0,0,0,0.9),
      0 16px 32px rgba(0,0,0,0.8),
      0 0 80px rgba(255,255,255,0.06);
    max-width: 100%;
    min-width: 0;
  }
}


/* =========================================================
   TRACK / SLIDE STRIP
   - Flex row with all slides.
   - JS applies translateX().
   - We do NOT force any fixed height here.
========================================================= */
#carousel-images {
  display: flex;
  flex-direction: row;
  align-items: stretch;      /* each slide defines its own height */
  width: 100%;
  transition: transform 0.8s ease-in-out;
  will-change: transform;
}

/* Each direct child = a slide */
#carousel-images > div {
  flex-shrink: 0;
  width: 100%;
  position: relative;

  /* The image inside sets the height. */
  display: flex;
  justify-content: center;
  align-items: flex-start;

  overflow: hidden; /* keep overlay/buttons inside rounded card */
}


/* =========================================================
   SLIDE IMAGE
   CRITICAL:
   - Show entire photo (no crop).
   - Width: fill container width (which is max ~1024px now).
   - Height: auto = keep aspect ratio.
   - Portrait stays tall. Landscape stays wide. We do not stretch.
========================================================= */
.fade-img {
  display: block;

  width: 100%;
  max-width: 100%;
  height: auto;

  object-fit: contain;
  object-position: center center;

  border-radius: 0; /* frame already rounded */

  opacity: 0;
  filter: brightness(0.9) saturate(0.95);
  transition:
    opacity 0.6s ease-in-out,
    filter 0.6s ease-in-out;
  will-change: opacity, filter;
}

.fade-img.active {
  opacity: 1 !important;
  filter: brightness(1) saturate(1);
  transform: none;
  animation: none;
}

@media (max-width: 640px) {
  .fade-img {
    border-radius: 0;
  }
}


/* =========================================================
   CAPTION OVERLAY (headline + subline)
   stays top-centre over the image, with gradient fade bg
========================================================= */
.slide-caption {
  position: absolute;
  z-index: 4; /* above image */

  top: 1rem;
  left: 50%;
  transform: translateX(-50%);

  max-width: 85%;
  text-align: center;
  color: #fff;

  background: rgba(0,0,0,0.10); /* subtle dark glass */
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 0.75rem;
  padding: 0.6rem 0.9rem;

  backdrop-filter: blur(4px) saturate(140%);
  -webkit-backdrop-filter: blur(4px) saturate(140%);

  box-shadow:
    0 16px 32px rgba(0,0,0,0.6),
    0 2px 4px rgba(0,0,0,0.6),
    0 0 20px rgba(255,255,255,0.06);
}

.slide-caption .headline {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.7);
  margin-bottom: 0.3rem;
}

.slide-caption .subline {
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

@media (min-width: 640px) {
  .slide-caption {
    max-width: 60%;
    padding: 0.7rem 1rem;
  }
  .slide-caption .headline {
    font-size: 1.1rem;
  }
  .slide-caption .subline {
    font-size: 0.9rem;
  }
}


/* =========================================================
   NAV BUTTONS (prev / next)
   absolute middle-left / middle-right
========================================================= */
#carousel-prev,
#carousel-next {
  position: absolute;
  z-index: 5;
  top: 50%;
  transform: translateY(-50%);

  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;

  font-size: 0.9rem;
  line-height: 1;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(6px) saturate(160%);
  -webkit-backdrop-filter: blur(6px) saturate(160%);

  box-shadow:
    0 20px 40px rgba(0,0,0,0.9),
    0 2px 4px rgba(0,0,0,0.8),
    0 0 30px rgba(255,255,255,0.12);

  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

#carousel-prev { left: 0.75rem; }
#carousel-next { right: 0.75rem; }

#carousel-prev:hover,
#carousel-next:hover,
#carousel-prev:focus,
#carousel-next:focus {
  background: rgba(255,255,255,0.18);
  color: #fff;
  box-shadow:
    0 24px 50px rgba(0,0,0,0.9),
    0 4px 8px rgba(0,0,0,0.9),
    0 0 40px rgba(255,255,255,0.25);
  transform: translateY(-50%) scale(1.05);
  outline: none;
}

@media (max-width: 400px) {
  #carousel-prev,
  #carousel-next {
    width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
  }
  #carousel-prev { left: 0.5rem; }
  #carousel-next { right: 0.5rem; }
}


/* =========================================================
   DOTS / PAGINATION
   spaced dots, bottom overlay
========================================================= */
#carousel-dots {
  position: absolute;
  z-index: 6;
  bottom: 0.5rem;
  left: 0;
  width: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  gap: 0.75rem;
  pointer-events: none;
}

#carousel-dots::before,
#carousel-dots::after {
  content: "";
  flex: 0 0 1.5rem;
}

#carousel-dots button,
#carousel-dots .carousel-dot {
  pointer-events: auto;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 9999px;

  background: rgba(255,255,255,0.5);
  box-shadow:
    0 0 8px rgba(255,255,255,0.6),
    0 0 2px rgba(255,255,255,0.9);

  transition: all 0.3s ease;
  transform: scale(0.8);
  opacity: 0.5;
}

#carousel-dots button:hover,
#carousel-dots .carousel-dot:hover {
  background: rgba(255,255,255,0.8);
  transform: scale(1);
  opacity: 0.9;
}

#carousel-dots button.active-dot,
#carousel-dots .active-dot,
#carousel-dots button.ring-2 {
  background: #ffffff;
  opacity: 1;
  transform: scale(1.2);
  box-shadow:
    0 0 10px rgba(255,255,255,0.8),
    0 0 40px rgba(255,255,255,0.4),
    0 6px 20px rgba(0,0,0,0.9);
}
