/* In-page map tools (body.map-page). Viewers and the editor omit this file.
   Full screen restores the locked map-shell layout via body.is-fullscreen. */

body.map-page:not(.is-fullscreen) {
  height: auto;
  max-height: none;
  min-height: 100dvh;
  overflow: visible;
}

body.map-page:not(.is-fullscreen) .map-app {
  flex: none;
  width: min(72rem, calc(100% - 2rem));
  max-width: 72rem;
  margin: 0 auto 1.5rem;
}

/* In-page map stage + dock as a card pair (full screen keeps map-shell layout). */
body.map-page:not(.is-fullscreen) .map-stage {
  flex: none;
  height: 70vh;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
}

body.map-page:not(.is-fullscreen) .map-stage.antipodes-stage {
  height: 70vh;
  min-height: 360px;
}

body.map-page:not(.is-fullscreen) .graph-dock {
  flex: none;
  height: auto;
  min-height: 0;
  max-height: none;
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

body.map-page:not(.is-fullscreen) .dock-handle {
  display: none;
}

body.map-page:not(.is-fullscreen) .measure-body,
body.map-page:not(.is-fullscreen) .bearing-body,
body.map-page:not(.is-fullscreen) .antipodes-body,
body.map-page:not(.is-fullscreen) .coords-body,
body.map-page:not(.is-fullscreen) .photo-body,
body.map-page:not(.is-fullscreen) .geotag-body,
body.map-page:not(.is-fullscreen) .route-body,
body.map-page:not(.is-fullscreen) .sun-body {
  flex: none;
  min-height: 0;
  overflow: visible;
  padding: 1rem 1.15rem 1.15rem;
  background: var(--surface);
  border-top: 0;
}

body.map-page:not(.is-fullscreen) .measure-legs,
body.map-page:not(.is-fullscreen) .route-legs,
body.map-page:not(.is-fullscreen) .photo-list {
  max-height: 50vh;
  overflow: auto;
}

body.map-page .map-head {
  flex-shrink: 0;
  padding: 0.85rem 0 0.75rem;
}

body.map-page .map-head-inner {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
}

body.map-page .map-head h1 {
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

body.map-page .map-head .tool-lead {
  margin-top: 0.35rem;
  font-size: 1rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--text) 82%, transparent);
}

body.map-page .map-ad-top {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto 1rem;
}

body.map-page .map-ad-top:empty {
  display: none;
}

/* Guide hero without the H1/lead (they live in .map-head). */
body.map-page .tool-landing .tool-hero {
  padding-top: 1.75rem;
}

body.map-page .tool-landing .tool-pills {
  margin-top: 0;
}

body.map-page.is-fullscreen .map-app {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  margin: 0;
}

body.map-page.is-fullscreen .map-stage {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

body.map-page.is-fullscreen .map-head,
body.map-page.is-fullscreen .map-ad-top,
body.map-page.is-fullscreen #tool-guide,
body.map-page.is-fullscreen .site-footer {
  display: none;
}

.map-hint {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.map-hint.is-visible {
  opacity: 1;
}

/* Locate control (Leaflet bar under zoom). Tokens only. */
body.map-page .map-locate-control {
  margin-top: 0.35rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.map-page .map-locate {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--tint);
  color: var(--text);
  cursor: pointer;
  position: relative;
}

body.map-page .map-locate::after {
  content: "";
  position: absolute;
  inset: -4px;
}

body.map-page .map-locate:hover,
body.map-page .map-locate:focus {
  background: var(--tint-strong);
}

body.map-page .map-locate:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

body.map-page .map-locate[disabled] {
  opacity: 0.6;
  cursor: progress;
}

body.map-page .map-locate svg {
  display: block;
  width: 18px;
  height: 18px;
}

body.map-page .map-locate-fix {
  stroke: var(--surface);
  stroke-width: 3;
  fill: var(--brand);
  fill-opacity: 1;
}

body.map-page .map-locate-fix-accuracy {
  stroke: var(--brand);
  stroke-width: 1.5;
  fill: var(--brand);
  fill-opacity: 0.12;
}

@media (pointer: coarse) {
  body.map-page .map-locate {
    width: 2.75rem;
    height: 2.75rem;
  }
}

@media (max-width: 720px) {
  body.map-page:not(.is-fullscreen) .map-app {
    width: auto;
    margin-inline: 16px;
    margin-bottom: 1.5rem;
  }

  body.map-page:not(.is-fullscreen) .map-stage,
  body.map-page:not(.is-fullscreen) .map-stage.antipodes-stage {
    height: 60svh;
    min-height: 300px;
  }

  body.map-page:not(.is-fullscreen) .graph-dock {
    margin-top: 12px;
  }

  body.map-page:not(.is-fullscreen) .measure-body,
  body.map-page:not(.is-fullscreen) .bearing-body,
  body.map-page:not(.is-fullscreen) .antipodes-body,
  body.map-page:not(.is-fullscreen) .coords-body,
  body.map-page:not(.is-fullscreen) .photo-body,
  body.map-page:not(.is-fullscreen) .route-body,
  body.map-page:not(.is-fullscreen) .sun-body {
    padding: 0.85rem 0.9rem 1rem;
  }

  body.map-page .map-head {
    padding: 0.7rem 0 0.6rem;
  }

  body.map-page .map-head h1 {
    font-size: 1.15rem;
  }

  body.map-page .map-head .tool-lead {
    font-size: 0.95rem;
  }

  body.map-page .map-ad-top {
    width: auto;
    margin-inline: 16px;
  }
}
