/* Kingdom Homes Real Estate — v1
   Navy & gold, mobile-first, logical properties for RTL/LTR */

:root {
  --navy: #0c1a2e;
  --navy-mid: #152a45;
  --navy-soft: #1c3556;
  --gold: #c4a056;
  --gold-bright: #d4b56a;
  --gold-deep: #8a6a32;
  --cream: #f7f2ea;
  --cream-2: #efe6d6;
  --sand: #e4d5bb;
  --ink: #1a140c;
  --muted: #5c5348;
  --line: rgba(196, 160, 86, 0.35);
  --white: #fff;
  --shadow: 0 10px 30px rgba(12, 26, 46, 0.12);
  --radius: 16px;
  --header-h: 72px;
  --font: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --display: "Cairo", "Segoe UI", sans-serif;
  --max: 1180px;
}

html[lang="en"] {
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  font-size: 16.5px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, select, input { font-family: inherit; }
h1, h2, h3, .display {
  font-family: var(--display);
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 0.5em;
}
p { margin: 0 0 1em; }

.skip {
  position: absolute;
  inset-inline-start: 8px;
  top: -40px;
  background: var(--gold);
  color: var(--navy);
  padding: 6px 10px;
  z-index: 100;
}
.skip:focus { top: 8px; }

/* Header */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold-bright);
}
.brand-sub { font-size: 0.68rem; letter-spacing: 0.06em; color: #d7d0c4; text-transform: uppercase; }

.nav-toggle {
  margin-inline-start: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold);
  width: 42px; height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.site-nav {
  display: none;
  flex-direction: column;
  position: absolute;
  inset-inline: 0;
  top: var(--header-h);
  background: var(--navy-mid);
  padding: 12px 16px 20px;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.site-nav.open { display: flex; }
.site-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #f3eee6;
  font-weight: 600;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  background: rgba(196, 160, 86, 0.15);
  color: var(--gold-bright);
}

.lang-toggle, .header-phone {
  display: none;
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}
.lang-toggle:hover { background: var(--gold); color: var(--navy); }

.header-phone {
  color: var(--gold-bright);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    flex-direction: row;
    position: static;
    background: transparent;
    padding: 0;
    margin-inline-start: auto;
    border: 0;
    align-items: center;
    gap: 2px;
  }
  .site-nav a { padding: 8px 10px; font-size: 0.95rem; }
  .lang-toggle, .header-phone { display: inline-flex; align-items: center; }
  .header-phone { margin-inline-start: 8px; }
}

@media (max-width: 959px) {
  .mobile-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-inline-start: auto;
  }
  .mobile-tools .lang-toggle { display: inline-flex; }
  .nav-toggle { margin-inline-start: 0; }
}

/* Page layout */
main { flex: 1; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--navy); }
.eyebrow {
  color: var(--gold-deep);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 8px;
}
html[lang="ar"] .eyebrow { letter-spacing: 0.04em; text-transform: none; font-size: 0.95rem; }
.gold-rule {
  width: 72px; height: 2px; background: var(--gold); margin: 12px auto 0;
}

/* Hero */
.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--navy) center/cover no-repeat;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,16,28,0.55) 0%, rgba(8,16,28,0.72) 55%, rgba(8,16,28,0.88) 100%);
  z-index: -1;
}
.hero-inner { text-align: center; padding: 72px 20px 64px; max-width: 800px; }
.hero-logo { width: 110px; height: 110px; margin: 0 auto 18px; object-fit: contain; filter: drop-shadow(0 4px 16px rgba(0,0,0,.35)); }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); color: var(--gold-bright); margin-bottom: 8px; }
.hero .tagline { font-size: clamp(1.15rem, 3vw, 1.6rem); margin-bottom: 10px; }
.hero .place { color: var(--sand); font-weight: 600; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s ease;
  text-align: center;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-bright); }
.btn-ghost { background: transparent; color: var(--white); border-color: var(--gold); }
.btn-ghost:hover { background: rgba(196,160,86,0.15); }
.btn-navy { background: var(--navy); color: var(--gold-bright); }
.btn-navy:hover { background: var(--navy-soft); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--gold-bright); }
.btn-wa { background: #128C7E; color: #fff; }
.btn-wa:hover { background: #0e7a6e; }
.btn-call { background: var(--navy); color: var(--gold-bright); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* Values / cards */
.grid-3, .grid-4, .grid-2 { display: grid; gap: 20px; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(12,26,46,0.06);
}
.value-card, .service-card, .type-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
  text-align: center;
}
.value-card h3, .service-card h3, .type-card h3 { color: var(--navy); }
.value-icon, .service-icon {
  width: 48px; height: 48px; margin: 0 auto 12px;
  color: var(--gold-deep);
}
.type-card { padding: 0; text-align: start; overflow: hidden; }
.type-card img { width: 100%; height: 180px; object-fit: cover; }
.type-card .pad { padding: 16px 18px 20px; }

.split {
  display: grid; gap: 28px; align-items: center;
}
@media (min-width: 800px) {
  .split { grid-template-columns: 1fr 1fr; gap: 48px; }
  .split.flip { direction: rtl; }
  .split.flip > * { direction: inherit; }
  html[lang="en"] .split.flip { direction: ltr; }
  html[lang="en"] .split.flip > * { direction: ltr; }
  html[lang="ar"] .split.flip { direction: ltr; }
  html[lang="ar"] .split.flip > * { direction: rtl; }
}
.split img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow);
  object-fit: cover; max-height: 460px;
}
.prose h2 { color: var(--navy); font-size: clamp(1.5rem, 3vw, 2rem); }
.prose p { color: #3a332a; }

/* Property cards */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 24px;
  align-items: end;
}
.filters label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.8rem; font-weight: 700; color: var(--navy);
  min-width: 140px; flex: 1;
}
.filters select {
  appearance: none;
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M0 0l6 8 6-8z' fill='%238a6a32'/></svg>") no-repeat;
  background-position: left 12px center;
  padding: 10px 12px;
  padding-inline-start: 12px;
  padding-inline-end: 32px;
  border: 1px solid var(--sand);
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.95rem;
}
html[lang="en"] .filters select { background-position: right 12px center; }
.filter-count { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }

.prop-grid {
  display: grid; gap: 22px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .prop-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .prop-grid { grid-template-columns: 1fr 1fr 1fr; } }

.prop-card { display: flex; flex-direction: column; height: 100%; }
.prop-card .thumb {
  position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--navy-mid);
}
.prop-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.prop-card:hover .thumb img { transform: scale(1.04); }
.badge {
  position: absolute; top: 12px; inset-inline-start: 12px;
  background: var(--gold); color: var(--navy);
  font-weight: 800; font-size: 0.75rem;
  padding: 4px 10px; border-radius: 999px;
}
.badge-rent { background: var(--navy); color: var(--gold-bright); }
.prop-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prop-type { color: var(--gold-deep); font-size: 0.8rem; font-weight: 700; }
.prop-body h3 { font-size: 1.1rem; color: var(--navy); margin: 0; font-family: var(--font); }
.prop-area { color: var(--muted); font-size: 0.9rem; }
.prop-facts { list-style: none; padding: 0; margin: 8px 0; color: #3a332a; font-size: 0.92rem; }
.prop-facts li { padding-inline-start: 0.2em; }
.prop-price { font-weight: 800; color: var(--navy); font-size: 1.05rem; margin-top: auto; padding-top: 8px; }
.prop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.prop-actions .btn { flex: 1; min-width: 90px; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }

/* Detail */
.detail-hero { background: var(--navy); color: #fff; padding: 24px 0 20px; }
.detail-hero h1 { color: var(--gold-bright); font-size: clamp(1.4rem, 3vw, 2.1rem); }
.crumb { color: #cfc6b8; font-size: 0.85rem; margin-bottom: 8px; }
.crumb a { text-decoration: underline; text-underline-offset: 3px; }
.gallery { display: grid; gap: 10px; }
.gallery-main {
  background: #000; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4/3; position: relative;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs button {
  border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden;
  width: 76px; height: 76px; cursor: pointer; background: none;
}
.gallery-thumbs button[aria-current="true"] { border-color: var(--gold); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-grid {
  display: grid; gap: 28px; padding: 32px 0 48px;
}
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: 1.4fr 0.8fr; align-items: start; }
}
.side-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; position: sticky; top: calc(var(--header-h) + 16px);
  border: 1px solid rgba(12,26,46,0.06);
}
.side-card .price { font-size: 1.35rem; font-weight: 800; color: var(--navy); margin: 8px 0 16px; }
.units { margin: 16px 0; display: grid; gap: 10px; }
.unit {
  border: 1px solid var(--sand); border-radius: 12px; padding: 12px 14px; background: var(--cream);
}
.unit strong { color: var(--navy); display: block; }
.feature-list { columns: 1; margin: 0; padding: 0 0 0 1.1em; }
@media (min-width: 600px) { .feature-list { columns: 2; } }
html[lang="ar"] .feature-list { padding: 0 1.1em 0 0; }
.feature-list li { break-inside: avoid; margin-bottom: 6px; }

/* Contact / management */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.contact-list a, .contact-list span { display: flex; gap: 14px; align-items: center; }
.contact-ico {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  display: grid; place-items: center; flex-shrink: 0;
}
.placeholder {
  text-align: center; padding: 64px 20px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px dashed var(--gold);
  max-width: 640px; margin: 0 auto;
}
.placeholder .crown { width: 80px; margin: 0 auto 16px; opacity: 0.9; }
.placeholder h2 { color: var(--navy); }

.page-hero {
  background: var(--navy);
  color: #fff;
  padding: 48px 0 40px;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}
.page-hero h1 { color: var(--gold-bright); font-size: clamp(1.6rem, 4vw, 2.4rem); }

/* Footer */
.site-footer {
  background: var(--navy);
  color: #e8e0d4;
  padding: 36px 0 20px;
  margin-top: auto;
  border-top: 3px solid var(--gold);
}
.footer-grid {
  display: grid; gap: 24px;
}
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h3 { color: var(--gold-bright); font-size: 1rem; }
.site-footer a:hover { color: var(--gold-bright); }
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.footer-brand img { width: 56px; height: 56px; object-fit: contain; }
.legal { border-top: 1px solid rgba(196,160,86,0.2); margin-top: 24px; padding-top: 14px; font-size: 0.85rem; color: #b7ae9f; text-align: center; }

.cta-band {
  background: var(--navy-mid);
  color: #fff;
  padding: 40px 0;
  text-align: center;
}
.cta-band h2 { color: var(--gold-bright); }

/* Utilities */
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

@media (min-width: 960px) {
  .mobile-tools { display: none !important; }
}
@media (max-width: 959px) {
  .header-inner > .lang-toggle,
  .header-inner > .header-phone { display: none !important; }
}
body { overflow-x: hidden; }


/* Keep phone numbers and @handles in reading order inside RTL pages */
.ltr-id {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* Management portrait — rectangular frame, never crop the head or ghutra */
.mgmt-card {
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 28px 40px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
}
.mgmt-portrait {
  margin: 0 auto 24px;
  max-width: 320px;
  padding: 7px;
  background: var(--navy);
  border: 1px solid var(--gold);
  box-shadow: 0 8px 24px rgba(12, 26, 46, 0.12);
}
.mgmt-portrait picture,
.mgmt-photo {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.mgmt-photo {
  object-fit: contain;
  object-position: top center;
  background: #fff;
}
.mgmt-card h2 { color: var(--navy); margin: 0 0 6px; font-size: clamp(1.35rem, 3vw, 1.7rem); }
.mgmt-role { color: var(--gold-deep); font-weight: 700; font-size: 1.1rem; margin: 0; }
@media (max-width: 600px) {
  .mgmt-card { padding: 28px 20px 32px; max-width: 100%; }
  .mgmt-portrait { max-width: 260px; padding: 6px; }
}

/* 404 */
.page-404 { text-align: center; padding: 64px 16px 80px; }
.page-404 .crown { width: 96px; margin: 0 auto 20px; }
.page-404 h1 { color: var(--gold-bright); }
