/* ─────────────────────────────────────────────────────────────────────────────
   map-pins.css — Antologa AdvancedMarkerElement HTML pin styles
   Used by all three maps (wonders, listing detail, admin editor).
   Pin color is driven by the --pin-color CSS custom property set per-marker.
───────────────────────────────────────────────────────────────────────────── */

/* ── Container ────────────────────────────────────────────────────────────── */

.amap-pin {
    position: relative;
    width: 32px;
    height: 32px;
    cursor: pointer;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Teardrop bubble ──────────────────────────────────────────────────────── */

.amap-pin__bubble {
    position: absolute;
    inset: 0;
    /* Flex centers the icon within the circular head of the teardrop.
       padding-bottom pushes the center up past the tip (~26% of total height). */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 26%;
    transform-origin: bottom center;
    transition: transform 0.15s ease;
}

.amap-pin__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
    transition: filter 0.15s ease;
}

/* ── Icon — flex child, perfectly centered in the circular head ───────────── */

.amap-pin__icon {
    position: relative; /* stacks above the absolutely-positioned bg */
    width: 14px;
    height: 14px;
    pointer-events: none;
    flex-shrink: 0;
}

/* ── Label ────────────────────────────────────────────────────────────────── */

.amap-pin__label {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--pin-color, #374151);
    /* White halo — readable on any tile, no background box */
    text-shadow:
        -2px -2px 0 #fff,  2px -2px 0 #fff,
        -2px  2px 0 #fff,  2px  2px 0 #fff,
        -2px  0   0 #fff,  2px  0   0 #fff,
         0   -2px 0 #fff,  0    2px 0 #fff;
    pointer-events: none;
}

/* ── Hover (pointer devices only) ────────────────────────────────────────── */

@media (hover: hover) {
    .amap-pin:hover .amap-pin__bubble {
        transform: scale(1.1);
    }
    .amap-pin:hover .amap-pin__bg {
        filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.38));
    }
}

/* ── Selected ─────────────────────────────────────────────────────────────── */

.amap-pin--selected .amap-pin__bubble {
    transform: scale(1.25);
}
.amap-pin--selected .amap-pin__bg {
    filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.45));
}

/* ── Dragging (admin editor) ──────────────────────────────────────────────── */

.amap-pin--dragging .amap-pin__bubble {
    transform: scale(1.15);
    opacity: 0.85;
}
.amap-pin--dragging .amap-pin__label {
    opacity: 0;
}

/* ── Nearby attraction pins (secondary, context-only overlay) ─────────────── */

.amap-pin--nearby {
    width: 24px;
    height: 24px;
    opacity: 0.9;
}
.amap-pin--nearby .amap-pin__icon {
    width: 11px;
    height: 11px;
}
.amap-pin--nearby .amap-pin__label {
    bottom: -12px;
    font-size: 9px;
    font-weight: 600;
    max-width: 80px;
}
@media (hover: hover) {
    .amap-pin--nearby:hover .amap-pin__bubble {
        transform: scale(1.15);
    }
}

/* ── Mobile ─────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .amap-pin {
        width: 32px;
        height: 32px;
    }
    .amap-pin__icon {
        width: 14px;
        height: 14px;
    }
    .amap-pin__label {
        font-size: 10px;
        bottom: -15px;
        max-width: 90px;
    }
    .amap-pin--nearby {
        width: 24px;
        height: 24px;
    }
    .amap-pin--nearby .amap-pin__icon {
        width: 11px;
        height: 11px;
    }
    .amap-pin--nearby .amap-pin__label {
        font-size: 8px;
        bottom: -12px;
    }
}
