/* css/pins.css — P1-10. Site markers and their lens states.
   Tokens only from styles.css; the pin colour rides on --pin-color, set by
   the mode modifier class, so a new mode is a CSS variable, not new rules. */

/* The divIcon wrapper is the TAP TARGET: a full 44x44 invisible square.
   The visible dot sits centred inside it. */
.atlas-pin {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  /* Leaflet positions the icon's top-left corner; iconAnchor recentres it. */
}

.atlas-pin--hike { --pin-color: var(--accent); }
.atlas-pin--dive { --pin-color: var(--accent-2); }
.atlas-pin--scout { --pin-color: var(--warn); }

.atlas-pin__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--pin-color);
  border: 2px solid #fff;
  /* Dark outer ring so the white border reads on pale basemaps too. */
  box-shadow: 0 0 0 1.5px rgba(10, 16, 19, 0.55), 0 1px 4px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, opacity 120ms ease, width 120ms ease, height 120ms ease;
}

/* Bucket sites are HOLLOW: still to do, an outline waiting to be filled. */
.atlas-pin--bucket .atlas-pin__dot {
  background: rgba(15, 20, 23, 0.72);
  border: 2.5px solid var(--pin-color);
}

/* Logged sites are FILLED and carry a check. */
.atlas-pin--logged .atlas-pin__dot::after {
  content: '✓';
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font);
}

/* Scout proposals (Phase 4) can NEVER be confused with a real site:
   dashed ring, warn colour, a question mark, no fill. */
.atlas-pin--scout .atlas-pin__dot {
  background: rgba(15, 20, 23, 0.72);
  border: 2px dashed var(--pin-color);
}
.atlas-pin--scout .atlas-pin__dot::after {
  content: '?';
  color: var(--pin-color);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* Lens de-emphasis: the other lens's pins stay visible but recede. */
.atlas-pin.is-dim .atlas-pin__dot {
  opacity: 0.38;
  width: 12px;
  height: 12px;
}
.atlas-pin.is-dim.atlas-pin--logged .atlas-pin__dot::after { content: ''; }

/* Selection: grow plus a soft halo. */
.atlas-pin.is-selected .atlas-pin__dot {
  width: 22px;
  height: 22px;
  box-shadow:
    0 0 0 1.5px rgba(10, 16, 19, 0.55),
    0 0 0 7px color-mix(in srgb, var(--pin-color) 30%, transparent),
    0 1px 6px rgba(0, 0, 0, 0.5);
}
.atlas-pin.is-selected.atlas-pin--logged .atlas-pin__dot::after { font-size: 12px; }

@supports not (box-shadow: 0 0 0 1px color-mix(in srgb, red 30%, transparent)) {
  .atlas-pin.is-selected .atlas-pin__dot {
    box-shadow: 0 0 0 1.5px rgba(10, 16, 19, 0.55), 0 0 0 7px rgba(46, 196, 182, 0.3);
  }
}

.atlas-pin:hover .atlas-pin__dot,
.atlas-pin:focus-visible .atlas-pin__dot {
  transform: scale(1.18);
}
.atlas-pin:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -6px;
  border-radius: 50%;
}

/* Leaflet tooltip, restyled to the app's tokens. */
.atlas-pin-tip {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  font-family: var(--font);
  font-size: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.atlas-pin-tip::before { display: none; }

@media (prefers-reduced-motion: reduce) {
  .atlas-pin__dot { transition: none; }
}
