/*
Theme Name: Lex Real
Theme URI: https://example.com/lex-real
Author: Lex Real
Description: A modern real-estate WordPress theme with property search, galleries and agent contacts.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: lex-real
*/

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #fff;
  --wash: #f6f8fb;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(15, 23, 42, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--wash); color: var(--ink); }
body.lightbox-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.container { width: min(1180px, calc(100% - 3rem)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.site-header__inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.2rem; font-weight: 850; letter-spacing: -.03em; }
.brand__mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--ink), var(--brand)); color: white; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 1.5rem; margin: 0; padding: 0; font-weight: 650; }
.main-nav a { transition: color .2s; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--brand); }
.site-language { display:flex; gap:.3rem; padding:.25rem; border-radius:999px; background:#eef2f7; }
.site-language a { padding:.32rem .55rem; border-radius:999px; color:#475569; font-size:.75rem; font-weight:850; }
.site-language a.is-active { background:var(--ink); color:white; }
.nav-toggle { display: none; border: 0; background: transparent; font-weight: 750; cursor: pointer; }

.button { min-height: 46px; border: 0; border-radius: 12px; padding: .75rem 1.25rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font-weight: 750; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button--primary { background: var(--brand); color: white; box-shadow: 0 10px 24px rgba(37, 99, 235, .24); }
.button--primary:hover { background: var(--brand-dark); }
.button--secondary { background: #e9eef5; color: var(--ink); }
.button--outline { background: white; border: 1px solid var(--line); }

.hero { min-height: min(760px, 78vh); display: flex; align-items: center; background-size: cover; background-position: center; position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 16, 34, .72), rgba(15, 23, 42, .27) 70%, rgba(15,23,42,.12)); }
.hero__content { color: white; padding-block: 5rem; max-width: 900px; }
.eyebrow { margin: 0 0 .8rem; color: #bfdbfe; font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .14em; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(2.7rem, 6vw, 5.2rem); line-height: .98; letter-spacing: -.055em; }
.hero__lead { max-width: 660px; margin: 1.2rem 0 1.8rem; color: #e2e8f0; font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.6; }
.search-panel { max-width: 900px; background: rgba(255,255,255,.96); padding: 1rem; border-radius: 18px; box-shadow: 0 24px 70px rgba(2,6,23,.26); }
.search-panel__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) auto; gap: .7rem; }
.field { display: grid; gap: .4rem; }
.field span { color: #475569; font-size: .77rem; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 1px solid #dbe2ea; border-radius: 11px; padding: .7rem .8rem; color: #334155; background: white; }
.search-panel .button { align-self: end; }
.quick-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.quick-tags a { padding: .38rem .72rem; border-radius: 999px; background: #edf2f7; color: #475569; font-size: .8rem; font-weight: 650; }

.section { padding-block: 4.5rem; }
.section--white { background: white; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.7rem; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; }
.section-heading p { color: var(--muted); margin: .5rem 0 0; }
.text-link { color: var(--brand); font-weight: 750; }

.featured-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 210px; gap: 1rem; }
.property-tile { position: relative; overflow: hidden; border-radius: var(--radius); background: #cbd5e1 center / cover no-repeat; color: white; box-shadow: var(--shadow); }
.property-tile:first-child { grid-row: span 2; }
.property-tile__shade { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: end; padding: 1.25rem; background: linear-gradient(transparent 24%, rgba(2,6,23,.82)); }
.property-tile h3 { margin: .35rem 0; font-size: 1.25rem; }
.property-tile p { margin: 0; color: #e2e8f0; }
.badge { width: fit-content; border-radius: 999px; padding: .32rem .7rem; background: rgba(224,242,254,.94); color: #075985; font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.badge--featured { position: absolute; z-index: 2; top: 1rem; left: 1rem; background: var(--brand); color: white; }
.badge--status { background: #dcfce7; color: #166534; }

.property-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.25rem; }
.property-card { overflow: hidden; border-radius: var(--radius); background: white; border: 1px solid #edf1f6; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.property-card:hover { transform: translateY(-5px); box-shadow: 0 24px 55px rgba(15,23,42,.14); }
.property-card__image { height: 220px; position: relative; background: #cbd5e1 center / cover no-repeat; }
.property-card__image .badge { position: absolute; top: 1rem; right: 1rem; }
.property-card__body { padding: 1.2rem; }
.property-card h3 { margin: .8rem 0 .35rem; font-size: 1.18rem; }
.property-card__location { margin: 0; color: var(--muted); }
.property-card__meta { display: flex; justify-content: space-between; gap: 1rem; margin: 1.1rem 0; padding-top: 1rem; border-top: 1px solid var(--line); color: #475569; }
.property-card__price { color: var(--ink); font-weight: 850; }
.empty-state { grid-column: 1 / -1; padding: 3rem; text-align: center; background: white; border: 1px dashed #cbd5e1; border-radius: var(--radius); color: var(--muted); }

.archive-hero { padding: 4.5rem 0 3rem; background: radial-gradient(circle at top right, #dbeafe, transparent 40%), white; }
.archive-hero h1 { font-size: clamp(2.5rem,5vw,4.5rem); margin: 0; letter-spacing: -.05em; }
.archive-hero p { color: var(--muted); font-size: 1.1rem; }
.filters { margin-top: -1.7rem; position: relative; z-index: 2; }
.filters__box { padding: 1.2rem; border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.offer-switch { display: inline-flex; gap: .35rem; padding: .32rem; margin-bottom: 1rem; border-radius: 999px; background: #e8edf3; }
.offer-switch a { padding: .55rem 1rem; border-radius: 999px; font-weight: 750; }
.offer-switch a.is-active { background: white; box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.filters__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; }
.filters__actions { display: flex; gap: .6rem; align-items: end; }
.results-count { color: var(--muted); margin: 2rem 0 1rem; }

.detail-hero { min-height: 66vh; display: flex; align-items: end; background: #334155 center / cover no-repeat; color: white; position: relative; }
.detail-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgba(2,6,23,.88)); }
.detail-hero__content { position: relative; padding-block: 4rem; }
.property-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.property-tag { display: inline-flex; align-items: center; min-height: 30px; padding: .32rem .72rem; border: 1px solid rgba(255,255,255,.42); border-radius: 999px; background: rgba(15,23,42,.46); color: white; font-size: .78rem; font-weight: 750; backdrop-filter: blur(8px); }
.detail-hero h1 { max-width: 850px; margin: .9rem 0 .45rem; font-size: clamp(2.4rem,5vw,4.5rem); line-height: 1; letter-spacing: -.05em; }
.detail-hero__meta { display: flex; gap: 1.5rem; align-items: center; margin-top: 1.2rem; font-size: 1.2rem; }
.detail-hero__meta strong { font-size: 1.7rem; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; }
.prose { color: #334155; line-height: 1.8; }
.prose h2 { color: var(--ink); font-size: 2rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1.5rem 0; }
.fact { padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.fact small, .fact strong { display: block; }
.fact small { color: var(--muted); margin-bottom: .3rem; }
.agent-card { position: sticky; top: 100px; padding: 1.4rem; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.agent-card__avatar { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; font-size: 1.5rem; font-weight: 850; }
.agent-card h3 { margin: .9rem 0 .25rem; }
.agent-card p { color: var(--muted); line-height: 1.55; }
.agent-card .button { width: 100%; margin-top: .5rem; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin-top: 2rem; }
.gallery button { border: 0; padding: 0; height: 260px; overflow: hidden; border-radius: 14px; cursor: zoom-in; background: #cbd5e1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery button:hover img { transform: scale(1.03); }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: 5rem; background: rgba(2,6,23,.94); }
.lightbox.is-open { display: grid; }
.lightbox__image { max-height: calc(100vh - 7rem); max-width: 100%; border-radius: 14px; }
.lightbox__close, .lightbox__nav { position: absolute; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: white; cursor: pointer; }
.lightbox__close { top: 1.2rem; right: 1.2rem; width: 46px; height: 46px; font-size: 1.5rem; }
.lightbox__nav { top: 50%; width: 52px; height: 52px; font-size: 1.7rem; }
.lightbox__prev { left: 1.2rem; } .lightbox__next { right: 1.2rem; }

.contact-page { padding-block: 5rem; }
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.contact-panel { padding: 2rem; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.contact-list span { display: block; color: var(--muted); font-size: .82rem; }
.site-footer { padding: 3rem 0; background: var(--ink); color: #cbd5e1; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 2rem; }
.site-footer a { color: white; }

@media (max-width: 1000px) {
  .search-panel__grid { grid-template-columns: repeat(2, 1fr); }
  .featured-grid { grid-template-columns: 1fr 1fr; }
  .property-tile:first-child { grid-row: span 1; grid-column: span 2; }
  .property-grid { grid-template-columns: repeat(2, 1fr); }
  .filters__grid { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .agent-card { position: static; }
}

@media (max-width: 700px) {
  .container { width: min(100% - 2rem, 1180px); }
  .site-header__inner { min-height: 66px; flex-wrap: wrap; padding-block: .8rem; }
  .nav-toggle { display: block; }
  .main-nav { display: none; width: 100%; }
  .main-nav.is-open { display: block; }
  .main-nav ul { align-items: stretch; flex-direction: column; gap: 0; padding: .5rem 0; }
  .main-nav a { display: block; padding: .7rem 0; }
  .site-language { margin-left:auto; }
  .hero { min-height: 720px; }
  .hero__content { padding-block: 3rem; }
  .search-panel__grid, .filters__grid, .property-grid, .contact-layout, .facts { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; grid-auto-rows: 250px; }
  .property-tile:first-child { grid-column: auto; }
  .section { padding-block: 3rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .gallery { grid-template-columns: 1fr; }
  .lightbox { padding: 4rem .75rem; }
  .lightbox__nav { top: auto; bottom: 1rem; }
  .site-footer__inner { flex-direction: column; }
}
