/* ============================================
   CHASE MERRITT — Montrose: River Walk & Cedar Creek
   The page is built on the Telluride showcase (telluride-showcase.css):
   hero, facts, sections, dark cards, map, lens row and page footer all come
   from there. This file holds only what Montrose adds.
   ============================================ */

.cm-mtr {
  overflow-x: clip;
}

.cm-mtr-gold {
  color: var(--cm-gold-text);
}

/* ----- Facts: six, so two rows of three on desktop ----- */

.cm-mtr-facts {
  margin-bottom: 0;
}

@media (min-width: 1101px) {
  .cm-mtr-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cm-mtr-facts .cm-tsg-fact:nth-child(3n + 1)::before {
    display: none;
  }

  .cm-mtr-facts .cm-tsg-fact:nth-child(n + 4) {
    border-top: 1px solid var(--cm-tsg-line);
  }
}

/* ----- Our approach: statement left, copy right ----- */

.cm-mtr-approach {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(36px, 7vw, 120px);
  align-items: end;
  border-bottom: 0;
}

/* ----- Rendering slideshow ----- */

.cm-mtr-slideshow {
  position: relative;
  --cm-mtr-slide-width: min(1180px, 86vw);
}

.cm-mtr-slides {
  display: flex;
  gap: clamp(8px, 1.2vw, 18px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: #080F14;
}

.cm-mtr-slides::-webkit-scrollbar {
  display: none;
}

.cm-mtr-slides:focus-visible {
  outline: 2px solid #B8924A;
  outline-offset: -2px;
}

.cm-mtr-slide {
  position: relative;
  flex: 0 0 var(--cm-mtr-slide-width);
  aspect-ratio: 16 / 7.4;
  margin: 0;
  overflow: hidden;
  scroll-snap-align: center;
  background: #121B21;
}

.cm-mtr-slide:first-child {
  scroll-snap-align: start;
}

.cm-mtr-slide:last-child {
  scroll-snap-align: end;
}

.cm-mtr-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  transition: opacity 0.5s ease;
}

.cm-mtr-slide.is-current img {
  opacity: 1;
}

.cm-mtr-slide-label {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(8, 15, 20, 0.12);
  background: #F5F0E8;
  color: var(--cm-tsg-ink);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cm-mtr-slide.is-current .cm-mtr-slide-label {
  opacity: 1;
}

.cm-mtr-slide-nav {
  position: absolute;
  top: calc((var(--cm-mtr-slide-width) * 7.4 / 16) / 2);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 254, 249, 0.7);
  border-radius: 0;
  background: rgba(8, 15, 20, 0.5);
  color: #FFFEF9;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.cm-mtr-slide-nav:hover,
.cm-mtr-slide-nav:focus-visible {
  border-color: #B8924A;
  background: #B8924A;
}

.cm-mtr-slide-nav--prev {
  left: clamp(8px, 2vw, 32px);
}

.cm-mtr-slide-nav--next {
  right: clamp(8px, 2vw, 32px);
}

.cm-mtr-slide-nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.cm-mtr-slideshow-note {
  margin: 0;
  padding: 14px 24px 0;
  color: var(--cm-tsg-muted);
  font-style: italic;
  text-align: center;
}

/* ----- Project highlights: one row of showcase cards per project ----- */

.cm-mtr-highlights {
  border-bottom: 0;
}

.cm-mtr-highlights .cm-tsg-section-header {
  margin-bottom: clamp(36px, 4vw, 52px);
}

.cm-mtr-project + .cm-mtr-project {
  margin-top: clamp(40px, 5vw, 64px);
}

.cm-mtr-project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  margin-bottom: 22px;
}

.cm-mtr-project-head .cm-tsg-lens-title {
  max-width: none;
}

.cm-mtr-project-head .cm-tsg-lens-kicker {
  margin: 0;
}

/* ----- Listening first (dark band) ----- */

.cm-mtr-dark {
  background: #080F14;
  color: #FFFEF9;
}

.cm-mtr-listening {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: clamp(520px, 46vw, 700px);
}

/* The copy starts on the page's 1280px column. */
.cm-mtr-listening-copy {
  align-self: center;
  padding: 72px clamp(24px, 4vw, 56px) 72px max(24px, calc((100vw - 1280px) / 2 + 24px));
}

/* Beri: the title and copy sat too close to the image. Wherever copy and
   image sit side by side, the copy starts a little left of the column and
   keeps a wider gap before the image. */
@media screen and (min-width: 901px) {
  .cm-mtr-listening-copy {
    padding-right: clamp(56px, 7vw, 120px);
    padding-left: max(24px, calc((100vw - 1280px) / 2 + 24px - 3vw));
  }
}

.cm-mtr-dark .cm-tsg-lens-kicker {
  color: #B8924A;
}

.cm-mtr-dark .cm-tsg-section-title {
  max-width: none;
  color: #FFFEF9;
}

.cm-mtr-dark .cm-tsg-lens-copy {
  max-width: 48ch;
}

.cm-mtr-dark .cm-tsg-lens-copy p {
  color: #C9C2B5;
}

.cm-mtr-listening-media {
  position: relative;
  min-height: 320px;
  overflow: hidden;
}

.cm-mtr-listening-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 50%;
}

/* ----- Scrolling site plans and drawings ----- */

.cm-mtr-plans {
  overflow-x: auto;
  scrollbar-width: none;
  padding: clamp(36px, 5vw, 64px) 0 clamp(56px, 7vw, 88px);
}

.cm-mtr-plans::-webkit-scrollbar {
  display: none;
}

.cm-mtr-plans:focus-visible {
  outline: 2px solid #B8924A;
  outline-offset: -2px;
}

.cm-mtr-plans-track {
  display: flex;
  gap: clamp(16px, 2.6vw, 36px);
  width: max-content;
  padding: 0 clamp(16px, 2.6vw, 36px);
}

.cm-mtr-plan {
  flex: 0 0 auto;
  width: clamp(280px, 34vw, 520px);
  margin: 0;
}

.cm-mtr-plan img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9.6;
  object-fit: cover;
}

.cm-mtr-plan--site-plan img {
  object-fit: contain;
  background: #EFE6D6;
}

.cm-mtr-plan-label {
  display: block;
  margin-top: 12px;
  color: #B8924A;
}

.cm-mtr-plan-link {
  display: block;
  cursor: pointer;
  -webkit-user-drag: none;
}

.cm-mtr-plan-link img {
  -webkit-user-drag: none;
}

.cm-mtr-lightbox {
  width: min(1320px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid rgb(255 254 249 / 24%);
  background: #080F14;
  color: #FFFEF9;
}

.cm-mtr-lightbox::backdrop {
  background: rgb(8 15 20 / 88%);
}

html:has(.cm-mtr-lightbox[open]) {
  overflow: hidden;
}

.cm-mtr-lightbox-panel {
  padding: clamp(8px, 2vw, 20px);
}

.cm-mtr-lightbox header,
.cm-mtr-lightbox footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cm-mtr-lightbox h3 {
  margin: 0;
  color: #FFFEF9;
  font: inherit;
}

.cm-mtr-lightbox img {
  display: block;
  width: 100%;
  height: min(72dvh, 810px);
  object-fit: contain;
  margin: 8px 0;
}

.cm-mtr-lightbox button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid #C9C2B5;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}

.cm-mtr-lightbox button:hover {
  background: rgb(255 254 249 / 12%);
}

/* ----- Project locations and leasing ----- */

.cm-mtr-map-header {
  max-width: 1232px;
  margin-right: auto;
  margin-left: auto;
}

/* Photos stay hidden until fully downloaded and decoded (js/montrose.js),
   then fade in, so none paints in line by line. */
.cm-mtr img.is-pending {
  visibility: hidden;
}

.cm-mtr img.is-arriving {
  animation: cm-mtr-image-in 0.35s ease-out backwards;
}

@keyframes cm-mtr-image-in {
  from {
    opacity: 0;
  }
}

/* Where the two pins sit before the live map replaces the placeholder. */
.cm-mtr-map-marker--cedar {
  top: 18%;
  left: 44%;
}

.cm-mtr-map-marker--river {
  top: 83%;
  left: 52%;
}

/* "Interested in space" keeps its own line. */
.cm-mtr-leasing-title {
  max-width: none;
}

.cm-mtr-leasing-title .cm-mtr-gold {
  display: block;
}

.cm-mtr-email {
  margin-top: 30px;
}

.cm-mtr-leasing-image {
  height: auto;
  aspect-ratio: 4 / 3;
}

.cm-mtr-leasing-image img {
  object-position: 42% 50%;
}

/* ----- Tablet ----- */

@media screen and (max-width: 1100px) {
  .cm-mtr-approach {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cm-mtr-approach .cm-tsg-section-copy {
    max-width: 62ch;
  }
}

@media screen and (max-width: 900px) {
  .cm-mtr-listening {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .cm-mtr-listening-copy {
    padding: 64px 24px 48px;
  }

  .cm-mtr-listening-media {
    order: -1;
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
}

/* On a tablet's single column the statement has room for one sentence per line. */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .cm-mtr-approach .cm-tsg-section-title {
    max-width: none;
    text-wrap: balance;
  }
}

/* ----- Phone ----- */

@media screen and (max-width: 767px) {
  .cm-mtr-slideshow {
    --cm-mtr-slide-width: 88vw;
  }

  .cm-mtr-slide {
    aspect-ratio: 3 / 2;
  }

  .cm-mtr-slide-label {
    left: 12px;
    bottom: 12px;
  }

  /* The arrows sit together in the photo's lower right corner, level with
     the name tag, instead of straddling the slide's edges. */
  .cm-mtr-slide-nav {
    top: calc(var(--cm-mtr-slide-width) * 2 / 3 - 34px);
    width: 44px;
    height: 44px;
  }

  .cm-mtr-slide-nav--prev {
    right: calc((100% - var(--cm-mtr-slide-width)) / 2 + 12px + 44px + 8px);
    left: auto;
  }

  .cm-mtr-slide-nav--next {
    right: calc((100% - var(--cm-mtr-slide-width)) / 2 + 12px);
  }

  /* A caption, not body copy: the site-wide phone rule sets every paragraph
     to 16px, which made this disclaimer louder than the section around it. */
  .cm-mtr .cm-mtr-slideshow-note {
    padding: 12px 16px 0;
    font-size: 14px !important;
    line-height: 1.5 !important;
    text-wrap: balance;
  }

  /* Telluride's fact values are paragraphs, which the site-wide phone rule
     holds at 16px; these are <dd>, so they stayed at the 24px desktop size
     and nearly every one wrapped. Short labels get a narrower column. */
  .cm-mtr-facts .cm-tsg-fact {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .cm-mtr-facts .cm-tsg-fact-value {
    font-size: 18px;
    line-height: 1.3;
    text-wrap: balance;
  }

  /* No single word left alone on a last line. */
  .cm-mtr .cm-tsg-hero-kicker,
  .cm-mtr .cm-tsg-hero-subtitle,
  .cm-mtr .cm-tsg-destination-name {
    text-wrap: balance;
  }

  /* The road always sits under the project name, at every phone width. */
  .cm-mtr-project-head {
    flex-direction: column;
    align-items: flex-start;
  }

  /* The map block follows the page's 16px gutter, so its heading and the
     leasing copy line up with every other section. */
  .cm-mtr .cm-tsg-map-section {
    width: 100%;
  }

  .cm-mtr-listening-copy {
    padding: 48px 16px 40px;
  }

  .cm-mtr-plan {
    width: 78vw;
  }

  .cm-mtr .cm-tsg-hero-title {
    max-width: none;
  }

  /* The copy crosses the lit hotel facade; a deeper pool of shade than the
     shared treatment keeps the gold kicker and the subtitle readable. */
  .cm-mtr .cm-tsg-hero-card::before {
    inset: -76px 0 -52px -24px;
    background: radial-gradient(
      ellipse 82% 60% at 38% 50%,
      rgba(8, 15, 20, 0.84) 0%,
      rgba(8, 15, 20, 0.72) 58%,
      rgba(8, 15, 20, 0) 100%
    );
  }

  /* Sized so the gold phrase still holds one line, as on desktop, and the
     rest of the question balances beneath it. */
  .cm-mtr-leasing-title {
    font-size: min(7.3vw, 34px);
    text-wrap: balance;
  }

  /* Each project name starts its own line instead of breaking mid-name. */
  .cm-mtr-project-head .cm-mtr-gold {
    display: block;
  }

  .cm-mtr-map-marker--cedar {
    top: 20%;
    left: 27%;
  }

  .cm-mtr-map-marker--river {
    top: 80%;
    left: 39%;
  }

  .cm-mtr-leasing-image {
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm-mtr-slide img,
  .cm-mtr-slide-label {
    transition: none;
  }

  .cm-mtr img.is-arriving {
    animation: none;
  }
}

@media (max-width: 600px) {
  .cm-mtr-lightbox img {
    height: auto;
    max-height: 62dvh;
  }
}
