/* Residence presentation — unified showcase with 3 selectable templates
   (editorial / cinematic / gallery), full-screen hero, dark-mode aware.
   Token-driven so dark mode + the cinematic style are just variable flips. */
.respres {
  /* light theme tokens */
  --bg:        #f6efe4;
  --bg-raised: #efe5d4;
  --fg:        #233140;
  --fg-soft:   #6c7585;
  --accent:    #b08a4e;
  --accent-ink:#1a1206;
  --heading:   #15273a;
  --line:      rgba(21, 39, 58, .12);
  --panel:     #15273a;       /* dark panels (cta) on light bg */
  --panel-fg:  #ffffff;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
}
.respres * { box-sizing: border-box; }
.respres-body { margin: 0; background: var(--bg); }

/* ---- Dark mode (site theme) + the always-dark cinematic style ---------- */
[data-theme="dark"] .respres,
.respres--cinematic {
  --bg:        #0d1620;
  --bg-raised: #16222f;
  --fg:        #e7edf4;
  --fg-soft:   #9bb0c4;
  --accent:    #cba46a;
  --accent-ink:#1a1206;
  --heading:   #ffffff;
  --line:      rgba(255, 255, 255, .14);
  --panel:     #16222f;
  --panel-fg:  #ffffff;
}
[data-theme="dark"] .respres-body { background: #0d1620; }

/* ---- Hero (FULL SCREEN) ------------------------------------------------- */
.respres-hero {
  position: relative;
  min-height: 100svh;            /* full viewport, mobile-safe */
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--heading);
}
.respres-hero__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.respres-hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,14,22,.34) 0%, rgba(6,14,22,.12) 34%, rgba(6,14,22,.82) 100%);
}
.respres-hero__inner {
  position: relative;
  width: min(1140px, 92vw);
  margin: 0 auto;
  padding: 0 0 clamp(3rem, 8vh, 6rem);
  color: #fff;
}
.respres-hero__back {
  display: inline-flex; align-items: center; gap: .5rem;
  color: rgba(255,255,255,.85); text-decoration: none;
  font-size: .82rem; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 1.4rem; transition: color .2s;
}
.respres-hero__back:hover { color: #fff; }
.respres-hero__eyebrow {
  margin: 0 0 .6rem;
  font-size: .82rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--accent);
}
.respres-hero__title {
  margin: 0;
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.8rem, 8vw, 5.6rem);
  line-height: 1.0; letter-spacing: .01em;
}
.respres-hero__loc {
  margin: 1rem 0 0;
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: 1.02rem; color: rgba(255,255,255,.92);
}
.respres-hero__meta { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .6rem 1.8rem; }
.respres-hero__meta span { display: inline-flex; align-items: center; gap: .5rem; font-size: .95rem; color: rgba(255,255,255,.92); }
.respres-hero__meta i { color: var(--accent); }
.respres-hero__cue {
  position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  color: rgba(255,255,255,.85); font-size: 1.15rem;
  animation: respres-bob 1.8s ease-in-out infinite;
}
@keyframes respres-bob { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,8px);} }

/* ---- Style switcher (fixed control bar) -------------------------------- */
.respres-switch {
  position: fixed; bottom: 1.1rem; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: .25rem;
  padding: .35rem .45rem; border-radius: 999px;
  background: rgba(13,22,32,.82); backdrop-filter: blur(10px);
  box-shadow: 0 10px 34px rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.1);
}
.respres-switch__label {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--accent); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  padding: 0 .55rem 0 .65rem;
}
.respres-switch__opt {
  color: rgba(255,255,255,.72); text-decoration: none;
  font-size: .82rem; font-weight: 500; padding: .4rem .9rem; border-radius: 999px;
  transition: background .2s, color .2s;
}
.respres-switch__opt:hover { color: #fff; }
.respres-switch__opt.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---- Main shell -------------------------------------------------------- */
.respres-main {
  width: min(1140px, 92vw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) 0 6rem;
}

/* ---- Intro (building & area) ------------------------------------------ */
.respres-intro { max-width: 780px; margin: 0 auto clamp(3rem, 7vw, 5rem); text-align: center; }
.respres-intro__eyebrow {
  display: block; font-size: .78rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.respres-intro__body { font-size: 1.2rem; line-height: 1.78; color: var(--fg); }
.respres-intro__body p { margin: 0 0 1.1rem; }
.respres-intro__body p:last-child { margin-bottom: 0; }

/* ---- Floor section ----------------------------------------------------- */
.respres-floor { margin: 0 0 clamp(2.6rem, 6vw, 4.5rem); }
.respres-floor__head {
  display: flex; align-items: baseline; gap: 1rem;
  padding-bottom: .9rem; margin-bottom: 2.4rem; border-bottom: 1px solid var(--line);
}
.respres-floor__name {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--heading);
}
.respres-floor__count { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-soft); }

/* ---- Apartment block (editorial default: info | gallery) --------------- */
.respres-apt {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
}
.respres-apt + .respres-apt { border-top: 1px solid var(--line); }
.respres-apt__info { position: sticky; top: 1.5rem; }
.respres-apt__title {
  margin: 0 0 .7rem; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--heading); line-height: 1.08;
}
.respres-apt__meta { display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; margin-bottom: 1.1rem; }
.respres-apt__meta span { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--fg-soft); }
.respres-apt__meta i { color: var(--accent); }
.respres-apt__desc { font-size: 1rem; line-height: 1.7; color: var(--fg); }
.respres-apt__desc p { margin: 0 0 .8rem; }
.respres-apt__cta {
  display: inline-flex; align-items: center; gap: .55rem;
  margin-top: 1.3rem; padding: .72rem 1.5rem;
  border: 1.5px solid var(--accent); border-radius: 999px;
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: .92rem;
  transition: background .2s, color .2s, transform .2s;
}
.respres-apt__cta:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.respres-apt__cta i { transition: transform .2s; }
.respres-apt__cta:hover i { transform: translateX(3px); }

/* ---- Feature image mosaic --------------------------------------------- */
.respres-apt__gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.respres-shot {
  position: relative; display: block; overflow: hidden;
  border-radius: 14px; aspect-ratio: 4 / 3; background: var(--bg-raised); cursor: zoom-in;
}
.respres-shot--lead { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.respres-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.respres-shot:hover img { transform: scale(1.045); }

/* ---- CTA --------------------------------------------------------------- */
.respres-cta {
  margin-top: clamp(2.5rem, 6vw, 4rem); padding: clamp(2.6rem, 6vw, 3.8rem);
  text-align: center; background: var(--panel); color: var(--panel-fg); border-radius: 24px;
}
.respres-cta__title { margin: 0 0 .5rem; font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.respres-cta__lead { margin: 0 0 1.6rem; color: rgba(255,255,255,.82); }
.respres-cta__btn {
  display: inline-flex; align-items: center; gap: .6rem; padding: .95rem 1.9rem;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; letter-spacing: .02em;
  text-decoration: none; border-radius: 999px; transition: transform .2s, box-shadow .2s;
}
.respres-cta__btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(176,138,78,.4); }
.respres-empty { text-align: center; color: var(--fg-soft); padding: 3rem 0; }

/* ======================================================================= */
/*  TEMPLATE: CINEMATIC — dark, immersive, image-led, stacked              */
/* ======================================================================= */
.respres--cinematic .respres-apt {
  grid-template-columns: 1fr;
  gap: 1.6rem;
  padding: clamp(2rem, 5vw, 3.5rem) 0;
}
.respres--cinematic .respres-apt__info { position: static; max-width: 820px; }
.respres--cinematic .respres-apt__title { font-size: clamp(1.9rem, 4.5vw, 3rem); }
.respres--cinematic .respres-apt__gallery { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.respres--cinematic .respres-shot { aspect-ratio: 1 / 1; border-radius: 10px; }
.respres--cinematic .respres-shot--lead { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.respres--cinematic .respres-floor__head { border-color: var(--line); }

/* ======================================================================= */
/*  TEMPLATE: GALLERY — image-forward lookbook, compact captions           */
/* ======================================================================= */
.respres--gallery .respres-apt {
  grid-template-columns: 1fr;
  gap: 1.2rem;
  padding: clamp(1.4rem, 3vw, 2rem) 0;
}
.respres--gallery .respres-apt__info {
  position: static;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem 1.5rem;
}
.respres--gallery .respres-apt__title { grid-row: 1; margin: 0; }
.respres--gallery .respres-apt__meta { grid-row: 2; grid-column: 1; margin: 0; }
.respres--gallery .respres-apt__desc { grid-column: 1 / -1; max-width: 70ch; }
.respres--gallery .respres-apt__cta { grid-row: 1 / 3; grid-column: 2; margin: 0; align-self: center; }
.respres--gallery .respres-apt__gallery { grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.respres--gallery .respres-shot { aspect-ratio: 1 / 1; }
.respres--gallery .respres-shot--lead { grid-column: span 2; grid-row: span 2; aspect-ratio: 1 / 1; }

/* ---- Lightbox ---------------------------------------------------------- */
.respres-lb {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center; background: rgba(8,14,22,.95);
}
.respres-lb[hidden] { display: none; }
.respres-lb__img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.respres-lb__close, .respres-lb__nav {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.respres-lb__close:hover, .respres-lb__nav:hover { background: rgba(255,255,255,.26); }
.respres-lb__close { top: 1.2rem; right: 1.2rem; }
.respres-lb__nav--prev { left: 1.2rem; }
.respres-lb__nav--next { right: 1.2rem; }

/* ---- Tablet ------------------------------------------------------------ */
@media (max-width: 900px) and (min-width: 769px) {
  .respres-apt,
  .respres--gallery .respres-apt { grid-template-columns: 1fr; }
  .respres-apt__info { position: static; }
  .respres--gallery .respres-apt__info { grid-template-columns: 1fr; }
  .respres--gallery .respres-apt__cta { grid-row: auto; grid-column: 1; justify-self: start; margin-top: .4rem; }
}

/* =======================================================================
   MOBILE (<=768px) — each apartment is a polished, image-led CARD:
   big lead photo on top, then title/meta/description, a 2-col thumbnail
   grid, and a full-width 'View apartment' button. Works for all 3 styles.
   ======================================================================= */
@media (max-width: 768px) {
  .respres-main { padding: clamp(2rem, 6vw, 3rem) 0 4.5rem; }

  /* hero — comfortable on small screens */
  .respres-hero__inner { padding-bottom: clamp(2.4rem, 9vh, 4rem); }
  .respres-hero__title { font-size: clamp(2.3rem, 11vw, 3.4rem); }
  .respres-hero__loc { font-size: .92rem; }
  .respres-hero__meta { gap: .5rem 1.2rem; }
  .respres-intro__body { font-size: 1.06rem; }
  .respres-floor { margin-bottom: 2rem; }
  .respres-floor__head { margin-bottom: 1.3rem; }

  /* apartment → card (override every template variant) */
  .respres-apt,
  .respres--cinematic .respres-apt,
  .respres--gallery .respres-apt {
    display: flex; flex-direction: column; gap: 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: clamp(.85rem, 3.5vw, 1.15rem);
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 26px rgba(8, 18, 30, .06);
  }
  .respres-apt + .respres-apt { border-top: 1px solid var(--line); }  /* card already bordered */

  /* images on TOP of the card */
  .respres-apt__gallery,
  .respres--cinematic .respres-apt__gallery,
  .respres--gallery .respres-apt__gallery {
    order: -1;
    grid-template-columns: repeat(2, 1fr);
    gap: .45rem;
  }
  .respres-shot { aspect-ratio: 1 / 1; border-radius: 12px; }
  .respres-shot--lead,
  .respres--cinematic .respres-shot--lead,
  .respres--gallery .respres-shot--lead {
    grid-column: 1 / -1; grid-row: auto; aspect-ratio: 4 / 3; border-radius: 14px;
  }

  /* text block */
  .respres-apt__info,
  .respres--gallery .respres-apt__info,
  .respres--cinematic .respres-apt__info {
    position: static; display: block; max-width: none;
  }
  .respres-apt__title { font-size: clamp(1.5rem, 6vw, 1.9rem); margin-bottom: .55rem; }
  .respres-apt__meta { gap: .4rem .9rem; margin-bottom: .9rem; }
  .respres-apt__desc { font-size: .98rem; }

  /* full-width tap-friendly CTA */
  .respres-apt__cta,
  .respres--gallery .respres-apt__cta {
    display: flex; width: 100%; justify-content: center;
    margin-top: 1rem; padding: .9rem 1.2rem; grid-row: auto; grid-column: auto; justify-self: stretch;
  }

  /* bottom CTA + switcher */
  .respres-cta { border-radius: 18px; }
  .respres-cta__btn { width: 100%; justify-content: center; }
  .respres-switch {
    left: .6rem; right: .6rem; bottom: .7rem; transform: none;
    justify-content: center; flex-wrap: wrap; gap: .2rem;
  }
  .respres-switch__opt { padding: .4rem .75rem; font-size: .78rem; }
}
