/* ============================================================
   clawson.world — Light / Minimal redesign
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg:           #f5f2ed;
  --surface:      #ffffff;
  --surface-soft: rgba(255,255,255,0.92);
  --border:       rgba(0,0,0,0.08);
  --border-mid:   rgba(0,0,0,0.12);
  --text:         #1a1916;
  --text-muted:   #7a776e;
  --accent:       #1a1916;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);
  --font-serif:   'Lora', Georgia, serif;
  --font-sans:    'DM Sans', system-ui, sans-serif;
  --topbar-h:     58px;
  --strip-h:      48px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Full-screen map ─────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--surface-soft);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
  user-select: none;
}

.brand-dot {
  color: var(--text-muted);
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.1px;
  margin-top: 1px;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.1px;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(0,0,0,0.05);
}

/* ── Category strip ──────────────────────────────────────── */
.category-strip {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  height: var(--strip-h);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  background: var(--surface-soft);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar { display: none; }

/* Category pill button */
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-mid);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}

.cat-pill:hover {
  background: #f0ede8;
}

/* Off state */
.cat-pill[aria-pressed="false"] {
  opacity: 0.42;
  border-color: transparent;
  box-shadow: none;
}

.cat-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.cat-label {
  /* label text */
}

.cat-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Floating toolbar (bottom-right) ─────────────────────── */
.toolbar {
  position: fixed;
  bottom: 28px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  overflow: hidden;
}

.tool-btn {
  width: 40px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  margin: 0 4px;
  transition: color 0.15s, background 0.15s;
}

.tool-btn:hover {
  color: var(--text);
  background: rgba(0,0,0,0.05);
}

.tool-btn.active {
  color: var(--text);
  background: rgba(0,0,0,0.07);
}

.tool-divider {
  width: 24px;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.tool-count {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 8px;
  letter-spacing: 0.1px;
}

/* ── Search panel ────────────────────────────────────────── */
.search-panel {
  position: fixed;
  bottom: 28px;
  right: 70px; /* clears the toolbar */
  z-index: 199;
  width: min(340px, calc(100vw - 90px));
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;

  /* Collapsed state */
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom right;
  transition: max-height 0.22s ease, opacity 0.18s ease, transform 0.18s ease;
}

.search-panel.open {
  max-height: 400px;
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

.search-inner {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-field-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-mid);
  background: #f9f7f4;
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-field {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  min-width: 0;
}

.search-field::placeholder {
  color: var(--text-muted);
}

.search-clear {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  padding: 2px;
  border-radius: 4px;
}

.search-clear:hover { color: var(--text); }

/* Search results list */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}

.search-result-item:hover {
  background: #f0ede8;
}

.result-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.result-title {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-cat {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.search-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  font-style: italic;
}

.only-matches-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  user-select: none;
}

.only-matches-check {
  accent-color: var(--text);
}

/* ── Status bar ──────────────────────────────────────────── */
.status-bar {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.status-bar.visible {
  opacity: 1;
}

/* ── Leaflet overrides ───────────────────────────────────── */
.leaflet-control-zoom {
  border: 1px solid var(--border-mid) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: var(--font-sans) !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
}

.leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
  background: #f0ede8 !important;
}

.leaflet-control-attribution {
  font-family: var(--font-sans) !important;
  font-size: 10px !important;
  background: var(--surface-soft) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  padding: 2px 8px !important;
}

.leaflet-control-attribution a {
  color: var(--text-muted) !important;
}

/* Popups */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  border: 1px solid var(--border-mid) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text) !important;
  font-family: var(--font-sans) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  font-family: var(--font-sans) !important;
}

.leaflet-popup-tip {
  background: var(--surface) !important;
}

.leaflet-popup-close-button {
  color: var(--text-muted) !important;
  font-size: 16px !important;
  top: 8px !important;
  right: 10px !important;
}

.leaflet-popup-close-button:hover {
  color: var(--text) !important;
  background: none !important;
}

/* Pin dot */
.pinDot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 1px 5px rgba(0,0,0,0.25);
}

/* Cluster overrides to match light theme */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(255,255,255,0.7) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(26,25,22,0.85) !important;
  color: #fff !important;
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}

/* ── Popup inner styles ───────────────────────────────────── */
.popup-inner {
  padding: 14px 16px;
  min-width: 200px;
  max-width: 260px;
}

.popup-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
}

.popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.popup-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0ede8;
  color: var(--text-muted);
}

.popup-date {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0;
}

.popup-notes {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  margin-top: 6px;
}

.popup-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-mid);
  padding-bottom: 1px;
}

.popup-link:hover {
  border-color: var(--text);
}

.popup-gmaps-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Brand stacked layout ────────────────────────────────── */
.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* ── Mobile adjustments ──────────────────────────────────── */
@media (max-width: 600px) {
  .nav-links {
    gap: 2px;
  }

  .nav-link {
    font-size: 11px;
    padding: 4px 7px;
  }

  .topbar {
    padding: 0 14px;
  }

  .category-strip {
    padding: 0 14px;
  }

  .toolbar {
    bottom: 20px;
    right: 14px;
  }

  .search-panel {
    bottom: 20px;
    right: 66px;
    width: calc(100vw - 84px);
  }
}
