/* clubmc.world — the map frame.
   The map is an instrument in a frame: the tools are anchored to the top and
   bottom edges of the frame, so the map itself is never covered. */

.map-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 76svh;
  min-height: 480px;
  background: #0A0A0A;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;          /* the closed panel must not widen the document */
}
@media (min-width: 900px) { .map-frame { height: 80svh; } }

.map-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  padding: .45rem .6rem;
  background: #0A0A0A;
  border-bottom: 1px solid var(--rule);
  z-index: 3;
}
.map-bar--bottom { border-bottom: 0; border-top: 1px solid var(--rule); }
.map-bar .spacer { flex: 1 1 auto; }

.map-tool {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-height: 32px;
  padding: .18rem .45rem;
  border: 1px solid var(--ink-4);
  border-radius: 2px;
  background: #101010;
}
.map-tool > label {
  font-family: var(--font-mono);
  font-size: .56rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  white-space: nowrap;
}
.map-tool input[type=search], .map-tool select {
  background: transparent;
  border: 0;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: .8rem;
  padding: .1rem;
  min-height: 28px;
  max-width: 150px;
}
.map-tool input[type=search] { width: 150px; }
.map-tool input[type=range] { width: 120px; accent-color: var(--gold); }
.map-tool .value {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--cream-dim);
  white-space: nowrap;
}
.map-tool.check { gap: .3rem; }
.map-tool.check label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--font-ui);
  font-size: .72rem;
  color: var(--cream-dim);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.map-tool.check input { accent-color: var(--gold); margin: 0; }

.map-seg { display: inline-flex; border: 1px solid var(--gold-lo); border-radius: 2px; overflow: hidden; }
.map-seg button {
  background: transparent;
  border: 0;
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .45rem .6rem;
  min-height: 32px;
  cursor: pointer;
}
.map-seg button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.map-seg button:hover { color: var(--gold); }
.map-seg button[aria-pressed="true"]:hover { color: var(--ink); }

.map-count { display: inline-flex; align-items: baseline; gap: .3rem; }
.map-count b { font-family: var(--font-display); color: var(--gold); font-size: 1.05rem; line-height: 1; }
.map-count span { font-family: var(--font-mono); font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cream-dim); }

.map-note {
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .07em;
  color: #6f6f6f;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 0;
  min-width: 0;
}
.map-note a { color: var(--cream-dim); }
.map-note a:hover { color: var(--gold); }

#map { flex: 1 1 auto; min-height: 0; position: relative; }

/* MapLibre's own controls, brought into the palette */
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(10, 10, 10, .8); }
.maplibregl-ctrl-attrib a { color: var(--cream-dim); }
.maplibregl-ctrl-attrib-button { background: transparent; filter: invert(1) opacity(.6); }
.maplibregl-ctrl-scale {
  background: rgba(10, 10, 10, .75);
  border-color: var(--gold-lo);
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .06em;
}
.maplibregl-ctrl-group { background: rgba(10, 10, 10, .85); border: 1px solid var(--ink-4); }
.maplibregl-ctrl-group button { filter: invert(1) opacity(.75); }
.maplibregl-ctrl-group button:hover { background: rgba(212, 175, 55, .15); }

/* the hover card, kept small so it never covers the map */
.cmc-hover .maplibregl-popup-content {
  background: rgba(16, 16, 16, .96);
  border: 1px solid var(--gold-lo);
  border-radius: 2px;
  padding: .45rem .6rem;
  color: var(--cream);
  font-family: var(--font-ui);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .6);
}
.cmc-hover .maplibregl-popup-tip { border-top-color: var(--gold-lo) !important; }
.hover-card { display: flex; flex-direction: column; gap: .1rem; }
.hover-card b { color: var(--gold); font-size: .82rem; font-weight: 600; }
.hover-card span { color: var(--cream-dim); font-size: .7rem; }

/* ---------------------------------------------------------- the side panel */
.map-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, 100%);
  background: rgba(12, 12, 12, .97);
  border-left: 1px solid var(--gold-lo);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 4;
  display: flex;
  flex-direction: column;
  box-shadow: -18px 0 40px rgba(0, 0, 0, .6);
}
.map-panel[data-open="true"] { transform: translateX(0); }
.map-panel .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .6rem;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--rule);
}
.map-panel .panel-body { overflow-y: auto; padding: .8rem; }
.map-panel h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0 0 .2rem;
}
.map-panel .meta { font-size: .78rem; color: var(--cream-dim); }
.map-panel .close {
  background: none;
  border: 1px solid var(--ink-4);
  color: var(--cream-dim);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
}
.map-panel .close:hover { border-color: var(--gold); color: var(--gold); }
.map-panel .facts { margin: .8rem 0; font-size: .82rem; }
.map-panel .facts div { display: flex; justify-content: space-between; gap: .8rem; padding: .22rem 0; border-bottom: 1px solid var(--ink-4); }
.map-panel .facts b { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 400; }
.map-panel .facts span { text-align: right; color: var(--cream-dim); }
.map-panel .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }
.map-panel .note { font-size: .72rem; color: #8a8a8a; margin-top: .9rem; line-height: 1.5; }

/* ------------------------------------------------- "near me", on this device */
.map-btn {
  background: none;
  border: 1px solid var(--gold-lo);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .32rem .55rem;
  cursor: pointer;
}
.map-btn:hover { background: rgba(212, 175, 55, .12); }
.map-btn[aria-pressed="true"] { background: var(--gold); color: var(--ink); border-color: var(--gold); }

.nearby-panel[hidden] { display: none; }
.nearby-panel {
  position: absolute;
  left: .6rem;
  bottom: .6rem;
  width: min(310px, calc(100% - 1.2rem));
  max-height: min(62%, 420px);
  background: rgba(12, 12, 12, .97);
  border: 1px solid var(--gold-lo);
  z-index: 5;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .6);
}
.nearby-panel .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--rule);
}
.nearby-panel h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0;
}
.nearby-panel .close {
  background: none;
  border: 1px solid var(--ink-4);
  color: var(--cream-dim);
  width: 24px; height: 24px;
  cursor: pointer;
  font-size: .85rem; line-height: 1;
}
.nearby-panel .close:hover { border-color: var(--gold); color: var(--gold); }
.nearby-panel .panel-body { overflow-y: auto; padding: .7rem; }
.nearby-lead { font-size: .78rem; color: var(--cream); margin: 0 0 .5rem; }
.nearby-list { list-style: none; margin: 0 0 .6rem; padding: 0; }
.nearby-list li { border-bottom: 1px solid var(--ink-4); }
.nearby-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 .5rem;
  padding: .4rem 0;
  text-decoration: none;
}
.nearby-list b { color: var(--gold); font-size: .82rem; font-weight: 600; }
.nearby-list span { grid-column: 1; font-size: .7rem; color: var(--cream-dim); }
.nearby-list i {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-style: normal;
  color: var(--cream);
  white-space: nowrap;
}
.nearby-list a:hover b { text-decoration: underline; }
.nearby-note { font-size: .72rem; color: var(--cream-dim); line-height: 1.5; margin: .4rem 0; }
.nearby-countries { font-size: .68rem; color: #8a8a8a; line-height: 1.6; margin: .3rem 0; }
.nearby-countries i { font-style: normal; color: var(--gold-lo); }
.nearby-privacy {
  font-size: .66rem;
  color: #7d7d7d;
  line-height: 1.5;
  margin: .6rem 0 0;
  border-top: 1px solid var(--ink-4);
  padding-top: .5rem;
}

@media (max-width: 720px) {
  .nearby-panel { bottom: .5rem; left: .5rem; right: .5rem; width: auto; max-height: 52%; }
}

@media (max-width: 720px) {
  .map-panel {
    top: auto;
    left: 0;
    width: 100%;
    height: 62%;
    border-left: 0;
    border-top: 1px solid var(--gold-lo);
    transform: translateY(100%);
  }
  .map-panel[data-open="true"] { transform: translateY(0); }
  .map-tool input[type=search] { width: 108px; }
  .map-tool select { max-width: 104px; }
  .map-note { display: none; }
}
