/* The map explorer (mapexplorer.js, docs/map-explorer.md): map and list side by side, the detail panel between
   them on wide screens; map on top, list below and the panel as a bottom sheet on a phone. */
.mx { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; margin: 12px 0 18px; align-items: start; }
.mx[hidden] { display: none; }
.mx.mx-open { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr) minmax(260px, 0.8fr); }
.mx-mapbox { position: relative; min-width: 0; overflow: hidden; }
.mx .mx-mapbox .map { height: 620px; margin: 0; width: 100%; }
.mx-listbox { min-width: 0; display: flex; flex-direction: column; height: 620px; }
.mx-count { margin: 0; font-size: 14px; font-weight: 500; color: var(--slate); }
.mx-view, .mx-more { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.mx-more[hidden], .mx-more:empty, .mx-view:empty { display: none; }
.mx-list { list-style: none; margin: 8px 0 0; padding: 0; flex: 1 1 0; min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); box-sizing: border-box; }
.mx-empty { padding: 14px 4px; font-size: 13px; color: var(--muted); }
/* Every row is the same height (ROW in mapexplorer.js), so the list can draw only those near the view. */
.mx-row { height: 76px; box-sizing: border-box; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); overflow: hidden; }
.mx-row.hot { background: var(--wash-light); box-shadow: inset 3px 0 0 #d93a37; }
.mx-row.open { background: var(--wash-light); box-shadow: inset 3px 0 0 var(--nhl); }
.mx-rowmain { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 4px 0 8px; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.mx-rowmain:focus-visible, .mx-rowact:focus-visible, .mx-close:focus-visible, .mx-act:focus-visible, .mx-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mx-thumb { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 3px; background: var(--wash-light); }
.mx-noimg { display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 500; color: var(--muted); }
.mx-num { flex: none; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.mx-row.chosen .mx-num { font-size: 15px; font-weight: 600; color: #fff; background: #d93a37; border-radius: 50%; width: 32px; height: 32px; margin: 0 12px; }
.mx-rowtext { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mx-name { font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-sub { font-size: 12px; line-height: 1.25; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 15px; }
.mx-rowact { flex: none; margin-right: 6px; font: inherit; font-size: 12px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; white-space: nowrap; }
.mx-rowact:hover { border-color: var(--slate); }
.mx-rowact[aria-pressed="true"] { border-color: var(--nhl); color: var(--nhl); }

/* The card over a place: hover on a wide screen, a tap on a phone. */
.mx-card { position: absolute; left: 0; top: 0; z-index: 3; width: 190px; display: flex; flex-direction: column; gap: 3px; padding: 0 0 8px; font: inherit; text-align: left; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 16px rgba(31, 41, 51, 0.22); cursor: pointer; overflow: hidden; }
.mx-card[hidden] { display: none; }
.mx-cardimg { width: 100%; height: 100px; object-fit: cover; background: var(--wash-light); }
.mx-cardimg.mx-noimg { height: 44px; }
.mx-cardname { padding: 4px 9px 0; font-size: 13px; font-weight: 500; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mx-cardsub { padding: 0 9px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The detail panel: between the map and the list. */
.mx-panel { position: relative; min-width: 0; height: 620px; overflow-y: auto; box-sizing: border-box; padding: 0 14px 14px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); }
.mx-panel[hidden] { display: none; }
.mx.mx-open .mx-mapbox { order: 1; }
.mx.mx-open .mx-panel { order: 2; }
.mx.mx-open .mx-listbox { order: 3; }
.mx-grab { display: none; }
.mx-close { position: sticky; top: 8px; float: right; z-index: 2; width: 32px; height: 32px; margin: 8px -6px 0 0; font-size: 14px; color: var(--slate); background: var(--paper); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.mx-photo { display: block; width: calc(100% + 28px); margin: 0 -14px 10px; max-height: 240px; object-fit: cover; background: var(--wash-light); }
.mx-photo.mx-noimg { height: 60px; width: 56px; margin: 12px 0 10px; border-radius: 3px; }
.mx-title { margin: 8px 0 2px; font-size: 21px; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; color: var(--slate); outline: none; }
.mx-where { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.mx-facts { font-size: 13.5px; line-height: 1.4; color: var(--slate); }
.mx-facts dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 10px; }
.mx-facts dt { color: var(--muted); font-size: 12.5px; }
.mx-facts dd { margin: 0; overflow-wrap: anywhere; }
/* a read fact's "about 73% sure" (site/factnote.js) */
.mx-facts dd .src { font-size: 11px; color: var(--muted); }
.mx-facts dd .src .sure { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.mx-facts .mx-links { margin: 10px 0 0; font-size: 13px; }
.mx-extra { margin: 10px 0 0; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.mx-extra[hidden] { display: none; }
.mx-acts { margin: 14px 0 0; }
.mx-act { font: inherit; font-size: 14px; font-weight: 500; padding: 8px 18px; color: #fff; background: var(--accent); border: 0; border-radius: 2px; cursor: pointer; }

/* A phone: the map stays in view on top, the list scrolls under it, the panel is a bottom sheet. */
@media (max-width: 819px) {
  .mx, .mx.mx-open { display: block; }
  .mx-mapbox { position: sticky; top: var(--mx-stick, 58px); z-index: 4; background: var(--paper); }
  .mx .mx-mapbox .map { height: 45vh; }
  .mx-listbox { height: auto; margin-top: 10px; }
  .mx-list { overflow: visible; flex: none; }
  .mx-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 75dvh; padding: 0 16px 20px; border: 0; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 24px rgba(31, 41, 51, 0.28); overscroll-behavior: contain; }
  .mx-grab { display: block; width: 44px; height: 4px; margin: 8px auto 2px; background: var(--line); border-radius: 2px; }
  .mx-photo { width: calc(100% + 32px); margin: 0 -16px 10px; }
  .mx-rowact { font-size: 11.5px; padding: 4px 8px; }
  .mx-thumb, .mx-num { width: 48px; height: 48px; }
  .mx-card { width: 170px; }
  .mx-cardimg { height: 84px; }
}
@media print {
  .mx { display: block; }
  .mx-listbox, .mx-panel, .mx-card { display: none !important; }
  .mx .mx-mapbox .map { height: auto; }
}
@media (prefers-reduced-motion: reduce) { .mx-row { transition: none; } }
