/* Map chrome on the home (the MVP wave, 2026-10-19; package a2). Loaded after tb-markers-v2.css; Baekja tokens
   (tb-baekja.css). index-legacy.html does not load it. */

/* The map ends at the window's bottom on desktop. /dist/css/critical.css gives #map 100vh while .main-content
   starts 72px down and clips, so the locate button, Naver's logo and its scale sat below the window. Phones
   size the map in tb-mobile-shell.css. */
@media (min-width: 769px) {
  body.tb-page #map.map-container { height: 100%; }
}
/* the "Skip to main content" target: focus moves on from here, no ring around the whole map area */
body.tb-page #main:focus { outline: none; }

/* With the panel docked the chip band ends at the panel: the main chips sit a little closer, which gives back the
   room the leading All chip takes (as many categories show as before it came). category-system.js peekMainRow
   ends an overflowing row inside a chip, never between two. */
@media (min-width: 769px) {
  body.tb-page .main-content:has(.right-panel.expanded) .category-ui .main-category { gap: 6px; }
  body.tb-page .main-content:has(.right-panel.expanded) .category-ui .main-category > button { padding-left: 12px; padding-right: 12px; }
  /* A map state on screen (core.js showMapState) and no place: the panel is display:none (tb-home-overrides.css)
     but keeps .expanded, so the band stopped at an edge nobody sees. It runs to the zoom control while the state
     shows. Keyed on the state, not on the panel: a load's band waits squeezed for the random place, never jumps. */
  body.tb-page:not(.place-detail-open) .main-content:has(#map-state:not([hidden])) .category-ui { right: 60px; }
}

/* Locate (app.js .location-btn-container > .location-btn; at ≤768px the shell's .tbm-locate draws the face) */
@media (min-width: 769px) {
  body.tb-page .location-btn-container {
    width: 40px; height: 40px; overflow: hidden; border-radius: 50%;
    background: rgba(249, 251, 253, 0.94);
    border: 1px solid var(--border-strong); box-shadow: var(--shadow-card);
  }
}
body.tb-page .location-btn {
  width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--color-ink-muted); cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
body.tb-page .location-btn:hover { background: var(--color-base-sunk); color: var(--color-ink); }
body.tb-page .location-btn.is-busy,
body.tb-page .location-btn.is-here { color: var(--color-celadon-deep); }
body.tb-page .location-btn.is-busy svg { animation: tb-mapc-spin 1.1s linear infinite; }
@keyframes tb-mapc-spin { to { transform: rotate(360deg); } }

/* "you are here": an icon.content marker (never Naver's default icon on the gl map) */
.tb-mapc-here { position: relative; width: 22px; height: 22px; }
.tb-mapc-here__dot {
  position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%;
  background: var(--color-celadon-deep, #44604F); border: 3px solid var(--color-base, #F9FBFD);
  box-shadow: 0 1px 4px rgba(28, 27, 24, 0.3);
}
.tb-mapc-here__pulse {
  position: absolute; left: -9px; top: -9px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(68, 96, 79, 0.18); animation: tb-mapc-pulse 2s ease-out infinite;
}
@keyframes tb-mapc-pulse { from { transform: scale(0.5); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tb-mapc-here__pulse, body.tb-page .location-btn.is-busy svg { animation: none; }
}

/* The map's own states (core.js showMapState): one porcelain card and one Try again, above #map-quiet */
body.tb-page .tb-mapc-state {
  position: absolute; inset: 0; z-index: 60; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-base);
}
body.tb-page .tb-mapc-state[hidden] { display: none; }
body.tb-page .tb-mapc-state__card { max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
body.tb-page .tb-mapc-state__title { margin: 0; font-family: 'Newsreader', 'Pretendard', serif; font-style: italic; font-size: 19px; color: var(--color-ink); }
body.tb-page .tb-mapc-state__note { margin: 0; font-size: 14px; line-height: 1.55; color: var(--color-ink-muted); }
body.tb-page .tb-mapc-state__retry {
  margin-top: 10px; padding: 9px 20px; cursor: pointer;
  border: 1px solid var(--color-celadon); border-radius: var(--radius-pill);
  background: transparent; color: var(--color-celadon-deep); font: 600 14px/1.2 var(--font-sans);
}
body.tb-page .tb-mapc-state__retry:hover { background: var(--color-celadon-soft); }
html[lang="ko"] body.tb-page .tb-mapc-state__note { word-break: keep-all; }

/* Visit History: the clock is an SVG; the chips and the Back/Forward buttons join the 999px chip family */
body.tb-page .visit-history-toggle-icon { display: inline-flex; }
body.tb-page .visit-history-toggle-icon svg { display: block; }
body.tb-page .visit-history-chip,
body.tb-page .visit-history-nav-btn { border-radius: var(--radius-pill); }
