/* Nafayis Kuwait Real Estate — one stylesheet for English (LTR) and Arabic (RTL).
   Uses logical properties (inline-start/end), so RTL works without overrides. */

:root {
  --navy: #1d3961;          /* logo navy */
  --navy-deep: #13284a;
  --bronze: #8a6a45;        /* lighter take on the logo brown */
  --bronze-dark: #6e5434;
  --sand: #f6f3ee;
  --paper: #ffffff;
  --ink: #1c2430;
  --muted: #5b6573;
  --line: #e4ded4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(19, 40, 74, .06), 0 6px 20px rgba(19, 40, 74, .07);
  --wrap: 1160px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sand);
}

[dir="rtl"] body { line-height: 1.8; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
a:hover { color: var(--bronze-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--navy-deep); }
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

.skip {
  position: absolute; inset-inline-start: -999px; top: 0;
  background: var(--paper); padding: 8px 12px; z-index: 10;
}
.skip:focus { inset-inline-start: 8px; }

:focus-visible { outline: 3px solid var(--bronze); outline-offset: 2px; }

/* ---------- Top bar + header ---------- */

.topbar {
  background: var(--navy-deep);
  color: #c9d3e3;
  font-size: .85rem;
}
.topbar .wrap {
  display: flex; flex-wrap: wrap; gap: 4px 20px;
  justify-content: space-between; align-items: center;
  padding-block: 6px;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }
.topbar .contacts { display: flex; flex-wrap: wrap; gap: 4px 18px; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px; flex-wrap: wrap;
  padding-block: 8px;
}
.brand img { height: 64px; width: auto; }

.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.nav a {
  color: var(--navy-deep); text-decoration: none; font-weight: 500;
  padding: 8px 12px; border-radius: 6px;
}
.nav a:hover { background: var(--sand); color: var(--navy-deep); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--bronze); border-radius: 0; }
.nav .lang {
  margin-inline-start: 8px;
  border: 1px solid var(--navy);
  font-weight: 600;
}
.nav .lang:hover { background: var(--navy); color: #fff; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px;
  font: inherit; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--bronze); color: #fff; }
.btn-primary:hover { background: var(--bronze-dark); color: #fff; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-light { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-light:hover { background: #fff; color: var(--navy); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */

.hero { background: var(--navy); color: #dfe6f1; }
.hero .wrap {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center;
  padding-block: 56px 64px;
}
.hero h1 { color: #fff; }
.eyebrow {
  display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .04em;
  color: #e9d3b4; margin-bottom: 12px;
}
[dir="ltr"] .eyebrow { text-transform: uppercase; }
.hero p { font-size: 1.08rem; max-width: 56ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero figure { margin: 0; }
.hero figure img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius); box-shadow: 0 20px 40px rgba(0,0,0,.25);
}

/* ---------- Sections ---------- */

.section { padding-block: 64px; }
.section-head { margin-bottom: 28px; max-width: 70ch; }
.section-head p { color: var(--muted); margin: 0; }
.section-alt { background: var(--paper); border-block: 1px solid var(--line); }

/* ---------- Property cards ---------- */

.cards {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  list-style: none; margin: 0; padding: 0;
}
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(19, 40, 74, .14); }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; }
.card h3 a { color: var(--navy-deep); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card .loc { color: var(--muted); font-size: .95rem; margin: 0; }
.tag {
  position: absolute; inset-block-start: 12px; inset-inline-start: 12px;
  background: rgba(19, 40, 74, .88); color: #fff;
  font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}

.specs { display: flex; flex-wrap: wrap; gap: 6px 8px; list-style: none; margin: 6px 0 0; padding: 0; }
.specs li {
  background: var(--sand); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 10px; font-size: .88rem; color: var(--ink);
}
.specs b { font-weight: 600; }

/* ---------- About ---------- */

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.fact { border-inline-start: 3px solid var(--bronze); padding-inline-start: 12px; }
.fact strong { display: block; font-size: 1.3rem; color: var(--navy-deep); }
.fact span { color: var(--muted); font-size: .9rem; }

/* ---------- CTA band ---------- */

.band { background: var(--navy); color: #dfe6f1; }
.band .wrap {
  display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between;
  padding-block: 40px;
}
.band h2 { color: #fff; margin: 0 0 4px; }
.band p { margin: 0; }
.band .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Page head / breadcrumb ---------- */

.page-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-block: 28px; }
.crumbs { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; color: #b3aa9c; }
.crumbs a { color: var(--muted); }
.page-head h1 { margin-bottom: 4px; }
.page-head .loc { color: var(--muted); margin: 0; }

/* ---------- Property page ---------- */

.property { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }

/* Flex so the last row of thumbnails always fills the width, whatever the photo count. */
.gallery {
  display: flex; flex-wrap: wrap; gap: 10px;
  list-style: none; margin: 0; padding: 0;
}
.gallery li { flex: 1 1 calc(25% - 10px); min-width: 0; }
.gallery li:first-child { flex-basis: 100%; }
.gallery button {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: 8px; overflow: hidden;
}
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: opacity .15s; }
.gallery button:hover img { opacity: .88; }

.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 14px; }
.aside { position: sticky; top: 16px; }
.aside .btn + .btn { margin-top: 10px; }
.aside .note { font-size: .88rem; color: var(--muted); margin: 12px 0 0; }

.facts-list { margin: 0 0 18px; display: grid; gap: 0; }
.facts-list div {
  display: flex; justify-content: space-between; gap: 16px;
  padding-block: 9px; border-bottom: 1px solid var(--line);
}
.facts-list div:last-child { border-bottom: 0; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; font-weight: 600; text-align: end; }

.details { margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.details .panel + .panel { margin-top: 0; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ticks li { padding-inline-start: 26px; position: relative; }
.ticks li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: .55em;
  width: 12px; height: 7px; border-left: 2px solid var(--bronze); border-bottom: 2px solid var(--bronze);
  transform: rotate(-45deg);
}

/* ---------- Lightbox ---------- */

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
}
.lightbox::backdrop { background: rgba(8, 16, 30, .92); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; text-align: center; color: #dfe6f1; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 80vh; border-radius: 6px; margin-inline: auto; }
.lightbox figcaption { margin-top: 10px; font-size: .9rem; }
.lb-btn {
  position: fixed; background: rgba(255,255,255,.12); color: #fff; border: 0;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lb-btn:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 16px; inset-inline-end: 16px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { inset-inline-start: 16px; }
.lb-next { inset-inline-end: 16px; }
[dir="rtl"] .lb-prev, [dir="rtl"] .lb-next { transform: translateY(-50%) scaleX(-1); }

/* ---------- Contact page ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: start; }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.info-list li { display: grid; gap: 2px; justify-items: start; }
.info-list .label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.map { margin-top: 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map iframe { display: block; width: 100%; height: 300px; border: 0; }

.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field textarea {
  font: inherit; color: var(--ink);
  padding: 10px 12px; border: 1px solid #cfc7ba; border-radius: 8px; background: #fff; width: 100%;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
.field textarea { min-height: 140px; resize: vertical; }
.form .note { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-deep); color: #b9c5d8; font-size: .95rem; }
.site-footer .wrap { padding-block: 48px 24px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 32px; }
.site-footer h2 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer .logo { height: 64px; width: auto; margin-bottom: 14px; background: #fff; border-radius: 6px; padding: 4px 8px; box-sizing: content-box; }
.copyright {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px;
  font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
}

/* ---------- 404 ---------- */

.notfound { text-align: center; padding-block: 96px; }
.notfound .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .property { grid-template-columns: 1fr; }
  .aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .hero .wrap, .about, .contact-grid, .details { grid-template-columns: 1fr; }
  .hero .wrap { padding-block: 36px 44px; gap: 28px; }
  .section { padding-block: 44px; }
}

@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .brand img { height: 52px; }
  .site-header .wrap { justify-content: center; }
  .nav { justify-content: center; }
  .nav a { padding: 6px 9px; }
  .topbar .wrap { justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  .gallery li { flex-basis: calc(33.33% - 10px); }
  .gallery li:first-child { flex-basis: 100%; }
  .facts { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  [dir="rtl"] .lb-prev, [dir="rtl"] .lb-next { transform: scaleX(-1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .gallery img { transition: none; }
}

@media print {
  .topbar, .site-header, .site-footer, .band, .aside .btn, .lightbox { display: none !important; }
  body { background: #fff; }
}
