/* ================================================================
   SGG Hero Slider Pro — Frontend Styles
   Version 1.0.0
================================================================ */

/* ── Slideshow container ─────────────────────────────────── */
.sgg-sp-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

/* ── Individual slides ───────────────────────────────────── */
.sgg-sp-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.sgg-sp-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform, opacity, filter;
}

/* ── Overlay ─────────────────────────────────────────────── */
.sgg-sp-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── Slide caption ───────────────────────────────────────── */
.sgg-sp-caption {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  pointer-events: none;
}

.sgg-sp-caption-title {
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease 0.3s, transform 0.7s ease 0.3s;
}

.sgg-sp-caption-subtitle {
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: rgba(255,255,255,0.88);
  margin: 0 0 24px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 0.45s, transform 0.7s ease 0.45s;
}

.sgg-sp-caption-btn {
  display: inline-block;
  padding: 13px 32px;
  background: #3ecf6e;
  color: #0f1117;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 3px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease 0.6s, transform 0.7s ease 0.6s, background 0.2s ease;
}

.sgg-sp-caption-btn:hover {
  background: #2eb85c;
  color: #fff;
}

/* Caption visible state */
.sgg-sp-slide.sgg-sp-active .sgg-sp-caption-title,
.sgg-sp-slide.sgg-sp-active .sgg-sp-caption-subtitle,
.sgg-sp-slide.sgg-sp-active .sgg-sp-caption-btn {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   EFFECTS — base (all slides hidden by default)
================================================================ */

/* ── 1. FADE ─────────────────────────────────────────────── */
.sgg-sp-fx-fade .sgg-sp-slide {
  opacity: 0;
  transition: opacity var(--sgg-sp-speed, 1s) ease;
  z-index: 1;
}
.sgg-sp-fx-fade .sgg-sp-slide.sgg-sp-active {
  opacity: 1;
  z-index: 2;
}

/* ── 2. KEN BURNS ZOOM ───────────────────────────────────── */
@keyframes sgg-kenburns-1 {
  0%   { transform: scale(1)    translate(0, 0); }
  100% { transform: scale(1.12) translate(-2%, -1%); }
}
@keyframes sgg-kenburns-2 {
  0%   { transform: scale(1)    translate(0, 0); }
  100% { transform: scale(1.10) translate(2%, 1%); }
}
@keyframes sgg-kenburns-3 {
  0%   { transform: scale(1.06) translate(1%, 1%); }
  100% { transform: scale(1)    translate(-1%, -2%); }
}

.sgg-sp-fx-zoom .sgg-sp-slide {
  opacity: 0;
  z-index: 1;
  transition: opacity var(--sgg-sp-speed, 1s) ease;
}
.sgg-sp-fx-zoom .sgg-sp-slide.sgg-sp-active {
  opacity: 1;
  z-index: 2;
}
.sgg-sp-fx-zoom .sgg-sp-slide.sgg-sp-active img {
  animation: sgg-kenburns-1 var(--sgg-sp-duration, 7s) ease-out forwards;
}
.sgg-sp-fx-zoom .sgg-sp-slide:nth-child(2n).sgg-sp-active img {
  animation-name: sgg-kenburns-2;
}
.sgg-sp-fx-zoom .sgg-sp-slide:nth-child(3n).sgg-sp-active img {
  animation-name: sgg-kenburns-3;
}

/* ── 3. SLIDE LEFT ───────────────────────────────────────── */
.sgg-sp-fx-slide-left .sgg-sp-slide {
  z-index: 1;
  transition: transform var(--sgg-sp-speed, 0.9s) cubic-bezier(0.77, 0, 0.175, 1),
              opacity   var(--sgg-sp-speed, 0.9s) ease;
}
.sgg-sp-fx-slide-left .sgg-sp-slide.sgg-sp-leaving {
  transform: translateX(-100%);
  opacity: 0;
  z-index: 2;
}
.sgg-sp-fx-slide-left .sgg-sp-slide.sgg-sp-entering {
  transform: translateX(100%);
  opacity: 0;
  z-index: 2;
}
.sgg-sp-fx-slide-left .sgg-sp-slide.sgg-sp-active {
  transform: translateX(0);
  opacity: 1;
  z-index: 3;
}

/* ── 4. SLIDE UP ─────────────────────────────────────────── */
.sgg-sp-fx-slide-up .sgg-sp-slide {
  z-index: 1;
  transition: transform var(--sgg-sp-speed, 0.9s) cubic-bezier(0.77, 0, 0.175, 1),
              opacity   var(--sgg-sp-speed, 0.9s) ease;
}
.sgg-sp-fx-slide-up .sgg-sp-slide.sgg-sp-leaving {
  transform: translateY(-100%);
  opacity: 0;
  z-index: 2;
}
.sgg-sp-fx-slide-up .sgg-sp-slide.sgg-sp-entering {
  transform: translateY(100%);
  opacity: 0;
  z-index: 2;
}
.sgg-sp-fx-slide-up .sgg-sp-slide.sgg-sp-active {
  transform: translateY(0);
  opacity: 1;
  z-index: 3;
}

/* ── 5. BLUR REVEAL ──────────────────────────────────────── */
.sgg-sp-fx-blur .sgg-sp-slide {
  opacity: 0;
  z-index: 1;
}
.sgg-sp-fx-blur .sgg-sp-slide img {
  transition: opacity var(--sgg-sp-speed, 1s) ease,
              filter  var(--sgg-sp-speed, 1s) ease;
  filter: blur(24px) brightness(1.1);
  opacity: 0;
}
.sgg-sp-fx-blur .sgg-sp-slide.sgg-sp-active {
  opacity: 1;
  z-index: 2;
}
.sgg-sp-fx-blur .sgg-sp-slide.sgg-sp-active img {
  filter: blur(0) brightness(1);
  opacity: 1;
}
.sgg-sp-fx-blur .sgg-sp-slide.sgg-sp-leaving img {
  filter: blur(24px) brightness(0.8);
  opacity: 0;
}

/* ── 6. SCALE & FADE ─────────────────────────────────────── */
.sgg-sp-fx-scale .sgg-sp-slide {
  opacity: 0;
  z-index: 1;
  transition: opacity var(--sgg-sp-speed, 1s) ease;
}
.sgg-sp-fx-scale .sgg-sp-slide img {
  transform: scale(1.14);
  transition: transform var(--sgg-sp-speed, 1s) ease;
}
.sgg-sp-fx-scale .sgg-sp-slide.sgg-sp-active {
  opacity: 1;
  z-index: 2;
}
.sgg-sp-fx-scale .sgg-sp-slide.sgg-sp-active img {
  transform: scale(1);
}
.sgg-sp-fx-scale .sgg-sp-slide.sgg-sp-leaving img {
  transform: scale(0.88);
}

/* ── 7. DIGITAL GLITCH ───────────────────────────────────── */
@keyframes sgg-glitch-clip {
  0%   { clip-path: inset(0 0 95% 0); transform: translateX(-6px); }
  10%  { clip-path: inset(30% 0 50% 0); transform: translateX(6px); }
  20%  { clip-path: inset(60% 0 20% 0); transform: translateX(-4px); }
  30%  { clip-path: inset(10% 0 75% 0); transform: translateX(4px); }
  40%  { clip-path: inset(80% 0 5% 0);  transform: translateX(-6px); }
  50%  { clip-path: inset(40% 0 40% 0); transform: translateX(6px); }
  60%  { clip-path: inset(5% 0 85% 0);  transform: translateX(-3px); }
  70%  { clip-path: inset(70% 0 10% 0); transform: translateX(3px); }
  80%  { clip-path: inset(20% 0 60% 0); transform: translateX(-5px); }
  90%  { clip-path: inset(50% 0 30% 0); transform: translateX(5px); }
  100% { clip-path: inset(0 0 0 0);      transform: translateX(0); }
}

@keyframes sgg-glitch-rgb {
  0%   { opacity: 0.8; filter: hue-rotate(0deg)   saturate(3); }
  25%  { opacity: 0.6; filter: hue-rotate(90deg)  saturate(4); }
  50%  { opacity: 0.9; filter: hue-rotate(180deg) saturate(2); }
  75%  { opacity: 0.7; filter: hue-rotate(270deg) saturate(5); }
  100% { opacity: 0;   filter: hue-rotate(360deg) saturate(1); }
}

.sgg-sp-fx-glitch .sgg-sp-slide {
  opacity: 0;
  z-index: 1;
}
.sgg-sp-fx-glitch .sgg-sp-slide.sgg-sp-active {
  opacity: 1;
  z-index: 2;
}
.sgg-sp-fx-glitch .sgg-sp-slide.sgg-sp-leaving {
  z-index: 3;
  animation: sgg-glitch-clip 0.5s steps(1) forwards,
             sgg-glitch-rgb  0.5s steps(1) forwards;
}
.sgg-sp-fx-glitch .sgg-sp-slide.sgg-sp-leaving::before,
.sgg-sp-fx-glitch .sgg-sp-slide.sgg-sp-leaving::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: cover;
  mix-blend-mode: screen;
  animation: sgg-glitch-clip 0.3s steps(1) forwards;
}
.sgg-sp-fx-glitch .sgg-sp-slide.sgg-sp-leaving::before {
  filter: hue-rotate(120deg);
  transform: translateX(-4px);
  opacity: 0.6;
}
.sgg-sp-fx-glitch .sgg-sp-slide.sgg-sp-leaving::after {
  filter: hue-rotate(240deg);
  transform: translateX(4px);
  opacity: 0.6;
}

/* ================================================================
   NAVIGATION — Arrows
================================================================ */
.sgg-sp-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  outline: none;
}
.sgg-sp-arrow:hover {
  background: rgba(62, 207, 110, 0.3);
  border-color: rgba(62, 207, 110, 0.6);
  transform: translateY(-50%) scale(1.08);
}
.sgg-sp-arrow-prev { left: 20px; }
.sgg-sp-arrow-next { right: 20px; }

/* ================================================================
   NAVIGATION — Dots
================================================================ */
.sgg-sp-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
}

.sgg-sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
  outline: none;
}
.sgg-sp-dot.sgg-sp-dot-active {
  background: #3ecf6e;
  width: 24px;
  border-radius: 4px;
}
.sgg-sp-dot:hover {
  background: rgba(255,255,255,0.75);
}

/* ================================================================
   PROGRESS BAR
================================================================ */
.sgg-sp-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: #3ecf6e;
  z-index: 11;
  transition: none;
  box-shadow: 0 0 8px rgba(62,207,110,0.6);
}
.sgg-sp-progress.sgg-sp-progress-run {
  transition: width linear;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 768px) {
  .sgg-sp-arrow { display: none; }
  .sgg-sp-caption { padding: 20px 16px; }
  .sgg-sp-caption-btn { padding: 11px 24px; font-size: 0.85rem; }
}

/* ================================================================
   MOBILE LAYOUT FIX
   Full-width image with text overlaid on top — same as desktop
================================================================ */
@media (max-width: 768px) {

  /* Hero becomes a positioning container, tall enough for content */
  #sgg-hero {
    display: block !important;
    position: relative !important;
    min-height: 520px !important;
    overflow: hidden !important;
  }

  /* Slider fills the entire hero behind the text */
  .sgg-hero-photo {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    z-index: 0 !important;
  }

  /* Text sits on top of the image */
  .sgg-hero-text-col {
    position: relative !important;
    z-index: 2 !important;
    background: transparent !important;
    min-height: 520px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Remove the grey diagonal wedge on mobile too */
  .sgg-hero-text-col::after {
    display: none !important;
  }

  /* Centre the text content block */
  .sgg-hero-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    max-width: 100% !important;
    padding: 40px 24px !important;
    margin: 0 !important;
  }

  /* White text so it shows over the image */
  .sgg-hero-text-col .sgg-label,
  .sgg-hero-text-col .sgg-hero-h1,
  .sgg-hero-text-col .sgg-hero-sub,
  .sgg-hero-text-col .sgg-badge-label {
    color: #ffffff !important;
  }

  .sgg-hero-text-col .dot { color: #3ecf6e !important; }

  /* Centre badges */
  .sgg-hero-badges { justify-content: center !important; }

  /* Slider wrapper fills the photo container */
  .sgg-hero-photo .sgg-sp-slider {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .sgg-hero-photo .sgg-sp-slide,
  .sgg-hero-photo .sgg-sp-slide img {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
}
