/* ==========================================================================
   Design tokens
   Palette:
     --bg        #F6F4EF  warm sand (background)
     --surface   #FFFFFF  card surface
     --ink       #262321  warm charcoal (text)
     --primary   #1B4B43  deep teal (Mediterranean tile)
     --accent    #C08A28  brass/gold (key & signage)
     --border    #DAD3C4  muted sand border
   Type:
     Display  -> "Cairo" (geometric Arabic, bold, used for headings only)
     Body     -> "IBM Plex Sans Arabic"
     Data/num -> "IBM Plex Mono" (prices, stats — tabular, trustworthy)
   Signature:
     Arch-topped property card with a thin "mashrabiya" lattice strip —
     nods to the arched windows/screens common across the region's
     architecture (Egypt, Gulf) without illustrating a literal building.
   ========================================================================== */

:root {
    --bg: #F6F4EF;
    --surface: #FFFFFF;
    --ink: #262321;
    --ink-soft: #5B5750;
    --primary: #1B4B43;
    --primary-soft: #E7EEEC;
    --accent: #C08A28;
    --border: #DAD3C4;
    --radius-card: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "IBM Plex Sans Arabic", sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

h1, h2, h3, .brand-text {
    font-family: "Cairo", sans-serif;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 .4em;
}

.price, .stat-number {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Header ---- */
/* ثابت أعلى الشاشة أثناء التمرير، بلون أخضر (primary) بدل الأبيض */
.site-header {
    background: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
    color: var(--accent);
    font-size: 1.6rem;
}
.brand-text { font-size: 1.3rem; color: #fff; }
.brand-accent { color: var(--accent); }
.main-nav { display: flex; gap: 28px; font-weight: 600; color: rgba(255,255,255,0.82); }
.main-nav a:hover { color: #fff; }

/* الهيرو أصبح تحت هيدر ثابت، فمفيش داعي لتكرار نفس الأخضر الغامق جداً أسفله */
.hero { padding-top: 40px; }

/* ---- Hero / search ---- */
.hero {
    background:
        radial-gradient(circle at 15% 20%, rgba(192,138,40,0.10), transparent 40%),
        var(--primary);
    color: #fff;
    padding: 48px 0 60px;
    position: relative;
}
.hero h1 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    max-width: 18ch;
}
.hero p { color: rgba(255,255,255,0.8); max-width: 48ch; }

/* شريط البحث ثابت (sticky) ويلزق تحت الهيدر الأخضر أثناء التمرير */
.search-sticky-wrap {
    position: sticky;
    top: 68px; /* ارتفاع الهيدر */
    z-index: 90;
    margin-top: -34px;
    padding-bottom: 12px;
}
.search-panel {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: 0 12px 28px rgba(27,75,67,0.22);
    padding: 18px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.search-panel select,
.search-panel input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
}
.search-panel button {
    grid-column: 1 / -1;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-family: "Cairo", sans-serif;
    cursor: pointer;
    transition: filter .15s ease;
}
.search-panel button:hover { filter: brightness(0.93); }
.search-panel button:focus-visible,
a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ---- Results grid ---- */
.results-section { padding: 40px 0 64px; }
.results-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    color: var(--ink-soft);
}
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
}

/* Signature component: arch-topped property card */
.property-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}
.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(38,35,33,0.12);
}
.card-arch {
    position: relative;
    height: 170px;
    background: var(--primary-soft);
    border-radius: 50% 50% 0 0 / 70px 70px 0 0;
    margin: 0 8px;
    overflow: hidden;
}
.card-arch img {
    width: 100%; height: 100%; object-fit: cover;
}
.card-lattice {
    /* thin mashrabiya-inspired strip beneath the arch */
    height: 8px;
    margin: 0 8px;
    background-image:
        repeating-linear-gradient(135deg, var(--accent) 0 3px, transparent 3px 9px),
        repeating-linear-gradient(45deg, var(--accent) 0 3px, transparent 3px 9px);
    opacity: 0.55;
}
.card-body { padding: 16px 18px 20px; }
.card-body .price { color: var(--primary); font-size: 1.15rem; display: block; margin-bottom: 4px; }
.card-title { font-weight: 600; margin-bottom: 6px; }
.card-meta { color: var(--ink-soft); font-size: 0.88rem; display: flex; gap: 10px; flex-wrap: wrap; }
.card-location { color: var(--ink-soft); font-size: 0.85rem; margin-top: 6px; }
.badge-listing {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-soft);
    border: 1px dashed var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
}

/* ---- Footer ---- */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.75);
    padding: 22px 0;
    font-size: 0.88rem;
    text-align: center;
}

@media (max-width: 640px) {
    .main-nav { display: none; }
}
