/* Peter Rodrigues — v3 light, classy, premium */
:root {
  --ivory: #FFFFFF;
  --ivory-2: #F3F6FB;
  --stone: #E8EDF6;
  --sand: #C2CBDB;
  --paper: #FFFFFF;
  --ink: #0B1B3A;
  --ink-2: #47546B;
  --ink-3: #5A6578;
  --line: #DDE3EE;
  --line-strong: #C2CBDB;
  --gold: #0F2C66;
  --gold-2: #1D4AA8;
  --gold-soft: #C5D3EA;
  --gold-pale: #E8EDF6;
  --gold-line: rgba(15, 44, 102, 0.28);
  --sage: #1D4AA8;
  --sage-soft: #E8EDF6;
  --teal: #0F2C66;
  --danger: #8A3B2A;
  --shadow: 0 14px 40px rgba(11, 27, 58, 0.08);
  --shadow-sm: 0 6px 18px rgba(11, 27, 58, 0.06);
  --display: "Cormorant Garamond", "Palatino Linotype", Palatino, serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --fs-display: clamp(3rem, 6.6vw, 5.6rem);
  --fs-h2: clamp(2rem, 3.6vw, 3.2rem);
  --fs-h3: clamp(1.22rem, 1.7vw, 1.5rem);
  --fs-body: 1.125rem;
  --fs-sm: 0.9rem;
  --fs-xs: 0.68rem;
  --wrap: 1200px;
  --wrap-wide: 1280px;
  --header-h: 84px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --text-ink: var(--ink);
  --text-ink-2: var(--ink-2);
  --champagne: var(--gold);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--ink); }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 0.6em;
}
h1 { font-size: var(--fs-display); font-weight: 500; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 500; }
h4 { font-size: 1.05rem; font-family: var(--sans); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; font-size: 0.72rem; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), calc(100% - 48px)); margin-inline: auto; }
.wrap-wide { width: min(var(--wrap-wide), calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 14px;
}
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 38em; }
.muted, .fine, .form-note, .sources { color: var(--ink-3); }
.fine, .form-note, .sources { font-size: 0.82rem; }
.rule { border: 0; width: 64px; height: 1px; background: var(--gold); margin: 22px 0; }
.section, .section-ivory, .section-charcoal, .section-stone, .section-cream { padding: 88px 0; }
.section-ivory, .section-cream { background: var(--ivory-2); }
.section-charcoal, .section-stone { background: var(--stone); }
.section-sm { padding: 56px 0; }
.asymmetric { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) {
  .asymmetric { grid-template-columns: 1.05fr 0.95fr; gap: 72px; }
  .asymmetric.flip { grid-template-columns: 0.95fr 1.05fr; }
  .asymmetric.flip > :first-child { order: 2; }
}
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 0; border: 1px solid transparent;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn-gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-gold:hover { background: #0A1E4A; color: #fff; border-color: #0A1E4A; }
.btn-ghost, .btn-ink {
  background: transparent; color: var(--ink); border-color: rgba(28,24,18,0.22);
}
.btn-ghost:hover, .btn-ink:hover { border-color: var(--gold); color: var(--gold); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.skip {
  position: absolute; left: 12px; top: -40px; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 8px 12px;
}
.skip:focus { top: 12px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 242, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.header.scrolled { border-bottom-color: var(--line); background: rgba(255, 255, 255, 0.96); }
.header-inner {
  width: min(var(--wrap-wide), calc(100% - 40px));
  margin-inline: auto;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.mono {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--gold);
  font-family: var(--display);
  font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.06em; color: var(--gold);
}
.brand-name {
  display: flex; flex-direction: column;
  font-family: var(--display); font-size: 1.25rem; line-height: 1.1; font-weight: 500;
}
.brand-name span {
  font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); margin-top: 3px;
}
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--ink-2); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.04em; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--gold); }
.nav-cta { margin-left: 8px; }
.menu-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent;
  padding: 12px 10px; cursor: pointer;
}
.menu-toggle i { display: block; height: 1px; background: var(--ink); margin: 6px 0; transition: transform 0.3s; }

/* Hero — editorial split, daylight photo, light panel */
.hero {
  position: relative;
  background: var(--ivory);
  overflow: hidden;
}
.hero-split { display: grid; min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h)); }
@media (min-width: 980px) {
  .hero-split { grid-template-columns: minmax(420px, 0.92fr) 1.08fr; }
}
.hero-copy {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px 8vw 72px;
  background: var(--ivory);
}
@media (min-width: 980px) {
  .hero-copy { padding: 80px 64px 88px 0; width: min(620px, 100%); margin-left: auto; padding-right: 56px; }
}
.hero-photo {
  position: relative; min-height: 42vh;
  background: var(--stone);
}
.hero-photo img, .hero-bg {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
}
.hero-photo img { position: absolute; inset: 0; }
@media (max-width: 979px) {
  .hero-split { min-height: 0; }
  .hero-photo { min-height: 0; max-height: none; aspect-ratio: 16 / 10; }
  .hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .hero-copy { padding: 40px 24px 56px; }
}
.hero-veil { display: none; } /* no dark overlay in v3 */
.hero h1 { max-width: 13ch; margin-bottom: 16px; }
.hero-tag {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  color: var(--gold); margin: 0 0 18px;
}
.hero .lede { color: var(--ink-2); margin-bottom: 28px; max-width: 34em; }

/* Compact inner-page hero (no night photos, light band) */
body.inner .hero:not(.hero-split) {
  background: var(--ivory-2);
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--line);
}
body.inner .hero:not(.hero-split) .hero-bg,
body.inner .hero:not(.hero-split) .hero-veil { display: none; }
body.inner .hero:not(.hero-split) .hero-content { padding: 0; }
body.inner .hero:not(.hero-split) h1 { max-width: 18ch; font-size: clamp(2.4rem, 5vw, 4.2rem); }
body.inner .hero:not(.hero-split) .lede { color: var(--ink-2); }

/* Stats */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 800px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 32px 24px; border-right: 1px solid var(--line); }
.stat:nth-child(2n) { border-right: 0; }
@media (min-width: 800px) {
  .stat:nth-child(2n) { border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 500; color: var(--gold); line-height: 1; margin-bottom: 8px;
}
.stat span {
  font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
}

/* Cards */
.cards-2, .cards-3, .cards-4, .post-grid, .listing-grid, .area-grid { display: grid; gap: 22px; }
@media (min-width: 700px) {
  .cards-2, .post-grid { grid-template-columns: 1fr 1fr; }
  .cards-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .cards-4 { grid-template-columns: repeat(4, 1fr); }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .listing-grid, .area-grid { grid-template-columns: repeat(3, 1fr); }
}
.card, .area-card, .post-card, .listing-card, .quote, .step, .reason, .qa, .tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
.card, .reason, .step { padding: 28px 26px; }
.icon-num {
  font-size: var(--fs-xs); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}
.area-card, .post-card, .listing-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  overflow: hidden; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
a.area-card:hover, a.post-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow); color: inherit;
}
.area-card img, .post-card img, .listing-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.area-card .body, .post-card .body, .listing-card .body { padding: 20px 20px 22px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.78rem; color: var(--ink-3); margin-top: 10px; }
.badge, .badge-sample {
  display: inline-block; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sage); border: 1px solid var(--sage-soft); padding: 3px 8px; background: #F3F6FB;
}
.price { font-family: var(--display); font-size: 1.25rem; color: var(--gold); }
.quotes { display: grid; gap: 22px; }
@media (min-width: 800px) { .quotes { grid-template-columns: 1fr 1fr; } }
.quote { padding: 28px 26px; }
.quote p { font-family: var(--display); font-size: 1.35rem; line-height: 1.4; font-style: italic; }
.quote-photo { width: 100%; height: auto; } /* height belongs on the img, with object-fit */
.gallery { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.gallery img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; object-position: center top; background: #F3F6FB; }
.portrait-frame img { width: 100%; }

/* Forms & tools */
.form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.form input, .form select, .form textarea {
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  min-height: 46px; padding: 10px 12px; font-size: 1rem;
}
.form textarea { min-height: 96px; resize: vertical; }
.two-col { display: grid; gap: 14px; }
@media (min-width: 640px) { .two-col { grid-template-columns: 1fr 1fr; } }
.tool-tabs, .tool-tablist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tool-tab {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  min-height: 42px; padding: 0 14px; font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 600; cursor: pointer;
}
.tool-tab[aria-selected="true"] { background: var(--gold); color: #fff; border-color: var(--gold); }
.tool-card { padding: 28px 26px; }
.tool-result, .results, .metric-row {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.eligible { background: var(--sage-soft); color: #0B1B3A; padding: 14px 16px; }
.not-eligible { background: #F6E8E4; color: #5A2E24; padding: 14px 16px; }
#rate-status.err { color: var(--danger); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }

/* Journal / article */
.article { max-width: 720px; }
.article h2 { margin-top: 1.4em; }
.page-hero-image { width: 100%; max-height: 420px; object-fit: cover; }

/* Footer — light stone, dark type only */
.footer {
  background: var(--ivory-2);
  border-top: 1px solid var(--gold-line);
  padding: 64px 0 32px;
  color: var(--ink-2);
}
.footer-top { display: grid; gap: 36px; margin-bottom: 40px; }
@media (min-width: 800px) { .footer-top { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer h4 { color: var(--ink); margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 22px; display: flex; flex-wrap: wrap; gap: 12px 24px;
  justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--ink-3);
}
.social { display: flex; gap: 10px; }
.social a {
  width: 36px; height: 36px; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 0.62rem; letter-spacing: 0.08em; color: var(--ink-2);
}
.mbar {
  display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 8px; gap: 8px;
}
@media (max-width: 800px) {
  .mbar { display: flex; }
  body { padding-bottom: 88px; }
  .mbar .btn { flex: 1; min-height: 44px; }
}

/* Lead popup */
.lead-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 27, 58, 0.28);
  z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px;
}
.lead-backdrop.open { display: flex; }
.lead {
  width: min(540px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 36px 30px 28px;
  max-height: calc(100vh - 40px); overflow: auto; position: relative;
  color: var(--ink);
}
.lead h2 { color: var(--ink); }
.lead-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 1.2rem; cursor: pointer;
}

/* ===================== Interactive map ===================== */
.imap {
  --imap-panel-w: 400px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.imap-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--ivory);
}
.imap-search { position: relative; flex: 1 1 240px; min-width: 200px; }
.imap-search input, .imap-q, .map-q {
  width: 100%; min-height: 44px; border: 1px solid var(--line-strong);
  background: #fff; padding: 0 12px; font-size: 0.95rem; color: var(--ink);
}
.imap-suggest, .map-suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  max-height: 240px; overflow: auto; display: none;
}
.imap-suggest.open, .map-suggest.open { display: block; }
.imap-suggest button, .map-suggest button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 12px; cursor: pointer; font-size: 0.92rem; color: var(--ink);
}
.imap-suggest button:hover, .imap-suggest button[aria-selected="true"],
.map-suggest button:hover { background: var(--gold-pale); }
.imap-choro { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.imap-choro > span, .imap-check {
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.imap-choro button, .imap-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  min-height: 36px; padding: 0 11px; font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 600; cursor: pointer;
}
.imap-choro button.is-on, .imap-btn.is-on { background: var(--gold); color: #fff; border-color: var(--gold); }
.imap-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.imap-check input { accent-color: var(--gold); }
.imap-count {
  margin-left: auto; font-size: 0.78rem; font-weight: 600; color: var(--sage);
  letter-spacing: 0.04em;
}
.imap-filters {
  display: none; grid-template-columns: 1fr; gap: 16px;
  padding: 16px 16px 18px; border-bottom: 1px solid var(--line);
  background: var(--ivory-2);
}
.imap-filters.open { display: grid; }
@media (min-width: 800px) {
  .imap-filters.open { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
}
.imap-filters label { display: block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.imap-filters input[type="range"] { width: 100%; accent-color: var(--gold); }
.imap-filters select {
  width: 100%; min-height: 40px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
}
.imap-filter-val { font-family: var(--display); font-size: 1.05rem; color: var(--ink); margin: 0 0 4px; }
.imap-filter-note { font-size: 0.75rem; color: var(--ink-3); margin: 6px 0 0; }
.imap-stage { position: relative; min-height: 560px; }
.imap-canvas, .map-canvas {
  position: absolute; inset: 0; background: #E8EDF6; min-height: 560px;
}
.imap-canvas { z-index: 1; }
.imap-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 5;
  background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); padding: 10px 12px; min-width: 160px;
  font-size: 0.75rem; color: var(--ink-2);
}
.imap-legend strong { display: block; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.imap-swatch { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.imap-swatch i { width: 18px; height: 10px; display: inline-block; border: 1px solid var(--line); }
.imap-tooltip {
  position: absolute; z-index: 8; pointer-events: none;
  background: var(--paper); border: 1px solid var(--gold-line);
  box-shadow: var(--shadow); padding: 10px 12px; min-width: 180px;
  transform: translate(14px, 14px);
}
.imap-tooltip h4 { font-family: var(--display); font-size: 1.15rem; text-transform: none; letter-spacing: -0.02em; margin: 0 0 4px; }
.imap-tooltip p { margin: 0; font-size: 0.8rem; color: var(--ink-2); }

/* Side panel / mobile bottom sheet */
.imap-panel {
  position: absolute; top: 16px; right: 16px; bottom: 16px;
  width: min(var(--imap-panel-w), calc(100% - 32px));
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
  z-index: 6; display: none; flex-direction: column; overflow: hidden;
}
.imap-panel.open { display: flex; }
.imap-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 18px 0;
}
.imap-panel-body { padding: 8px 18px 20px; overflow: auto; }
.imap-close {
  width: 36px; height: 36px; border: 1px solid var(--line); background: transparent;
  cursor: pointer; font-size: 1.1rem; color: var(--ink); flex: none;
}
.imap-kicker { font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin: 0 0 6px; }
.imap-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.imap-stat { background: var(--ivory); border: 1px solid var(--line); padding: 10px 12px; }
.imap-stat b { display: block; font-family: var(--display); font-size: 1.2rem; font-weight: 500; color: var(--ink); line-height: 1.2; }
.imap-stat span { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.imap-source { font-size: 0.72rem; color: var(--ink-3); margin: 2px 0 0; line-height: 1.4; }
.imap-chart { margin: 16px 0; }
.imap-chart h4 { margin-bottom: 10px; }
.imap-bar { display: grid; grid-template-columns: 88px 1fr 52px; gap: 8px; align-items: center; margin: 6px 0; font-size: 0.75rem; }
.imap-bar .track { height: 8px; background: var(--stone); position: relative; overflow: hidden; }
.imap-bar .fill { height: 100%; background: var(--gold); }
.imap-bar .fill.avg { background: var(--sage); }
.imap-distances { display: grid; gap: 6px; margin: 12px 0; font-size: 0.82rem; color: var(--ink-2); }
.imap-distances b { font-weight: 600; color: var(--ink); }
.imap-actions { display: grid; gap: 8px; margin-top: 16px; }
.imap-actions .btn { width: 100%; }

@media (max-width: 979px) {
  .imap-stage { min-height: 420px; height: min(68vh, 560px); }
  .imap-canvas, .map-canvas { min-height: 0; height: 100%; }
  .imap-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 72vh; border-radius: 18px 18px 0 0;
    transform: translateY(110%);
    display: flex;
    transition: transform 0.4s var(--ease);
  }
  .imap-panel.open { transform: translateY(0); }
  .imap-panel::before {
    content: ""; display: block; width: 42px; height: 4px; border-radius: 4px;
    background: var(--sand); margin: 10px auto 0;
  }
  .imap-legend { left: 10px; bottom: auto; top: 10px; }
}

/* Compare tray */
.imap-compare {
  display: none; border-top: 1px solid var(--line);
  background: var(--ivory); padding: 16px 18px 20px;
}
.imap-compare.open { display: block; }
.imap-compare h3 { font-size: 1.5rem; margin-bottom: 8px; }
.imap-compare-table { overflow: auto; }
.imap-compare table { min-width: 520px; }
.imap-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.imap-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold-pale); border: 1px solid var(--gold-line);
  padding: 4px 10px; font-size: 0.8rem;
}
.imap-chip button { border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }

/* Pulsing markers */
.imap-pulse {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(15, 44, 102, 0.45);
  animation: imapPulse 2.2s ease-out infinite;
}
.imap-pulse.is-off { animation: none; opacity: 0.35; box-shadow: none; }
@keyframes imapPulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 44, 102, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(154, 120, 64, 0); }
  100% { box-shadow: 0 0 0 0 rgba(154, 120, 64, 0); }
}
.imap-pin {
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--teal); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(28,24,18,0.2);
  display: grid; place-items: center;
}
.imap-pin span {
  transform: rotate(45deg);
  font-size: 0.55rem; font-weight: 700; color: #fff; letter-spacing: 0;
}
.imap-metro {
  width: 20px; height: 20px; border-radius: 3px; background: var(--sage);
  border: 2px solid #fff; color: #fff; font-size: 0.55rem; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(28,24,18,0.18);
}

/* Leaflet tweaks for a light, clean canvas */
.imap .leaflet-container { background: #E8EDF6; font-family: var(--sans); }
.imap .leaflet-control-attribution { font-size: 9px; background: rgba(255, 255, 255, 0.92); }
.imap .leaflet-tooltip { display: none !important; } /* custom tooltip used */

/* Misc leftovers from v2 markup */
.coming { color: var(--ink-3); font-style: italic; }
.map-shell { /* old wrapper: ignored if .imap is used */ }
.header.open .nav {
  /* mobile */
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 12px 20px 20px; gap: 0;
  }
  .header.open .nav { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-cta { margin: 12px 0 0; }
  .wrap, .wrap-wide { width: min(var(--wrap-wide), calc(100% - 32px)); }
}

/* Page-specific helpers */
.photo-band { width: 100%; height: min(52vh, 520px); object-fit: cover; display: block; }
.disclaimer { font-size: 0.82rem; color: var(--ink-3); max-width: 70em; }
#y-area-note { background: var(--gold-pale); border: 1px solid var(--gold-line); padding: 10px 12px; margin-bottom: 14px; font-size: 0.85rem; }

.leaflet-div-icon.imap-divicon, .imap-divicon {
  background: transparent !important;
  border: 0 !important;
}

/* Completing light styles for remaining v2 components */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 800px) { .gallery { grid-template-columns: repeat(5, 1fr); } }
.gallery img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; object-position: center top; background: #F3F6FB; }

.marquee {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 28px 0; background: var(--paper);
}
.marquee-track { display: flex; align-items: center; gap: 64px; width: max-content; animation: slide 42s linear infinite; }
.marquee img { height: 26px; width: auto; max-width: 130px; object-fit: contain; filter: grayscale(1); opacity: 0.7; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .imap-pulse { animation: none; }
}

.faq-list { display: grid; gap: 8px; }
.qa summary {
  list-style: none; cursor: pointer; padding: 18px 20px;
  font-family: var(--display); font-size: 1.15rem; font-weight: 500;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; float: right; color: var(--gold); }
.qa[open] summary::after { content: "–"; }
.qa .answer, .answer { padding: 0 20px 20px; color: var(--ink-2); }

.rate-bar {
  background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.rate-bar-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; }
.rates { display: flex; flex-wrap: wrap; gap: 28px; }
.rate b { font-family: var(--display); font-size: 1.6rem; font-weight: 500; color: var(--gold); display: block; line-height: 1; }
.rate span { font-size: var(--fs-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.rate-status { font-size: var(--fs-xs); color: var(--ink-3); max-width: 36em; }
.rate-status.err { color: var(--danger); }

.tool-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tool-panel { display: block; margin-bottom: 64px; }
.tool-layout { display: grid; gap: 22px; }
@media (min-width: 900px) { .tool-layout { grid-template-columns: 1fr 1fr; align-items: start; } }
.results { background: var(--ivory-2); border: 1px solid var(--line); padding: 28px 26px; }
.result-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem;
}
.result-row b { font-family: var(--display); font-size: 1.15rem; font-weight: 500; color: var(--gold); }
.schedule { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 12px; }
.schedule th, .schedule td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.schedule th { font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }

/* Inner page heroes — light typographic banners, no dark wash */
.page-hero {
  padding: 56px 0 48px;
  background: var(--ivory-2);
  border-bottom: 1px solid var(--line);
}
.page-hero.photo {
  background: var(--ivory-2);
}
.page-hero h1 { max-width: 16ch; }
.contact-grid, .about-grid { display: grid; gap: 36px; }
@media (min-width: 860px) {
  .contact-grid { grid-template-columns: 0.85fr 1.15fr; }
  .about-grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
}
.about-grid img, .portrait-frame img, .photo { width: 100%; height: auto; }
.contact-details { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.contact-details li { border-top: 1px solid var(--line); padding-top: 14px; }
.contact-details span { display: block; font-size: var(--fs-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.q-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.q-list li { padding: 16px 0; border-bottom: 1px solid var(--line); font-family: var(--display); font-size: 1.25rem; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.kpis div { border: 1px solid var(--line); padding: 12px 14px; background: var(--paper); }
.kpis b { display: block; font-family: var(--display); font-size: 1.15rem; color: var(--gold); }
.kpis span { font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.area-detail { display: grid; gap: 32px; padding: 56px 0; border-top: 1px solid var(--line); }
@media (min-width: 860px) { .area-detail { grid-template-columns: 1.1fr 0.9fr; align-items: center; } }
.area-detail img { width: 100%; height: 380px; object-fit: cover; }
.steps { display: grid; gap: 16px; }
@media (min-width: 800px) { .steps { grid-template-columns: 1fr 1fr; } }
.crumb { font-size: var(--fs-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--gold); }
.article-hero { width: min(var(--wrap-wide), calc(100% - 48px)); margin: 0 auto; }
.article-hero img { width: 100%; height: min(480px, 56vw); object-fit: cover; }
.article-wrap { width: min(740px, calc(100% - 48px)); margin-inline: auto; }
.prose h2 { margin: 1.7em 0 0.5em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ol.toc { margin: 0 0 1.4em; }

/* CTA — light, with a clear portrait, no dark veil */
.cta-band {
  position: relative; overflow: hidden;
  padding: 88px 0;
  background: var(--ivory-2);
  border-top: 1px solid var(--gold-line);
}
.cta-photo {
  position: absolute; right: 0; top: 0; width: 38%; height: 100%;
  object-fit: cover; object-position: 50% 20%;
  opacity: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28%);
  mask-image: linear-gradient(90deg, transparent, #000 28%);
  pointer-events: none;
}
@media (max-width: 800px) { .cta-photo { display: none; } }

.badge-rent, .badge-sale { display: inline-block; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line); }
.badge-rent { color: var(--sage); background: #F3F6FB; }
.badge-sale { color: var(--gold); background: var(--gold-pale); }
.dim { color: var(--ink-3); }

#panel-yield, .tool-panel, .page-hero { scroll-margin-top: calc(var(--header-h) + 12px); }



/* ========== Layout repair: containment, no overlaps ========== */
.section, .section-ivory, .section-stone, .section-charcoal, .section-cream, .section-sm,
.stats, .rate-bar, .logo-strip, .marquee, .cta-band, .footer, .hero, .page-hero {
  position: relative;
  isolation: isolate;
}
.section, .section-sm { background: var(--ivory); }
.section-ivory, .section-cream { background: var(--ivory-2); }
.section-charcoal, .section-stone { background: var(--stone); }

.quotes {
  display: grid !important;
  gap: 24px;
  align-items: stretch;
}
@media (min-width: 800px) {
  .quotes { grid-template-columns: 1fr 1fr; }
}
.quote,
.quote.quote-photo {
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.quote img,
.quote-photo img,
.quote.quote-photo img {
  width: 100%;
  height: auto !important;
  max-height: none;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: 50% 28%;
  display: block;
}
.quote .body { padding: 22px 24px 26px; flex: 1; }
.quote blockquote,
.quote p {
  font-family: var(--display);
  font-size: 1.12rem;
  line-height: 1.45;
  font-style: italic;
  margin: 0;
  color: var(--ink);
}
.quote cite {
  display: block;
  margin-top: 16px;
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.quote cite span {
  display: block;
  margin-top: 3px;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--ink-3);
}

.gallery {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .gallery { grid-template-columns: repeat(5, 1fr); }
}
.gallery img {
  width: 100%;
  height: auto !important;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center;
  display: block;
}

.logo-strip, .marquee {
  overflow: hidden;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 24px;
  z-index: 2;
}
.logo-strip-inner, .marquee-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px 48px;
  width: min(var(--wrap-wide), 100%);
  max-width: 100%;
  margin-inline: auto;
  animation: none !important;
  transform: none !important;
}
.logo-strip img, .marquee img {
  height: 28px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.78;
  flex: 0 0 auto;
}

/* Fade-up that cannot leave a leftover translate in the layout */
.reveal {
  opacity: 0;
  transform: none;
}
.reveal.in {
  opacity: 1;
  transform: none;
  animation: prFadeUp 0.7s var(--ease);
}
@keyframes prFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; animation: none; }
}

.area-card img, .post-card img, .listing-card img,
.article-hero img, .about-grid img, .area-detail img, .photo-band {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
.area-card img, .post-card img, .listing-card img {
  aspect-ratio: 16 / 10;
  height: auto !important;
}
.about-grid img {
  aspect-ratio: 1000 / 1150;
  object-fit: contain;
  object-position: center top;
  background: #F3F6FB;
}
.area-detail img {
  aspect-ratio: 16 / 10;
}

.hero-photo { overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Why-Dubai: even grid instead of a 3+2 ragged last row when possible */
.cards-5 { display: grid; gap: 22px; }
@media (min-width: 700px) { .cards-5 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .cards-5 { grid-template-columns: repeat(5, 1fr); } }

@media (max-width: 800px) {
  .imap-panel {
    bottom: 80px; /* sit above the fixed Call / 15-min bar */
    max-height: calc(100vh - 80px - 70px);
  }
}

/* CTA copy must not run into the portrait */
@media (min-width: 801px) {
  .cta-band .wrap,
  .cta-band .wrap-wide {
    position: relative;
    z-index: 1;
    width: min(36rem, calc(58% - 40px));
    margin-left: max(24px, calc((100% - var(--wrap)) / 2));
    margin-right: auto;
    padding-right: 16px;
  }
}
.cta-photo { z-index: 0; }

/* Map tiles stay inside the map stage */
.imap, .imap-stage, .imap-canvas, .leaflet-container { overflow: hidden; }

/* Headings wrap on small screens; anchors clear the sticky header */
h1, h2, h3 { overflow-wrap: break-word; word-wrap: break-word; }
section, .page-hero, .tool-panel, .logo-strip, #clients, #blog, #faq, #map {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* WordPress alignments */
.alignwide { width: min(var(--wrap-wide), calc(100% - 40px)); margin-inline: auto; }
.alignfull { width: 100%; }
.wp-block-image img { height: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.admin-bar .header { top: var(--wp-admin--admin-bar--height, 32px); }
.post-content { max-width: 740px; }
.post-content img { height: auto; }

/* WordPress menu markup */
.nav ul { list-style: none; display: flex; align-items: center; gap: 26px; margin: 0; padding: 0; }
.nav li { margin: 0; }
.nav .sub-menu { display: none; }
.nav .current-menu-item > a, .nav .current_page_item > a { color: var(--ink); box-shadow: inset 0 -1px 0 var(--gold); }
@media (max-width: 900px) {
  .header.open .nav ul { flex-direction: column; align-items: stretch; width: 100%; gap: 0; }
}
