/* The map itself: the Leaflet canvas, pin markers and clusters, and the
   popups that open on the map. */

.map-stage {
    position: relative;
    flex: 1;
    min-height: 560px;
}

.map-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--map-block);
}

.leaflet-container {
    background: var(--map-block);
    font-family: inherit;
}

.leaflet-control-attribution {
    background: #ffffffa6 !important;
    font-size: .68rem !important;
}

/* ---------- Map tag ---------- */

.map-tag {
    position: absolute;
    top: 18px;
    left: 60px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: var(--shadow-1);
    z-index: 2;
    pointer-events: none;
}

.map-tag svg {
    width: .9375rem;
    height: .9375rem;
    color: var(--teal);
}

/* ---------- Pin markers ---------- */

.pin-marker {
    position: relative;
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .28));
}

.pin-marker svg.pin-body {
    width: 100%;
    height: 100%;
}

.pin-marker .pin-glyph {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translate(-50%);
    width: 16px;
    height: 16px;
    color: #fff;
}

.pin-marker.status-done .pin-body {
    color: var(--status-done);
}

.pin-marker.status-in_progress .pin-body {
    color: var(--status-progress);
}

.pin-marker.status-unconfirmed .pin-body {
    color: var(--status-unconfirmed);
}

.pin-marker.status-rejected .pin-body {
    color: var(--status-rejected);
}

.pin-marker.status-picker .pin-body {
    color: var(--orange);
}

.pin-marker--cluster .pin-body {
    color: var(--teal);
}

.pin-cluster-count {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translate(-50%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

/* ---------- Pin popup ---------- */

.pin-popup {
    min-width: 260px;
    line-height: 1.4;
}

/* Right padding keeps the title clear of Leaflet's close button. */
.pin-popup h3,
.pin-popup .h3 {
    margin: 0 0 6px;
    padding-right: 20px;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
}

.pin-popup p {
    margin: 0;
    font-size: .95rem;
    color: var(--ink-dim);
}

.pin-popup-address {
    margin-top: 4px !important;
}

.pin-popup-images {
    margin-top: 10px;
}

.pin-popup-images img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: block;
}

/* Text is --surface rather than a fixed white so it stays readable on the
   teal fill in dark mode and in the contrast modes, where --teal is --ink. */
.pin-popup-details {
    width: 100%;
    min-height: 2.75rem;
    margin-top: 12px;
    padding: 0 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--teal);
    color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.pin-popup-details:hover {
    background: var(--teal-ink);
}

.pin-popup-details:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.pin-popup-details-label {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.pin-popup-details svg {
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
}

.leaflet-container a.leaflet-popup-close-button {
    width: 2rem;
    height: 2rem;
    font-size: 1.375rem;
    line-height: 2rem;
}

/* ---------- Add-a-point prompt ---------- */

.map-add-popup {
    min-width: 190px;
}

.map-add-popup-text {
    margin: 0 0 10px;
    font-size: .85rem;
    color: var(--ink);
}

.map-add-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
