/* One control pattern for spaces, apartment filters and the location deck. */
.section-switch {
  position: relative;
  display: flex;
  isolation: isolate;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  min-height: 52px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--soft);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-tap-highlight-color: transparent;
}

.section-switch::-webkit-scrollbar {
  display: none;
}

.section-switch > button {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 44px;
  min-height: 44px;
  padding: 10px 21px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}

.section-switch > button:hover {
  background: #d8e9e5;
}

.section-switch > button:is([aria-selected="true"], [aria-pressed="true"], .is-active),
.section-switch > button:is([aria-selected="true"], [aria-pressed="true"], .is-active):hover {
  background: var(--ink);
  color: white;
}

.section-switch > button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -3px;
}

.section-switch > button:is([aria-selected="true"], [aria-pressed="true"], .is-active):focus-visible {
  outline-color: var(--aqua);
}

.section-switch-indicator {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 0;
  width: 0;
  height: 44px;
  border-radius: 100px;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
}

.section-switch.has-switch-indicator .section-switch-indicator {
  opacity: 1;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1),
    width .45s cubic-bezier(.22, 1, .36, 1),
    height .45s cubic-bezier(.22, 1, .36, 1);
}

.section-switch.has-switch-indicator > button:is([aria-selected="true"], [aria-pressed="true"], .is-active),
.section-switch.has-switch-indicator > button:is([aria-selected="true"], [aria-pressed="true"], .is-active):hover {
  background: transparent;
  color: white;
}

.section-switch .location-switch-indicator {
  display: none;
}

.section-switch.location-switch {
  display: none;
  width: 340px;
  margin: 0;
  flex: none;
}

.has-location-deck .section-switch.location-switch {
  display: flex;
}

.section-switch.location-switch > button {
  flex: 1;
  min-width: 0;
  padding-right: 14px;
  padding-left: 14px;
}

.section-switch.location-switch > button > span {
  margin-left: 5px;
  color: inherit;
  font-size: 10px;
  font-weight: 400;
  opacity: .75;
}

/* JavaScript animates each stage's measured height and its outgoing/incoming view. */
#space-panel,
#space-panel.is-gallery {
  height: auto;
  overflow: visible;
  background: transparent;
}

.space-motion-stage,
.space-motion-stage.is-gallery {
  position: relative;
  height: auto;
  overflow: hidden;
  border-radius: 20px;
  background: var(--soft);
}

.space-motion-stage.is-gallery {
  background: transparent;
}

.space-motion-stage > .space-banner {
  width: 100%;
  height: 570px;
  border-radius: inherit;
}

.space-motion-stage > .lobby-gallery {
  width: 100%;
  border-radius: 0;
}

.space-motion-stage .space-photo {
  animation: none;
}

.apartment-motion-viewport {
  position: relative;
  isolation: isolate;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.apartment-motion-viewport > .apartment-grid {
  width: 100%;
}

.space-motion-stage.is-section-changing,
.apartment-motion-viewport.is-section-changing {
  will-change: height, opacity, transform;
}

.space-motion-stage.is-section-changing > *,
.apartment-motion-viewport.is-section-changing > * {
  will-change: opacity, transform;
}

.is-deck-ready .location-track,
.is-deck-ready .location-viewport {
  transition-duration: .48s;
  transition-timing-function: cubic-bezier(.22, 1, .36, 1);
}

.space-motion-stage [hidden],
.apartment-motion-viewport [hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .space-motion-stage > .space-banner {
    height: 530px;
  }
}

@media (max-width: 700px) {
  .section-switch > button {
    padding-right: 16px;
    padding-left: 16px;
    font-size: 12px;
  }

  .section-switch.location-switch {
    width: 100%;
  }

  .section-switch.location-switch > button {
    padding-right: 12px;
    padding-left: 12px;
  }

  .space-motion-stage,
  .space-motion-stage.is-gallery {
    border-radius: 19px;
  }

  .space-motion-stage > .space-banner {
    height: 570px;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Keep the requested, user-triggered tab transitions perceptible even when
     the site's general reduced-motion rule disables decorative animation. */
  .section-switch > button {
    transition: color .2s ease, background .2s ease !important;
  }

  .section-switch.has-switch-indicator .section-switch-indicator {
    transition: transform .45s cubic-bezier(.22, 1, .36, 1),
      width .45s cubic-bezier(.22, 1, .36, 1),
      height .45s cubic-bezier(.22, 1, .36, 1) !important;
  }

  .is-deck-ready .location-track {
    transition: transform .48s cubic-bezier(.22, 1, .36, 1) !important;
  }

  .is-deck-ready .location-viewport {
    transition: height .48s cubic-bezier(.22, 1, .36, 1) !important;
  }
}
