/* Investment chapter layout, with the Non-resident hero fade contract below. */
/* Final mortgage chapter is mist; continue the sequence with existing white. */
.financing-guide .redesign-adviser {
  background: var(--investment-white);
}

.financing-guide .investment-chapter__inner {
  --investment-chapter-gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.financing-guide .investment-chapter__heading {
  position: static;
  grid-row: auto;
  padding-top: 0;
}

.financing-guide .investment-chapter__heading h2 {
  max-width: none;
  line-height: 1.12;
}

.financing-guide .investment-chapter__content--with-link {
  grid-column: 1;
  grid-row: auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.financing-guide .investment-chapter__body {
  min-width: 0;
  max-width: 72ch;
  overflow-wrap: break-word;
}

.financing-guide .financing-factors {
  margin: 0 0 1.15rem;
  padding-inline-start: 1.25rem;
}

.financing-guide .financing-factors li + li {
  margin-top: .35rem;
}

.financing-guide .investment-chapter__content--with-link > .investment-related {
  grid-column: 1;
  max-width: none;
  margin: 0;
  padding-top: 0;
}

.financing-guide .financing-heading-line {
  display: inline;
}

/* Full chapter-heading/prose/resource composition when there is room. */
@media (min-width: 1121px), (min-width: 880px) and (orientation: landscape) {
  .financing-guide {
    --financing-heading-size: clamp(2.25rem, 3.1vw, 3.55rem);
  }

  .financing-guide .investment-chapter__inner {
    grid-template-columns: calc(var(--financing-heading-size) * 9) minmax(0, 1fr);
    column-gap: var(--investment-chapter-gap);
  }

  .financing-guide .investment-chapter__heading {
    position: sticky;
    top: 2rem;
  }

  .financing-guide .investment-chapter__heading h2 {
    font-size: var(--financing-heading-size);
  }

  .financing-guide .investment-chapter__content--with-link {
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr) 11rem;
    column-gap: var(--investment-chapter-gap);
  }

  .financing-guide .investment-chapter__content--with-link > .investment-related {
    grid-column: 2;
  }

  .financing-guide .financing-heading-single,
  .financing-guide .financing-heading-line {
    white-space: nowrap;
  }

  .financing-guide .financing-heading-line {
    display: block;
  }
}

/* Compact landscape: heading above until a third column is comfortable. */
@media (min-width: 640px) and (max-width: 1120px) and (orientation: landscape) {
  .financing-guide {
    --investment-gutter: 1.25rem;
    --financing-heading-size: 1.75rem;
  }

  .financing-guide .investment-chapter {
    padding-block: 2.5rem;
  }

  .financing-guide .investment-chapter__inner {
    --investment-chapter-gap: 1.25rem;
  }

  .financing-guide .investment-chapter__heading {
    position: static;
  }

  .financing-guide .investment-chapter__content--with-link {
    grid-template-columns: minmax(0, 1fr) 9rem;
    column-gap: var(--investment-chapter-gap);
  }

  .financing-guide .investment-chapter__content--with-link > .investment-related {
    grid-column: 2;
  }

  .financing-guide .investment-opening {
    padding-block: 2.5rem;
  }

  .financing-guide .investment-opening__main {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    grid-template-rows: auto;
    align-items: center;
    gap: 2rem;
  }

  .financing-guide .investment-opening__heading {
    grid-column: 1;
    grid-row: 1;
  }

  .financing-guide .investment-opening h1 {
    max-width: none;
    font-size: clamp(1.625rem, 3.7vw, 2.5rem);
    line-height: 1.08;
  }

  .financing-guide .financing-title-line {
    display: block;
    white-space: nowrap;
  }

  .financing-guide .investment-opening__image {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    aspect-ratio: 3 / 2;
  }

  .financing-guide .investment-opening__image img {
    position: static;
    width: 100%;
    height: 100%;
  }
}

@media (min-width: 1121px) {
  .financing-guide {
    --financing-heading-size: clamp(2rem, 2.4vw, 2.6rem);
  }

  .financing-guide .investment-chapter__inner {
    grid-template-columns: calc(var(--financing-heading-size) * 8.5) minmax(0, 1fr);
    column-gap: 1.5rem;
  }

  .financing-guide .investment-chapter__content--with-link {
    /* 21.5rem covers the longest label + arrow measured at the maximum type
       size in Georgia and DejaVu Serif; larger fonts can expand intrinsically. */
    grid-template-columns: minmax(0, 1fr) minmax(21.5rem, max-content);
  }

  .financing-guide .investment-related__text {
    white-space: nowrap;
  }

  .financing-guide .investment-opening__main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }

  .financing-guide .investment-opening h1 {
    max-width: none;
    font-size: clamp(2.75rem, 3.7vw, 3.75rem);
  }

  .financing-guide .financing-title-line {
    display: block;
    white-space: nowrap;
  }
}

@media (min-width: 640px) and (max-width: 879px) and (orientation: landscape) {
  .financing-guide .investment-chapter__content--with-link {
    column-gap: 2rem;
  }
}

/* Hero geometry follows Non-resident's active how-to-buy.css opening exactly.
   The gradient and overlay layering are owned by redesign-hero-fade.css;
   there is deliberately no Financing gradient. Chapter grids are independent. */
.financing-guide .investment-opening__main {
  position: relative;
  min-height: 23rem;
  overflow: hidden;
  row-gap: 0;
}

.financing-guide .investment-opening__heading {
  position: relative;
  z-index: 4;
  display: flex;
  width: min(61%, 54rem);
  max-width: none;
  min-height: 23rem;
  grid-column: 1 / -1;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.8rem, 5vw, 4.8rem) clamp(1.5rem, 3vw, 3rem) clamp(2.8rem, 5vw, 4.8rem) 0;
}

.financing-guide .investment-opening__image {
  --redesign-hero-fade-secondary: linear-gradient(0deg, rgba(16,41,66,.035), transparent 28%);
  position: absolute;
  z-index: 0;
  inset: 0 0 0 25%;
  grid-column: auto;
  grid-row: auto;
  align-self: auto;
  width: auto;
  max-width: none;
  min-height: 23rem;
  margin: 0;
  aspect-ratio: auto;
  overflow: hidden;
  border-bottom: 0;
  background: #e9eef1;
}

.financing-guide .investment-opening__image img {
  position: static;
  width: 100%;
  height: 100%;
  min-height: 23rem;
  object-fit: cover;
  /* Retain this photograph's approved crop rather than copying the interior. */
  object-position: center 53%;
}

.financing-guide .investment-opening__image::after {
  content: none;
}

@media (max-width: 900px) {
  .financing-guide .investment-opening__main {
    min-height: auto;
    overflow: visible;
  }

  .financing-guide .investment-opening__heading {
    width: 100%;
    min-height: auto;
    padding: 3.5rem 0 3rem;
  }

  .financing-guide .investment-opening__image {
    position: relative;
    inset: auto;
    min-height: 0;
    margin-inline: calc(-1 * var(--investment-gutter));
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .financing-guide .investment-opening__image img {
    min-height: 0;
    aspect-ratio: 2 / 1;
  }

  .financing-guide .investment-opening__image::before {
    background-image: linear-gradient(0deg, rgba(16,41,66,.055), transparent 30%);
    content: "";
  }
}

/* Same landscape exception as Non-resident; 667px retains its stacked mode. */
@media (min-width: 700px) and (max-width: 950px) and (max-height: 430px) and (orientation: landscape) {
  .financing-guide .investment-opening__main {
    min-height: 17.5rem;
    overflow: hidden;
  }

  .financing-guide .investment-opening__heading {
    width: 61%;
    min-height: 17.5rem;
    padding: 1.8rem 1.5rem 1.8rem 0;
  }

  .financing-guide .investment-opening__image {
    position: absolute;
    inset: 0 0 0 25%;
    grid-column: auto;
    grid-row: auto;
    min-height: 17.5rem;
    margin: 0;
  }

  .financing-guide .investment-opening__image img {
    min-height: 17.5rem;
    aspect-ratio: auto;
  }

  .financing-guide .investment-opening__image::before {
    background-image: var(--redesign-hero-fade-gradient), var(--redesign-hero-fade-secondary);
  }
}
