/* Domestat — public site design system
   Hybrid: minimalist search-first + luxury lifestyle photography.
   Region-adaptive via [data-country] attribute on <body>. */

:root {
  --navy: #1a2b4c;
  --navy-dark: #10192f;
  --accent: #b8894f; /* warm brass accent, luxury without being loud */
  --accent-dark: #9c7440;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e6e6e9;
  --text: #1c1c1e;
  --text-secondary: #6b6b70;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(20, 24, 40, 0.06);
  --shadow-md: 0 10px 26px rgba(20, 24, 40, 0.09);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

/* ---------- Top nav ---------- */
.site-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(20,24,40,0.03), 0 4px 16px rgba(20,24,40,0.04);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 24px;
}
.brand { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--navy); }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a {
  font-size: 13.5px; font-weight: 600; color: var(--text); letter-spacing: 0.01em;
  position: relative; padding: 4px 0; transition: color 0.15s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1.5px;
  background: var(--accent); transition: right 0.2s ease;
}
.nav-links a:hover { color: var(--accent-dark); }
.nav-links a:hover::after { right: 0; }
.country-switcher select {
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 13px;
  font-weight: 500; background: var(--bg); color: var(--text); cursor: pointer;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy); color: #fff; border: none;
  padding: 11px 20px; border-radius: var(--radius); font-size: 13.5px; font-weight: 600;
  letter-spacing: 0.01em; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn.secondary { background: var(--surface); color: var(--navy); border: 1px solid var(--border); }
.btn.accent { background: var(--accent); box-shadow: 0 4px 12px rgba(184,137,79,0.25); }
.btn.danger { background: #c0392b; }

/* ---------- Mobile nav toggle ---------- */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; height: 2px; width: 22px; background: var(--navy); border-radius: 2px; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: fixed; inset: 65px 0 0 0; background: var(--surface);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 24px; overflow-y: auto;
    z-index: 49; box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-links form, .nav-links .btn { width: 100%; }
  .nav-links a { padding: 14px 4px; border-bottom: 1px solid var(--border); font-size: 16px; }
  .nav-links .country-switcher { margin: 12px 0; }
  .nav-links .country-switcher select { width: 100%; padding: 12px; }
  .nav-links .btn.accent { justify-content: center; margin-top: 8px; padding: 14px; }
}

/* ---------- Sticky consultation CTA ---------- */
.sticky-cta {
  position: fixed; bottom: 20px; right: 20px; z-index: 60;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
@media (max-width: 640px) {
  .sticky-cta {
    left: 16px; right: 16px; bottom: 14px; width: auto;
    justify-content: center; text-align: center;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 420px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.62) 100%);
}
.hero-content { position: relative; z-index: 1; width: 100%; padding: 40px 0; color: #fff; }
.hero h1 { font-size: 34px; margin: 0 0 6px; font-weight: 600; }
.hero p.sub { margin: 0 0 20px; opacity: 0.9; font-size: 15px; }

.search-bar {
  background: var(--surface); border-radius: var(--radius-lg); padding: 10px;
  display: flex; gap: 8px; flex-wrap: wrap; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.search-bar select, .search-bar input {
  border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; font-size: 14px;
}
.search-bar input[type="text"] { flex: 1; min-width: 180px; }

@media (max-width: 640px) {
  .hero { min-height: 340px; }
  .hero h1 { font-size: 26px; }
  .hero p.sub { font-size: 14px; }
  .search-bar { flex-direction: column; padding: 12px; }
  .search-bar select, .search-bar input, .search-bar button { width: 100%; }
}

/* ---------- Listing cards ---------- */
.listing-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
/* UK layout adapts to a denser 4-up grid with smaller cards */
body[data-country="UK"] .listing-grid.region-adaptive {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease; box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

@media (max-width: 480px) {
  .listing-grid { grid-template-columns: 1fr; }
}
.card .photo { height: 190px; background-size: cover; background-position: center; position: relative; }
.card .photo .tag {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.65); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
}
.card .body { padding: 14px 16px; }
.card .price { font-size: 18px; font-weight: 700; color: var(--navy); }
.card .facts { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.card .addr { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.card .epc { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: #e8f5e0; color: #2f6b1f; }

/* ---------- Filters sidebar ---------- */
.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; position: sticky; top: 90px; }
.filters h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.filters .field { margin-bottom: 14px; }
.filters label { display: block; font-size: 13px; margin-bottom: 5px; }
.filters select, .filters input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
@media (max-width: 820px) { .search-layout { grid-template-columns: 1fr; } .filters { position: static; } }
@media (max-width: 640px) {
  .filters { padding: 14px; }
}

/* ---------- Property detail page ---------- */
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; border-radius: var(--radius-lg); overflow: hidden; height: 420px; }
.gallery .main { background-size: cover; background-position: center; cursor: pointer; }
.gallery .side { display: grid; grid-template-rows: 1fr 1fr; gap: 8px; }
.gallery .side div { background-size: cover; background-position: center; cursor: pointer; position: relative; }
.gallery .main, .gallery .side div { transition: filter 0.15s ease; }
.gallery .main:hover, .gallery .side div:hover { filter: brightness(0.9); }
.gallery-more-badge {
  position: absolute; inset: 0; background: rgba(16,25,47,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; letter-spacing: 0.01em;
}
.pdp-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; margin-top: 28px; align-items: start; }
@media (max-width: 900px) { .pdp-layout { grid-template-columns: 1fr; } }
.fact-row { display: flex; gap: 26px; flex-wrap: wrap; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 18px 0; }
.fact { font-size: 14px; }
.fact strong { display: block; font-size: 18px; color: var(--navy); }
.agent-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.agent-card .name { font-weight: 700; font-size: 17px; font-family: var(--font-display); }
.agent-card .role { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.agent-card label { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 5px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.agent-card input, .agent-card textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  font-family: var(--font-body); background: var(--bg); transition: border-color 0.15s ease, background 0.15s ease;
}
.agent-card input:focus, .agent-card textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
}
.agent-card textarea { min-height: 90px; resize: vertical; }

@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr; height: auto; gap: 6px; }
  .gallery .main { height: 220px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .gallery .side { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .gallery .side div { height: 100px; }
  .fact-row { gap: 16px 22px; }
}

/* ---------- Map ---------- */
.map-box { height: 320px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
@media (max-width: 640px) { .map-box { height: 260px; } }

/* ---------- Photo lightbox ---------- */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100; background: rgba(10,12,20,0.94);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 88vw; max-height: 84vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox-close {
  position: absolute; top: 18px; right: 22px; background: none; border: none; color: #fff;
  font-size: 34px; line-height: 1; cursor: pointer; opacity: 0.85;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1);
  border: none; color: #fff; font-size: 30px; width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s ease;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-counter {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.85); font-size: 13px; letter-spacing: 0.03em;
}
@media (max-width: 640px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 24px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ---------- Forms ---------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; max-width: 560px; }
@media (max-width: 640px) { .form-card { padding: 18px; } }
.form-card label { display: block; font-size: 13px; margin: 12px 0 5px; font-weight: 600; }
.form-card input, .form-card select, .form-card textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.form-card textarea { min-height: 100px; resize: vertical; }
.notice { padding: 12px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.notice.success { background: #e6f6ea; color: #1e7a34; }
.notice.error { background: #fdecea; color: #c0392b; }

/* ---------- Description read more/less ---------- */
.description-wrap { position: relative; }
.description-text.clamped {
  max-height: 8.6em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 60px; padding: 30px 0; background: var(--navy); color: rgba(255,255,255,0.75); font-size: 13px; }
.site-footer a { color: #fff; }

section.block { padding: 40px 0; }
section.block h2 { font-size: 22px; margin-bottom: 18px; }
