/* Abbado – vekslende bildebanner. Lastes etter style.css. */

.hero {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 1.25rem;
  overflow: hidden;
  border-radius: 10px;
}

/* Før bildene er på plass: det opprinnelige bildet vises som før */
.hero .hero-fallback {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* Når karusellen er aktiv: bredt format */
/* Hele bildet vises uten beskjæring. Bredden begrenses i stedet,
   slik at høyden blir passe, og banneret sentreres med hvitt på sidene. */
.hero.hero--active {
  aspect-ratio: 1584 / 672;   /* samme format som bildene */
  max-width: 900px;           /* gir maks ca. 382 px høyde */
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}
.hero.hero--compact.hero--active {
  max-width: 707px;           /* undersidene: maks ca. 300 px høyde */
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.hero-slide.is-active { opacity: 1; }

.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 2;
}
.hero-dots button {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}
.hero-dots button.is-active { background: #fff; }
.hero-dots button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Mobil: høyere format så ansiktene ikke blir for små */
@media (max-width: 640px) {
  .hero { border-radius: 0; }
  .hero.hero--active,
  .hero.hero--compact.hero--active { aspect-ratio: 4 / 3; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
}
