/* Exact production HeroBanner geometry from skeidar.no Emotion CSS */

/* Banner Size. The option an editor picks on the Hero Banner arrives as hero-banner--{option}
   (lower case, spaces as hyphens) and these rules decide how tall it is. A banner with no size,
   or with an option that has no rule here, gets the default below. A size added to the CMS
   dropdown needs only one more rule like these. */
.hero-banner {
  --hero-height-desktop: 50vh;
  --hero-height-mobile: 200px;
}

.hero-banner--medium {
  --hero-height-desktop: 75vh;
  --hero-height-mobile: 350px;
}

.hero-banner--large {
  --hero-height-desktop: 100vh;
  --hero-height-mobile: 400px;
}

.hero-banner__container {
  width: 100%;
  max-width: none;
  /* Live: height: calc(100vh - 33.5px - 70px) with heroheight="100vh" */
  height: calc(var(--hero-height-desktop, 50vh) - var(--announcement-bar-height, 0px) - 70px);
  min-height: calc(var(--hero-height-desktop, 50vh) - var(--announcement-bar-height, 0px) - 70px);
  margin-inline: 0;
  position: relative;
  overflow: hidden;
}

@media (max-width: 599.95px) {
  .hero-banner__container {
    height: var(--hero-height-mobile, 200px);
    min-height: var(--hero-height-mobile, 200px);
  }
}

.hero-banner__carousel {
  width: 100%;
  height: 100%;
  position: relative;
  /* Prefer horizontal drag for slide changes (live skeidar.no swipe) */
  touch-action: pan-y;
}

/* Critical: Swiper reparents slides — height must survive the full DOM chain */
.hero-banner__carousel .Swipper,
.hero-banner__carousel .swiper,
.hero-banner__carousel .swiper-wrapper,
.hero-banner__carousel .swiper-slide {
  height: 100% !important;
  width: 100%;
  box-sizing: border-box;
  touch-action: pan-y;
}

.hero-banner__carousel .Swipper {
  position: relative;
}

.hero-banner__carousel .swiper {
  position: relative;
  overflow: hidden;
}

/* Full-bleed slides — no CSwiper gutters on the hero */
.hero-banner__carousel.Swipper--disable-internal-spacing > .swiper > .swiper-wrapper > .swiper-slide,
.hero-banner__carousel .Swipper--disable-internal-spacing > .swiper > .swiper-wrapper > .swiper-slide,
.hero-banner__carousel .swiper-slide {
  margin-right: 0 !important;
}

.hero-banner__slide {
  position: relative;
  height: 100%;
  width: 100%;
}

.hero-banner__slide-hit {
  cursor: grab;
  height: 100%;
  width: 100%;
  display: block;
  color: inherit;
  text-decoration: none;
  user-select: none;
  -webkit-user-drag: none;
}

.hero-banner__slide-hit:active {
  cursor: grabbing;
}

/* Live css-imf4ni — content layer with side padding over edge-to-edge media */
.hero-banner__swiper-wrapper {
  height: 100%;
  width: 100%;
  position: relative;
  padding: 30px 68px;
  box-sizing: border-box;
}

@media (max-width: 599.95px) {
  .hero-banner__swiper-wrapper {
    padding: 10px 40px;
  }
}

.hero-banner__desc-wrapper {
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

/*
 * Banner Content is rich text: alignment, size and colour are set in the editor. These are only
 * the defaults it starts from — centred white copy, as every hero had before.
 */
.hero-banner__content {
  max-width: 100%;
  color: #ffffff;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.hero-banner__content > :first-child {
  margin-top: 0;
}

.hero-banner__content > :last-child {
  margin-bottom: 0;
}

.hero-banner__content a {
  color: inherit;
}

/* Live css-znz2wy — media fills the entire slide behind copy */
.hero-banner__media-wrapper {
  height: 100%;
  width: 100%;
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
}

.hero-banner__overlay {
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* One image per viewport: mobile below 600px, tablet from 600px, desktop from 900px. */
.hero-banner__media-desktop,
.hero-banner__media-tablet {
  display: none;
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-banner__media-mobile {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

@media (min-width: 600px) {
  .hero-banner__media-tablet {
    display: block;
  }

  .hero-banner__media-mobile {
    display: none;
  }
}

@media (min-width: 900px) {
  .hero-banner__media-desktop {
    display: block;
  }

  .hero-banner__media-tablet {
    display: none;
  }
}

.hero-banner__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-banner__cover img,
.hero-banner__cover video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  color: transparent;
}

.hero-banner__cover--animate img {
  transform: scale(1.18);
}

.hero-banner__cover--animate.is-playing img {
  transform: scale(1);
  transition: transform 4s ease-out;
}

/*
 * Live hover arrows (arrowsmall): hidden until cursor is over the carousel.
 * Size 21×23, translucent grey plate, 40px desktop / 10px mobile inset.
 */
.hero-banner__carousel .carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  width: 21px;
  height: 23px;
  min-width: unset;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: rgba(248, 248, 248, 0.66);
  color: #000000;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

/* Live arrow inset: 40px desktop / 10px below 900px (overrides JS inline spacing) */
.hero-banner__carousel .carousel-arrow--prev {
  left: 40px !important;
  right: auto !important;
}

.hero-banner__carousel .carousel-arrow--next {
  right: 40px !important;
  left: auto !important;
}

@media (max-width: 899.95px) {
  .hero-banner__carousel .carousel-arrow--prev {
    left: 10px !important;
  }

  .hero-banner__carousel .carousel-arrow--next {
    right: 10px !important;
  }
}

.hero-banner__carousel .carousel-arrow > svg {
  width: 18px;
  height: 18px;
  display: block;
}

.hero-banner__carousel .swiper:hover > .carousel-arrow,
.hero-banner__carousel:hover .carousel-arrow {
  opacity: 1;
  pointer-events: auto;
}

.hero-banner__carousel .carousel-arrow.swiper-button-disabled {
  display: none;
}

@media (hover: none) {
  /* Touch devices: keep arrows usable without hover */
  .hero-banner__carousel .carousel-arrow {
    opacity: 1;
    pointer-events: auto;
  }
}
