/*
 * DXB Residence UI (2026 redesign).
 * Loaded after main.css: re-maps the legacy tokens to the new palette and
 * defines the shared components every template uses (ui-*). Templates that
 * still use legacy classes inherit the new colours and type through the
 * token mapping below.
 */
:root {
  --ui-ink: #141B2D;
  --ui-body: #3A4358;
  --ui-muted: #5A6478;
  --ui-faint: #636D82;
  --ui-line: #E2E8F3;
  --ui-line-soft: #EDF1F8;
  --ui-ground: #F2F5FB;
  --ui-panel: #FFFFFF;
  --ui-tint: #E8EEFF;
  --ui-accent: #3B5BF5;
  --ui-accent-hover: #2C49DE;
  --ui-accent-deep: #2340C8;
  --ui-night: #1A2238;
  --ui-radius: 22px;
  --ui-radius-sm: 14px;
  --ui-shadow: 0 6px 22px rgba(36, 56, 120, .06);
  --ui-shadow-hover: 0 18px 44px rgba(36, 56, 120, .14);
  --ui-font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui-max: 1440px;
  --ui-pad: 40px;

  /* Legacy tokens → new palette */
  --ink: var(--ui-ink);
  --body: var(--ui-body);
  --muted: var(--ui-muted);
  --line: var(--ui-line);
  --surface: var(--ui-ground);
  --surface-blue: var(--ui-tint);
  --paper: var(--ui-panel);
  --green: var(--ui-accent);
  --green-soft: var(--ui-tint);
  --lime: var(--ui-accent);
  --lime-hover: var(--ui-accent-hover);
  --brand-yellow: var(--ui-accent);
  --brand-yellow-hover: var(--ui-accent-hover);
  --orange: var(--ui-accent);
  --display: var(--ui-font);
  --ui: var(--ui-font);
  --shadow: var(--ui-shadow-hover);
  --shadow-card: var(--ui-shadow);
  --shell: min(1360px, calc(100vw - 2 * var(--ui-pad)));
}

body { margin: 0; background: var(--ui-ground); color: var(--ui-ink); font-family: var(--ui-font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--ui-font); letter-spacing: -0.03em; }
a { color: var(--ui-ink); }
a:hover { color: var(--ui-accent); }
:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
button, input, select, textarea { font: inherit; }

/* Legacy buttons adopt the pill style */
.button, .button--primary, .project-lead-action { border-radius: 999px; font-family: var(--ui-font); font-weight: 700; }
.button--primary, .project-lead-action { background: var(--ui-accent); color: #fff; border-color: var(--ui-accent); }
.button--primary:hover, .project-lead-action:hover { background: var(--ui-accent-hover); color: #fff; }
.eyebrow { color: var(--ui-accent); font-family: var(--ui-font); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Layout primitives ---------- */
.ui-container { width: 100%; max-width: var(--ui-max); margin: 0 auto; padding: 0 var(--ui-pad); box-sizing: border-box; }
.ui-section { padding-top: 88px; }
.ui-section--tight { padding-top: 56px; }
.ui-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.ui-section__titles { display: flex; flex-direction: column; gap: 10px; }
.ui-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-accent); }
.ui-h1 { margin: 0; font-size: clamp(40px, 5.4vw, 72px); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
.ui-h2 { margin: 0; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.ui-h3 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.ui-lead { margin: 0; font-size: 19px; line-height: 1.5; color: var(--ui-muted); max-width: 680px; }
.ui-text { font-size: 16px; line-height: 1.65; color: var(--ui-body); }
.ui-muted { color: var(--ui-muted); }
.ui-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.ui-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }

/* ---------- Buttons & chips ---------- */
.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s, color .15s; white-space: nowrap; }
.ui-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.ui-btn--primary { background: var(--ui-accent); color: #fff; }
.ui-btn--primary:hover { background: var(--ui-accent-hover); color: #fff; }
.ui-btn--light { background: var(--ui-panel); border-color: var(--ui-line); color: var(--ui-ink); }
.ui-btn--light:hover { background: #E6ECF8; color: var(--ui-ink); }
.ui-btn--ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.ui-btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ui-btn--white { background: #fff; color: var(--ui-ink); }
.ui-btn--white:hover { background: var(--ui-accent); color: #fff; }
.ui-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--ui-ground); font-size: 13px; font-weight: 600; color: var(--ui-ink); }
.ui-chip--accent { background: var(--ui-accent); color: #fff; }
.ui-chip--outline { background: transparent; border: 1px solid var(--ui-line); }
.ui-pill-link { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--ui-line); background: var(--ui-panel); font-size: 13px; font-weight: 600; color: var(--ui-ink); text-decoration: none; }
.ui-pill-link:hover { border-color: var(--ui-accent); color: var(--ui-accent); }

/* ---------- Cards ---------- */
.ui-card { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); transition: box-shadow .2s; }
.ui-card:hover { box-shadow: var(--ui-shadow-hover); }
.ui-card--pad { padding: 28px; }
.ui-card--accent { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.ui-card--accent .ui-muted { color: rgba(255, 255, 255, .72); }
.ui-icon-tile { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: var(--ui-radius-sm); background: var(--ui-ground); color: var(--ui-accent); }
.ui-card--accent .ui-icon-tile { background: rgba(255, 255, 255, .12); color: #fff; }
.ui-stat { display: flex; flex-direction: column; gap: 4px; }
.ui-stat strong { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.ui-stat span { font-size: 14px; color: var(--ui-muted); }

/* ---------- Project card (legacy markup, new look) ---------- */
.project-grid { gap: 16px; }
.project-card { overflow: hidden; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); transition: box-shadow .2s; }
.project-card:hover { box-shadow: var(--ui-shadow-hover); transform: none; }
.project-card__media-wrap { position: relative; }
.project-card__media { display: block; aspect-ratio: 4 / 3; background: var(--ui-line); border-radius: 0; }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-card__badge { position: absolute; left: 12px; top: 12px; padding: 6px 10px; border-radius: 999px; background: var(--ui-accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.save-button--card { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .92); color: var(--ui-ink); }
.project-card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; }
.project-card__body h2 { order: -2; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.project-card__body h2 a { color: var(--ui-ink); text-decoration: none; }
.project-card__location { order: -1; font-size: 14px; color: var(--ui-muted); }
.project-card__location svg { display: none; }
.project-card__developer { order: -1; margin-top: -6px; font-size: 14px; color: var(--ui-muted); text-decoration: none; }
.project-card__developer-logo { display: none; }
.project-card__facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.project-card__facts > div { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--ui-ground); }
.project-card__facts dt { display: none; }
.project-card__facts dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--ui-ink); }
.project-card__facts .project-card__price { flex: 1 0 100%; padding: 0 0 12px; margin-bottom: 4px; background: none; border-radius: 0; border-bottom: 1px solid var(--ui-line-soft); align-items: baseline; gap: 6px; }
.project-card__facts .project-card__price dt { display: inline; font-size: 13px; font-weight: 500; color: var(--ui-muted); }
.project-card__facts .project-card__price dd { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.project-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.project-card__plan { font-size: 13px; font-weight: 600; color: var(--ui-muted); }
.compare-button { border-radius: 999px; border: 1px solid var(--ui-line); background: var(--ui-panel); color: var(--ui-ink); font-size: 13px; font-weight: 700; padding: 6px 12px; }
.compare-button[aria-pressed="true"] { background: var(--ui-tint); border-color: var(--ui-accent); color: var(--ui-accent); }

/* ---------- Breadcrumbs, FAQ, forms ---------- */
.breadcrumbs { font-size: 13px; color: var(--ui-muted); }
.breadcrumbs a { color: var(--ui-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ui-accent); }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-list details { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 18px; padding: 0; }
.faq-list summary { cursor: pointer; list-style: none; padding: 20px 56px 20px 24px; font-size: 17px; font-weight: 700; position: relative; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 999px; background: var(--ui-ground); display: grid; place-items: center; font-size: 18px; color: var(--ui-accent); }
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { margin: 0; padding: 0 24px 22px; color: var(--ui-body); font-size: 15px; line-height: 1.65; }
.ui-field { display: flex; flex-direction: column; gap: 4px; padding: 12px 18px; border-radius: var(--ui-radius-sm); background: var(--ui-ground); min-width: 0; }
.ui-field > span { font-size: 12px; font-weight: 600; color: var(--ui-muted); }
.ui-field input, .ui-field select { border: 0; background: transparent; outline: 0; font-size: 16px; font-weight: 600; padding: 0; color: var(--ui-ink); appearance: none; min-width: 0; }
.ui-field:focus-within { box-shadow: 0 0 0 2px var(--ui-accent); }

/* ---------- Header ---------- */
.top-note { display: none; }
.ui-header { position: relative; z-index: 20; background: var(--ui-panel); border-bottom: 1px solid var(--ui-line); }
.ui-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.ui-header .brand__logo { display: block; height: 42px; width: auto; }
.ui-header .brand__logo--light { display: none; }
.ui-nav { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px; background: var(--ui-ground); border: 1px solid var(--ui-line); }
.ui-nav a { padding: 10px 16px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--ui-ink); text-decoration: none; }
.ui-nav a:hover, .ui-nav a[aria-current="page"] { background: var(--ui-panel); color: var(--ui-accent); }
.ui-header__side { display: flex; align-items: center; gap: 10px; }
.ui-lang { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; border: 1px solid var(--ui-line); }
.ui-lang a { padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ui-muted); text-decoration: none; }
.ui-lang a[aria-current="page"] { background: var(--ui-ink); color: #fff; }
.ui-icon-btn { position: relative; display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--ui-line); background: transparent; color: var(--ui-ink); }
.ui-icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ui-icon-btn .header-favorite__count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--ui-accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.ui-header__phone { font-size: 15px; font-weight: 700; color: var(--ui-ink); text-decoration: none; white-space: nowrap; }
.ui-menu-btn { display: none; }
/* Transparent header over a full-bleed hero */
.has-hero-header .ui-header { position: absolute; left: 0; right: 0; top: 0; background: transparent; border-bottom: 0; }
.has-hero-header .ui-header .brand__logo { display: none; }
.has-hero-header .ui-header .brand__logo--light { display: block; }
.has-hero-header .ui-nav { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); }
.has-hero-header .ui-nav a, .has-hero-header .ui-header__phone { color: #fff; }
.has-hero-header .ui-nav a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.has-hero-header .ui-lang { border-color: rgba(255, 255, 255, .3); }
.has-hero-header .ui-lang a { color: rgba(255, 255, 255, .78); }
.has-hero-header .ui-lang a[aria-current="page"] { background: #fff; color: var(--ui-ink); }
.has-hero-header .ui-icon-btn { border-color: rgba(255, 255, 255, .3); color: #fff; }
.has-hero-header .ui-header .ui-btn--primary { background: #fff; color: var(--ui-ink); }
.has-hero-header .ui-header .ui-btn--primary:hover { background: var(--ui-accent); color: #fff; }

/* ---------- Footer ---------- */
.ui-cta { margin-top: 96px; }
.ui-cta__box { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 56px; border-radius: 32px; background: var(--ui-accent); color: #fff; }
.ui-cta__box h2 { margin: 0; color: #fff; font-size: clamp(30px, 3vw, 42px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
.ui-cta__box p { margin: 0 0 20px; color: rgba(255, 255, 255, .82); font-size: 17px; line-height: 1.55; }
.ui-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ui-footer { margin-top: 96px; background: var(--ui-night); color: rgba(255, 255, 255, .72); }
.ui-cta + .ui-footer { margin-top: 64px; }
.ui-footer__main { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 32px; padding-top: 64px; padding-bottom: 40px; }
.ui-footer__brand p { margin: 16px 0 20px; font-size: 14px; line-height: 1.6; max-width: 320px; }
.ui-footer__brand .brand__logo { height: 42px; width: auto; }
.ui-footer nav { display: flex; flex-direction: column; gap: 10px; }
.ui-footer nav strong { margin-bottom: 4px; color: #fff; font-size: 14px; font-weight: 800; }
.ui-footer a { color: rgba(255, 255, 255, .72); font-size: 14px; text-decoration: none; }
.ui-footer a:hover { color: #fff; }
.ui-footer .ui-lang { border-color: rgba(255, 255, 255, .2); }
.ui-footer .ui-lang a[aria-current="page"] { background: #fff; color: var(--ui-ink); }
.ui-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: 28px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }

@media (max-width: 1100px) {
  .ui-header__phone { display: none; }
  .ui-footer__main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  :root { --ui-pad: 20px; }
  .ui-nav, .ui-header__side .ui-lang, .ui-header__side .ui-btn { display: none; }
  .ui-menu-btn { display: inline-flex; }
  .ui-nav.is-open { display: flex; position: absolute; left: var(--ui-pad); right: var(--ui-pad); top: 72px; flex-direction: column; align-items: stretch; padding: 10px; border-radius: 22px; background: var(--ui-panel); box-shadow: var(--ui-shadow-hover); }
  .ui-nav.is-open a { color: var(--ui-ink); }
  .ui-section { padding-top: 64px; }
  .ui-cta__box { grid-template-columns: 1fr; padding: 36px 24px; }
}
@media (max-width: 560px) {
  .ui-footer__main { grid-template-columns: 1fr; }
}
.project-card__badge--ready { background: #0F7B4F; }
/* OSM tiles toned towards the familiar Google Maps palette: softer greens, lighter ground. */
.atlas-map-tiles { filter: saturate(.62) brightness(1.06) contrast(.94) hue-rotate(-6deg); }

/* ---------- Header fixes: neutralise legacy .site-nav / .nav-toggle rules ---------- */
.ui-nav a::after { display: none !important; content: none; }
.ui-nav a { position: static; min-height: 0; }
.ui-nav__mobile { display: none; }
.ui-menu-btn { grid-column: auto; grid-row: auto; padding: 0; min-width: 44px; min-height: 44px; place-items: center; }
.ui-menu-btn__close { display: none; }
.ui-menu-btn[aria-expanded="true"] .ui-menu-btn__open { display: none; }
.ui-menu-btn[aria-expanded="true"] .ui-menu-btn__close { display: block; }
.ui-header .header-favorite:hover, .ui-icon-btn:hover { background: var(--ui-ground); color: var(--ui-ink); border-color: var(--ui-line); }
.has-hero-header .ui-icon-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.ui-nav a:focus-visible { outline-offset: 0; }

@media (max-width: 960px) {
  .ui-header__inner { min-height: 68px; }
  .ui-menu-btn { display: inline-flex; }
  .ui-nav, .ui-nav.site-nav { position: fixed; inset: 68px 0 0 0; z-index: 40; display: none; flex-direction: column; align-items: stretch; justify-self: auto; gap: 4px; padding: 16px var(--ui-pad) 32px; margin: 0; border: 0; border-radius: 0; background: var(--ui-panel); box-shadow: none; overflow-y: auto; font-size: 17px; white-space: normal; }
  .ui-nav.is-open { display: flex; top: 68px; left: 0; right: 0; }
  .ui-nav a, .ui-nav.is-open a, .has-hero-header .ui-nav a { display: flex; align-items: center; min-height: 52px; padding: 0 16px; border: 0; border-radius: 14px; color: var(--ui-ink); font-size: 17px; font-weight: 700; }
  .ui-nav a:hover, .ui-nav a[aria-current="page"] { background: var(--ui-ground); color: var(--ui-accent); }
  .ui-nav__mobile { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 12px; padding: 20px 16px 0; border-top: 1px solid var(--ui-line); }
  .ui-nav__mobile .ui-lang { display: inline-flex; border-color: var(--ui-line); }
  .ui-nav__mobile .ui-lang a { min-height: 36px; padding: 0 14px; border-radius: 999px; color: var(--ui-muted); font-size: 14px; }
  .ui-nav__mobile .ui-lang a[aria-current="page"] { background: var(--ui-ink); color: #fff; }
  .ui-nav.is-open .ui-nav__mobile .ui-nav__phone, .ui-nav .ui-nav__mobile .ui-nav__phone { min-height: 0; padding: 0; font-size: 18px; }
  .ui-nav .ui-nav__mobile .ui-btn { width: 100%; min-height: 52px; justify-content: center; background: var(--ui-accent); color: #fff; }
  .ui-nav .ui-nav__mobile .ui-btn:hover { background: var(--ui-accent-hover); color: #fff; }
  body.nav-open { overflow: hidden; }
  /* Over the home hero the bar turns solid while the menu is open. */
  body.nav-open.has-hero-header .ui-header { background: var(--ui-panel); }
  body.nav-open.has-hero-header .ui-header .brand__logo { display: block; }
  body.nav-open.has-hero-header .ui-header .brand__logo--light { display: none; }
  body.nav-open.has-hero-header .ui-icon-btn { color: var(--ui-ink); border-color: var(--ui-line); }
}

/* ---------- Hover: only the shadow changes on cards (legacy lift/zoom/recolour removed) ---------- */
.project-card:hover { transform: none; box-shadow: var(--ui-shadow-hover); }
.project-card:hover .project-card__media img, .project-card:hover .project-card__placeholder { transform: none; }
.project-card h2 a:hover { color: var(--ui-ink); }
.project-card__developer:hover { color: var(--ui-ink); }
.breadcrumbs a:hover { color: var(--ui-accent); }
/* Card-like links keep their own colours; the global a:hover tint is for text links only. */
a.ui-card:hover { color: var(--ui-ink); }
a.ui-card--accent:hover { color: #fff; }
a.ui-btn--light:hover { color: var(--ui-ink); }

/* ---------- Price notice ---------- */
.ui-price-notice { display: flex; align-items: center; gap: 18px; margin: 24px 0; padding: 18px 22px; border: 1px solid var(--ui-line); border-radius: 18px; background: var(--ui-tint); }
.ui-price-notice__icon { flex: 0 0 auto; display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--ui-panel); color: var(--ui-accent); }
.ui-price-notice__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ui-price-notice__body { flex: 1 1 auto; min-width: 0; }
.ui-price-notice__body strong { display: block; font-size: 15px; font-weight: 800; color: var(--ui-ink); }
.ui-price-notice__body p { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--ui-body); }
.ui-price-notice__cta { flex: 0 0 auto; }
@media (max-width: 760px) {
  .ui-price-notice { flex-direction: column; align-items: flex-start; }
  .ui-price-notice__cta { width: 100%; }
}
