/* Why Invest */

.why-invest {
  position: relative;
  overflow-x: clip;
  /* Bottom padding only has to keep the snapshot cut-out, which overhangs
     the blue band, clear of the next section. */
  padding-bottom: 32px;
  background: var(--white);
  color: var(--black);
}

/* Intro
   ------------------------------------------------------------------ */

/*
 * Type follows the theme scale: the eyebrow uses the 20px / 28px large-copy
 * steps, the heading reuses .larger-heading (35px, 50px from 64em) in the
 * dark blue of the design, and the intro sentence stays at body size.
 */
.why-invest__eyebrow {
  margin: 0 0 20px;
  font-family: 'Jura', sans-serif;
  font-weight: 300;
  font-size: 20px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--blue);
}

.why-invest__heading.larger-heading {
  max-width: 18em;
  margin: 0 0 24px;
  color: var(--dark-blue);
  line-height: 1.15;
}

.why-invest__intro-copy {
  margin: 0;
}

/* Cards
   ------------------------------------------------------------------ */

/* Sits above the blue band, which is pulled up underneath it. */
.why-invest__cards {
  position: relative;
  z-index: 2;
  margin-top: 32px;
}

.why-invest__card-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.why-invest__card {
  margin-bottom: 20px;
}

.why-invest__card-inner {
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  display: block;
  height: 100%;
  min-height: 240px;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
  @media (max-width: 50em) {
    aspect-ratio: 10 / 9;
  }
}

.why-invest__card-inner.is-flipped {
  transform: rotateY(180deg);
}

.why-invest__card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  box-shadow: 0px 9px 20px 0px #00000082;
  transition:
    background-color 300ms ease,
    color 300ms ease;
}

.why-invest__card-front {
  z-index: 1;
  padding: 22px;
  background: var(--dark-blue);
  color: var(--white);
}

.why-invest__card-back {
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 22px;
  background: var(--black);
  color: var(--white);
  transform: rotateY(180deg);
}

.why-invest__card-back::-webkit-scrollbar {
  display: none;
}

.why-invest__card-back em {
  font-size: 80%;
}

.why-invest__card-front:hover,
.why-invest__card-front:focus-within {
  background: var(--white);
  color: var(--blue);
}

.why-invest__card-front:hover .why-invest__card-heading,
.why-invest__card-front:focus-within .why-invest__card-heading {
  color: var(--blue);
}

.why-invest__card-media {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  display: block;
  height: 71%;
  overflow: hidden;
  transition: all 300ms ease;
}

.why-invest__card-front:hover .why-invest__card-media {
  transform: scale(1.05);
}

.why-invest__card-image {
  display: block;
  width: auto;
  height: 100%;
  margin-left: auto;
  transition: filter 300ms ease;
}

.why-invest__card-front:hover .why-invest__card-image,
.why-invest__card-front:focus-within .why-invest__card-image {
  filter: grayscale(1) contrast(1.1);
}

.why-invest__card-heading {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-right: 19px;
  font-family: 'Jura', sans-serif;
  font-weight: 300;
  font-size: 30px;
  line-height: 1.1;
  color: var(--white);
  transition: color 300ms ease;
}

.why-invest__card-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.why-invest__card-toggle:hover,
.why-invest__card-toggle:focus-visible {
  opacity: 1;
}

.why-invest__card-toggle:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.why-invest__card-toggle-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--white);
  stroke-width: 2;
  stroke-linecap: round;
  transform: translateZ(1px);
  transition: stroke 300ms ease;
}

.why-invest__card-front:hover .why-invest__card-toggle-icon,
.why-invest__card-front:focus-within .why-invest__card-toggle-icon {
  stroke: var(--blue);
}

.why-invest__card-toggle-plus,
.why-invest__card-toggle-close {
  transition: opacity 300ms ease;
}

.why-invest__card-toggle-close {
  opacity: 0;
}

.why-invest__card-back .why-invest__card-toggle-plus {
  opacity: 0;
}

.why-invest__card-back .why-invest__card-toggle-close {
  opacity: 1;
}

.why-invest__card-panel-inner {
  padding-right: 30px;
  font-size: 16px;
  line-height: 1.4;
}

.why-invest__card-panel-inner strong {
  font-family: 'Jura', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 17px;
}

.why-invest__card-panel-inner p {
  margin: 0 0 0.5em;
  line-height: 1.25;
}

.why-invest__card-panel-inner > :last-child {
  margin-bottom: 0;
}

.why-invest__card-back a {
  color: var(--white);
  text-decoration: underline;
}

/* Blue diagonal band
   ------------------------------------------------------------------ */

/*
 * The blue is a clipped pseudo-element, as in the theme's scale-potential
 * section, so the snapshot card and cut-out image can overhang the band.
 * The negative top margin slides the blue up behind the cards.
 */
.why-invest__band {
  position: relative;
  overflow: hidden;
  margin-top: -40px;
  padding-top: 95px;
  padding-bottom: 135px;
  color: var(--white);
}

.why-invest__band::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--blue);
  clip-path: polygon(0 0, 100% 80px, 100% 100%, 0 calc(100% - 80px));
}

/* Masks the image to the same lower diagonal as the blue band. */
.why-invest__band::after {
  content: '';
  position: absolute;
  inset: 0;
  bottom: -1px;
  z-index: 2;
  pointer-events: none;
  background: var(--white);
  clip-path: polygon(0 calc(100% - 82px), 100% calc(100% - 2px), 100% 100%, 0 100%);
}

.why-invest__band > .grid-container {
  position: relative;
  z-index: 1;
}

.why-invest__about-heading.larger-heading,
.why-invest__news-heading.larger-heading {
  max-width: 14em;
  margin: 0 0 33px;
  color: var(--white);
  line-height: 1.15;
}

.why-invest__news-heading.larger-heading {
  margin-top: 40px;
}

.why-invest__about-copy {
  max-width: 30em;
}

.why-invest__about-copy p {
  margin: 0 0 1em;
}

.why-invest__about-copy > :last-child {
  margin-bottom: 0;
}

.why-invest__about-copy a {
  color: var(--white);
  text-decoration: underline;
}

/*
 * The frame fills the column width. Its height comes from the widget's own
 * postMessage updates in why-invest.js, so it never needs scrollbars; the
 * starting height just avoids a collapsed flash before the first update.
 * The background matches the band so the frame is invisible while loading.
 */
.why-invest__news-frame {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
  overflow: hidden;
  background: var(--blue);
}

/* .button already renders as a white outline on a blue ground. */
.why-invest__news-button {
  margin-top: 42px;
  margin-bottom: 30px;
  @media (min-width: 50em) {
    margin-top: 52px;
    margin-bottom: 40px;
  }
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.why-invest__news-button:hover,
.why-invest__news-button:focus-visible {
  background: var(--white);
  color: var(--blue);
  opacity: 1;
}

/* Snapshot card
   ------------------------------------------------------------------ */

.why-invest__snapshot-cell {
  position: relative;
  margin-top: 48px;
}

.why-invest__snapshot {
  position: relative;
  z-index: 2;
  padding: 40px 48px;
  max-width: 340px;
  outline: 7px solid var(--blue);
  background: var(--white);
  box-shadow: 0px 9px 33px 0px #000000;

  @media (max-width: 50em) {
    box-shadow: 0px 9px 23px 0px #000000c2;
    max-width: 270px;
    padding: 42px 46px;
    padding: 28px 26px 24px;
    margin-left: auto;
    margin-right: auto;
  }
}

.why-invest__snapshot-heading {
  margin: 0 0 26px;
  font-family: 'Jura', sans-serif;
  font-weight: 300;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--blue);
  span {
    letter-spacing: 0.25em;
  }
}

.why-invest__snapshot-heading::after {
  content: '';
  display: block;
  width: 62px;
  height: 3px;
  margin-top: 14px;
  background: var(--blue);
}

.why-invest__snapshot-rows {
  margin: 0;
}

.why-invest__snapshot-row + .why-invest__snapshot-row {
  margin-top: 18px;
}

.why-invest__snapshot-label {
  margin: 0 0 5px;
  padding-bottom: 5px;
  font-family: 'Jura', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--black);
  border-bottom: 1px solid var(--grey);
}

.why-invest__snapshot-value {
  margin: 0;
  font-family: 'Jura', sans-serif;
  font-weight: 300;
  font-size: 23px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--blue);
}

.why-invest__snapshot-note {
  font-size: 0.62em;
}

.why-invest__snapshot-image {
  position: absolute;
  top: calc(100% - 320px);
  left: 50%;
  z-index: 1;
  display: block;
  width: 145vw;
  max-width: none;
  height: auto;
  margin: 0;
  transform: translateX(-50%);
}

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

  .why-invest__eyebrow {
    margin-bottom: 24px;
    font-size: 28px;
  }

  .why-invest__heading.larger-heading {
    margin-bottom: 28px;
  }

  .why-invest__cards {
    margin-top: 44px;
  }

  .why-invest__card {
    margin-bottom: 24px;
  }

  .why-invest__band {
    margin-top: -80px;
    padding-top: 160px;
    padding-bottom: 200px;
  }

  .why-invest__band::before {
    clip-path: polygon(0 0, 100% 155px, 100% 100%, 0 calc(100% - 155px));
  }

  .why-invest__band::after {
    clip-path: polygon(0 calc(100% - 157px), 100% calc(100% - 2px), 100% 100%, 0 100%);
  }

  .why-invest__news-heading.larger-heading {
    margin-top: 48px;
  }

  .why-invest__snapshot-cell {
    margin-top: 0;
  }

  .why-invest__snapshot {
    margin-left: auto;
    margin-right: 6%;
    margin-top: 0%;

    @media (min-width: 74em) {
      margin-top: 5%;
    }
  }

  /*
   * The cut-out sits behind the snapshot card. It is anchored to the top of
   * the column so its position stays predictable however long the text
   * column beside it runs; a wide image then overhangs the band's lower edge.
   */
  .why-invest__snapshot-image {
    right: 0;
    left: auto;
    width: clamp(400px, 49vw, 1100px);
    transform: none;
    top: unset;
    bottom: -23vw;

    @media (min-width: 1617px) {
      top: 140px;
      width: clamp(400px, 54vw, 1100px);
    }

    @media (min-width: 78rem) {
      right: calc((110vw - 78rem) / -2);
    }
  }
}

/* Large and up */
@media print, screen and (min-width: 64em) {
  .why-invest {
    padding-bottom: 56px;
  }

  .why-invest__card-inner {
    min-height: 278px;
  }

  .why-invest__card-heading {
    font-size: 25px;
  }

  /* Matches the 50px the theme already uses for headings of this weight. */
  .why-invest__heading.larger-heading {
    font-size: 50px;
  }

  .why-invest__band {
    margin-top: -110px;
    padding-top: 200px;
    padding-bottom: 250px;
  }

  .why-invest__band::before {
    clip-path: polygon(0 0, 100% 225px, 100% 100%, 0 calc(100% - 225px));
  }

  .why-invest__band::after {
    clip-path: polygon(0 calc(100% - 227px), 100% calc(100% - 2px), 100% 100%, 0 100%);
  }

  .why-invest__snapshot-heading {
    font-size: 41px;
  }

  .why-invest__snapshot-value {
    font-size: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .why-invest__card-face,
  .why-invest__card-inner,
  .why-invest__card-heading,
  .why-invest__card-image,
  .why-invest__card-toggle-icon,
  .why-invest__card-toggle-plus,
  .why-invest__card-toggle-close,
  .why-invest__news-button {
    transition: none;
  }
}
