/* Places globe (MapLibre + OpenFreeMap tiles). Pin colors are tokens so
   both themes work; checked with the dataviz validator and WCAG contrast:
   each pin is >= 3.3:1 against the positron and dark map land and water,
   and wears a 2px surface ring. */
:root {
    --pin-want: #cb181d;
    --pin-been: #1b64be;
}
:root[data-theme='dark'] {
    --pin-want: #ef5a47;
    --pin-been: #338ced;
}

.places { max-width: 1200px; }
/* Embedded in gada.space/places, which has its own heading. */
.is-embed .places { padding: 0; }
.is-embed .places-head { display: none; }
.is-embed body { background: transparent; }

.places-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
@media (max-width: 760px) {
    .places-layout { grid-template-columns: minmax(0, 1fr); }
}

.globe {
    position: relative;
    width: 100%;
    height: min(72vh, 640px);
    min-height: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}
.globe .map { position: absolute; inset: 0; }
/* MapLibre's own focus ring would be clipped; draw ours inside the edge. */
.globe .maplibregl-canvas:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* Space under the globe on the page background, not a map-colored box. */
.globe .maplibregl-map { background: var(--surface); }
/* Embedded: the globe fills the frame, the card floats over it, and the
   page's own list (outside the frame) picks places by postMessage. */
.is-embed .places-layout { display: block; position: relative; }
.is-embed .globe { height: 100vh; min-height: 300px; border-radius: 0; }
.is-embed .list, .is-embed .globe-help, .is-embed .source { display: none; }
/* Embedded, the map credit stays (it is inside the map, bottom right). */
.is-embed .side { position: absolute; top: 12px; left: 12px; width: min(300px, calc(100% - 24px)); z-index: 5; }
.is-embed .card { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); }
/* The page shows its own key next to the frame. */
.is-embed .legend { display: none; }

/* Bottom left: MapLibre's attribution takes the bottom right. */
.globe-tools { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; z-index: 2; }
.globe-tools .btn { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.btn.icon { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 18px; }

.globe-help { color: var(--ink-2); font-size: 12px; margin: 6px 0 0; }
.legend .swatch.dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.legend .item.row { flex-direction: row; align-items: center; gap: 6px; margin-right: 12px; }

.side { display: flex; flex-direction: column; gap: 16px; }
.card { border: 1px solid var(--ring); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card h2 { font: 500 20px/1.2 var(--serif); margin: 0; }
.card p { margin: 6px 0 0; font-size: 14px; }
.card-status { color: var(--ink-2); font-size: 13px !important; }
.card-status .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.card-note:empty { display: none; }
.card-links a { color: var(--ink); }

.list-title { font: 500 13px/1 var(--sans); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; }
#place-list, .card-places { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#place-list button, .card-places button {
    width: 100%;
    text-align: left;
    font: inherit;
    color: var(--ink);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 2px 10px;
    align-items: center;
}
#place-list button:hover, .card-places button:hover { background: var(--plane); }
#place-list button[aria-current='true'] { border-color: var(--ink); }
#place-list .dot, .card-places .dot { width: 10px; height: 10px; border-radius: 50%; }
#place-list .name, .card-places .name { font-weight: 500; font-size: 14px; }
#place-list .where, .card-places .where { grid-column: 2; color: var(--ink-2); font-size: 12px; }
.card-places { margin-top: 10px !important; }

/* MapLibre's attribution box in the dark theme. */
:root[data-theme='dark'] .maplibregl-ctrl-attrib,
:root[data-theme='dark'] .maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(23, 23, 23, 0.85); color: var(--ink-2); }
:root[data-theme='dark'] .maplibregl-ctrl-attrib a { color: var(--ink); }
:root[data-theme='dark'] .maplibregl-ctrl-attrib-button { filter: invert(1); }
