/*
 * Accessible MRZ Banner image
 *
 * The banner image is now a real <img> element rather than a CSS background.
 * These rules keep it behind the existing content and preserve the original
 * cover-style appearance.
 */
.banner-block {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-image: none !important;
}

.banner-block > .mrz-banner-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}

.banner-block > :not(.mrz-banner-background) {
  position: relative;
  z-index: 2;
}

/* Keep gradient overlays between the image and the banner content. */
.banner-block::before,
.banner-block::after {
  z-index: 1;
  pointer-events: none;
}

.stripper-barca .banner-block > .mrz-banner-background {
  object-position: center center;
}

/* Gutenberg editor preview. */
.editor-styles-wrapper .banner-block > .mrz-banner-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.editor-styles-wrapper .banner-block > .block-editor-inner-blocks {
  position: relative;
  z-index: 2;
  width: 100%;
}

@media (max-width: 980px) {
  .banner-block > .mrz-banner-background {
    object-position: bottom right;
  }

  /*
   * Reproduce the homepage hero's original mobile CSS background exactly:
   * background-size: 200%; background-position: 80% 0%;
   *
   * A 200%-wide real image must be shifted left by 80% of the banner width.
   * Keep its natural height so the photograph occupies the top of the hero,
   * as it did before, instead of being stretched over the full 95vh banner.
   */
  .hero .banner-block > .mrz-banner-background {
    inset: auto;
    top: 0;
    right: auto;
    bottom: auto;
    left: -80%;
    width: 200%;
    height: auto;
    max-width: none;
    object-fit: initial;
    object-position: initial;
    transform: none;
  }

  .stripper-barca .banner-block > .mrz-banner-background {
    object-position: center center;
    transform: none;
  }
}
