/* Bluejack Ranch - residences */

.bjr-residence {
  --bjr-res-inset: clamp(16px, 3.45vw, 70px);
  --bjr-res-top: clamp(14px, 2.1vw, 42px);
  --bjr-res-band: clamp(46px, 3.8vw, 78px);
  display: grid;
  grid-template-columns: 40.1vw 1fr;
  column-gap: 7.05vw;
  align-items: center;
  padding: clamp(3rem, 5.4vw, 7rem) 8.75vw clamp(3rem, 5.6vw, 7.25rem) 8.85vw;
  background: var(--bjr-cream);
}
/* every other one is white and flipped */
.bjr-residence:nth-of-type(even) {
  grid-template-columns: 1fr 40.1vw;
  padding-right: 9vw;
  padding-left: 7.85vw;
  background: var(--bjr-white);
}
.bjr-residence:nth-of-type(even) .bjr-residence__media { order: 2; }

/* Photos */

.bjr-residence__media {
  position: relative;
  padding: var(--bjr-res-top) 0 var(--bjr-res-band);
}
.bjr-residence__media::before {
  content: "";
  position: absolute;
  inset: 0 var(--bjr-res-inset);
  border: 1px solid var(--bjr-gold);
  pointer-events: none;
}
.bjr-residence__slides {
  position: relative;
  aspect-ratio: 802 / 557;
  overflow: hidden;
  background: rgba(var(--bjr-brown-rgb), .08);
}
.bjr-residence__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .6s ease;
}
.bjr-residence__slide.is-active,
.bjr-residence__slides:not(.is-ready) .bjr-residence__slide:first-child { opacity: 1; }
/* click to enlarge */
.bjr-residence__slides.is-ready { cursor: zoom-in; }
.bjr-residence__controls {
  position: absolute;
  inset: auto var(--bjr-res-inset) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bjr-res-band);
  padding: 0 clamp(10px, 1.3vw, 26px) 0 clamp(14px, 1.75vw, 36px);
}
.bjr-residence__dots {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.2vw, 24px);
}
.bjr-residence__dot {
  width: clamp(10px, .65vw, 13px);
  height: clamp(10px, .65vw, 13px);
  padding: 0;
  border: 1px solid var(--bjr-gold);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease;
}
.bjr-residence__dot.is-active,
.bjr-residence__dot:hover { border-color: var(--bjr-orange); background: var(--bjr-orange); }
.bjr-residence__expand {
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  padding: 0;
  border: 0;
  font-size: clamp(1rem, 1.3vw, 1.6rem);
  color: var(--bjr-gold);
  background: transparent;
  cursor: pointer;
  transition: color .25s ease;
}
.bjr-residence__expand:hover,
.bjr-residence__expand:focus-visible { color: var(--bjr-orange); }

/* Details */

.bjr-residence__title {
  margin: 0 0 clamp(.75rem, 1.5vw, 2rem);
  font-family: var(--bjr-font-heading);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 4.25rem);
  line-height: 1.1;
}
/* the + in a name */
.bjr-residence__title span { color: var(--bjr-gold); }
.bjr-residence__caption {
  max-width: 30vw;
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.8rem);
  line-height: 1.57;
}
.bjr-residence__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: clamp(1.75rem, 3vw, 3.75rem) 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--bjr-gold);
  border-bottom: 1px solid var(--bjr-gold);
}
.bjr-residence__stat {
  display: flex;
  align-items: center;
  min-height: clamp(64px, 5.15vw, 104px);
  padding-left: clamp(10px, 1.25vw, 26px);
  border-left: 1px solid var(--bjr-gold);
}
.bjr-residence__stat:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
.bjr-residence__stat:nth-child(n + 4) { border-top: 1px solid rgba(198, 157, 102, .45); }
.bjr-residence__stat i,
.bjr-residence__label {
  flex: none;
  width: clamp(44px, 3.6vw, 72px);
  color: var(--bjr-gold);
}
.bjr-residence__stat i { font-size: clamp(1.6rem, 2.3vw, 2.9rem); line-height: 1; }
.bjr-residence__label {
  font-weight: 500;
  font-size: clamp(.62rem, .7vw, .9rem);
  letter-spacing: .14em;
  line-height: 1.6;
  text-transform: uppercase;
}
.bjr-residence__value {
  flex: 1;
  font-weight: 600;
  font-size: clamp(1.15rem, 1.55vw, 1.95rem);
  text-align: center;
}
.bjr-residence__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.bjr-residence__foot .bjr-btn { margin-left: auto; }
.bjr-residence__features h3 {
  margin: 0 0 .5em;
  font-family: var(--bjr-font-body);
  font-weight: 500;
  font-size: clamp(.68rem, .75vw, .95rem);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.bjr-residence__features p {
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.8rem);
  line-height: 1.4;
}

@media (max-width: 991.98px) {
  .bjr-residence,
  .bjr-residence:nth-of-type(even) {
    grid-template-columns: 1fr;
    row-gap: 2rem;
    padding: 3rem var(--bjr-gutter);
  }
  .bjr-residence:nth-of-type(even) .bjr-residence__media { order: 0; }
  .bjr-residence__caption { max-width: none; }
}

/* Lightbox */

.bjr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem clamp(1rem, 6vw, 6rem) 2rem;
  background: rgba(var(--bjr-brown-rgb), .94);
}
.bjr-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* when residences.js knows the photo's shape it fills the space, so a small copy can stand in for the big one */
  width: min(100%, calc((100vh - 6.5rem) * var(--bjr-ratio)));
  aspect-ratio: var(--bjr-ratio);
}
.bjr-lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--bjr-gold);
  font-size: 1.15rem;
  color: var(--bjr-gold);
  background: rgba(var(--bjr-brown-rgb), .6);
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease;
}
.bjr-lightbox__btn:hover,
.bjr-lightbox__btn:focus-visible { color: var(--bjr-brown); background: var(--bjr-gold); }
.bjr-lightbox__close { top: 1rem; right: 1rem; }
.bjr-lightbox__prev,
.bjr-lightbox__next { top: 50%; transform: translateY(-50%); }
.bjr-lightbox__prev { left: 1rem; }
.bjr-lightbox__next { right: 1rem; }
