/* WhatAFind — vintage-leaning palette */
:root {
  --bg: #f5efe2;
  --paper: #faf6ec;
  --ink: #2c2418;
  --ink-soft: #5d4f3a;
  --accent: #b8541b;
  --accent-soft: #e8a474;
  --rule: #d8cdb4;
  --shadow: 0 1px 3px rgba(44, 36, 24, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Georgia', 'Cambria', serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: var(--paper);
  border-bottom: 2px solid var(--rule);
  padding: 0.75rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}
.brand { display: flex; align-items: baseline; gap: 0.5rem; }
.brand .logo { color: var(--accent); font-size: 1.6rem; line-height: 1; }
.brand .name {
  font-family: 'Georgia', serif;
  font-weight: bold;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.filters input[type="search"], .filters select {
  font: inherit;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--rule);
  background: white;
  color: var(--ink);
  border-radius: 3px;
  min-width: 180px;
}
.filters input[type="search"]:focus, .filters select:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}
.checkbox { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; font-size: 0.9rem; color: var(--ink-soft); }
.meta { font-size: 0.8rem; color: var(--ink-soft); font-style: italic; }
.header-nav a { color: var(--accent); text-decoration: none; font-size: 0.9rem; font-weight: bold; }
.header-nav a:hover { text-decoration: underline; }

/* Main */
main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 420px;
  min-height: 0;
}
#map { width: 100%; height: 100%; background: #e0d8c4; }
#list-pane {
  background: var(--paper);
  border-left: 2px solid var(--rule);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.list-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 1;
  font-style: italic;
}
#list { display: flex; flex-direction: column; }

/* Sale card */
.sale {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 120ms;
}
.sale:hover { background: rgba(184, 84, 27, 0.05); }
.sale.active { background: rgba(184, 84, 27, 0.1); border-left: 3px solid var(--accent); padding-left: calc(1rem - 3px); }
.sale__img {
  width: 80px; height: 80px;
  background: var(--bg) center/cover no-repeat;
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.sale__img.placeholder { display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 1.5rem; }
.sale__body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.sale__name {
  font-weight: bold;
  font-size: 0.95rem;
  line-height: 1.25;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sale__meta { font-size: 0.78rem; color: var(--ink-soft); }
.sale__meta .badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  border-radius: 2px;
  margin-right: 0.4rem;
  font-style: normal;
}
.sale__meta .badge.virtual { background: var(--ink-soft); }
.sale__location { font-size: 0.78rem; color: var(--ink-soft); }
.sale__dates { font-size: 0.75rem; color: var(--ink-soft); }
.sale__org { font-size: 0.72rem; color: var(--ink-soft); font-style: italic; }

/* Map popup */
.leaflet-popup-content-wrapper {
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.popup__name { font-weight: bold; font-size: 0.9rem; margin-bottom: 0.25rem; }
.popup__meta { font-size: 0.78rem; color: var(--ink-soft); }
.popup__link { display: inline-block; margin-top: 0.4rem; color: var(--accent); font-size: 0.8rem; }

/* Mobile */
@media (max-width: 800px) {
  header { grid-template-columns: 1fr; gap: 0.75rem; }
  main { grid-template-columns: 1fr; grid-template-rows: 50vh 1fr; }
  #list-pane { border-left: none; border-top: 2px solid var(--rule); }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input[type="search"], .filters select { width: 100%; min-width: 0; }
}
