/* Killogram — LCSD fitness-corner map page.
 * Self-contained layout for map.html. Safe to delete with the map feature.
 */

.map-disclaimer {
  max-width: var(--measure-wide);
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--bg-mint);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  line-height: var(--lh-body);
}

.map-source {
  max-width: var(--measure-wide);
  font-size: 13px;
  margin: 0;
}
.map-source a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
  border-radius: 2px;
  white-space: nowrap;
}
.map-source a:hover { color: var(--green); text-decoration: underline; }
.map-source a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.map-section { padding-bottom: var(--space-section); }

.map-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(150px, 200px) minmax(0, 1fr);
  gap: 16px 20px;
  margin-bottom: 16px;
  align-items: end;
}
.map-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--track-label);
  color: var(--muted);
}
.map-field select,
.map-field input {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: var(--track-body);
  line-height: 1.4;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  appearance: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.map-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235c6862' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.map-field select:hover,
.map-field input:hover { border-color: var(--green); }
.map-field select:focus,
.map-field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(70,136,109,.18);
}

.map-count { margin: 0 0 16px; font-size: 13px; }

.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .85fr);
  gap: 20px;
  align-items: stretch;
}

.map-canvas {
  height: 640px;
  min-height: 420px;
  background: var(--bg-mint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  z-index: 1;
}
.map-canvas .leaflet-container {
  height: 100%;
  width: 100%;
  font-family: inherit;
  background: var(--bg-mint);
}
.map-canvas .leaflet-control-attribution {
  font-size: 10px;
  letter-spacing: 0;
  background: rgba(242,243,241,.9);
  color: var(--muted);
}
.map-canvas .leaflet-control-attribution a { color: var(--green-dark); }

.map-list-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 0;
  overflow: hidden;
}
.map-list {
  height: 640px;
  overflow: auto;
  overscroll-behavior: contain;
}

.map-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  padding: 16px 18px 16px 16px;
  cursor: pointer;
  color: inherit;
  transition: background var(--ease), border-color var(--ease);
}
.map-item:last-child { border-bottom: 0; }
.map-item:hover { background: var(--bg-mint); }
.map-item:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.map-item.is-active {
  background: var(--bg-mint);
  border-left-color: var(--green);
}
.map-item-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: var(--track-heading);
  line-height: var(--lh-heading);
  margin-bottom: 4px;
}
.map-item-meta,
.map-item-addr {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: var(--lh-body);
  letter-spacing: var(--track-body);
}
.map-item-flag {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
}

.map-empty {
  padding: 32px 20px;
  color: var(--muted);
  font-size: 14px;
}

.klg-pin {
  background: var(--green);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(28,51,41,.35);
}
.klg-pin.is-active {
  background: var(--green-deep);
  box-shadow: 0 0 0 4px rgba(70,136,109,.35), 0 2px 8px rgba(28,51,41,.35);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(70,136,109,.22);
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
}

.klg-popup .leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  padding: 0;
}
.klg-popup .leaflet-popup-content {
  margin: 14px 16px 16px;
  min-width: 200px;
  line-height: var(--lh-body);
  letter-spacing: var(--track-body);
}
.klg-popup .leaflet-popup-tip { background: var(--card); }
.klg-popup h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: var(--track-heading);
  line-height: var(--lh-heading);
  margin: 0 0 6px;
}
.klg-popup p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.klg-popup-tag {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 600;
}
.klg-popup a {
  color: var(--green-dark);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.klg-popup a:hover { color: var(--green); text-decoration: underline; }

.map-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 860px) {
  .map-toolbar { grid-template-columns: 1fr 1fr; }
  .map-field-search { grid-column: 1 / -1; }
  .map-shell { grid-template-columns: 1fr; }
  .map-canvas { height: 420px; }
  .map-list { height: min(520px, 70vh); }
}

@media (max-width: 520px) {
  .map-toolbar { grid-template-columns: 1fr; }
  .map-field-search { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .map-item { transition: none; }
}
