/* ========================================================================
   CIMA Real Estate — Design System
   Palette: Navy #0D1B2A · Gold #CBA36A · Warm #D9D7D2 · Slate #687077 · Bone #F6F4F1
   Fonts: Playfair Display (display) + DM Sans (ui/body)
   ======================================================================== */

:root {
  /* Brand */
  --navy:      #0D1B2A;
  --navy-80:   #1a2a3c;
  --navy-60:   #394a5e;
  --gold:      #CBA36A;
  --gold-dark: #A6834E;
  --gold-light:#E4C893;
  --warm:      #D9D7D2;
  --slate:     #687077;
  --bone:      #F6F4F1;
  --cream:     #EFECE6;
  --ink:       #0D1B2A;
  --line:      rgba(13,27,42,0.12);
  --line-dk:   rgba(255,255,255,0.14);

  /* Semantic */
  --bg: var(--bone);
  --bg-alt: var(--cream);
  --fg: var(--navy);
  --muted: var(--slate);
  --accent: var(--gold);

  /* Type */
  --ff-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --ff-sans:    "DM Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  /* Scale */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 8px;

  --container: 1280px;
  --container-narrow: 960px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(13,27,42,0.06);
  --shadow: 0 8px 24px rgba(13,27,42,0.08);
  --shadow-lg: 0 20px 60px rgba(13,27,42,0.15);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Typography */
.display {
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
h1, h2, h3, h4 { font-family: var(--ff-display); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(2.5rem, 5.5vw, 4.75rem); line-height: 1.04; }
h2 { font-size: clamp(1.875rem, 3.5vw, 3rem); line-height: 1.1; }
h3 { font-size: clamp(1.375rem, 2vw, 1.75rem); line-height: 1.2; }
h4 { font-size: 1.125rem; font-family: var(--ff-sans); font-weight: 500; letter-spacing: 0.01em; }

.eyebrow {
  font-family: var(--ff-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.eyebrow--light { color: var(--gold); }

.lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 62ch;
}

/* Layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: var(--container-narrow); }
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section--tight { padding: clamp(40px, 6vw, 72px) 0; }
.section--dark { background: var(--navy); color: var(--bone); }
.section--dark .lead, .section--dark .eyebrow { color: var(--warm); }
.section--cream { background: var(--cream); }
.section--warm { background: var(--warm); }

.grid { display: grid; gap: 24px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .cols-2.keep-2, .cols-4.keep-2 { grid-template-columns: 1fr 1fr; }
}

/* Divider */
.rule {
  display: inline-block; width: 48px; height: 1px;
  background: var(--gold); vertical-align: middle;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 14px 28px; border-radius: 2px;
  border: 1px solid transparent; cursor: pointer;
  transition: all .25s ease;
}
.btn--primary {
  background: var(--gold); color: var(--navy); border-color: var(--gold);
}
.btn--primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn--dark {
  background: var(--navy); color: var(--bone); border-color: var(--navy);
}
.btn--dark:hover { background: var(--navy-80); }
.btn--ghost {
  background: transparent; color: var(--navy); border-color: var(--navy);
}
.btn--ghost:hover { background: var(--navy); color: var(--bone); }
.btn--ghost-light {
  background: transparent; color: var(--bone); border-color: var(--bone);
}
.btn--ghost-light:hover { background: var(--bone); color: var(--navy); }
.btn--link {
  background: transparent; padding: 0; border: none;
  color: var(--navy); font-size: 12px;
}
.btn--link::after { content: "→"; margin-left: 6px; transition: transform .2s; }
.btn--link:hover::after { transform: translateX(4px); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.field input, .field select, .field textarea {
  font-family: var(--ff-sans); font-size: 15px;
  padding: 12px 14px; background: transparent;
  border: 1px solid var(--line); border-radius: 2px;
  color: var(--fg); transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
}
.field textarea { min-height: 120px; resize: vertical; }
.field .required { color: var(--gold-dark); }

/* Cards (property) */
.prop-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
  cursor: pointer;
}
.prop-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.prop-card__media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--warm); }
.prop-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.prop-card:hover .prop-card__media img.is-active { transform: scale(1.05); }
/* Stacked gallery — only the .is-active image is visible */
.prop-card__img { position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease; }
.prop-card__img.is-active { opacity: 1; position: relative; }
/* Inline gallery arrows — only appear on hover */
.prop-card__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.9); color: var(--navy);
  font-size: 22px; line-height: 1; cursor: pointer; z-index: 3;
  display: grid; place-items: center;
  opacity: 0; transition: opacity .2s, background .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.prop-card__arrow:hover { background: #fff; }
.prop-card__arrow--prev { left: 10px; }
.prop-card__arrow--next { right: 10px; }
.prop-card:hover .prop-card__arrow { opacity: 1; }
.prop-card__dots {
  position: absolute; bottom: 10px; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: center; gap: 5px;
  opacity: 0; transition: opacity .2s;
}
.prop-card:hover .prop-card__dots { opacity: 1; }
.prop-card__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.55); cursor: pointer;
  transition: background .15s, transform .15s;
}
.prop-card__dot.is-active { background: #fff; transform: scale(1.3); }
@media (hover: none) {
  .prop-card__arrow, .prop-card__dots { opacity: 1; }
}
.prop-card__badge {
  position: absolute; top: 14px; left: 14px;
  background: var(--navy); color: var(--bone);
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 2px;
}
.prop-card__badge--gold { background: var(--gold); color: var(--navy); }
.prop-card__sold {
  position: absolute; inset: 0; background: rgba(13,27,42,0.55);
  display: grid; place-items: center;
  font-family: var(--ff-display); color: var(--bone);
  font-size: 1.75rem; letter-spacing: 0.1em;
}
.prop-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.prop-card__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.prop-card__price { font-family: var(--ff-display); font-size: 1.375rem; color: var(--navy); white-space: nowrap; }
.prop-card__type { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-dark); }
/* Card title: clamp to exactly 2 lines with ellipsis so every card aligns,
   regardless of how long the agent makes the title. Hover on the card shows full title as a tooltip via title=. */
.prop-card__title {
  font-size: 0.95rem; color: var(--fg); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
  min-height: 2.8em; max-height: 2.8em;
}
.prop-card__loc { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.prop-card__meta {
  display: flex; gap: 18px; padding-top: 12px; margin-top: auto;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.prop-card__meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Listing page filter bar — force uniform control heights so labels + inputs
   align across selects, text inputs, and buttons.
   (Browsers render <select> ~2-4 px taller than <input> with identical padding
   because of the native dropdown arrow; this normalises them.) */
.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar input[type="email"] { height: 44px; box-sizing: border-box; }
.filter-bar .btn,
.filter-bar button { height: 44px; }

/* Rich-text description output on the public property page */
.rt-content { color: var(--fg); line-height: 1.7; font-size: 15px; }
.rt-content p { margin: 0 0 1em; }
.rt-content strong, .rt-content b { font-weight: 600; color: var(--navy); }
.rt-content em, .rt-content i { font-style: italic; }
.rt-content ul, .rt-content ol { margin: 0 0 1em; padding-left: 1.4em; }
.rt-content li { margin: 0.25em 0; }
.rt-content blockquote {
  margin: 1em 0; padding: 0.5em 1.2em;
  border-left: 3px solid var(--gold);
  color: var(--muted); font-style: italic;
}

/* Icons inline */
.icn {
  width: 14px; height: 14px; stroke: currentColor; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* Header / Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,244,241,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav--transparent {
  position: fixed; width: 100%;
  background: transparent; border-color: transparent;
  color: var(--bone);
}
.nav--transparent.scrolled {
  background: rgba(13,27,42,0.94);
  border-color: var(--line-dk);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 80px; padding: 0 32px;
}
.nav__logo { display: flex; align-items: center; gap: 12px; }
.nav__wordmark {
  font-family: var(--ff-display); font-size: 1.625rem; letter-spacing: 0.3em;
  font-weight: 500;
}
.nav__tagline {
  font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted); margin-top: 2px;
}
.nav--transparent .nav__tagline { color: var(--warm); }
.nav__links { display: flex; gap: 28px; align-items: center; }
.nav__link {
  font-size: 13px; letter-spacing: 0.04em; color: inherit;
  padding: 6px 0; position: relative;
}
.nav__link:hover { color: var(--gold); }
.nav__link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--gold);
}
.nav__right { display: flex; align-items: center; gap: 20px; }
.nav__icon-btn {
  background: transparent; border: none; cursor: pointer;
  color: inherit; padding: 8px; display: flex; align-items: center;
}
.nav__icon-btn:hover { color: var(--gold); }
.nav__lang {
  display: inline-flex; gap: 4px; padding: 4px; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.nav__lang button {
  background: transparent; border: none; color: inherit;
  padding: 4px 8px; cursor: pointer; letter-spacing: inherit;
  font-size: inherit; opacity: .55; transition: opacity .2s;
}
.nav__lang button.active { opacity: 1; color: var(--gold); }

.nav__burger { display: none; background: transparent; border: none; cursor: pointer; color: inherit; padding: 8px; }
.nav__burger svg { width: 22px; height: 22px; }

.nav__mobile { display: none; }

@media (max-width: 1024px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__mobile.open {
    display: block;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bone); border-top: 1px solid var(--line);
    padding: 16px 24px 24px;
  }
  .nav--transparent .nav__mobile.open { background: var(--navy); }
  .nav__mobile .nav__link {
    display: block; padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .nav--transparent .nav__mobile .nav__link { border-color: var(--line-dk); }
}

/* Footer */
.footer { background: var(--navy); color: var(--bone); padding: 80px 0 28px; }
.footer a { color: var(--warm); }
.footer a:hover { color: var(--gold); }
.footer__grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 48px; }
.footer__brand { font-family: var(--ff-display); font-size: 1.75rem; letter-spacing: 0.3em; }
.footer__tag { font-size: 10px; letter-spacing: 0.3em; color: var(--gold); margin-top: 4px; text-transform: uppercase; }
.footer__col h4 { color: var(--gold); font-family: var(--ff-sans); font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 18px; font-weight: 500; }
.footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__col li { font-size: 13px; color: var(--warm); }
.footer__socials { display: flex; gap: 14px; margin-top: 16px; }
.footer__socials a {
  width: 36px; height: 36px; border: 1px solid var(--line-dk);
  display: grid; place-items: center; border-radius: 50%;
}
.footer__socials a:hover { border-color: var(--gold); }
.footer__bottom {
  border-top: 1px solid var(--line-dk); margin-top: 56px; padding-top: 24px;
  display: flex; justify-content: space-between; gap: 24px;
  font-size: 12px; color: var(--warm);
}
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* Utility */
.text-center { text-align: center; }
.muted { color: var(--muted); }
.mt-4 { margin-top: 32px; }
.mt-6 { margin-top: 48px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Section header */
.s-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 48px; }
.s-head__eyebrow { display: flex; align-items: center; gap: 14px; }
.s-head__title { max-width: 28ch; }
.s-head__intro { max-width: 58ch; }
.s-head--center { align-items: center; text-align: center; }
.s-head--center .s-head__title { max-width: 26ch; }
.s-head--row { flex-direction: row; align-items: flex-end; justify-content: space-between; }
@media (max-width: 800px) { .s-head--row { flex-direction: column; align-items: flex-start; } }

/* Carousel */
.carousel { position: relative; }
.carousel__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(320px, 380px);
  gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 8px 24px 24px; margin: 0 -24px;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * { scroll-snap-align: start; }
.carousel__controls { display: flex; gap: 10px; }
.carousel__btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center; cursor: pointer;
  color: var(--fg); transition: all .2s;
}
.carousel__btn:hover { background: var(--navy); color: var(--bone); border-color: var(--navy); }
.carousel__btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Page hero */
.page-hero {
  position: relative; min-height: 420px;
  display: flex; align-items: flex-end;
  color: var(--bone); overflow: hidden;
  padding: 140px 0 80px;
}
.page-hero__img {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
}
.page-hero__img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,27,42,0.45) 0%, rgba(13,27,42,0.7) 100%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero__title { font-size: clamp(2.5rem, 6vw, 4.5rem); }
.page-hero__crumbs { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--warm); margin-bottom: 18px; }

/* Placeholder image pattern */
.ph {
  background: repeating-linear-gradient(
    45deg, var(--warm), var(--warm) 10px,
    var(--cream) 10px, var(--cream) 20px);
  position: relative;
}
.ph::after {
  content: attr(data-label);
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}

/* WhatsApp float */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  background: #25D366; color: #fff;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .2s;
}
.wa-float:hover { transform: scale(1.06); }

/* Tweaks panel */
.tweaks {
  position: fixed; right: 20px; bottom: 88px; z-index: 45;
  width: 280px; max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid var(--line);
  border-radius: 4px; box-shadow: var(--shadow-lg);
  padding: 20px; font-family: var(--ff-sans);
}
.tweaks h5 { margin: 0 0 14px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dark); }
.tweaks__row { margin-bottom: 14px; }
.tweaks__row label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.tweaks__swatches { display: flex; gap: 8px; }
.tweaks__swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.tweaks__swatch.active { border-color: var(--navy); }
.tweaks__toggle { display: flex; gap: 6px; }
.tweaks__toggle button {
  flex: 1; padding: 6px 10px; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; background: transparent;
  border: 1px solid var(--line); cursor: pointer; color: var(--fg);
  font-family: inherit;
}
.tweaks__toggle button.active { background: var(--navy); color: var(--bone); border-color: var(--navy); }
