:root {
  --ink: #221910;
  --muted: #6b5b4d;
  --paper: #f6efe3;
  --card: #fffaf2;
  --line: #d8c8b4;
  --green: #1d4a38;
  --green-deep: #123226;
  --copper: #c25b2c;
  --gold: #e4c48a;
  --shadow: 0 18px 40px rgba(34, 25, 16, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(226, 196, 138, 0.35), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(29, 74, 56, 0.16), transparent 32%),
    #e8dcc9;
  font-family: Outfit, sans-serif;
}

.paper {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 64px;
}

.hero {
  padding: 18px 8px 8px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--copper);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}

h1 {
  margin: 0;
  max-width: 14ch;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

h1 em {
  font-style: italic;
  color: var(--green);
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.search {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-top: 28px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span,
.sources legend {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.grow {
  flex: 1;
}

.field input,
.field select,
.price-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
}

.field input,
.field select {
  padding: 13px 14px;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.price {
  width: 180px;
}

.beds {
  width: 140px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
}

.price-row {
  display: flex;
  align-items: center;
  padding-left: 12px;
}

.price-row span {
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-size: 1rem;
}

.price-row input {
  border: 0;
  outline: none;
}

button {
  font: inherit;
  cursor: pointer;
}

#search-btn,
.contact-btn,
.open-link,
.lightbox-close {
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: #f7f1e7;
  padding: 13px 18px;
  font-weight: 600;
}

#search-btn:hover,
.contact-btn:hover,
.open-link:hover,
.lightbox-close:hover {
  background: var(--green-deep);
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.sources label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.status[hidden],
.lightbox[hidden] {
  display: none;
}

.source-pill {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}

.source-pill strong {
  display: block;
  font-size: 0.95rem;
}

.source-pill span {
  color: var(--muted);
  font-size: 0.85rem;
}

.source-pill.error {
  border-color: #d9a394;
  background: #fff1ea;
}

.results {
  display: grid;
  gap: 22px;
}

.card {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.gallery {
  position: relative;
  min-height: 280px;
  background: #d7c3a6;
}

.badge-photo {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  box-shadow: 0 6px 16px rgba(34, 25, 16, 0.18);
}

.gallery > .hero-photo {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  cursor: zoom-in;
}

.thumbs {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  overflow: auto;
}

.thumbs button {
  width: 52px;
  height: 40px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0.78;
}

.thumbs button.active,
.thumbs button:hover {
  opacity: 1;
}

.thumbs img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.no-photo {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), #3d6a4f);
}

.details {
  padding: 22px 24px 20px;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.card-index {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.place-flag {
  display: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--copper);
  color: #fffaf2;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card.is-place {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(194, 91, 44, 0.28), var(--shadow);
}

.card.is-place .place-flag {
  display: inline-flex;
}

.badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: #efe3d0;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 600;
}

.price-tag {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.details h2 {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  line-height: 1.2;
}

.facts,
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3e7d4;
  color: var(--ink);
  font-size: 0.88rem;
}

.chip-phone {
  background: #dce8df;
  color: var(--green-deep);
  font-weight: 600;
}

.contact-btn,
.open-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.open-link {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}

.place-btn {
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  padding: 13px 18px;
  font-weight: 600;
}

.place-btn:hover,
.place-btn[aria-pressed='true'] {
  border-color: var(--copper);
  border-style: solid;
  color: var(--copper);
  background: #fff4ea;
}

#place-jump {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 15;
  border: 0;
  border-radius: 14px;
  background: var(--copper);
  color: #fffaf2;
  padding: 13px 18px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

#place-jump[hidden] {
  display: none;
}

.empty,
.note {
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(18, 12, 8, 0.86);
  padding: 28px;
  z-index: 20;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 86vh;
  border-radius: 12px;
}

.lightbox img:not([src]),
.lightbox img[src=''] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
  padding: 18px 8px 8px;
}

.site-footer a {
  color: var(--muted);
  font-size: 0.88rem;
}

.legal {
  max-width: 72ch;
}

.legal h1 {
  max-width: none;
  font-size: clamp(2.4rem, 6vw, 4rem);
}

.legal h2 {
  margin: 28px 0 10px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
}

.legal p,
.legal li {
  color: var(--ink);
  line-height: 1.65;
}

.legal ul {
  padding-left: 1.2em;
}

.legal a {
  color: var(--green);
}

@media (max-width: 800px) {
  .search,
  .card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .search {
    display: grid;
  }

  .price,
  .beds,
  #search-btn {
    width: 100%;
  }
}
