/* Home Hero */

.home-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  /* Clears the 64px transparent header that overlaps the top of the page. */
  padding-top: 112px;
  padding-bottom: 56px;
  background: var(--dark-blue);
  color: var(--white);
}

.home-hero--full-height {
  --home-hero-banner-offset: 0px;
  min-height: 800px;
  height: calc(100vh - var(--home-hero-banner-offset));
  height: calc(100lvh - var(--home-hero-banner-offset));
}

html:not(.cmr-site-banner-dismissed):has(.cmr-site-banner) .home-hero--full-height {
  --home-hero-banner-offset: 64px;
}

.home-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
}

.home-hero__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-hero__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-hero--overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--dark-blue) 55%, transparent) 0%,
    color-mix(in srgb, var(--dark-blue) 10%, transparent) 55%,
    color-mix(in srgb, var(--dark-blue) 45%, transparent) 100%
  );
  pointer-events: none;
}

.home-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  @media (min-width: 50em) {
    padding-bottom: 80px;
  }
  @media (min-width: 64em) {
    padding-bottom: 120px;
  }
}

/*
 * Type sizes follow the existing scale in style.css:
 * - small Jura labels: 18px, 20px from 50em, 21px from 64em (as .job-title,
 *   .page-sub-menu li a and .footer-heading);
 * - the heading reuses .section-heading: 35px, 40px from 50em, 60px from 64em;
 * - the button keeps .button's own sizes and padding.
 */
.home-hero__eyebrow {
  margin: 0 0 20px;
  font-family: 'Jura', sans-serif;
  font-weight: 300;
  font-size: 26px;
  line-height: 1.2;
  text-transform: uppercase;
  @media (max-width: 50em) {
    max-width: 240px;
  }
}

.home-hero .section-heading {
  display: block;
  max-width: 12em;
  margin: 0 0 40px;
  color: var(--white);
  @media (max-width: 50em) {
    line-height: 1.1;
  }
}

/* Filled variant of the theme's .button. */

.home-hero__elements {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  @media (max-width: 50em) {
    max-width: 290px;
    margin-left: auto;
    margin-right: auto;
  }
}

.home-hero__element-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 40px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid white;
  border-radius: 3px;
  font-family: 'Jura', sans-serif;
  font-weight: 300;
  font-size: 22px;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  @media (max-width: 50em) {
    aspect-ratio: 1 / 1;
  }
}

.home-hero__element-chip.is-highlighted,
a.home-hero__element-chip:hover,
a.home-hero__element-chip:focus-visible {
  background: var(--white);
  color: var(--blue);
}

/* Medium and up */
@media print, screen and (min-width: 50em) {
  .home-hero {
    padding-bottom: 72px;
  }

  .home-hero__eyebrow {
    margin-bottom: 28px;
    font-size: 20px;
  }

  .home-hero .section-heading {
    margin-bottom: 56px;
  }

  .home-hero__elements {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 56px;
  }

  .home-hero__element-chip {
    width: auto;
    min-width: 44px;
    min-height: 48px;
    font-size: 20px;
  }
}

@media screen and (max-width: 50em) {
  .home-hero__cta {
    margin-left: auto;
    margin-right: auto;
    display: block;
    width: fit-content;
  }
}

/* Matches the header's own breakpoint, where it grows to 79px. */
@media print, screen and (min-width: 955px) {
  .home-hero {
    padding-top: 160px;
  }
}

/* Large and up */
@media print, screen and (min-width: 64em) {
  .home-hero__eyebrow {
    font-size: 38px;
  }
}

/*
 * Transparent overlay header for pages where this hero is the first section
 * but which are not (yet) the front page. header.php only adds .home-header
 * on the front page, so this mirrors the #masthead.home-header rules from
 * style.css (same negative margins, which equal the header's height) without
 * editing shared templates. On the front page both sets of rules apply and
 * agree. The open mobile menu keeps its own background and stacking.
 */
#masthead:has(+ #primary > article > .home-hero:first-child) {
  margin-bottom: -63.9px;
}

#masthead:not(.open):has(+ #primary > article > .home-hero:first-child) {
  background: transparent;
  z-index: 4;
}

@media print, screen and (min-width: 955px) {
  #masthead:has(+ #primary > article > .home-hero:first-child) {
    margin-bottom: -78.4px;
  }
}
