/* Final responsive safeguards for project branding and editorial cards. */
.portfolio-first .project .dream-estate-card-mark,
.portfolio-first .project .neo76-card-mark {
  position: absolute !important;
  inset: clamp(22px, 2.5vw, 36px) auto auto clamp(22px, 2.5vw, 40px) !important;
  z-index: 10 !important;
  width: auto !important;
  height: auto !important;
  max-width: calc(100% - 44px) !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  background: transparent !important;
  color: #fff !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
  pointer-events: none;
}

.portfolio-first .project .dream-estate-card-mark strong,
.portfolio-first .project .neo76-card-mark strong {
  display: block !important;
  color: #fff !important;
  max-width: min(78%, 330px);
  overflow-wrap: normal;
  white-space: nowrap;
}

.insights-scroller .insight-card h3,
.insights-scroller .insight-card:first-child h3 {
  line-height: 1.42 !important;
  max-height: calc(1.42em * 3) !important;
  -webkit-line-clamp: 3 !important;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .home-project-hero { min-height: 650px !important; }

  .home-project-logo,
  .home-project-logo.project-wordmark,
  .home-project-text-logo {
    top: 18px !important;
    left: 18px !important;
    right: auto !important;
    max-width: 155px !important;
    max-height: none !important;
  }

  .home-project-switcher {
    top: auto !important;
    right: 18px !important;
    bottom: 92px !important;
    left: 18px !important;
    width: calc(100% - 36px) !important;
  }

  .home-project-switcher > button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 7px !important;
  }

  .home-project-copy { bottom: 154px !important; }
  .home-project-facts { bottom: 14px !important; }
}

@media (max-width: 600px) {
  .portfolio-first .project .dream-estate-card-mark,
  .portfolio-first .project .neo76-card-mark {
    inset: 20px auto auto 20px !important;
    min-height: 0 !important;
  }

  .portfolio-first .project .dream-estate-card-mark strong {
    font-size: clamp(30px, 10vw, 40px) !important;
  }

  .portfolio-first .project .neo76-card-mark strong {
    font-size: clamp(36px, 12vw, 48px) !important;
  }

  .portfolio-first .project > div:last-child { padding: 18px 20px !important; }

  .home-project-logo,
  .home-project-logo.project-wordmark,
  .home-project-text-logo { max-width: 135px !important; }

  .home-project-text-logo { gap: 4px !important; }
  .home-project-text-logo strong { font-size: 21px !important; white-space: nowrap; }

  .home-project-copy h2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .insights-scroller .insight-card,
  .insights-scroller .insight-card:first-child {
    height: 445px !important;
    min-height: 445px !important;
    grid-template-rows: 165px auto auto auto !important;
  }
}

/* Grand Forest: keep hero and gallery copy inside their media at all sizes. */
@media (max-width: 800px) {
  .dream-estate .n76-hero { min-height: 720px; padding: 64px 6vw 46px; }

  .dream-estate .n76-hero h1 {
    margin: 16px 0 22px;
    font-size: clamp(50px, 17vw, 72px);
    line-height: 0.9;
    overflow-wrap: normal;
  }

  .dream-estate .n76-hero-copy > p {
    margin: 0;
    font-size: clamp(18px, 5.2vw, 25px);
  }

  .dream-gallery figcaption {
    padding: 42px 16px 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .dream-aerial span {
    left: 6vw;
    right: 6vw;
    bottom: 5vh;
    font-size: clamp(22px, 7vw, 34px);
    line-height: 1.18;
  }
}

@media (max-width: 520px) {
  .dream-estate .n76-hero { min-height: 760px; }
  .dream-estate .n76-hero-facts div { gap: 12px; }
  .dream-estate .n76-hero-facts strong { font-size: 24px; }
  .dream-estate .n76-hero-facts span { max-width: 45%; line-height: 1.4; }
}

/* Alignment pass: keep both custom project lockups genuinely stacked. */
.home-project-logo.home-project-text-logo {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  width: max-content !important;
  max-width: min(240px, 45vw) !important;
  max-height: none !important;
  text-align: left !important;
}

.home-project-logo.home-project-text-logo small,
.home-project-logo.home-project-text-logo strong {
  display: block !important;
  position: static !important;
  margin: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.home-project-logo.home-project-text-logo strong {
  font-size: clamp(26px, 3vw, 42px) !important;
  line-height: 1.02 !important;
}

/* Media cards use one fixed, left-aligned editorial rhythm. */
.insights-scroller .insight-card,
.insights-scroller .insight-card * {
  text-align: left !important;
}

.insights-scroller .insight-card h3 {
  min-width: 0 !important;
  width: 100% !important;
  margin: 12px 0 10px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  line-clamp: 3;
  line-height: 1.4 !important;
  max-height: 4.2em !important;
}

.insights-scroller .insight-card > span,
.insights-scroller .insight-card > b {
  width: 100% !important;
  flex: none !important;
}

/* NEO76 and Grand Forest pages: aligned columns and safe text widths. */
body.neo76,
.neo76 main,
.neo76 main > section,
.neo76 main > section > div,
.n76-hero-copy,
.n76-hero-facts,
.n76-intro > *,
.n76-masterplan > * {
  min-width: 0;
  max-width: 100%;
}

body.neo76 { overflow-x: hidden; }

.n76-hero {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .55fr);
  padding-inline: 7.5vw;
  min-height: calc(100svh - 140px);
  padding-block: 6vh 5vh;
}

.n76-hero-copy { width: 100%; }

.n76-hero h1 {
  max-width: 100%;
  font-size: clamp(66px, 7.2vw, 112px);
  line-height: .9;
  overflow-wrap: anywhere;
}

.dream-estate .n76-hero h1 { font-size: clamp(64px, 7vw, 108px); }

.n76-hero-copy > p,
.n76-copy,
.n76-section h2,
.n76-landscape h2,
.n76-close h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dream-estate .n76-landscape-art {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dream-estate .n76-landscape-art img {
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.dream-gallery img,
.dream-gallery-wide img {
  object-position: center;
}

@media (max-width: 800px) {
  .n76-subnav {
    display: none !important;
  }

  .n76-hero {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-height: auto;
    padding: 64px 6vw 48px;
  }

  .n76-hero h1,
  .dream-estate .n76-hero h1 {
    width: 100%;
    font-size: clamp(48px, 15vw, 68px);
    line-height: .94;
    letter-spacing: -.055em;
  }

  .n76-section h2,
  .n76-landscape h2,
  .n76-close h2 {
    font-size: clamp(36px, 10.5vw, 50px);
    line-height: 1.02;
    letter-spacing: -.045em;
  }

  .n76-intro,
  .n76-masterplan,
  .n76-landscape {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .dream-estate .n76-landscape-art { min-height: 0; }
}

@media (max-width: 600px) {
  .home-project-logo.home-project-text-logo {
    gap: 3px !important;
    max-width: 180px !important;
  }

  .home-project-logo.home-project-text-logo strong {
    font-size: 23px !important;
  }

  .insights-scroller .insight-card h3,
  .insights-scroller .insight-card:first-child h3 {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset;
    line-height: 1.4 !important;
  }
}
