/* Meanfeast stall map — theme drawn from the festival poster:
   burnt orange ground, marigold accents, cream chunky type with
   hard dark-green offset shadows, stitched-border motif. */

@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lilita-one-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-700.woff2") format("woff2");
}

:root {
  --orange: #c4501b;
  --orange-deep: #9e3d10;
  --gold: #eea320;
  --gold-deep: #d18a10;
  --cream: #f5efde;
  --cream-soft: #fbf7ea;
  --green: #1c2b1f;
  --green-soft: rgba(28, 43, 31, 0.65);
  --font-display: "Lilita One", "Arial Black", sans-serif;
  --font-body: "Poppins", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: var(--font-body);
  background: var(--green);
  color: var(--green);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
}

.noscript-warning {
  background: var(--gold);
  color: var(--green);
  font-weight: 600;
  text-align: center;
  padding: 14px 18px;
}

/* ---------- Header ---------- */

.site-header {
  flex: none;
  background: var(--orange);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 9px;
  padding-top: calc(10px + env(safe-area-inset-top));
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 7vw, 36px);
  line-height: 1;
  letter-spacing: 1.5px;
  color: var(--cream);
  text-shadow: 3px 3px 0 var(--green);
  transform: rotate(-1deg);
}

.brand .brand-alt {
  color: var(--gold);
}

.strapline {
  margin: 4px 0 0;
  font-size: clamp(10px, 2.9vw, 13px);
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--gold);
}

.doodles {
  font-size: 22px;
  letter-spacing: 8px;
  white-space: nowrap;
  opacity: 0.95;
}

@media (max-width: 479px) {
  .doodles {
    display: none;
  }
}

/* Stitched gold strip under the header, like the poster border */
.stitch {
  flex: none;
  height: 12px;
  background: var(--gold);
  position: relative;
}

.stitch::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: -1px;
  border-top: 2px dashed rgba(28, 43, 31, 0.6);
}

/* ---------- Map ---------- */

.map-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
  background: #e8e0cd;
}

/* Warm the standard OSM tiles slightly so they sit in the theme */
.leaflet-tile-pane {
  filter: saturate(0.88) sepia(0.16);
}

.leaflet-container {
  font-family: var(--font-body);
}

.leaflet-bottom {
  bottom: env(safe-area-inset-bottom);
}

/* ---------- Filter chips (overlay along the top of the map) ---------- */

.filters {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  gap: 8px;
  padding: 4px 12px 8px;
  overflow-x: auto;
  pointer-events: none;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  pointer-events: auto;
  flex: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  background: var(--cream);
  border: 2px solid var(--green);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--green);
  padding: 8px 14px;
  cursor: pointer;
  transition: transform 0.08s ease;
}

.chip:active {
  transform: translateY(2px);
  box-shadow: none;
}

.chip-active {
  background: var(--green);
  color: var(--cream);
}

/* ---------- Stall pins ---------- */

.stall-icon {
  background: none;
  border: none;
}

.stall-pin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream);
  border: 2.5px solid var(--green);
  box-shadow: 0 2px 0 rgba(28, 43, 31, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stall-pin-emoji {
  font-size: 17px;
  line-height: 1;
  transform: translateY(1px);
}

.stall-pin-tip {
  width: 0;
  height: 0;
  margin: -1px auto 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--green);
}

.stall-icon:hover .stall-pin {
  background: var(--cream-soft);
}

/* ---------- Venue pins (nearby places, not festival stalls) ----------
   Rounded-square "premises" shape so they read differently from the
   round stall pins. Promoted (paying) venues get a gold fill + star. */

.venue-pin {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--cream);
  border: 2.5px solid var(--green);
  box-shadow: 0 2px 0 rgba(28, 43, 31, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.venue-pin-promoted {
  background: var(--gold);
}

.venue-star {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--cream);
  border: 2px solid var(--green);
  font-size: 9px;
  line-height: 12px;
  text-align: center;
}

.venue-icon:hover .venue-pin {
  filter: brightness(1.03);
}

/* ---------- Popups ---------- */

.leaflet-popup-content-wrapper {
  background: var(--cream);
  color: var(--green);
  border: 3px solid var(--green);
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(28, 43, 31, 0.85);
}

.leaflet-popup-tip {
  background: var(--green);
}

.leaflet-popup-content {
  margin: 14px 18px;
}

.leaflet-popup-close-button {
  color: var(--green-soft) !important;
  font-size: 20px !important;
  padding: 6px 6px 0 0 !important;
}

.stall-popup h2 {
  margin: 0 0 7px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.1;
  color: var(--orange-deep);
}

.stall-tag {
  display: inline-block;
  background: var(--gold);
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
}

.stall-popup p {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Promoted venue's highlighted offer/event line */
.venue-promo {
  margin: 9px 0 0 !important;
  background: var(--gold);
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 700;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.stall-directions {
  display: inline-block;
  margin-top: 11px;
  background: var(--orange);
  color: var(--cream);
  border: 2px solid var(--green);
  border-radius: 10px;
  box-shadow: 0 2px 0 var(--green);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  padding: 7px 12px;
}

.stall-directions:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* ---------- Map controls ---------- */

.map-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  color: var(--green);
  border: 3px solid var(--green);
  box-shadow: 0 3px 0 var(--green);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.map-fab:active {
  transform: translateY(2px);
  box-shadow: none;
}

.locate-fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 22px;
}

.locate-fab.fab-active {
  background: var(--gold);
}

.list-fab {
  height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.6px;
}

.leaflet-bar {
  border: 3px solid var(--green);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--green);
  overflow: hidden;
}

.leaflet-touch .leaflet-bar {
  border: 3px solid var(--green);
}

.leaflet-bar a,
.leaflet-touch .leaflet-bar a {
  background: var(--cream);
  color: var(--green);
  width: 40px;
  height: 40px;
  line-height: 40px;
  font-size: 20px;
  font-weight: 700;
  border-bottom: 2px solid rgba(28, 43, 31, 0.25);
}

.leaflet-bar a:last-child {
  border-bottom: none;
}

.leaflet-bar a:hover {
  background: var(--cream-soft);
}

.leaflet-control-attribution {
  background: rgba(245, 239, 222, 0.85);
  color: var(--green-soft);
  font-size: 10px;
  border-radius: 8px 8px 0 0;
  padding: 2px 8px;
}

.leaflet-control-attribution a {
  color: var(--green);
}

/* ---------- Stall list sheet ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2900;
  background: rgba(28, 43, 31, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.sheet-open .sheet-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  background: var(--cream);
  border-top: 4px solid var(--green);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
  max-height: 72vh;
  max-height: 72dvh;
  display: flex;
  flex-direction: column;
  padding: 6px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform 0.28s ease;
}

body.sheet-open .sheet {
  transform: none;
}

.sheet-handle {
  flex: none;
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: rgba(28, 43, 31, 0.35);
  margin: 6px auto 10px;
}

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--green);
}

#sheet-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-soft);
}

.sheet-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.sheet-search {
  flex: none;
  margin: 12px 0 6px;
  width: 100%;
  padding: 11px 14px;
  border: 2.5px solid var(--green);
  border-radius: 12px;
  background: var(--cream-soft);
  font-family: var(--font-body);
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
  color: var(--green);
}

.sheet-search:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

.stall-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.stall-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  border-bottom: 2px dashed rgba(28, 43, 31, 0.22);
  padding: 12px 4px;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}

.stall-row:active {
  background: rgba(238, 163, 32, 0.18);
}

.stall-row-emoji {
  flex: none;
  font-size: 24px;
  line-height: 1;
}

.stall-row-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--green);
}

.stall-row-cat {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--orange-deep);
}

.stall-row-empty {
  padding: 18px 4px;
  font-size: 14px;
  color: var(--green-soft);
}

/* Nearby venues in the list — square emoji chip; promoted get a gold dot */
.stall-row-venue .stall-row-emoji {
  border-radius: 9px;
  background: var(--cream-soft);
  border: 2px solid rgba(28, 43, 31, 0.3);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

.stall-row-promoted .stall-row-emoji {
  background: var(--gold);
  border-color: var(--green);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  z-index: 3500;
  max-width: 88vw;
  background: var(--green);
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Wider screens ---------- */

@media (min-width: 820px) {
  .site-header {
    padding: 16px 28px 14px;
  }

  .filters {
    justify-content: center;
  }

  .sheet {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 400px;
    max-height: 72vh;
    border: 4px solid var(--green);
    border-radius: 22px;
    box-shadow: 8px 8px 0 rgba(28, 43, 31, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet-backdrop,
  .toast,
  .chip,
  .map-fab {
    transition: none;
  }
}
