/* === Vanilla Slider Deluxe UX Edition – 2025 (Glass Premium) === */
.vanilla-slider {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  position: relative; 
  display:block;
}

/* Spår för slides */
.vanilla-slider .slider-track {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  transition: transform 0.5s ease;
}

/* Enskild slide */
.vanilla-slider .slide {
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex: 0 0 100%;
}

/* ===== Premium Glass Overlay ===== */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Multi-lager: mjuk vignett + riktat ljus + subtil color wash */
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255,255,255,.20) 0%, rgba(255,255,255,0) 55%) /* top glow */
    , radial-gradient(100% 70% at 80% 10%, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 60%) /* secondary glow */
    , linear-gradient(180deg, rgba(9, 12, 20, .35) 0%, rgba(9, 12, 20, .55) 55%, rgba(9, 12, 20, .65) 100%); /* depth */
  /* Subtil glitternoise via mask (kräver modern browser; fallbacks ser ändå bra ut) */
  -webkit-mask-image: radial-gradient(120% 120% at 50% 0%, rgba(0,0,0,.95), rgba(0,0,0,1));
          mask-image: radial-gradient(120% 120% at 50% 0%, rgba(0,0,0,.95), rgba(0,0,0,1));
}
/* ===== Glass Content Card — DARK (premium tuned) ===== */
.hero-content {
  position: relative;
  z-index: 2;
  color: var(--font-color, #fff);
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.22) 0%, rgba(255,255,255,.06) 45%, rgba(255,255,255,.02) 100%),
    var(--layer, rgba(15,19,32,.35));
  border: 1px solid color-mix(in srgb, #ffffff 22%, transparent);
  border-radius: 18px;
  padding: 2.5rem 2.5rem 5rem;
  box-shadow:
    0 30px 80px rgba(14,20,36,.35),
    inset 0 1px 0 color-mix(in srgb, #ffffff 45%, transparent),
    inset 0 -1px 0 rgba(255,255,255,.08); /* svag bottenkant */
  backdrop-filter: blur(18px) saturate(125%) contrast(102%);
  -webkit-backdrop-filter: blur(18px) saturate(125%) contrast(102%);
  max-width: 800px;
  max-height: none;
  overflow: visible; /* undvik intern scrollbar */
  text-align: left;
  font-size: 1.2rem;
  line-height: 1.6;
  animation: fadeInUp .8s ease;
  isolation: isolate;
  /* Läsbarhet på mörk bakgrund */
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
.hero-content::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    linear-gradient(135deg,
      rgba(255,255,255,.18) 0%,   /* tidigare .35 → ner till .18 */
      rgba(255,255,255,.08) 25%,  /* tidigare .12 → ner till .08 */
      rgba(255,255,255,0) 40%,
      rgba(255,255,255,0) 60%,
      rgba(255,255,255,.06) 75%,  /* tidigare .10 → ner till .06 */
      rgba(255,255,255,.14) 100%  /* tidigare .28 → ner till .14 */
    );
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
}

.hero-content::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 20%, rgba(255,255,255,.06) 0, rgba(255,255,255,0) 100%),
    radial-gradient(1px 1px at 80% 40%, rgba(255,255,255,.04) 0, rgba(255,255,255,0) 100%),
    radial-gradient(1px 1px at 60% 80%, rgba(255,255,255,.05) 0, rgba(255,255,255,0) 100%);
  opacity: .7;
}

/* ===== Glass Content Card — LIGHT (premium glass) ===== */
[data-theme="light"] .hero-content {
  color: #0f1320; /* mörk text */
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.58) 0%, rgba(255,255,255,.32) 45%, rgba(255,255,255,.18) 100%),
    rgba(240,243,248,.38); /* ljus glas-tint, ej solid */
  border: 1px solid color-mix(in srgb, #ffffff 62%, transparent);
  box-shadow:
    0 24px 60px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.70),
    inset 0 -1px 0 rgba(255,255,255,.40);
  backdrop-filter: blur(20px) saturate(170%) contrast(102%);
  -webkit-backdrop-filter: blur(20px) saturate(170%) contrast(102%);
  text-shadow: none; /* inte behövs på ljus */
}

[data-theme="light"] .hero-content::before {
  background: linear-gradient(135deg,
      rgba(255,255,255,.85) 0%,
      rgba(255,255,255,.35) 28%,
      rgba(255,255,255,0) 55%,
      rgba(255,255,255,0) 70%,
      rgba(255,255,255,.22) 88%,
      rgba(255,255,255,.35) 100%);
}

[data-theme="light"] .hero-content::after {
  background-image:
    radial-gradient(1px 1px at 22% 22%, rgba(0,0,0,.05) 0, rgba(0,0,0,0) 100%),
    radial-gradient(1px 1px at 78% 38%, rgba(0,0,0,.03) 0, rgba(0,0,0,0) 100%),
    radial-gradient(1px 1px at 60% 80%, rgba(0,0,0,.04) 0, rgba(0,0,0,0) 100%);
  opacity: .5;
}

/* Fokusring i light */
[data-theme="light"] .hero-content :where(a,button,[role="button"],.btn):focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(16,19,28,.55), 0 0 0 6px rgba(255,193,7,.35);
  border-radius: 12px;
}

/* Light + kompakt */
[data-theme="light"] .hero-content.glass-compact { padding: 1.25rem 1.25rem 1.75rem; }

/* För rubriker/länkar inne i glaset – bättre läsbarhet/djup */
.hero-content :where(h1,h2,h3){ letter-spacing:.2px; }
.hero-content a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Reducera animationer om användaren önskar */
@media (prefers-reduced-motion: reduce) {
  .hero-content { animation: none; }
}

/* Diskret fokusring för knappar/länkar i .hero-content */
.hero-content :where(a,button,[role="button"],.btn):focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.65), 0 0 0 6px rgba(255,193,7,.35);
  border-radius: 12px;
}

/* Kompakt variant att slå på vid behov */
.hero-content.glass-compact { padding: 1.5rem 1.5rem 2rem; }



/* Fade-in animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Nav-knappar (glass pills) ===== */
.slider-nav-inside {
  position: absolute;
  bottom: 40px;
  left: 40px;
  display: flex;
  gap: 12px;
  z-index: 3;
}

.slider-nav-inside .slider-prev,
.slider-nav-inside .slider-next {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.14) 0%, rgba(255,255,255,.06) 45%, rgba(255,255,255,.03) 100%),
    rgba(10, 14, 24, .45);
  color: var(--nav-color, #fff);
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, #ffffff 20%, transparent);
  box-shadow:
    0 10px 22px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.35);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.slider-nav-inside .slider-prev:hover,
.slider-nav-inside .slider-next:hover {
  transform: translateY(-1px);
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.20) 0%, rgba(255,255,255,.10) 45%, rgba(255,255,255,.05) 100%),
    rgba(255, 193, 7, .75);
  color: #10131c;
  box-shadow: 0 12px 26px rgba(255,193,7,.35), inset 0 1px 0 rgba(255,255,255,.55);
}

/* Dots (glass beads) */
.vanilla-slider .slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}
.vanilla-slider .slider-dots .dot {
  width: 10px; height: 10px; display:inline-block; border-radius: 999px;
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.35) 0%, rgba(255,255,255,.10) 45%, rgba(255,255,255,.06) 100%),
    rgba(255,255,255,.18);
  border: 1px solid color-mix(in srgb, #ffffff 28%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 10px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.vanilla-slider .slider-dots .dot.active {
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255,255,255,.45) 0%, rgba(255,255,255,.16) 45%, rgba(255,255,255,.08) 100%),
    #ffc107;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 0 18px rgba(255,193,7,.65);
  transform: scale(1.18);
}

/* Bildbakgrunder */
.bg1 { background: url(images/isolering.webp) top/cover no-repeat; }
.bg2 { background: url(images/isolering02.webp) top/cover no-repeat; }
.bg3 { background: url(images/isolering03.webp) top/cover no-repeat; }

/* Knappfokus – tillgängligt men diskret glassring */
.slider-prev,
.slider-next {
  outline: none;
  border: none;
  box-shadow: none;
}
.slider-prev:focus-visible,
.slider-next:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.65), 0 0 0 6px rgba(255,193,7,.45);
  transition: box-shadow .2s ease;
}
.slider-prev:focus,
.slider-prev:active,
.slider-next:focus,
.slider-next:active {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Motion-reducering */
@media (prefers-reduced-motion: reduce) {
  .vanilla-slider .slider-track { transition: none; }
  .hero-content { animation: none; }
}

/* ===== Responsivitet ===== */
@media (max-width: 480px) {
  .slider-nav-inside .slider-prev,
  .slider-nav-inside .slider-next {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  .slider-nav-inside {
    position: relative;
    bottom: 10px;
    left: 40px;
    gap: 12px;
    z-index: 10;
    padding:0px;
  }
  
  .hero-content {
    padding-bottom: 25rem;
  }

  .vanilla-slider {
    width: 100%;
    height: auto;
    min-height: auto;
  }

  .vanilla-slider .slide {
    height: auto;
    min-height: auto;
    flex: 0 0 auto;
    padding: 3rem 1rem 2rem 1rem;
    box-sizing: border-box;
    background: none !important;
  }

  .vanilla-slider .slide.bg1,
  .vanilla-slider .slide.bg2,
  .vanilla-slider .slide.bg3,
  .vanilla-slider .slide.bg4 {
    background: none !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .hero-content {
    max-height: none;
    overflow: visible;
    font-size: 1rem;
    padding: 1rem;
    margin: 0 auto;
    width: 100%;
  }

  .hero-overlay {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .vanilla-slider {
    width: 100%;
    height: auto;
    min-height: auto;
  }

  .vanilla-slider .slide {
    height: auto;
    min-height: auto;
    flex: 0 0 auto;
    padding: 7rem 2rem 6rem 2rem; /* justera efter behov */
    box-sizing: border-box;
    padding-right: 25rem;
  }

  .vanilla-slider .slide.bg1,
  .vanilla-slider .slide.bg2,
  .vanilla-slider .slide.bg3,
  .vanilla-slider .slide.bg4 {
    min-height: 0 !important;
    height: auto !important;
  }

  .slider-nav-inside {
    bottom: 2rem;
    left: 1.5rem;
    gap: 12px;
  }

  .slider-nav-inside .slider-prev,
  .slider-nav-inside .slider-next {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .hero-content {
    padding-bottom: 20rem; /* som på mobil */
    max-width: 480px;
    overflow: visible;
    margin: 0 auto;
  }
}

/* === Glass overflow hotfix (desktop) === */
@media (min-width: 1025px) {
  .vanilla-slider .slide {
    padding: 3rem 2.5rem;
  }

  .hero-content {
    overflow: visible;
    max-height: none;
    padding-bottom: 2.5rem;
  }
}

/* Om du fortfarande vill ha en övre gräns utan scrollbar: */
@media (min-width: 1025px) {
  .hero-content.is-capped {
    max-height: calc(100vh - 8rem); /* 8rem marginal till kanter/nav */
    overflow: clip;                  /* döljer utan scrollbar (modern) */
    overflow: hidden;
  }
}