/* The Pinner Map — Low Tide Media-style paper map, GMP palette. */
:root {
  --ink: #2A2A28;
  --cream: #F3EDE3;
  --paper: #FFFDF8;
  --mustard: #E2B83A;
  --teal: #7E9DAB;
  --terracotta: #A85A3B;
  --muted: #5F5B52;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body.map-page {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
}
a { color: inherit; }

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--cream);
  z-index: 0;
}

.map-ui {
  position: absolute;
  inset: 0;
  z-index: 800;
  pointer-events: none;
}

/* Floating site bar — always above the tiles, top-left. */
.map-brandbar {
  position: absolute;
  top: 12px;
  left: 20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 11px 8px;
  background: var(--cream); /* #F3EDE3 */
  border: 2px solid var(--ink); /* #2A2A28 */
  box-shadow: 4px 4px 0 var(--ink);
  border-radius: 6px;
  pointer-events: auto;
}
.map-brandbar__brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.map-brandbar__brand:hover { color: var(--terracotta); }
.map-brandbar__subscribe {
  padding-left: 12px;
  border-left: 1px solid rgba(42, 42, 40, .28);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--terracotta);
  text-decoration: none;
}
.map-brandbar__subscribe:hover { color: var(--ink); }

/* Floating header + day chips */
.map-topbar {
  position: absolute;
  top: 66px;
  left: 20px;
  width: min(430px, calc(100vw - 40px));
  pointer-events: auto;
}
.map-heading,
.legend-card,
.subscribe-card {
  background: var(--cream);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.map-heading { padding: 14px 18px 16px; margin-bottom: 12px; }
.map-heading .section-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.map-heading h1 {
  margin: 4px 0 5px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.85rem;
  line-height: 1.1;
}
.map-heading p { margin: 0; font-size: .82rem; line-height: 1.4; color: var(--muted); }

.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 9px;
  font: 800 11px/1 'DM Sans', sans-serif;
  letter-spacing: .07em;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.day-chip:hover { transform: translate(-1px, -1px); }
.day-chip.is-active { background: var(--mustard); box-shadow: 2px 2px 0 var(--ink), inset 0 0 0 2px var(--cream); }
/* Every chip is always active — the rolling window never has a past/disabled day. */
.day-chip .chip-count { font-size: 9px; opacity: .7; letter-spacing: 0; }
.day-chip--all { background: var(--paper); }

/* Bottom cards */
.rail-panel {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  pointer-events: none;
}
.rail-head { display: none; }
.rail-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.legend-card,
.subscribe-card {
  pointer-events: auto;
  padding: 13px 15px;
  max-width: 320px;
}
.legend-card { width: 240px; }
.subscribe-card { width: 300px; }
.legend-card h2,
.subscribe-card h2 {
  margin: 0 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
}
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legend-list li { display: flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 600; }
.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--mustard);
}
.legend-dot--community { background: var(--teal); }
.legend-count { margin: 10px 0 4px; font-size: .8rem; }
.legend-foot { margin: 0; font-size: .72rem; color: var(--muted); line-height: 1.35; }
.map-attribution {
  margin: 9px 0 0;
  padding-top: 7px;
  border-top: 1px solid rgba(42, 42, 40, .2);
  font-size: .66rem;
  line-height: 1.35;
  color: var(--muted);
}
.map-attribution a { text-decoration: underline; }
.subscribe-card p { margin: 0 0 10px; font-size: .8rem; line-height: 1.4; color: var(--muted); }
.subscribe-link {
  display: inline-block;
  padding: 9px 12px;
  background: var(--ink);
  color: var(--cream);
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}
.subscribe-link:hover { background: var(--terracotta); }

/* Pins */
.gmp-pin-wrap { background: transparent; border: 0; }
.gmp-pin {
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--mustard);
  box-shadow: 1px 1px 0 rgba(42, 42, 40, .45);
}
.gmp-pin--community { background: var(--teal); }

/* Brand popups */
.leaflet-popup.gmp-popup .leaflet-popup-content-wrapper {
  background: var(--cream);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 0;
}
.leaflet-popup.gmp-popup .leaflet-popup-content {
  margin: 0;
  padding: 13px 15px 14px;
  width: auto !important;
  min-width: 190px;
  max-width: 250px;
  font-family: 'DM Sans', sans-serif;
}
.leaflet-popup.gmp-popup .leaflet-popup-tip {
  background: var(--cream);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42, 42, 40, .2);
}
.leaflet-popup.gmp-popup a.leaflet-popup-close-button { color: var(--ink); }
.popup-chip {
  display: inline-block;
  margin-bottom: 7px;
  padding: 3px 7px;
  background: var(--mustard);
  border: 1px solid var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.popup-chip--community { background: var(--teal); }
.popup-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}
.popup-meta { display: grid; gap: 2px; font-size: .78rem; line-height: 1.35; }
.popup-meta .popup-when { font-weight: 700; }
.popup-meta .popup-venue { color: var(--muted); }
.popup-link {
  display: inline-block;
  margin-top: 10px;
  padding-bottom: 1px;
  border-bottom: 2px solid var(--terracotta);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}
.popup-link:hover { color: var(--terracotta); }

/* Leaflet chrome */
.leaflet-container { font-family: 'DM Sans', sans-serif; background: var(--cream); }
.leaflet-control-zoom a {
  background: var(--cream) !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink) !important;
  border-bottom-width: 1px !important;
  font-weight: 800 !important;
}
.leaflet-control-zoom a:last-child { border-bottom-width: 2px !important; }
.leaflet-control-attribution {
  background: rgba(243, 237, 227, .9) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--ink) !important; }

/* Mobile: full-screen map + transform bottom sheet, same approach as the reference. */
@media (max-width: 820px) {
  #map { position: fixed; inset: 0; width: 100vw; height: 100dvh; }
  .map-ui { position: fixed; inset: 0; }
  .map-topbar { top: 58px; left: 12px; right: 12px; width: auto; }
  .map-brandbar { top: 10px; left: 12px; padding: 6px 9px; gap: 9px; }
  .map-brandbar__brand { font-size: .9rem; }
  .map-brandbar__subscribe { padding-left: 9px; font-size: 9px; }
  .map-heading { padding: 10px 13px; margin-bottom: 8px; }
  .map-heading h1 { font-size: 1.35rem; }
  .map-heading p { font-size: .74rem; }
  .day-chips { gap: 5px; }
  .day-chip { padding: 7px 8px; font-size: 10px; box-shadow: 1px 1px 0 var(--ink); }

  .rail-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: 78dvh;
    background: var(--cream);
    border: 2px solid var(--ink);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 16px rgba(42, 42, 40, .18);
    pointer-events: auto;
    transform: translateY(calc(100% - 64px));
    transition: transform .25s ease;
    z-index: 1000;
  }
  .rail-panel.rail-open { transform: translateY(0); }
  .rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: 64px;
    padding: 0 16px;
    background: transparent;
    border: 0;
    color: var(--ink);
    font: 800 .82rem/1.2 'DM Sans', sans-serif;
    text-align: left;
    cursor: pointer;
  }
  .rail-pill { flex: 1; }
  .rail-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--mustard);
    font-size: 15px;
    line-height: 1;
    transition: transform .25s ease;
  }
  .rail-open .rail-arrow { transform: rotate(180deg); }
  .rail-body {
    display: grid;
    gap: 12px;
    max-height: calc(78dvh - 64px);
    overflow-y: auto;
    padding: 0 14px 18px;
  }
  .legend-card,
  .subscribe-card { width: auto; max-width: none; box-shadow: none; }
  .leaflet-control-zoom { margin-top: 8px !important; }
}
