/* =========================================================
   Friars Gate Patron Map (Mobile-first, pannable + zoomable)
   Cleaned + de-duplicated
   ========================================================= */

/* ---------- Layout wrappers ---------- */
.fg-patron-map-wrap { position: relative; width: 100%; max-width: 100%; }
.fg-patron-map-stage { width: 100%; max-width: 100%; }

/* Sticky controls bar */
.fg-patron-controls{
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

/* Filter panel */
.fg-filter-panel{
  padding: 12px;
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.fg-filter-title { font-weight: 700; margin-bottom: 6px; }
.fg-filter-section { margin-bottom: 12px; }

/* ---------- Viewport + canvas ---------- */
#fg-map-viewport{
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 70vh;
  max-height: 75vh;

  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;

  border-radius: 10px;
}

/* Fixed base canvas that JS scales (transform on this element) */
#fg-map-inner{
  position: relative;
  width: 1600px;   /* BASE MAP WIDTH */
  height: 1181px;  /* BASE MAP HEIGHT */
  transform-origin: 0 0;
}

/* Map image must NOT be responsive inside the fixed base */
#fg-map-img{
  display: block;
  width: 1600px;
  height: 1181px;
  max-width: none !important;
  max-height: none !important;
  position: relative;
  z-index: 1;
}

/* Marker layer matches image exactly */
#fg-map-markers{
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 1181px;
  z-index: 10;

  pointer-events: none; /* layer ignores clicks... */
}
#fg-map-markers .fg-map-pin{ pointer-events: auto; } /* ...pins stay clickable */

/* ---------- Pins: base ---------- */
.fg-map-pin{
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(58,47,31,0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  background: #f3e4c5; /* parchment-ish */
  display: inline-block;
}

/* Larger touch targets on mobile without changing visible size too much */
@media (max-width: 760px){
  .fg-map-pin{
    width: 20px;
    height: 20px;
  }
  .fg-map-pin::before{
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    /* Transparent hit area */
    background: transparent;
  }
}

/* Ownership styling */
.fg-own-festival { border-style: solid; }
.fg-own-sellable { border-style: dashed; }
.fg-own-restricted { opacity: 0.55; }
.fg-own-sellable.fg-claimed { opacity: 0.5; }

/* ---------- Type dot in filter list ---------- */
.fg-type-dot{
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.25);
  vertical-align: middle;
  margin-right: 6px;
}
.fg-type-0 { background: #d9d9d9; }

/* ---------- Booth Type pin colors (by taxonomy tid) ---------- */
.fg-map-pin.fg-type-1   { background: #2f7bd3; } /* Merchant */
.fg-map-pin.fg-type-2   { background: #d3a12f; } /* Food Seller */
.fg-map-pin.fg-type-3   { background: #8e5ad3; } /* Entertainment */
.fg-map-pin.fg-type-4   { background: #6b6b6b; } /* Administrative */
.fg-map-pin.fg-type-232 { background: #2e9a57; } /* Volunteer */
.fg-map-pin.fg-type-233 { background: #c14a2a; } /* Festival */
.fg-map-pin.fg-type-234 { background: #3aa0a0; } /* Community */
.fg-map-pin.fg-type-238 { background: #caa43a; border-width: 3px; } /* Sponsor */
.fg-map-pin.fg-type-239 { background: #d44b3a; } /* Artisan */
.fg-map-pin.fg-type-271 { background: #3f51b5; } /* Attraction */
.fg-map-pin.fg-type-227 { background: #2f2f2f; } /* Game */

/* Stage */
.fg-map-pin.fg-type-268{
  background: #111;
  border-width: 3px;
  border-color: rgba(243,228,197,0.95);
  border-radius: 6px; /* quick scanning */
}

/* Tavern */
.fg-map-pin.fg-type-269{
  background: #7b3f1d;
  border-width: 3px;
  border-radius: 50% 50% 50% 10%;
}

/* Match filter dots to pins */
.fg-type-dot.fg-type-1   { background: #2f7bd3; }
.fg-type-dot.fg-type-2   { background: #d3a12f; }
.fg-type-dot.fg-type-3   { background: #8e5ad3; }
.fg-type-dot.fg-type-4   { background: #6b6b6b; }
.fg-type-dot.fg-type-232 { background: #2e9a57; }
.fg-type-dot.fg-type-233 { background: #c14a2a; }
.fg-type-dot.fg-type-234 { background: #3aa0a0; }
.fg-type-dot.fg-type-238 { background: #caa43a; }
.fg-type-dot.fg-type-239 { background: #d44b3a; }
.fg-type-dot.fg-type-271 { background: #3f51b5; }
.fg-type-dot.fg-type-227 { background: #2f2f2f; }
.fg-type-dot.fg-type-268 { background: #111; }
.fg-type-dot.fg-type-269 { background: #7b3f1d; }

/* ---------- Zoom buttons ---------- */
.fg-zoom-controls { display: flex; gap: 6px; }
.fg-zoom-btn { min-width: 44px; min-height: 36px; }

/* ---------- Focus highlight (beacon + label) ---------- */
/* IMPORTANT: keep the same translate(-50%, -50%) so the coordinate doesn't move */
#fg-map-markers .fg-map-pin.is-focused{
  z-index: 9999;
  outline: 3px solid rgba(255,255,255,0.95);
  outline-offset: 2px;

  background: #ff2d55 !important;
  border: 4px solid #fff !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55) !important;

  animation: fgFocusPulse 1.0s ease-in-out 0s 5;
}

#fg-map-markers .fg-map-pin.is-focused::after{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 4px solid rgba(255,45,85,0.6);
  box-shadow: 0 0 0 10px rgba(255,255,255,0.18);
  pointer-events: none;
}

#fg-map-markers .fg-map-pin.is-focused::before{
  content: "YOU ARE HERE";
  position: absolute;
  left: 50%;
  top: -52px;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  pointer-events: none;
}

@keyframes fgFocusPulse{
  0%   { box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 0 0 0 rgba(255, 232, 150, 0.0); }
  50%  { box-shadow: 0 6px 18px rgba(0,0,0,0.60), 0 0 0 10px rgba(255, 232, 150, 0.55); }
  100% { box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 0 0 0 rgba(255, 232, 150, 0.0); }
}
