/* =========================================================================
   LeParvis · Design system
   ========================================================================= */

:root {
  --bg: #f7f4ee;
  --bg-deep: #ede5d4;
  --paper: #ffffff;
  --paper-2: #fdfaf3;
  --ink: #2b2118;
  --ink-soft: #5a4a3c;
  --ink-muted: #8a7a6b;
  --accent: #8b1a1a;
  --accent-soft: #b13a3a;
  --accent-bg: #fbf3f0;
  --gold: #b78e3a;
  --gold-bg: #faf3df;
  --green: #2d6a4f;
  --green-bg: #e8f3ed;
  --line: #e6dfd4;
  --line-strong: #d4c8b4;
  --shadow-sm: 0 1px 2px rgba(43, 33, 24, 0.06);
  --shadow-md: 0 6px 22px rgba(43, 33, 24, 0.10);
  --shadow-lg: 0 18px 50px rgba(43, 33, 24, 0.18);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --serif: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.link-muted { color: var(--ink-soft); font-size: 13px; }

/* =========================================================================
   Top bar
   ========================================================================= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand-block { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 22px; }
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.topbar-nav { display: flex; align-items: center; gap: 16px; }
.api-pill {
  display: inline-flex;
  align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 2px 4px;
}
.api-pill input {
  background: transparent;
  border: none;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-muted);
  width: 200px;
  padding: 4px 8px;
  outline: none;
}

/* =========================================================================
   Hero
   ========================================================================= */

.hero {
  position: relative;
  background:
    radial-gradient(ellipse at top, var(--paper-2) 0%, var(--bg) 60%),
    var(--bg);
  padding: 60px 24px 48px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::before, .hero::after {
  /* subtle decorative crosses */
  content: "✦";
  position: absolute;
  font-size: 14px;
  color: var(--gold);
  opacity: 0.35;
}
.hero::before { top: 22px; left: 50%; transform: translateX(-50%); }
.hero::after  { bottom: 18px; left: 50%; transform: translateX(-50%); }

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 76px);
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
  line-height: 1;
}
.hero-tagline {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--ink-soft);
}
.hero-divider { color: var(--gold); padding: 0 6px; }

.search-shell {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: var(--paper);
  padding: 6px 6px 6px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.search-shell:focus-within {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.search-icon { font-size: 18px; opacity: 0.6; flex-shrink: 0; }
.search-shell input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--ink);
  padding: 10px 4px;
  font-family: inherit;
}
.search-submit {
  border-radius: var(--radius-pill);
  padding: 10px 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

/* =========================================================================
   Buttons & chips
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--paper-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn-secondary {
  background: var(--paper);
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover { background: var(--accent-bg); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.12s ease;
  box-shadow: var(--shadow-sm);
}
.chip-btn:hover {
  background: var(--paper-2);
  border-color: var(--gold);
  color: var(--accent);
}
.chip-btn-muted { color: var(--ink-muted); }
.chip-count {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}

/* =========================================================================
   Results
   ========================================================================= */

.results-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.results-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.results-title #results-count { color: var(--accent); }
.results-title .results-label {
  font-size: 16px;
  color: var(--ink-muted);
  font-weight: 400;
  font-style: italic;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper);
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.view-toggle button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.view-toggle button.active {
  background: var(--ink);
  color: #fff;
}

/* =========================================================================
   State cards (loading / empty / error)
   ========================================================================= */

.state-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  margin-bottom: 16px;
}
.state-emoji { font-size: 40px; margin-bottom: 12px; }
.state-card h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.state-card p { margin: 0; color: var(--ink-muted); }

.loading-dots {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 12px;
}
.loading-dots span {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* =========================================================================
   List view & cards
   ========================================================================= */

.list-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  /* thin accent gold stripe on the left */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.card:hover::before { opacity: 1; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.card .name {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.card .meta {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.card .celebrations {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.card .celebrations li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 14px;
}
.card .celebrations li:last-child { border-bottom: 0; }
.card .celebrations .time {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  min-width: 120px;
}
.card .celebrations .label { color: var(--ink-soft); }
.card .celebrations .extra {
  font-size: 11px;
  color: var(--gold);
  background: var(--gold-bg);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-left: 4px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-top: auto;
  padding-top: 8px;
}
.card-footer .website {
  color: var(--accent);
  font-weight: 500;
}
.card-footer .distance {
  color: var(--ink-muted);
  font-style: italic;
  font-size: 12px;
}

/* =========================================================================
   Map view
   ========================================================================= */

.map-view {
  height: calc(100vh - 360px);
  min-height: 460px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* =========================================================================
   Filter slide-over
   ========================================================================= */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 33, 24, 0.45);
  z-index: 90;
  animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.filter-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--paper);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slide-in 0.22s ease-out;
}
@keyframes slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.filter-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--accent);
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--ink); }

.filter-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}

.filter-section {
  margin-bottom: 22px;
}
.filter-section h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ink-muted);
}

.row { display: flex; gap: 8px; }
.row > label { flex: 1; }

.filter-section label { display: block; margin-bottom: 8px; }
.filter-section label > span {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.filter-section input,
.filter-section select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.filter-section input:focus,
.filter-section select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.chip:hover { border-color: var(--gold); }
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.filter-section.ingest {
  border-top: 1px dashed var(--gold);
  padding-top: 18px;
  margin-top: 22px;
}
.filter-section.ingest summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
}
.filter-section.ingest .hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 6px 0 10px;
  line-height: 1.4;
}
.ingest-output {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: var(--paper-2);
  padding: 8px;
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  margin-top: 10px;
}

.filter-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 720px) {
  .topbar { padding: 10px 16px; }
  .api-pill { display: none; }
  .hero { padding: 40px 16px 32px; }
  .results-shell { padding: 20px 16px 60px; }
  .results-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .search-shell { flex-direction: column; padding: 12px; border-radius: var(--radius); }
  .search-shell input { width: 100%; padding: 8px 0; }
  .search-submit { width: 100%; }
  .map-view { height: 70vh; }
}
