@font-face {
  font-family: 'Libre Franklin';
  src: url('../fonts/LibreFranklin-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1a1a1a;
  --paper: #ffffff;
  --hair: rgba(0, 0, 0, 0.12);
  --font: 'Libre Franklin', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
}

#app, #map { position: absolute; inset: 0; }

/* Legend — plain text over the map (no panel), top-left, with title + minimize */
#legend {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 2;
  width: min(92vw, 340px);
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 3px rgba(255, 255, 255, 0.9);
}
.lg-inner { width: 100%; line-height: 1.45; }
.lg-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.lg-btns { display: flex; gap: 6px; flex: none; }
.lg-body { margin-top: 2px; }
.lg-title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(18px, 2.6vw, 24px);
  letter-spacing: 0.01em;
  line-height: 1.05;
}
.lg-heading { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.lg-heading .title-swimmer {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
  margin-left: 0.15em;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.95));
}
#langtoggle, #geoloc, #mintoggle {
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border: 1px solid var(--hair);
  background: #f4f4f5;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  flex: none;
  text-shadow: none;
}
#geoloc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
#langtoggle:hover, #geoloc:hover, #mintoggle:hover { background: #e9e9eb; }
.lg-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.lg-toggle { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; cursor: pointer; }
.lg-toggle input { cursor: pointer; margin: 0; }
.lg-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px white;
  flex: none;
}

.lg-transp { color: #888; }
.lg-updated { display: inline-block; margin-bottom: 3px; color: #444; }

/* Standalone credits box, bottom-left; minimizes to a single "Credits" word. */
#credits {
  position: absolute;
  bottom: 14px;
  left: 16px;
  z-index: 2;
  max-width: min(92vw, 340px);
  font-size: 10.5px;
  color: #666;
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 3px rgba(255, 255, 255, 0.9);
}
#credits a { color: #2c7fb8; }
.cr-body { margin-bottom: 4px; }
.cr-chip {
  display: inline-block;
  font-family: inherit; font-weight: 700; font-size: 12px; color: #333;
  background: none; border: none; padding: 0; cursor: pointer;
  text-decoration: underline;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 3px rgba(255, 255, 255, 0.9);
}

/* "Share 📋" link, bottom-right, same style as the credits chip. */
#share { position: absolute; bottom: 14px; right: 16px; z-index: 2; }
.share-link {
  font-family: inherit; font-weight: 700; font-size: 12px; color: #333;
  background: none; border: none; padding: 0; cursor: pointer;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 3px rgba(255, 255, 255, 0.9);
}
.share-link .u { text-decoration: underline; }

/* Default geolocate control is hidden — triggered from the legend button. */
.maplibregl-ctrl-bottom-right { display: none; }

/* Popup — circular, matching the legend */
/* Popups — bare, square, tight */
.maplibregl-popup-content {
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 8px 10px;
}
/* Faint thin grey outline hugging the whole bubble + nib. A drop-shadow on the
   popup follows the combined content+tip silhouette (no seam at the nib) and works
   for both above/below anchors; stacked twice to read as a crisp line, not a blur. */
.maplibregl-popup {
  filter: drop-shadow(0 0 0.4px rgba(107, 114, 128, 0.85)) drop-shadow(0 0 0.4px rgba(107, 114, 128, 0.85));
}
/* Small downward tip so a popup clearly stems from the point beneath it (all our
   popups anchor 'bottom', i.e. sit above the point). */
.maplibregl-popup-tip { display: block; border: 7px solid transparent; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #fff; border-bottom: none; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #fff; border-top: none; }
.maplibregl-popup-close-button { z-index: 1; }
/* Ambient centre preview: read-only, so pointer events pass through to the map. */
.maplibregl-popup.popup-preview { pointer-events: none; }

.popup { font-family: var(--font); min-width: 160px; }
.popup h2 { margin: 0 0 3px; font-size: 13.5px; font-weight: 700; line-height: 1.15; }
.popup h2 .pool-link { color: inherit; text-decoration: none; }
.popup h2 .pool-link:hover { text-decoration: underline; }
.popup .status { font-weight: 600; font-size: 12px; margin-bottom: 6px; }
.popup .status-next { display: inline-block; margin-top: 2px; } /* next open hours — bold (inherits .status) */
.popup .status-when { display: inline-block; margin-top: 2px; font-weight: 400; color: #666; } /* further shifts — not bold */
.popup .actions { display: flex; flex-direction: column; gap: 3px; }
.popup .btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  padding: 2px 0;
  border: none;
  border-radius: 0;
  background: none;
  color: #2c7fb8;
  cursor: pointer;
}
.popup .btn:hover { text-decoration: underline; }
.popup .btn-ics { color: #2c7fb8; }
.popup .week-dd { margin-top: 0; }
.popup .week-dd summary {
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  color: #2c7fb8;
  cursor: pointer;
  padding: 2px 0;
  list-style: none;
}
.popup .week-dd summary::-webkit-details-marker { display: none; }
.popup .week-dd summary::marker { content: ''; }
.popup .week-dd summary:hover { text-decoration: underline; }
.popup .week-dd summary::after {
  content: '⌄';
  display: inline-block;
  margin-left: 5px;
  font-size: 11px;
  line-height: 1;
}
.popup .week-dd[open] summary::after { transform: rotate(180deg); }
.popup .week { font-size: 11.5px; color: #444; margin: 6px 0; max-height: 130px; overflow: auto; }
.popup .day { padding: 1px 0; }
.popup .day.today { font-weight: 700; color: var(--ink); }
.popup .day .dname { display: inline-block; width: 30px; color: #888; font-weight: 600; }
.popup .day.today .dname { color: var(--ink); }

#loaderr {
  position: absolute; inset: 0; display: grid; place-content: center;
  text-align: center; color: #666; z-index: 3; background: #fff;
}
