/* Hero — fullscreen band; image/shell in .normal-container. */

.hero {
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  margin-block-end: calc(var(--hero-overlap, 0px) * -1);
  padding-block-end: var(--hero-overlap, 0px);
  color: var(--color-on-primary);
  isolation: isolate;
}

/* Hero owns its vertical rhythm; no filled-row padding or inter-row margin. */
.wpb_row:has(.hero) {
  padding-block: 0 !important;
  margin-block-start: 0;
}

/*
 * Salient’s negative top margin on the next row paints before JS can add
 * compensating hero padding — content covers the hero. Zero that margin;
 * overlap is recreated via --hero-overlap (padding + matching negative margin).
 */
.wpb_row:has(.hero) + .wpb_row[class*="top_margin_-"] {
  margin-top: 0 !important;
}

/* Sit behind the fixed header: collapse the spacer and clear the bar. */
body:has(.hero) #header-space {
  height: 0 !important;
  background: transparent;
}

body[data-header-resize="1"]:has(.hero) .container-wrap {
  padding-block-start: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: start;
  --hero-pad-end: clamp(3rem, 8vw, 6rem);
  padding-block: calc(var(--header-height) + 3rem) var(--hero-pad-end);
}

/* —— Media on itself (default) —— */

.hero-media-itself {
  background-color: var(--color-primary);
  overflow: hidden;
}

@keyframes hero-wheel-rotate {
  to {
    rotate: 360deg;
  }
}

.hero-media-itself .hero-inner {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 0;
  align-items: start;
  min-height: clamp(28rem, 55vh, 40rem);
}

.hero-media-itself .hero-content {
  grid-column: 2 / span 6;
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
  position: relative;
  z-index: 2;
}

@media (min-width: 1000px) {
  .hero-media-itself .hero-content {
    width: calc(100% + 3.125rem);
  }
}

.hero-media-itself .hero-media {
  grid-column: 8 / span 5;
  position: absolute;
  top: 70px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-media-itself .hero-media::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 120vw;
  aspect-ratio: 1;
  background: url("../../assets/images/wheel.png") center / contain no-repeat;
  opacity: 0.2;
  animation: hero-wheel-rotate 25s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.hero-media-itself .video-modal,
.hero-media-itself .hero-media-image {
  width: min(100%, 42rem);
  mask-image: radial-gradient(circle, #000 40%, transparent 70%);
}

.hero-media-itself .video-modal video,
.hero-media-itself .video-modal img,
.hero-media-itself .hero-media-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

/* —— Media as background —— */

.hero-media-background {
  padding-block-end: 0;
}

.hero-media-background::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 45vh;
  max-height: 80%;
  background-color: var(--color-primary);
  z-index: 0;
  pointer-events: none;
}

.hero-media-background .hero-inner {
  overflow: hidden;
  border-end-end-radius: var(--radius-lg);
  min-height: clamp(28rem, 50vh, 38.8rem);
  padding-block-end: calc(var(--hero-pad-end) + var(--hero-overlap, 0px));
  background-color: lightgray;
  background-image:
    linear-gradient(
      270deg,
      rgba(0, 28, 64, 0) 52.19%,
      rgba(0, 28, 64, 0.9) 76.94%
    ),
    var(--hero-bg-image, none);
  /* A percentage, not a pixel offset: cover sizes the image to the box, so the
     old 0 -4.5rem lifted it clear of the bottom edge and left a grey strip
     wherever the box was as tall as the image (tablets, and wide screens). */
  background-position: 0 0, center;
  background-size: auto, cover;
  background-repeat: no-repeat;
}

.hero-media-background .hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.hero-media-background .hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    270deg,
    rgba(0, 28, 64, 0) 52.19%,
    rgba(0, 28, 64, 0.9) 76.94%
  );
}

.hero-media-background .hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
  width: 50%;
  margin-inline-start: calc(100% / 12);
}

.hero-media-background:has(.hero-bg-video) .hero-inner {
  background-image: none;
}

/* —— Shared content —— */

.hero-content > .breadcrumbs {
  min-block-size: 1.5em;
  margin-block-end: calc(var(--row-spacer) - var(--gap-l));
}

.breadcrumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumbs-item:not(:last-child)::after {
  content: "";
  flex-shrink: 0;
  inline-size: 0.34375rem;
  block-size: 0.5rem;
  margin-inline: 0.5rem;
  background-color: currentColor;
  mask: var(--breadcrumb-chevron, url("breadcrumb-chevron.svg")) center / contain no-repeat;
  -webkit-mask: var(--breadcrumb-chevron, url("breadcrumb-chevron.svg")) center / contain no-repeat;
}

.breadcrumbs a {
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible,
.breadcrumbs [aria-current="page"] {
  text-decoration: underline;
}

.hero-heading {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.hero .tag {
  display: inline-block;
  width: fit-content;
  padding-inline: 0.5rem;
  border-radius: 1rem;
  background-color: var(--color-brand-1);
  color: var(--color-on-primary);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  color: inherit;
}

.hero-description {
  margin: 0;
  padding-block-end: 0;
  color: inherit;
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;

  .btn {
    margin-inline-end: 0 !important;
  }
}

@media (max-width: 999px) {
  .hero-media-itself .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--gap-l);
  }

  .hero-media-itself .hero-content,
  .hero-media-itself .hero-media {
    grid-column: 1;
  }

  .hero-media-itself .hero-content {
    width: 100%;
  }

  /* Media follows the content: on a phone the title and buttons lead. */
  .hero-media-itself .hero-media {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    max-width: 22rem;
    margin-inline: auto;
  }

  /* Below desktop the image runs to the viewport edges, and the content keeps
     to the container line: Salient's .container is 88% wide here, so the
     remaining 12% is split over both sides as padding. */
  .hero-media-background .hero-inner {
    max-width: none;
    padding-inline: 6%;
  }

  .hero-media-background .hero-content {
    width: 100%;
    margin-inline-start: 0;
  }
}
