/* Unit Types carousel — the slides and panes are in the HTML; units.js only switches between them */
.units {
  --md-bg: var(--charcoal);
  --md-gold: var(--gold);
  --md-cream: var(--cream);
  --md-interval: 5s;
  font-family: var(--font-body);
  background-color: var(--md-bg);
  color: var(--md-gold);
  min-height: 600px;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.units *, .units *::before, .units *::after { box-sizing: border-box; }

/* ---------- Media (left) ---------- */
.units .units-media {
  position: relative;
  min-height: 360px;
  background: #0f172a;
  overflow: hidden;
  touch-action: pan-y;
}
.units .units-slide {
  margin: 0;
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms ease, visibility 600ms ease;
}
.units .units-slide.is-active { opacity: 1; visibility: visible; }
.units .units-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
  transition: transform 6s ease-out;
}
.units .units-slide.is-active img { transform: scale(1); }


/* Controls — same treatment as the amenities gallery */
.units .units-control {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  background: rgba(15,23,42,.66);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  backdrop-filter: blur(6px);
}
.units .units-control:hover,
.units .units-control:focus-visible,
.units .units-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  background: rgba(15,23,42,.88);
}
.units .units-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.units .units-next { right: 16px; top: 50%; transform: translateY(-50%); }
.units .units-pause { left: 16px; bottom: 14px; }
.units-control svg { width: 20px; height: 20px; }
.units-pause svg { width: 16px; height: 16px; }

.units .units-dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateX(-50%);
}
.units .units-dot {
  display: inline-flex;
  width: 28px;
  height: 28px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.units .units-dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transition: transform .2s ease, background .2s ease;
}
.units .units-dot[aria-current="true"]::before { background: #fff; transform: scale(1.2); }

/* ---------- Info (right) ---------- */
.units .units-info {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 64px 24px 40px;
}
.units .units-counter {
  position: absolute;
  top: 0;
  left: 0;
  padding: 4px 14px;
  background: var(--md-gold);
  color: var(--md-bg);
  font-size: 14px;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
/* 5s timer line */
.units .units-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(180,158,130,.2);
  overflow: hidden;
}
.units .units-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--md-gold);
  transform: scaleX(0);
  transform-origin: left center;
}
.units .units-progress span.running {
  animation: units-fill var(--md-interval) linear forwards;
}
.units.is-paused .units-progress span.running { animation-play-state: paused; }
@keyframes units-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Stack every pane in the same cell so height never jumps */
.units .units-panes { display: grid; grid-template-columns: 1fr; min-width: 0; }
.units .units-pane {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .45s ease, transform .45s ease, visibility .45s;
  overflow-wrap: anywhere;
}
.units .units-pane.is-active {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.units .units-headline {
  margin: 0 0 .75rem;
  font-family: var(--font-display);
  font-weight: normal;
  font-size: 30px;
  line-height: 1.2;
  color: var(--md-cream);
  text-transform: uppercase;
}
.units .units-levels {
  margin: 0 0 1.5rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--md-gold);
}
.units .units-tagline {
  margin: 0 0 .35rem;
  color: var(--md-cream);
  font-size: 1.05rem;
  line-height: 1.5;
}
.units .units-body {
  margin: 0;
  line-height: 1.6;
  font-size: 1rem;
}

/* Feature list — amenities styling */
.units .units-features {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.units .units-features li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--md-gold);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--md-gold);
}
.units .units-features li:last-child { border-bottom: none; padding-bottom: 0; }
.units .units-features svg { flex-shrink: 0; width: 20px; height: 20px; margin-top: .15rem; }

/* Two-column feature list on wider screens (reads down, then across) */
@media (min-width: 1024px) {
  .units .units-features.is-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(var(--rows), auto);
    grid-auto-flow: column;
    gap: 4px 32px;
  }
  .units .units-features.is-split li { border-bottom: 1px solid var(--md-gold); padding-bottom: 4px; }
  .units .units-features.is-split li.units-col-end { border-bottom: none; padding-bottom: 0; }
}

/* ---------- Tablet: photo above the text, shown whole ---------- */
/* Side by side, the photo column is much taller than it is wide on tablets and
   only a narrow slice of each room shows, so tablets stack like phones. */
@media (min-width: 768px) {
  .units .units-media { aspect-ratio: 16 / 9; min-height: 0; }
  .units .units-info { padding: 64px 48px 56px; }
  .units .units-headline { font-size: 36px; }
}

/* ---------- Desktop: side by side ---------- */
@media (min-width: 1200px) {
  .units { flex-direction: row; align-items: stretch; }
  .units .units-media { flex: 0 0 50%; width: 50%; min-width: 0; aspect-ratio: auto; }
  .units .units-info { flex: 0 0 50%; width: 50%; min-width: 0; padding: 80px 60px 60px; justify-content: center; }
}
@media (max-width: 767px) {
  .units .units-prev { left: 8px; }
  .units .units-next { right: 8px; }
  /* Mobile: info section is only as tall as the current unit's content */
  .units .units-pane { display: none; transition: none; }
  .units .units-pane.is-active { display: block; animation: units-pane-in .45s ease; }
}
@keyframes units-pane-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .units .units-slide,
  .units .units-slide img,
  .units .units-pane { transition: none; animation: none; }
  .units .units-slide img { transform: none; }
}

/* Controls only appear once units.js is running */
.units:not(.is-enhanced) .units-control,
.units:not(.is-enhanced) .units-dots,
.units:not(.is-enhanced) .units-progress { display: none; }

/* Row count for two-column feature lists (lists longer than 8 split in two) */
.units-features.rows-5 { --rows: 5; }
.units-features.rows-6 { --rows: 6; }
.units-features.rows-7 { --rows: 7; }
.units-features.rows-8 { --rows: 8; }