/* Photo bubbles of the full memory map (exp_memory_map_clusters, docs/MEMORY_MAP_LAYER.md).
   The clusters, dots and glow are WebGL layers coloured from the same tokens in
   memory-map-layer.js; only these bubbles are DOM. Tokens only (design-system/AI_RULES.md). */

/* MapLibre owns this element's transform (its position); never animate it. */
.mb-memory-marker:hover,
.mb-memory-marker:focus-within {
    z-index: 2;
}

.mb-memory-bubble {
    --mb-memory-bubble-size: 44px;
    position: relative;
    width: var(--mb-memory-bubble-size);
    height: var(--mb-memory-bubble-size);
    padding: 0;
    border: 3px solid var(--ds-card);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-brand);
    box-shadow: var(--ds-shadow-elevated);
    cursor: pointer;
    transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}

.mb-memory-bubble:hover {
    transform: scale(1.08);
}

.mb-memory-bubble:focus-visible {
    outline: 3px solid var(--ds-focus);
    outline-offset: 2px;
}

.mb-memory-bubble__photo {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--ds-radius-pill);
    object-fit: cover;
}

/* A thumbnail that failed to load leaves the brand fill, never a broken image. */
.mb-memory-bubble--no-photo .mb-memory-bubble__photo {
    visibility: hidden;
}

/* Dark label on the brand fill: white on #EA794C is below AA (AI_RULES.md §6). */
.mb-memory-bubble__count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 24px;
    padding: 2px 6px;
    border: 2px solid var(--ds-card);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-brand);
    color: var(--ds-ink);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    box-shadow: var(--ds-shadow-card);
}

.mb-memory-bubble__count[hidden] {
    display: none;
}

.mb-memory-bubble--enter {
    animation: mb-memory-bubble-in 220ms ease-out;
}

@keyframes mb-memory-bubble-in {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .mb-memory-bubble,
    .mb-memory-bubble--enter {
        animation: none;
        transition: none;
    }

    .mb-memory-bubble:hover {
        transform: none;
    }
}
