/* =====================================================================
   Cedar Hills — stylesheet (Gallery White)
   White ground, photography first, one serif display + one sans.
   Only transform / opacity / clip-path move. Radius is 0 everywhere.
   Each villa carries its own tint through [data-theme]: a hint of it on
   its card, the full palette in the villa view.
   ===================================================================== */

:root {
  --ground: #ffffff;
  --surface: #f6f4ef;
  --ink: #141414;
  --ink-muted: #6b665e;
  --hairline: #e4e0d8;
  --accent: #8a6a2e;

  --font-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --font-sans: "Libre Franklin", "Franklin Gothic", "Helvetica Neue", Arial, sans-serif;

  --fs-h1: clamp(2.5rem, 1rem + 5.75vw, 6.25rem);
  --fs-h2: clamp(2rem, 1.2rem + 2.6vw, 3.5rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.45vw, 1.625rem);
  --fs-lead: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --fs-body: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  --fs-label: 0.8125rem;
  --fs-small: 0.9375rem;
  --fs-price: 1.0625rem;
  --fs-price-detail: clamp(1.5rem, 1.2rem + 0.9vw, 2rem);

  --lh-h1: 1.02; --lh-h2: 1.08; --lh-h3: 1.2; --lh-lead: 1.45; --lh-body: 1.55; --lh-label: 1.2;
  --ls-h1: -0.02em; --ls-h2: -0.01em; --ls-label: 0.08em; --ls-wordmark: 0.18em;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px; --s11: 160px;
  --gutter: clamp(20px, 2.8vw, 40px);
  --max: 1360px;
  --section: clamp(64px, 4vw + 40px, 128px);
  --header-h: 64px;
  --measure: 38rem;

  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-travel: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-move: cubic-bezier(0.25, 1, 0.5, 1);
  --d-press: 120ms; --d-color: 200ms; --d-line: 260ms; --d-panel: 450ms; --d-image: 700ms; --d-curtain: 900ms; --d-sheet: 650ms;
  --origin-start: left;
}
html[lang="ar"] {
  --font-display: "Amiri", "Noto Naskh Arabic", "Times New Roman", serif;
  --font-sans: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --fs-label: 0.875rem;
  --lh-h1: 1.3; --lh-h2: 1.35; --lh-h3: 1.45; --lh-lead: 1.8; --lh-body: 1.9; --lh-label: 1.5;
  --ls-h1: 0; --ls-h2: 0; --ls-label: 0; --ls-wordmark: 0;
  --origin-start: right;
}

/* ---------- villa themes ----------
   Ground / surface / hairline tint the villa view; accent colours the availability line,
   the focus ring and the headline. Cards only pick up the accent and the placeholder tint. */
[data-theme="castle"]           { --ground: #f4efe6; --surface: #e9e0cf; --hairline: #d8ccb6; --accent: #7d5f26; }
[data-theme="stand-alone"]      { --ground: #f4f6f7; --surface: #e5eaee; --hairline: #cfd7dd; --accent: #4a6478; }
[data-theme="twin-house"]       { --ground: #f7f1e8; --surface: #ecdfcd; --hairline: #d9c7ad; --accent: #8f532e; }
[data-theme="townhouse-corner"] { --ground: #eff0ea; --surface: #e1e3d7; --hairline: #cbcebe; --accent: #58643f; }
[data-theme="townhouse-middle"] { --ground: #f3ede4; --surface: #e6dccc; --hairline: #d2c4af; --accent: #8c6224; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); -webkit-text-size-adjust: 100%; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
@media (pointer: fine) { html { scrollbar-gutter: stable; } }
html.detail-open { overflow: hidden; }
body { margin: 0; min-height: 100vh; font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body); background: var(--ground); color: var(--ink); text-rendering: optimizeLegibility; overflow-x: clip; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 0; }
p, h1, h2, h3, h4, figure, ul, ol, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-weight: 400; }
ul, ol { padding: 0; list-style: none; }
svg { display: block; }
bdi { unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--surface); color: var(--ink); }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: var(--gutter); top: -100px; z-index: 200; background: var(--ink); color: #fff; padding: 12px 16px; font-size: var(--fs-label); }
.skip:focus { top: 8px; }

/* ---------- type ---------- */
.h1, .h2, .h3 { font-family: var(--font-display); font-weight: 400; }
.h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1); text-wrap: balance; }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); text-wrap: balance; }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); text-wrap: balance; }
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); text-wrap: pretty; }
.muted { color: var(--ink-muted); }
.small { font-size: var(--fs-small); }
.label { font-size: var(--fs-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); font-weight: 500; }
html[lang="en"] .label { text-transform: uppercase; }
.num, .price { font-variant-numeric: tabular-nums lining-nums; }
.price { font-weight: 500; font-size: var(--fs-price); }
.measure { max-width: var(--measure); text-wrap: pretty; }
.measure p + p { margin-top: 1em; }
.mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); } .mt-7 { margin-top: var(--s7); } .mt-8 { margin-top: var(--s8); }

.text-link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.28em; text-decoration-color: var(--hairline); transition: text-decoration-color var(--d-color) ease; padding-block: 6px; }
@media (hover: hover) and (pointer: fine) { .text-link:hover { text-decoration-color: currentColor; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 var(--s6); background: var(--ink); color: #fff; font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-label); line-height: 1.2; text-align: center; white-space: nowrap; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color var(--d-color) ease, color var(--d-color) ease, transform var(--d-press) var(--ease-enter); }
html[lang="en"] .btn { text-transform: uppercase; }
.btn:active { transform: scale(0.985); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: #2b2b2b; } .btn-outline:hover { background: var(--surface); } }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; transition: background-color var(--d-color) ease; }
.icon-btn svg { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--surface); } }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ground); border-bottom: 1px solid transparent; transition: border-color var(--d-color) ease; }
.site-header.scrolled { border-bottom-color: var(--hairline); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s6); }
.wordmark { font-family: var(--font-display); font-size: 1.375rem; line-height: 1; letter-spacing: var(--ls-wordmark); padding-block: 10px; white-space: nowrap; }
html[lang="ar"] .wordmark { font-size: 1.5rem; }
.site-nav { display: flex; gap: var(--s6); margin-inline-start: var(--s7); }
.site-nav a { position: relative; padding-block: 14px; }
.site-nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: 8px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: var(--origin-start); transition: transform var(--d-line) var(--ease-enter); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .site-nav a:hover::after { transform: scaleX(1); } }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s4); }
.lang-switch { font-size: 0.9375rem; line-height: 1; min-height: 44px; padding: 0 6px; }
html[lang="en"] .lang-switch { font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", sans-serif; }
html[lang="ar"] .lang-switch { font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif; letter-spacing: 0.02em; }
.wa-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; }
.wa-link svg { width: 20px; height: 20px; }
@media (max-width: 767px) {
  .header-inner { height: 56px; gap: var(--s4); }
  .site-nav { display: none; }
  .wa-link .wa-label { display: none; }
  .header-actions { gap: var(--s2); }
}

/* ---------- frames ---------- */
.frame { position: relative; overflow: hidden; background: var(--surface); display: block; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-21-9 { aspect-ratio: 21 / 9; } .frame-3-2 { aspect-ratio: 3 / 2; } .frame-4-3 { aspect-ratio: 4 / 3; } .frame-4-5 { aspect-ratio: 4 / 5; } .frame-16-9 { aspect-ratio: 16 / 9; }
.caption-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3) var(--s6); flex-wrap: wrap; padding-block: var(--s4); font-size: var(--fs-small); }
.caption-row .caption-right { display: flex; align-items: baseline; gap: var(--s5); margin-inline-start: auto; }
a.frame img { transition: transform var(--d-image) var(--ease-expo); }
@media (hover: hover) and (pointer: fine) { a.frame:hover img { transform: scale(1.03); } }

/* ---------- hero ---------- */
.hero-text { padding-block: var(--s7) var(--s7); }
.hero-title { max-width: 16ch; }
.hero-lead { max-width: var(--measure); margin-top: var(--s5); color: var(--ink-muted); }
/* 2:1 keeps the whole top of the render — the logo sits there — and only loses pavement at the bottom.
   width: 100% is load-bearing: with only aspect-ratio + max-height the browser shrinks the WIDTH to keep
   the ratio on short, wide screens, which leaves a bare strip beside the picture (on the left in Arabic).
   An explicit width makes the ratio drive the height alone, and max-height then crops from the bottom. */
.hero-frame { width: 100%; aspect-ratio: 2 / 1; max-height: 86vh; }
.hero-curtain { position: absolute; inset: 0; }
.hero-curtain img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { .hero-text { padding-block: var(--s6) var(--s6); } .hero-frame { aspect-ratio: 4 / 5; max-height: none; } }

/* ---------- featured villa ---------- */
.featured { padding-top: var(--section); }
.featured-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4) var(--s6); padding-bottom: var(--s4); border-bottom: 1px solid var(--hairline); }
.featured-head .label { color: var(--ink-muted); }
.featured-row { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s5) var(--s8); align-items: end; margin-top: var(--s7); }
.featured-row + .featured-row { margin-top: var(--s9); }
.featured-row.alt .featured-media { order: 2; }
.featured-row.alt .featured-text { order: 1; }
.featured-text { padding-bottom: var(--s2); }
.featured-text .loc { margin-top: var(--s3); }
.featured-text .headline { margin-top: var(--s5); font-family: var(--font-display); font-size: var(--fs-h3); line-height: var(--lh-h3); font-style: italic; color: var(--accent); max-width: 26ch; text-wrap: pretty; }
html[lang="ar"] .featured-text .headline { font-style: normal; }
.featured-text .price-line { margin-top: var(--s6); display: flex; gap: var(--s4); align-items: baseline; flex-wrap: wrap; }
.featured-text .price-line .price { font-size: var(--fs-price-detail); font-weight: 400; line-height: 1.2; }
.featured-text .facts { margin-top: var(--s3); }
.featured-actions { margin-top: var(--s6); display: flex; align-items: center; gap: var(--s6); flex-wrap: wrap; }
@media (max-width: 767px) {
  .featured-row { grid-template-columns: 1fr; margin-top: var(--s6); }
  .featured-row.alt .featured-media, .featured-row.alt .featured-text { order: 0; }
  .featured-actions .btn { width: 100%; min-height: 52px; }
}

/* ---------- communities ---------- */
.communities { padding-top: var(--section); }
.communities-head { display: grid; gap: var(--s3); }
.communities-head .lead { max-width: var(--measure); }
.community-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); margin-top: var(--s7); }
.community-cap { padding-top: var(--s4); }
.community-cap .meta { margin-top: var(--s2); color: var(--ink-muted); font-size: var(--fs-small); }
.community-cap .text-link { display: inline-block; margin-top: var(--s3); }
@media (max-width: 767px) { .community-grid { grid-template-columns: 1fr; gap: var(--s7); margin-top: var(--s6); } }

/* ---------- catalog (villas page) ---------- */
.catalog { padding-block: var(--s7) var(--section); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4) var(--s6); flex-wrap: wrap; }
.section-head .count { color: var(--ink-muted); font-size: var(--fs-price); }
.catalog-intro { margin-top: var(--s3); max-width: var(--measure); }
.filters { margin-top: var(--s6); border-block: 1px solid var(--hairline); display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, 1fr)) minmax(170px, 1.1fr); gap: 0 var(--s5); position: sticky; top: var(--header-h); z-index: 20; background: var(--ground); }
.field { position: relative; display: flex; align-items: center; gap: 8px; min-height: 56px; }
.field-label { color: var(--ink-muted); font-size: var(--fs-small); white-space: nowrap; }
.field-search svg { width: 16px; height: 16px; color: var(--ink-muted); flex: 0 0 auto; }
.control { font: inherit; font-size: 1rem; line-height: 1.4; color: var(--ink); background: transparent; border: 0; border-radius: 0; padding: 12px 0; width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; }
.control::placeholder { color: var(--ink-muted); opacity: 1; }
.control:focus { outline: none; }
.field-select .control, .f select.control { padding-inline-end: 20px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23141414' stroke-width='1.5'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; background-size: 12px 12px; cursor: pointer; }
html[dir="rtl"] .field-select .control, html[dir="rtl"] .f select.control { background-position: left center; }
.field.active::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 1px; background: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s8) var(--s7); margin-top: var(--s8); transition: opacity 150ms ease; }
.grid.fading { opacity: 0; }
.empty { margin-top: var(--s8); }
.empty .lead { color: var(--ink-muted); }
.empty .text-link { display: inline-block; margin-top: var(--s3); }

.card { display: block; color: inherit; -webkit-tap-highlight-color: transparent; }
.card-media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface); position: relative; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--d-image) var(--ease-expo); }
.card-body { padding-top: var(--s4); }
.card-title { display: inline; font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-h3); background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-size: 0 1px; background-position: 0 100%; transition: background-size var(--d-line) var(--ease-enter); padding-bottom: 2px; }
html[dir="rtl"] .card-title { background-position: 100% 100%; }
.card-loc { color: var(--ink-muted); font-size: var(--fs-small); margin-top: var(--s2); }
.card-price { margin-top: var(--s3); display: flex; gap: var(--s4); align-items: baseline; flex-wrap: wrap; }
.card-facts { color: var(--ink-muted); font-size: var(--fs-label); line-height: var(--lh-label); margin-top: var(--s2); }
.status { font-size: var(--fs-label); letter-spacing: var(--ls-label); font-weight: 500; color: var(--accent); }
html[lang="en"] .status { text-transform: uppercase; }
@media (hover: hover) and (pointer: fine) { .card:hover .card-media img { transform: scale(1.03); } .card:hover .card-title { background-size: 100% 1px; } }
@media (max-width: 1099px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s5); }
  .field-search { grid-column: 1 / -1; border-bottom: 1px solid var(--hairline); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7) var(--s6); }
}
@media (max-width: 767px) {
  .catalog { padding-top: var(--s6); }
  .filters { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); border-top: 1px solid var(--hairline); }
  .field { min-height: 52px; border-bottom: 1px solid var(--hairline); }
  .field-search, .field-sort { grid-column: 1 / -1; }
  .field-label { font-size: var(--fs-label); }
  .grid { grid-template-columns: 1fr; gap: var(--s7); margin-top: var(--s7); }
  .card-body { padding-top: var(--s3); }
}

/* ---------- about ---------- */
.about { padding-block: var(--section); margin-top: var(--section); border-top: 1px solid var(--hairline); }
.about-grid { display: grid; grid-template-columns: 5fr 1fr 6fr; gap: var(--s7); align-items: start; }
.about-text { grid-column: 3; }
.about-text .h3 { max-width: 24ch; }
.about-text p { margin-top: var(--s5); max-width: var(--measure); text-wrap: pretty; }
.about-text p + p { margin-top: var(--s4); }
@media (max-width: 767px) { .about-grid { grid-template-columns: 1fr; gap: var(--s6); } .about-text { grid-column: 1; } }

/* ---------- general enquiry ---------- */
.request { padding-block: var(--section); border-top: 1px solid var(--hairline); }
.request-grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s8); align-items: start; }
.request-aside .lead { margin-top: var(--s5); color: var(--ink-muted); max-width: 30rem; }
.request-aside .contact-lines { margin-top: var(--s6); display: grid; gap: var(--s3); color: var(--ink-muted); font-size: var(--fs-small); }
.request-aside .contact-lines .v { color: var(--ink); font-family: var(--font-display); font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.request-aside .btn { margin-top: var(--s6); }
.request-aside .wa-note { margin-top: var(--s3); font-size: var(--fs-label); color: var(--ink-muted); line-height: var(--lh-label); }
.request-intro { color: var(--ink-muted); margin-bottom: var(--s6); max-width: var(--measure); }
@media (max-width: 767px) { .request-grid { grid-template-columns: 1fr; gap: var(--s7); } }

/* ---------- form ---------- */
.form { position: relative; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s6); }
.f { display: flex; flex-direction: column; margin-bottom: var(--s5); }
.f label, .f .f-label { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--ink-muted); }
.f .opt { color: var(--ink-muted); }
.f .control { border-bottom: 1px solid var(--hairline); min-height: 52px; padding: 14px 0; transition: border-color var(--d-color) ease; }
.f .control:focus { border-bottom-color: var(--ink); }
.f textarea.control { min-height: 96px; resize: vertical; }
.f .static { border-bottom: 1px solid var(--hairline); min-height: 52px; padding: 14px 0; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.3; }
.f .hint, .f .error { margin-top: var(--s2); font-size: var(--fs-label); line-height: var(--lh-label); }
.f .hint { color: var(--ink-muted); }
.f .error { color: var(--accent); min-height: 1em; }
.f.invalid .control { border-bottom-color: var(--accent); }
.form-foot { display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap; margin-top: var(--s3); }
.form-foot .privacy { font-size: var(--fs-label); color: var(--ink-muted); line-height: var(--lh-label); max-width: 28rem; }
.form-success { padding: var(--s5) 0; border-top: 1px solid var(--hairline); }
.form-success p + p { margin-top: var(--s3); color: var(--ink-muted); }
.hp { position: absolute; inset-inline-start: -10000px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
@media (max-width: 767px) { .form-row { grid-template-columns: 1fr; } .form .btn { width: 100%; min-height: 52px; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding-block: var(--s7) var(--s7); font-size: var(--fs-label); line-height: var(--lh-label); color: var(--ink-muted); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s7); }
.footer-row .wordmark { color: var(--ink); padding-block: 0; }
.footer-nav { display: flex; gap: var(--s5); }
.footer-nav a { color: var(--ink); display: inline-block; padding-block: 8px; }
.footer-lang { margin-inline-start: auto; display: flex; gap: var(--s3); align-items: center; }
.footer-lang button { min-height: 44px; padding: 0 4px; color: var(--ink-muted); }
.footer-lang button[aria-current="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.3em; text-decoration-thickness: 1px; }
.footer-note { margin-top: var(--s6); max-width: 60rem; text-wrap: pretty; display: grid; gap: var(--s2); }
.footer-note .tel { color: var(--ink); display: inline-block; padding-block: 6px; font-variant-numeric: tabular-nums; }
.footer-bottom { margin-top: var(--s5); display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }

/* ---------- villa view ----------
   Opens as a sheet in the villa's own colour rising over the page, while the picture that was
   clicked travels into place as the gallery. Text settles in once the sheet is up. */
.detail { position: fixed; inset: 0; z-index: 80; background: var(--ground); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; transition: background-color 400ms ease; }
.detail[hidden] { display: none; }
.detail.is-opening { transform: translateY(100%); }
.detail.is-open { transform: none; transition: transform var(--d-sheet) var(--ease-expo), background-color 400ms ease; }
.detail.is-closing { transform: translateY(100%); transition: transform 520ms var(--ease-travel); }
.detail-inner { position: relative; }
.detail-inner.ghost { position: absolute; inset-inline: 0; pointer-events: none; opacity: 0; transition: opacity 240ms ease; }
.detail .d-fade { opacity: 0; transform: translateY(14px); }
.detail .d-dim { opacity: 0; }
.detail.is-open .d-fade { opacity: 1; transform: none; transition: opacity 480ms var(--ease-enter) 260ms, transform 480ms var(--ease-enter) 260ms; }
.detail.is-open .d-dim { opacity: 1; transition: opacity 400ms ease 300ms; }
.detail.is-open .detail-inner.enter .d-fade { opacity: 0; transform: translateY(14px); transition: none; }
.detail.is-open .detail-inner.enter .d-dim { opacity: 0; transition: none; }
.detail.is-closing .d-fade, .detail.is-closing .d-dim { opacity: 0; transform: none; transition: opacity 180ms ease; }
.detail:not(.is-landed) .detail-inner:not(.ghost) .gallery-track, .detail.flying .gallery-track { opacity: 0; }
.flyer { position: fixed; z-index: 130; overflow: hidden; pointer-events: none; }
.flyer img { position: absolute; max-width: none; transform-origin: 0 0; }

.detail-bar { position: sticky; top: 0; z-index: 5; background: var(--ground); border-bottom: 1px solid var(--hairline); transition: background-color 400ms ease; }
.detail-bar .bar-inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s4); }
.detail-bar .back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding-inline-end: 8px; font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-label); }
html[lang="en"] .detail-bar .back { text-transform: uppercase; }
.detail-bar .back svg { width: 18px; height: 18px; }
html[dir="rtl"] .icon-flip { transform: scaleX(-1); }
.detail-bar .ref { margin-inline: auto; color: var(--ink-muted); font-size: var(--fs-small); }
.detail-bar .bar-actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.detail-bar .ref + .bar-actions { margin-inline-start: 0; }

.gallery { position: relative; }
.gallery-track { display: flex; width: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; direction: ltr; aspect-ratio: 16 / 9; background: var(--surface); max-height: calc(100vh - var(--header-h) - 120px); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.gallery-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.94); color: #141414; transition: background-color var(--d-color) ease; }
.gallery-nav svg { width: 20px; height: 20px; }
.gallery-nav.prev { left: var(--s4); } .gallery-nav.next { right: var(--s4); }
.detail .gallery-nav.d-dim { transform: translateY(-50%); }
@media (hover: hover) and (pointer: fine) { .gallery-nav:hover { background: #fff; } }
@media (hover: none) { .gallery-nav { display: none; } }
.gallery-foot { display: flex; align-items: center; gap: var(--s4); padding-block: var(--s3); border-bottom: 1px solid var(--hairline); }
.thumbs { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding: 2px; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: 0 0 104px; aspect-ratio: 3 / 2; position: relative; overflow: hidden; background: var(--surface); opacity: 0.55; transition: opacity var(--d-color) ease, outline-color var(--d-color) ease; outline: 1px solid transparent; outline-offset: 1px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.active { opacity: 1; outline-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .thumb:hover { opacity: 1; } }
.counter { margin-inline-start: auto; color: var(--ink-muted); font-size: var(--fs-small); white-space: nowrap; }

.detail-body { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s6) var(--s8); grid-template-areas: "head facts" "rest facts"; padding-block: var(--s8) var(--s10); align-items: start; }
.detail-head { grid-area: head; }
.detail-rest { grid-area: rest; }
.facts-panel { grid-area: facts; background: var(--surface); padding: var(--s6); position: sticky; top: calc(var(--header-h) + var(--s5)); }
.detail-head .h2:focus { outline: none; }
.detail-head .loc { margin-top: var(--s3); color: var(--ink-muted); }
.detail-head .headline { margin-top: var(--s5); font-family: var(--font-display); font-size: var(--fs-h3); line-height: var(--lh-h3); max-width: 30ch; font-style: italic; color: var(--accent); text-wrap: pretty; }
html[lang="ar"] .detail-head .headline { font-style: normal; }
.facts-price { font-size: var(--fs-price-detail); line-height: 1.2; font-variant-numeric: tabular-nums lining-nums; }
.facts-status { margin-top: var(--s2); }
.facts { margin-top: var(--s5); border-top: 1px solid var(--hairline); }
.facts li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); padding-block: 12px; border-bottom: 1px solid var(--hairline); }
.facts .k { color: var(--ink-muted); font-size: var(--fs-small); }
.facts .v { font-variant-numeric: tabular-nums lining-nums; font-size: var(--fs-price); text-align: end; }
.facts-actions { display: grid; gap: var(--s3); margin-top: var(--s6); }
.detail-rest h3 { margin-top: var(--s8); }
.detail-rest h3:first-child { margin-top: 0; }
.desc { margin-top: var(--s5); max-width: var(--measure); }
.desc p { text-wrap: pretty; }
.desc p + p { margin-top: 1em; }
.features { margin-top: var(--s5); columns: 2; column-gap: var(--s8); border-top: 1px solid var(--hairline); }
.features li { padding-block: 12px; border-bottom: 1px solid var(--hairline); break-inside: avoid; }
.plan { margin-top: var(--s5); border-top: 1px solid var(--hairline); max-width: var(--measure); }
.plan li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: var(--s5); align-items: baseline; padding-block: 12px; border-bottom: 1px solid var(--hairline); }
.plan .n { font-family: var(--font-display); font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.plan-note { margin-top: var(--s5); color: var(--ink-muted); max-width: var(--measure); }
.video-block { margin-top: var(--s5); display: grid; gap: var(--s3); max-width: 880px; }
.video-block video { width: 100%; height: auto; background: #000; }
.video-block figcaption { color: var(--ink-muted); font-size: var(--fs-small); }
.video-block.portrait { max-width: 340px; }
.video-block.portrait video { aspect-ratio: 9 / 16; object-fit: cover; }
.location-block { margin-top: var(--s5); max-width: var(--measure); }
.location-block p + p { margin-top: var(--s3); }
.location-block .map-note { color: var(--ink-muted); font-size: var(--fs-small); }
.detail-form { margin-top: var(--s5); max-width: 44rem; }
.detail-form-intro { color: var(--ink-muted); margin-top: var(--s3); max-width: var(--measure); }
.detail-form .form { margin-top: var(--s6); }
.similar { padding-bottom: var(--s10); }
.similar .grid { margin-top: var(--s6); }
.mobile-bar { display: none; position: fixed; inset-inline: 0; bottom: 0; z-index: 90; grid-template-columns: 1fr 1fr; gap: var(--s2); padding: var(--s2) var(--gutter) calc(var(--s2) + env(safe-area-inset-bottom, 0px)); background: var(--ground); border-top: 1px solid var(--hairline); }
.mobile-bar .btn { min-height: 48px; padding: 0 var(--s3); }
@media (max-width: 1023px) {
  .detail-body { grid-template-columns: 1fr; grid-template-areas: "head" "facts" "rest"; gap: var(--s6); padding-block: var(--s6) var(--s10); }
  .facts-panel { position: static; padding: var(--s5); }
  .facts-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .gallery-track { aspect-ratio: 4 / 3; max-height: none; }
  .thumbs { display: none; }
  .gallery-foot { border-bottom: 0; padding-block: var(--s2); }
  .features { columns: 1; }
  .facts-actions { display: none; }
  .mobile-bar { display: grid; }
  .detail-body { padding-bottom: var(--s6); }
  .similar { padding-bottom: calc(var(--s10) + 40px); }
  .detail-bar .ref { display: none; }
}

/* ---------- opening sequence ---------- */
.intro-mark { position: fixed; left: 0; top: 0; z-index: 120; display: none; font-family: var(--font-display); font-size: 40px; line-height: 1; letter-spacing: var(--ls-wordmark); color: var(--ink); pointer-events: none; transform-origin: 0 0; will-change: transform; white-space: nowrap; }
html.intro .intro-mark { display: flex; }
.intro-mark .l { display: inline-block; opacity: 0; transform: translateY(10px); }
.intro-mark .l.sp { width: 0.35em; }
.intro-mark .w { display: inline-block; clip-path: inset(0 0 0 100%); }
html[dir="rtl"] .intro-mark .w { clip-path: inset(0 100% 0 0); }
html.intro-go .intro-mark .l { opacity: 1; transform: none; transition: opacity 480ms var(--ease-enter), transform 480ms var(--ease-enter); }
html.intro-go .intro-mark .w { clip-path: inset(0); transition: clip-path 620ms var(--ease-enter); }
html.intro .site-header .wordmark { opacity: 0; }
html.intro.intro-landed .site-header .wordmark { opacity: 1; }
html.intro .site-nav, html.intro .header-actions { opacity: 0; }
html.intro-go .site-nav, html.intro-go .header-actions { opacity: 1; transition: opacity 300ms ease 1500ms; }
html.intro .hero-title, html.intro .hero-lead, html.intro .hero-caption, html.intro .catalog-head, html.intro .filters { opacity: 0; transform: translateY(24px); }
html.intro .hero-lead, html.intro .filters { transform: translateY(12px); }
html.intro .hero-caption { transform: translateY(8px); }
html.intro-go .hero-title, html.intro-go .catalog-head { opacity: 1; transform: none; transition: opacity 700ms var(--ease-enter) 1000ms, transform 700ms var(--ease-enter) 1000ms; }
html.intro-go .hero-lead, html.intro-go .filters { opacity: 1; transform: none; transition: opacity 600ms var(--ease-enter) 1250ms, transform 600ms var(--ease-enter) 1250ms; }
html.intro-go .hero-caption { opacity: 1; transform: none; transition: opacity 300ms var(--ease-enter) 1800ms, transform 300ms var(--ease-enter) 1800ms; }
html.intro .hero-curtain { clip-path: inset(100% 0 0 0); }
html.intro .hero-curtain img { transform: scale(1.04); }
html.intro-go .hero-curtain { clip-path: inset(0); transition: clip-path 1100ms var(--ease-expo) 800ms; }
html.intro-go .hero-curtain img { transform: none; transition: transform 1100ms var(--ease-expo) 800ms; }
html.intro-skip .intro-mark, html.intro-skip .intro-mark *, html.intro-skip .site-header *, html.intro-skip .hero-title, html.intro-skip .hero-lead, html.intro-skip .hero-caption, html.intro-skip .catalog-head, html.intro-skip .filters, html.intro-skip .hero-curtain, html.intro-skip .hero-curtain img { transition-duration: 0ms !important; transition-delay: 0ms !important; }
html.soft-enter .hero-curtain { animation: softFade 300ms ease both; }
@keyframes softFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- scroll reveals ---------- */
.will-reveal { opacity: 0; }
.will-reveal.reveal-up { transform: translateY(14px); }
.will-reveal.revealed { opacity: 1; transform: none; transition: opacity 550ms var(--ease-enter), transform 550ms var(--ease-enter); }
.will-reveal.reveal-slow.revealed { transition-duration: 700ms; transition-timing-function: ease; }
.curtain-inner { position: absolute; inset: 0; }
/* the clip sits on an inner wrapper: a fully clipped element never intersects, so it could never reveal itself */
.will-reveal.curtain { opacity: 1; }
.will-reveal.curtain .curtain-inner { clip-path: inset(100% 0 0 0); }
.will-reveal.curtain.revealed .curtain-inner { clip-path: inset(0); transition: clip-path var(--d-curtain) var(--ease-expo); }

/* ---------- language switch ---------- */
body { transition: opacity 200ms ease; }
html.lang-fade body { opacity: 0; }
html.lang-switching *, html.lang-switching *::before, html.lang-switching *::after { transition: none !important; animation: none !important; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0ms !important; animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
  .will-reveal { opacity: 1; transform: none; clip-path: none; }
  .detail, .detail.is-opening, .detail.is-closing { transform: none; }
}
@media print { .site-header, .filters, .mobile-bar, .intro-mark, .skip, .flyer { display: none !important; } .detail { position: static; overflow: visible; } }
