/* backyardultra.co.uk — events map page */

.map-section { padding: 44px 0 70px; }
.map-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.map-head .eyebrow { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.map-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); color: var(--white); margin-bottom: 8px; }
.map-head p { color: var(--text-muted); max-width: 620px; }

.map-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: min(72vh, 720px);
  min-height: 460px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(155,93,229,0.25);
  background: var(--card-bg);
}
.map-list { overflow-y: auto; border-right: 1px solid var(--border); }
.map-list-loading { padding: 24px; color: var(--text-muted); font-size: 0.92rem; }
.map-item {
  display: flex; gap: 12px; align-items: center; width: 100%;
  padding: 14px 16px;
  background: none; border: 0; border-bottom: 1px solid var(--border);
  text-align: left; cursor: pointer; color: inherit; font: inherit;
  transition: background var(--transition);
}
.map-item:hover:not(:disabled), .map-item.is-active { background: rgba(107,45,191,0.14); }
.map-item.is-active { box-shadow: inset 3px 0 0 var(--ultra-purple-light); }
.map-item:focus-visible { outline: 2px solid var(--ultra-purple-light); outline-offset: -2px; }
.map-item:disabled { cursor: default; }
.map-item-logo {
  width: 48px; height: 48px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
  background: #110a1e; display: flex; align-items: center; justify-content: center;
}
.map-item-logo img { width: 100%; height: 100%; object-fit: contain; }
.map-item-logo.is-fallback { background: rgba(107,45,191,0.18); }
.map-item-logo.is-fallback span { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.4rem; color: var(--ultra-purple-light); }
.map-item-body { display: flex; flex-direction: column; min-width: 0; }
.map-item-name { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.08rem; color: var(--white); line-height: 1.25; }
.map-item-meta { font-size: 0.8rem; color: var(--text-muted); }
.map-item.is-live .map-item-meta:first-of-type { color: #4caf50; }
.map-item-nopin { font-size: 0.72rem; color: #ffb74d; margin-top: 2px; }

.map-wrap { position: relative; min-width: 0; }
#map { width: 100%; height: 100%; background: #1b1b1b; }
/* Dark-mode the OpenStreetMap tiles to sit with the site */
#map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.6); }
.map-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 500;
  display: flex; flex-direction: column; gap: 4px; text-align: center;
  background: rgba(13,13,13,0.9); border: 1px solid rgba(155,93,229,0.3); border-radius: 10px;
  padding: 18px 22px; color: var(--text-muted); font-size: 0.9rem;
}
.map-empty[hidden] { display: none; }
.map-empty strong { color: var(--white); font-family: 'Rajdhani', sans-serif; font-size: 1.15rem; }

/* Pins: a teardrop with the event date in it */
.byu-pin { background: none; border: 0; }
.byu-pin .pin-body {
  position: relative;
  width: 46px; height: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-family: 'Rajdhani', sans-serif; font-weight: 700; line-height: 1;
}
.byu-pin .pin-body::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--ultra-purple);
  border: 2px solid #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.45);
  transition: background var(--transition);
}
.byu-pin .pin-day, .byu-pin .pin-mon { position: relative; z-index: 1; }
.byu-pin .pin-day { font-size: 1.15rem; }
.byu-pin .pin-mon { font-size: 0.6rem; letter-spacing: 1px; text-transform: uppercase; margin-top: 1px; }
.byu-pin.is-live .pin-body::before { background: #2e7d32; }
.byu-pin:hover .pin-body::before { background: var(--ultra-purple-light); }

/* Popups */
.byu-popup .leaflet-popup-content-wrapper { background: var(--card-bg); color: var(--light); border: 1px solid rgba(155,93,229,0.35); border-radius: 12px; }
.byu-popup .leaflet-popup-tip { background: var(--card-bg); }
.byu-popup .leaflet-popup-content { margin: 16px 18px; font-family: 'Open Sans', sans-serif; }
.byu-popup a.leaflet-popup-close-button { color: var(--text-muted); }
.map-pop-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.map-pop-logo { width: 52px; height: 52px; border-radius: 9px; overflow: hidden; flex-shrink: 0; background: #110a1e; display: flex; align-items: center; justify-content: center; }
.map-pop-logo img { width: 100%; height: 100%; object-fit: contain; }
.map-pop-logo.is-fallback { background: rgba(107,45,191,0.18); }
.map-pop-logo.is-fallback span { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--ultra-purple-light); }
.map-pop-name { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--white); line-height: 1.2; }
.map-pop-meta { font-size: 0.78rem; color: var(--text-muted); }
.byu-popup p.map-pop-desc { margin: 0 0 12px; font-size: 0.84rem; color: #bbb; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.byu-popup .event-links .btn { color: #fff; }
.byu-popup .event-links .btn-outline { color: var(--light); }

.leaflet-container .leaflet-control-attribution { background: rgba(13,13,13,0.75); color: #888; }
.leaflet-container .leaflet-control-attribution a { color: #aaa; }
.leaflet-bar a { background: var(--card-bg); color: var(--light); border-bottom-color: var(--border); }
.leaflet-bar a:hover { background: var(--dark-3); color: var(--white); }

.map-pitch {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 26px; padding: 22px 26px;
  border-radius: 12px;
  background: rgba(107,45,191,0.1);
  border: 1px solid rgba(155,93,229,0.25);
}
.map-pitch strong { display: block; font-family: 'Rajdhani', sans-serif; font-size: 1.25rem; color: var(--white); }
.map-pitch span { color: var(--text-muted); font-size: 0.92rem; }

@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; grid-template-rows: 60vh auto; height: auto; }
  .map-list { order: 2; border-right: 0; border-top: 1px solid var(--border); max-height: none; }
  .map-wrap { order: 1; height: 60vh; min-height: 360px; }
}
