:root {
  --primary: #1F3D2E;
  --secondary: #143025;
  --accent: #A88B4A;
  --cream: #EFE6D2;
  --paper: #FBF7EA;
  --ink: #1A1A1A;
  --muted: #5e5b54;
  --line: #d8cfb6;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; color: var(--primary); }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: 0 0 0.5em; }
h3 { font-size: 1.4rem; margin: 0 0 0.4em; }
a { color: var(--primary); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
a:hover { border-bottom-color: var(--accent); }

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.brand-mark { display: flex; align-items: center; gap: 12px; border: 0; }
.brand-mark img, .brand-mark svg { height: 38px; width: auto; }
.brand-mark .name { font-family: var(--serif); font-size: 1.45rem; color: var(--primary); letter-spacing: 0.02em; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { font-size: 0.92rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); border: 0; }
.nav a:hover { color: var(--accent); }
.btn-call {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--accent);
  padding: 9px 18px; border-radius: 2px;
  border: 1px solid var(--accent);
  font-family: var(--sans); font-size: 0.86rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: background .2s, color .2s;
}
.btn-call:hover { background: var(--accent); color: var(--paper); }
.btn-call::before { content: "☎"; font-size: 0.95rem; }

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
  padding: 96px 0 88px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("/images/hero-pattern.svg");
  background-position: center; background-repeat: no-repeat; background-size: cover;
  opacity: 0.06; pointer-events: none;
}
.hero .container { position: relative; }
.eyebrow { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.hero p.lede { font-size: 1.2rem; color: var(--muted); max-width: 620px; margin: 0 0 32px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 14px 28px; border-radius: 2px;
  font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--primary); cursor: pointer; transition: all .2s; border-bottom: 1px solid var(--primary);
}
.btn-primary { background: var(--primary); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: var(--paper); }

/* Sections */
section { padding: 80px 0; }
section.alt { background: var(--cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head .rule { width: 60px; height: 1px; background: var(--accent); margin: 0 auto 18px; }
.section-head p { color: var(--muted); max-width: 620px; margin: 0 auto; }

/* Listings grid */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 36px; }
.listing-card { background: var(--paper); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; cursor: pointer; }
.listing-card:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(15,31,58,0.10); }
.listing-card .photo { aspect-ratio: 3/2; background: var(--cream) center/cover; position: relative; }
.listing-card .badge { position: absolute; top: 14px; left: 14px; background: var(--primary); color: var(--paper); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 5px 10px; }
.listing-card .body { padding: 22px 24px 26px; }
.listing-card h3 { font-family: var(--serif); font-size: 1.4rem; color: var(--primary); margin: 0 0 6px; }
.listing-card .addr { color: var(--muted); font-size: 0.92rem; margin: 0 0 14px; }
.listing-card .price { font-family: var(--serif); font-size: 1.5rem; color: var(--accent); margin: 0 0 10px; }
.listing-card .specs { display: flex; gap: 14px; color: var(--muted); font-size: 0.86rem; padding-top: 14px; border-top: 1px solid var(--line); }
.listing-card .specs span { display: inline-flex; align-items: center; gap: 5px; }

/* Listing detail */
.listing-hero { aspect-ratio: 16/9; background: var(--cream) center/cover; }
.listing-detail { padding: 56px 0; }
.listing-detail h1 { margin-bottom: 8px; }
.listing-detail .price { font-family: var(--serif); font-size: 2rem; color: var(--accent); margin: 0 0 24px; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 28px 0; }
.spec-grid div .label { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.spec-grid div .val { font-family: var(--serif); font-size: 1.4rem; color: var(--primary); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 28px 0; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: pointer; }

/* Forms */
.form { display: grid; gap: 18px; max-width: 560px; }
.form label { display: block; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); background: var(--paper);
  font-family: var(--sans); font-size: 1rem; color: var(--ink); border-radius: 2px;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--primary); }
.form textarea { min-height: 140px; resize: vertical; }

/* Footer */
.site-footer { background: var(--primary); color: var(--cream); padding: 56px 0 32px; }
.site-footer .grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer h4 { color: var(--cream); font-family: var(--serif); font-size: 1.1rem; margin: 0 0 14px; }
.site-footer a { color: var(--cream); border-bottom: 0; }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal { border-top: 1px solid rgba(244,237,225,0.15); padding-top: 24px; font-size: 0.82rem; color: rgba(244,237,225,0.7); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
@media (max-width: 720px) { .site-footer .grid { grid-template-columns: 1fr; } .nav { display: none; } }

/* Admin */
.admin-shell { min-height: 100vh; background: var(--paper); }
.admin-bar { background: var(--primary); color: var(--cream); padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; }
.admin-bar a { color: var(--cream); border: 0; }
.admin-bar .who { font-size: 0.86rem; opacity: 0.75; }
.admin-main { padding: 40px 28px; max-width: 1180px; margin: 0 auto; }
.admin-listings { display: grid; gap: 14px; }
.admin-listing-row { display: grid; grid-template-columns: 80px 1fr auto auto auto auto; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); background: var(--paper); }
.admin-listing-row .thumb { width: 80px; height: 60px; background: var(--cream) center/cover; }
.admin-listing-row .title { font-family: var(--serif); font-size: 1.15rem; color: var(--primary); }
.admin-listing-row .meta { color: var(--muted); font-size: 0.86rem; }
.tag { display: inline-block; padding: 3px 10px; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; background: var(--cream); color: var(--primary); }
.tag.draft { background: #f0e6d2; }
.tag.sold, .tag.rented { background: #e0e7d8; }

.btn-sm { padding: 7px 14px; font-size: 0.78rem; }
.btn-danger { border-color: #8a1f1f; color: #8a1f1f; background: transparent; }
.btn-danger:hover { background: #8a1f1f; color: var(--paper); }

.media-uploader { border: 2px dashed var(--line); padding: 28px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.media-uploader:hover, .media-uploader.drag { border-color: var(--accent); background: var(--cream); }
.media-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.media-item { position: relative; aspect-ratio: 4/3; background: var(--cream) center/cover; border: 1px solid var(--line); }
.media-item.is-hero { outline: 2px solid var(--accent); }
.media-item video { width: 100%; height: 100%; object-fit: cover; }
.media-item .controls { position: absolute; bottom: 4px; right: 4px; display: flex; gap: 4px; }
.media-item button { background: rgba(15,31,58,0.85); color: var(--cream); border: 0; padding: 4px 8px; font-size: 0.7rem; cursor: pointer; }
.media-item .badge-video { position: absolute; top: 6px; left: 6px; background: var(--primary); color: var(--cream); font-size: 0.66rem; padding: 2px 6px; letter-spacing: 0.1em; text-transform: uppercase; }

.toast { position: fixed; bottom: 28px; right: 28px; background: var(--primary); color: var(--cream); padding: 14px 22px; box-shadow: 0 12px 36px rgba(0,0,0,0.2); animation: slideIn .25s; }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.hidden { display: none !important; }
