/* Anecdote — Map. A guide panel (search, filters, what's in view) beside a
   full-height Leaflet map whose tiles are tinted to the site's paper. */
.mp-page [hidden] { display: none !important; }
html, body.mp-page { height: 100%; }
.mp-page { background: var(--bg); color: var(--ink); overflow: hidden; }
.mp-main { display: flex; height: calc(100vh - 49px); height: calc(100dvh - 49px); }

/* ═══ panel ═══ */
.mp-panel {
  width: clamp(320px, 28vw, 420px); flex: none; display: flex; flex-direction: column;
  border-right: 1px solid rgba(var(--ink-rgb), .18); background: var(--bg); min-height: 0;
}
.mp-head { padding: 26px 24px 14px; border-bottom: 1px solid rgba(var(--ink-rgb), .12); }
.mp-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.mp-title { font-size: clamp(30px, 2.6vw, 40px); font-weight: 900; letter-spacing: -.04em; line-height: .95; margin: 8px 0 8px; }
.mp-lede { font-size: 13px; line-height: 1.45; color: var(--mute); margin: 0 0 16px; }
.mp-search { position: relative; }
.mp-search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mute); }
.mp-search input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--ink);
  padding: 11px 36px 11px 38px; border-radius: 999px; outline: none;
  border: 1px solid rgba(var(--ink-rgb), .2); background: var(--paper);
}
.mp-search input:focus { border-color: rgba(var(--ink-rgb), .55); }
.mp-search input::-webkit-search-cancel-button { display: none; }
.mp-search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--mute); cursor: pointer; font-size: 12px; padding: 4px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mp-chip {
  font: inherit; font-size: 12px; font-weight: 500; color: var(--mute); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid rgba(var(--ink-rgb), .18); background: transparent; transition: color .2s, border-color .2s, background .2s;
}
.mp-chip:hover { color: var(--ink); border-color: rgba(var(--ink-rgb), .45); }
.mp-chip.is-on { color: var(--ink); border-color: var(--ink); background: var(--paper); }
.mp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ink); }
.mp-dot--collection { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }

.mp-count { padding: 12px 24px 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.mp-list { list-style: none; margin: 0; padding: 0 12px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.mp-item {
  display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center;
  padding: 8px 12px; border-radius: 10px; cursor: pointer; transition: background .18s;
}
.mp-item:hover, .mp-item.is-hot { background: rgba(var(--ink-rgb), .06); }
.mp-item-img { width: 56px; height: 42px; border-radius: 6px; background: rgba(var(--ink-rgb), .08) center / cover no-repeat; position: relative; }
.mp-item-img::after { content: ''; position: absolute; left: -4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--sec, var(--ink)); }
.mp-item-t { font-size: 13px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.mp-item-s { font-size: 11.5px; color: var(--mute); margin-top: 2px; line-height: 1.35; }
.mp-item-s b { font-weight: 600; color: var(--ink); }
.mp-more { font-size: 12px; color: var(--mute); padding: 10px 12px 4px; }
.mp-empty { font-size: 13px; color: var(--mute); padding: 18px 12px; line-height: 1.5; }
.mp-foot { padding: 10px 24px 14px; font-size: 11px; color: var(--mute); border-top: 1px solid rgba(var(--ink-rgb), .12); }
.mp-foot a { color: inherit; text-decoration: underline; }

/* ═══ map ═══ */
.mp-map { flex: 1; min-width: 0; background: var(--bg); position: relative; }
.mp-map .maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { font-size: 10px; background: rgba(var(--ink-rgb), .04) !important; color: var(--mute); }
.maplibregl-ctrl-attrib a { color: var(--mute); }
.maplibregl-ctrl-group { background: var(--paper); border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .14) !important; }
.maplibregl-ctrl-group button + button { border-top-color: rgba(var(--ink-rgb), .12); }
:root[data-theme="dark"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
/* Map / Satellite switch */
.mp-view { display: flex; background: var(--paper); border-radius: 999px; padding: 3px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.mp-view button { font: inherit; font-size: 12px; font-weight: 600; border: 0; background: none; color: var(--mute); padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.mp-view button.is-on { background: var(--ink); color: var(--paper); }

/* "Showing one work" (arrived from a work's Map button) */
.mp-work { margin-top: 12px; font-size: 12.5px; color: var(--mute); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.mp-work b { color: var(--ink); }
.mp-work button { font: inherit; font-size: 12px; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; margin-left: auto; }

/* the window beside a dot: a scrollable list, a row opens the work's card */
.mp-pop .maplibregl-popup-content { background: var(--paper); color: var(--ink); border-radius: 12px; padding: 0; overflow: hidden;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .22); font-family: inherit; }
.mp-pop.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--paper); }
.mp-pop.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--paper); }
.mp-pop.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--paper); }
.mp-pop.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--paper); }
.mp-pop .maplibregl-popup-close-button { font-size: 18px; width: 28px; height: 28px; right: 4px; top: 4px; color: var(--mute); z-index: 2;
  border-radius: 50%; background: rgba(var(--ink-rgb), .06); line-height: 1; }
.mp-win { width: 320px; max-width: calc(100vw - 60px); }
.mp-win-head { padding: 16px 40px 12px 16px; border-bottom: 1px solid rgba(var(--ink-rgb), .12); }
.mp-win-t { font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.mp-win-s { font-size: 12px; color: var(--mute); margin-top: 3px; }
.mp-win-zoom { margin-top: 10px; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(var(--ink-rgb), .25); background: none; color: var(--ink); cursor: pointer; }
.mp-win-list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.mp-win-back { display: block; width: 100%; text-align: left; font: inherit; font-size: 12px; font-weight: 600; color: var(--mute);
  border: 0; border-bottom: 1px solid rgba(var(--ink-rgb), .12); background: none; padding: 11px 40px 11px 14px; cursor: pointer; }
.mp-win-back:hover { color: var(--ink); }
.mp-win .mp-card-img { height: 170px; }

/* the work's card */
.mp-card-img { height: 170px; background: rgba(var(--ink-rgb), .08) center / cover no-repeat; }
.mp-card-body { padding: 14px 16px 16px; }
.mp-card-chip { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--sec); padding: 3px 7px; border-radius: 3px; }
.mp-card-t { font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 8px 0 2px; }
.mp-card-y { font-size: 12px; color: var(--mute); }
.mp-card-by { font-size: 12.5px; margin-top: 8px; }
.mp-card-by a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(var(--ink-rgb), .3); }
.mp-card-where { font-size: 12.5px; color: var(--mute); margin-top: 4px; line-height: 1.4; }
.mp-card-note { font-size: 11.5px; color: var(--mute); margin-top: 6px; font-style: italic; line-height: 1.4; }
.mp-card-lost { font-size: 11.5px; color: var(--accent); margin-top: 6px; font-weight: 600; }
.mp-card-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mp-card-acts a { font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(var(--ink-rgb), .25); color: var(--ink); text-decoration: none; }
.mp-card-acts a.is-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mp-card-src { font-size: 10.5px; color: var(--mute); margin-top: 10px; }
.mp-card-src a { color: inherit; }

/* ═══ phones: map on top, the guide as a sheet below ═══ */
@media (max-width: 699px) {
  .mp-main { flex-direction: column-reverse; }
  .mp-map { flex: none; height: 52%; }
  .mp-panel { width: auto; flex: 1; border-right: 0; border-top: 1px solid rgba(var(--ink-rgb), .18); }
  .mp-head { padding: 14px 16px 10px; }
  .mp-eyebrow, .mp-title, .mp-lede { display: none; }
  .mp-count { padding: 10px 16px 6px; }
  .mp-list { padding: 0 6px 10px; }
  .mp-foot { display: none; }
  .mp-card-img, .mp-win .mp-card-img { height: 130px; }
  .mp-win { width: 270px; }
  .mp-win-list { max-height: 36vh; }
}

/* the window never runs off-screen: it keeps to the map's height and scrolls inside */
.mp-win { max-height: min(62vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.mp-win-list { max-height: none; overflow: visible; }
.mp-win .mp-card-img { height: 150px; }

/* the card photo opens the image viewer */
.mp-card-img { cursor: zoom-in; }
.dict-lb.sv-lb { z-index: 400; }

/* phones: the dot's window is a sheet over the lower half (the list area) */
.mp-sheet { display: none; }
@media (max-width: 699px) {
  .mp-main { position: relative; }
  .mp-sheet { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; z-index: 20;
    background: var(--paper); border-top: 1px solid rgba(var(--ink-rgb), .18); border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .14); overflow-y: auto; overscroll-behavior: contain;
    transform: translateY(105%); transition: transform .32s cubic-bezier(.22, .8, .24, 1); }
  .mp-sheet.is-open { transform: none; }
  .mp-sheet .mp-win { width: auto; max-width: none; max-height: none; overflow: visible; }
  .mp-sheet .mp-win-head { padding-right: 52px; }
  .mp-sheet .mp-win-list { max-height: none; }
  .mp-sheet .mp-card-img { height: 190px; }
  .mp-sheet-x { position: sticky; top: 10px; float: right; margin: 10px 12px -38px 0; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
    border: 0; background: rgba(var(--ink-rgb), .08); color: var(--ink); font-size: 13px; cursor: pointer; }
}
