/* ================================================================
   FriendsByChance — locations.css
   Locations tab (090).
   The chips are the shared TagLike ones (components/taglike.css) —
   everywhere, journeys included.  This file keeps the place editor's
   coordinates block, its map and tools, and the atlas search rows.
   ================================================================ */

/* ── Place editor: coordinates block ─────────────────────────── */

.loc-coords-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

/* Latitude, longitude, radius, then the buttons.  It wraps rather than
   squeezing: a coordinate squashed to three characters is unreadable, and
   the buttons are 30px targets that must not shrink. */
.loc-coord-row {
    display:     flex;
    flex-wrap:   wrap;
    align-items: center;
    gap:         6px;
}

.loc-coord-input {
    flex: 1;
    min-width: 0;
    -moz-appearance: textfield;
}

.loc-editor-map {
    margin-top: 8px;
    height: 260px;
    border: 1px solid var(--color-divider);
    border-radius: 8px;
    overflow: hidden;
}

/* The radius sits on the coordinate row with the pair it belongs to: all
   three say where this location is and how far it reaches, and splitting
   them across two rows made them read as two questions. */
.loc-radius-input {
    flex:      0 1 7em;
    min-width: 4.5em;
}

/* The three copy buttons in the detail sheet.  They wrap rather than
   shrink: a button whose label is clipped is a button nobody presses. */
.loc-detail-copy {
    display:   flex;
    flex-wrap: wrap;
    gap:       8px;
    margin-top: 4px;
}
.loc-detail-copy .fbc-btn { flex: 1 1 auto; }

/* ── The map, and the tools that draw on it ───────────────────────
   Hidden until the ▣ button asks for it, so an edit that never needs a
   map never loads one.  The tools are a column down the right edge, so
   the map keeps all the width it can get.                           */

.loc-map-wrap {
    display:     flex;
    align-items: stretch;
    gap:         6px;
    margin-top:  8px;
}

.loc-map-wrap .loc-editor-map {
    flex:       1;
    min-width:  0;
    margin-top: 0;
}

.loc-map-tools {
    display:        flex;
    flex-direction: column;
    /* Evenly down the map's height, so every tool is a long reach from
       nothing and a short one from its neighbours. */
    justify-content: space-evenly;
    gap:            6px;
    flex-shrink:    0;
}

/* Taller than a toolbar button: these are aimed at while the other hand is
   holding the phone, and there is vertical room to spare. */
.loc-map-tool { width: 38px; height: 38px; }

/* A place in the search results that has an outline on the map. */
.loc-result-boundary {
    position:    static;
    flex-shrink: 0;
    width:       14px;
    height:      14px;
    color:       var(--color-text-secondary);
    opacity:     0.9;
}
.loc-result-boundary svg { width: 14px; height: 14px; }

/* ── The "search places" row of the coordinates block ─────────
   Row 1 of the block: pick a real place instead of typing a pair.  Same
   shape as the coordinate row below it, so the two read as one block. */

.loc-search-row {
    display:     flex;
    align-items: center;
    gap:         6px;
    margin-bottom: 6px;
}

.loc-search-input {
    flex:      1;
    min-width: 0;
}

/* The results dropdown: an anchored popover, so it may overflow the editor
   rather than being clipped by it.  Wider than a chip popover (place names
   carry a subtitle) and scrollable, because a search can fill it. */
.fbc-popover.loc-search-pop {
    max-width: min(460px, calc(100vw - 16px));
    padding:   5px;
}

.loc-search-results {
    max-height: 46vh;
    overflow-y: auto;
    min-width:  0;
}

/* ── Cartographic result rows (search dropdown) ──────────────── */

.loc-result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.loc-result-row:hover { background: var(--color-hover, rgba(0,0,0,0.03)); }

/* A whole row is the target when it is there to be picked. */
.loc-result-row--pick        { cursor: pointer; border-radius: 6px; }
.loc-result-row--pick:last-child { border-bottom: none; }
.loc-result-row--pick:focus-visible {
    outline:        2px solid var(--color-primary, #4a7c59);
    outline-offset: -2px;
}

.loc-result-text {
    flex: 1;
    min-width: 0;
}

.loc-result-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loc-result-sub {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

