/* =========================================
   FutureSprouts - Seed Swap & Cleanup Map
   Self-contained styles for the Chester County
   pin map on rsvp.html. Uses the site palette
   custom properties from style.css.
   Class names are prefixed "swapmap-" so they
   never collide with .county-map / .map-pin.
========================================= */

.swapmap-frame{
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-top: 26px;
  max-width: 760px;
}

/* Canvas wraps the inline SVG; the pin layer is
   absolutely positioned over it, so percent pin
   coordinates map 1:1 onto the SVG viewBox. */
.swapmap-canvas{
  position: relative;
}
.swapmap-canvas svg{
  display: block;
  width: 100%;
  height: auto;
}

/* Hand-drawn county outline */
.swapmap-outline{
  fill: var(--bg2);
  stroke: var(--soil);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.swapmap-sketch{
  fill: none;
  stroke: var(--soil);
  stroke-width: 1.6;
  stroke-dasharray: 8 10;
  stroke-linecap: round;
  opacity: 0.35;
}
.swapmap-creek{
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.45;
}
.swapmap-town-dot{
  fill: var(--soil);
}
.swapmap-town-label{
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  fill: var(--text);
}
.swapmap-map-title{
  font-family: var(--display);
  font-style: italic;
  font-size: 26px;
  fill: var(--muted);
}
.swapmap-compass{
  font-family: var(--font);
  font-size: 18px;
  font-weight: 800;
  fill: var(--muted);
}
.swapmap-compass-line{
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

/* =========================
   PIN LAYER
========================= */
.swapmap-pins{
  position: absolute;
  inset: 0;
}

/* Each pin is a real button: keyboard focusable,
   44px tap target, tip of the teardrop marks the spot. */
.swapmap-pin{
  position: absolute;
  transform: translate(-50%, -100%);
  width: 44px;
  height: 46px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 10px;
}
.swapmap-pin:focus{
  outline: 3px solid var(--greenDark);
  outline-offset: 2px;
}
.swapmap-pin:focus:not(:focus-visible){
  outline: none;
}
.swapmap-pin:focus-visible{
  outline: 3px solid var(--greenDark);
  outline-offset: 2px;
}

.swapmap-pin-marker{
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid rgba(41, 50, 31, 0.45);
  box-shadow: 0 3px 7px rgba(41, 50, 31, 0.35);
  position: relative;
}
.swapmap-pin-marker::after{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
}

/* Earth-tone markers by event type */
.swapmap-pin[data-type="seed-swap"] .swapmap-pin-marker{
  background: var(--harvest);
}
.swapmap-pin[data-type="cleanup"] .swapmap-pin-marker{
  background: var(--green);
}

/* =========================
   TOOLTIP
========================= */
.swapmap-tip{
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 190px;
  padding: 7px 11px;
  border-radius: 10px;
  background: #275634;
  color: #F8F3E7;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  z-index: 5;
}
.swapmap-tip::after{
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #275634;
}
.swapmap-pin:hover .swapmap-tip,
.swapmap-pin:focus .swapmap-tip,
.swapmap-pin:focus-visible .swapmap-tip,
.swapmap-pin.is-open .swapmap-tip{
  visibility: visible;
  opacity: 1;
}
.swapmap-pin:hover,
.swapmap-pin.is-open{
  z-index: 6;
}

/* =========================
   LEGEND
========================= */
.swapmap-legend{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 14px;
  padding: 0 4px;
}
.swapmap-legend-item{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.swapmap-legend-swatch{
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid rgba(41, 50, 31, 0.45);
}
.swapmap-legend-swatch.seed-swap{ background: var(--harvest); }
.swapmap-legend-swatch.cleanup{ background: var(--green); }

.swapmap-note{
  margin-top: 10px;
}

/* =========================
   MOTION (opt-in only)
========================= */
@media (prefers-reduced-motion: no-preference){
  .swapmap-tip{
    transition: opacity 0.18s ease;
  }
  .swapmap-pin-marker{
    transition: transform 0.18s ease;
    animation: swapmap-settle 0.55s ease-out both;
  }
  .swapmap-pin:hover .swapmap-pin-marker,
  .swapmap-pin:focus-visible .swapmap-pin-marker{
    transform: rotate(-45deg) scale(1.12);
  }
  @keyframes swapmap-settle{
    from{ opacity: 0; translate: 0 -8px; }
    to{ opacity: 1; translate: 0 0; }
  }
}
@media (prefers-reduced-motion: reduce){
  .swapmap-pin-marker,
  .swapmap-tip{
    animation: none;
    transition: none;
  }
}

/* Small screens: keep tooltips comfortably sized */
@media (max-width: 480px){
  .swapmap-frame{ padding: 10px; }
  .swapmap-tip{ max-width: 160px; font-size: 13px; }
}
