/* Shared frame and text levels for the homepage carousel and navigation heroes. */
.rise-site .rise-section-hero,
.home-page .rise-hero {
  --hero-green: #0c342b;
  --hero-photo-width: 100%;
  --hero-photo-height: 56.25vw;
  --hero-copy-inset: clamp(24px, 4vw, 56px);
  --hero-copy-top: calc(var(--hero-photo-height) + 28px);
  --hero-copy-end: var(--hero-copy-inset);
  --hero-title-lines: 2lh;
  --hero-gradient: linear-gradient(0deg, #0c342b, rgba(12, 52, 43, .46) 28%, transparent 68%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: auto;
  padding: 0;
  background: var(--hero-green);
  color: #fff;
}

.rise-section-hero .rise-section-hero-image,
.home-page .rise-hero .carousel-item > img {
  position: absolute;
  inset: 0 0 auto auto;
  width: var(--hero-photo-width) !important;
  height: var(--hero-photo-height) !important;
  max-width: none;
  object-fit: cover;
  object-position: var(--hero-focus, center);
  z-index: 0;
}

.rise-section-hero::after,
.home-page .rise-hero .carousel-item::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: var(--hero-photo-width);
  height: var(--hero-photo-height);
  background: var(--hero-gradient);
  z-index: 1;
  pointer-events: none;
}

.rise-section-hero .rise-wrap,
.home-page .rise-hero .rise-hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--hero-copy-top) var(--hero-copy-end) 40px var(--hero-copy-inset);
}

.home-page .rise-hero {
  --hero-photo-height: clamp(175px, 53vw, 320px);
  --hero-copy-top: calc(var(--hero-photo-height) + clamp(20px, 3.2vw, 32px));
  --hero-lede-lines: 4lh;
}

.home-page .rise-hero .carousel-item {
  height: auto;
  min-height: 0;
  background-color: var(--hero-green);
}

.home-page .rise-hero .rise-hero-copy {
  padding-bottom: 88px;
}

.rise-section-hero .rise-eyebrow,
.home-page .rise-hero .rise-eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 1.8px;
  color: #d6ef9e;
}

.rise-section-hero .rise-page-title,
.home-page .rise-hero .rise-hero-title {
  max-width: none;
  min-block-size: var(--hero-title-lines);
  margin: 0 0 12px;
  font-size: clamp(32px, 3.3vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.rise-section-hero .rise-page-lede,
.home-page .rise-hero .rise-hero-description {
  max-width: none;
  margin: 0;
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 400;
  line-height: 1.55;
  color: #dce9dc;
}

.home-page .rise-hero .rise-eyebrow {
  margin-bottom: 10px;
  font-size: .6875rem;
  line-height: 1.45;
  letter-spacing: .12em;
}

.home-page .rise-hero .rise-hero-title {
  max-inline-size: 18ch;
  margin-bottom: 10px;
  font-size: clamp(1.8125rem, calc(1.35rem + 2.5vw), 2.5rem);
}

.home-page .rise-hero .rise-hero-description {
  min-block-size: var(--hero-lede-lines);
  font-size: clamp(1rem, 1.25vw, 1.1875rem);
  text-wrap: pretty;
}

.home-page .rise-hero .rise-actions {
  gap: 10px;
  margin-top: 16px;
}

.home-page .rise-hero .rise-actions .btn {
  min-height: 44px;
  padding-inline: clamp(14px, 1.65vw, 24px);
  font-size: .875rem;
}

.home-page .rise-hero .carousel-indicators { margin-left: var(--hero-copy-inset); }

.home-page .rise-hero :is(.carousel-control-prev, .carousel-control-next) {
  background-color: rgb(12 52 43 / .68);
}

.home-page .rise-hero :is(.carousel-control-prev, .carousel-control-next):focus-visible {
  outline: 2px solid #d6ef9e;
  outline-offset: 3px;
}

.rise-section-hero-publications { --hero-focus: 50% 80%; }
.rise-section-hero-publications > picture {
  position: absolute;
  inset: 0;
}
.rise-section-hero-news { --hero-focus: 50% 55%; }
.rise-section-hero-media { --hero-focus: 50% 60%; }
.rise-section-hero-people { --hero-focus: 50% 63%; }
.rise-section-hero-join { --hero-focus: 50% 24%; }
.rise-section-hero-about .rise-name-nowrap { white-space: nowrap; }
.home-page .rise-hero .carousel-item:nth-child(1) { --hero-focus: 50% 30%; }
.home-page .rise-hero .carousel-item:nth-child(2) { --hero-focus: 50% 65%; }

@media (max-width: 360px) {
  .rise-site .rise-section-hero { --hero-title-lines: 3lh; }
}

@media (min-width: 480px) {
  .home-page .rise-hero { --hero-lede-lines: 3lh; }
}

@media (min-width: 560px) and (max-width: 991.98px) {
  .home-page .rise-hero {
    --hero-photo-height: clamp(290px, 44vw, 400px);
  }
}

@media (min-width: 992px) {
  .home-page .rise-hero {
    --hero-photo-width: min(56%, 1320px);
    --hero-photo-height: 100%;
    --hero-copy-inset: max(clamp(24px, 4vw, 56px), calc((100% - 1388px) / 2));
    --hero-copy-top: clamp(26px, 3vw, 54px);
    --hero-copy-end: calc(var(--hero-photo-width) + 24px);
    --hero-gradient: linear-gradient(90deg, #0c342b, rgba(12, 52, 43, .62) 12%, transparent 36%);
  }

  .home-page .rise-hero .carousel-item {
    min-height: clamp(388px, 33.75vw, 620px);
  }

  .home-page .rise-hero .carousel-item:is(.active, .carousel-item-next, .carousel-item-prev) {
    display: grid;
    align-content: center;
  }

  .home-page .rise-hero .rise-hero-copy {
    padding-bottom: 64px;
  }

  .home-page .rise-hero .rise-hero-title {
    font-size: clamp(2.25rem, 3.15vw, 3.25rem);
  }
}

/* Keep the navigation page headers more compact than the homepage carousel. */
.rise-site .rise-section-hero {
  --hero-photo-height: clamp(150px, 45vw, 340px);
  --hero-copy-top: calc(var(--hero-photo-height) + 22px);
  --hero-title-lines: 0px;
}

.rise-site .rise-section-hero .rise-wrap {
  padding-bottom: 28px;
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .rise-section-hero-publications .rise-section-hero-image {
    object-fit: contain;
    object-position: center;
  }
}

@media (min-width: 992px) {
  .rise-site .rise-section-hero {
    --hero-photo-width: min(60%, 1320px);
    --hero-photo-height: clamp(350px, 24vw, 480px);
    --hero-copy-inset: max(clamp(24px, 4vw, 56px), calc((100% - 1388px) / 2));
    --hero-copy-top: 32px;
    --hero-copy-end: calc(var(--hero-photo-width) + 20px);
    --hero-gradient: linear-gradient(90deg, #0c342b, rgba(12, 52, 43, .62) 12%, transparent 36%);
    display: grid;
    align-items: center;
    min-height: var(--hero-photo-height);
  }

  .rise-site .rise-section-hero .rise-wrap {
    padding-bottom: 32px;
  }

  .rise-section-hero-people {
    --hero-focus: 50% 67%;
  }

  .rise-section-hero-publications {
    --hero-focus: 50% 65%;
  }
}

/* On short landscape screens, keep the masthead copy beside the image. */
@media (min-width: 480px) and (max-width: 991.98px) and (max-height: 520px) and (orientation: landscape) {
  .rise-site .rise-section-hero,
  .home-page .rise-hero {
    --hero-photo-width: min(44%, calc(100% - 380px));
    --hero-photo-height: 100%;
    --hero-copy-top: clamp(14px, 4vh, 22px);
    --hero-copy-end: calc(var(--hero-photo-width) + 16px);
    --hero-gradient: linear-gradient(90deg, var(--hero-green), rgba(12, 52, 43, .46) 20%, transparent 54%);
  }

  .rise-site .rise-section-hero > .rise-wrap {
    padding-bottom: var(--hero-copy-top);
  }

  .rise-section-hero .rise-page-title,
  .home-page .rise-hero .rise-hero-title {
    font-size: clamp(1.75rem, 3.5vw, 2.125rem);
  }

  .home-page .rise-hero .rise-hero-copy {
    padding-bottom: 60px;
  }

  .home-page .rise-hero .rise-hero-description {
    font-size: .9375rem;
    line-height: 1.4;
  }

  .rise-section-hero-publications .rise-section-hero-image {
    object-fit: cover;
    object-position: var(--hero-focus);
  }

  .home-page .rise-hero :is(.rise-eyebrow, .rise-hero-title) {
    margin-bottom: 8px;
  }

  .home-page .rise-hero .rise-actions {
    margin-top: 8px;
  }

  .home-page .rise-hero .rise-actions .btn {
    padding-block: 10px;
  }

  .home-page .rise-hero .carousel-indicators,
  .home-page .rise-hero :is(.carousel-control-prev, .carousel-control-next) {
    bottom: 10px;
  }

  .home-page .rise-hero .carousel-indicators [data-bs-target] {
    border-block-width: 21px 20px;
  }

  .home-page .rise-hero .carousel-control-prev {
    right: calc(var(--hero-copy-inset) + 52px);
  }

  .home-page .rise-hero .carousel-control-next {
    right: var(--hero-copy-inset);
  }
}

@media (min-width: 568px) and (max-width: 991.98px) and (max-height: 520px) and (orientation: landscape) {
  .home-page .rise-hero .rise-hero-copy { padding-bottom: 20px; }

  .home-page .rise-hero .carousel-indicators {
    left: calc(100% - var(--hero-photo-width));
    right: 0;
    justify-content: center;
    margin-inline: 0;
  }

  .home-page .rise-hero .carousel-indicators [data-bs-target] {
    border-inline: 6px solid transparent;
    margin-inline: 0;
  }

  .home-page .rise-hero :is(.carousel-control-prev, .carousel-control-next) {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .home-page .rise-hero .carousel-control-prev {
    left: calc(100% - var(--hero-photo-width) + 10px);
    right: auto;
  }

  .home-page .rise-hero .carousel-control-next { right: 10px; }
}

/* Align the first content section across the primary navigation pages. */
.rise-site main > .rise-section-hero + .rise-section {
  padding-block: clamp(36px, 4.2vw, 56px);
}

@media (max-width: 359.98px) {
  .home-page .rise-hero {
    --hero-photo-height: clamp(144px, 48vw, 172px);
    --hero-copy-inset: 20px;
    --hero-copy-top: calc(var(--hero-photo-height) + 16px);
  }

  .home-page .rise-hero .rise-actions {
    gap: 8px;
    margin-top: 12px;
  }

  .home-page .rise-hero .rise-actions .btn {
    padding-inline: 9px;
  }
}

/* Size each copy row to the tallest slide on narrow screens. */
@supports (grid-template-rows: subgrid) {
  @media (max-width: 991.98px) {
    .home-page .rise-hero .carousel-inner {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: repeat(4, auto);
    }

    .home-page .rise-hero .carousel-inner::after {
      content: none;
    }

    .home-page .rise-hero .carousel-item {
      display: grid;
      grid-area: 1 / 1 / -1 / -1;
      grid-template-rows: subgrid;
      margin-inline-end: 0;
      visibility: hidden;
    }

    /* Reset hidden slides before they are shown again. */
    .home-page .rise-hero .carousel-item:not(.active, .carousel-item-start, .carousel-item-end) {
      transition: none;
    }

    .home-page .rise-hero .carousel-item:is(.active, .carousel-item-next, .carousel-item-prev) {
      visibility: visible;
    }

    .home-page .rise-hero .rise-hero-copy {
      display: grid;
      grid-row: 1 / -1;
      grid-template-rows: subgrid;
      align-items: start;
    }
  }
}

/* Keep tablet mastheads beside the copy so the content starts sooner. */
@media (min-width: 768px) and (max-width: 991.98px) and (min-height: 521px) {
  .rise-site .rise-section-hero,
  .home-page .rise-hero {
    --hero-photo-width: 44%;
    --hero-photo-height: 100%;
    --hero-copy-top: clamp(24px, 3.6vw, 34px);
    --hero-copy-end: calc(var(--hero-photo-width) + 24px);
    --hero-gradient: linear-gradient(90deg, var(--hero-green), rgba(12, 52, 43, .46) 20%, transparent 54%);
  }

  .rise-site .rise-section-hero > .rise-wrap {
    padding-bottom: var(--hero-copy-top);
  }
}

/* Keep the first controls within reach on shorter laptop displays. */
@media (min-width: 992px) and (max-width: 1399.98px) and (max-height: 900px) {
  .rise-site .rise-section-hero {
    --hero-photo-width: 50%;
    --hero-photo-height: 100%;
    min-height: clamp(246px, 19.5vw, 290px);
  }
}

/* Align masthead artwork and controls with the content edges on wide screens. */
@media (min-width: 1600px) {
  .rise-site .rise-section-hero,
  .home-page .rise-hero {
    --hero-photo-width: min(48vw, 810px);
    --hero-copy-end: calc(var(--hero-copy-inset) + var(--hero-photo-width) + 24px);
    --hero-gradient:
      linear-gradient(90deg, var(--hero-green), rgba(12, 52, 43, .62) 12%, transparent 36%),
      linear-gradient(270deg, var(--hero-green), transparent 10%);
  }

  .rise-section-hero .rise-section-hero-image,
  .rise-section-hero::after,
  .home-page .rise-hero .carousel-item > img,
  .home-page .rise-hero .carousel-item::after {
    right: var(--hero-copy-inset);
  }

  .home-page .rise-hero .carousel-control-next {
    right: var(--hero-copy-inset);
  }

  .home-page .rise-hero .carousel-control-prev {
    right: calc(var(--hero-copy-inset) + 56px);
  }
}

/* Keep the page title and introduction close to the controls on very short screens. */
@media (min-width: 480px) and (max-width: 991.98px) and (max-height: 320px) and (orientation: landscape) {
  .rise-site .rise-section-hero {
    --hero-copy-top: 8px;
  }

  .rise-site .rise-section-hero > .rise-wrap > .rise-eyebrow {
    display: none;
  }

  .rise-site .rise-section-hero .rise-page-title {
    margin-bottom: 6px;
  }

  .rise-site main > .rise-section-hero + :is(#overview, #opportunities) {
    padding-block-start: 18px;
  }

  #overview > .rise-wrap > .rise-eyebrow {
    margin-bottom: 8px;
  }

  #overview > .rise-wrap > .rise-section-title {
    margin-bottom: 12px;
  }

  #overview > .rise-wrap > .rise-intro {
    margin-bottom: 16px;
  }
}

/* Keep everyone in the frame when a group photograph has a narrow side panel. */
@media (min-width: 480px) and (max-width: 739.98px) and (max-height: 520px) and (orientation: landscape) {
  .rise-site :is(.rise-section-hero-join, .rise-section-hero-people) {
    --hero-gradient: linear-gradient(90deg, var(--hero-green), transparent 13%);
  }

  :is(.rise-section-hero-join, .rise-section-hero-people) .rise-section-hero-image {
    object-fit: contain;
    object-position: center;
  }
}
