/* 계절 명소 지도 — tokens from _side/daycare-map/toss-reference.md (light only).
   Spacing uses only --sp-*, type only --t*. */
:root {
  --brand: #3182f6;
  --brand-strong: #2272eb;
  --brand-soft: #e8f3ff;
  --brand-text: #1b64da;
  --bg: #ffffff;
  --surface: #f2f4f6;
  --border: #e5e8eb;
  --text: #191f28;
  --text-soft: #4e5968;
  --text-muted: #8b95a1;
  --danger: #e42939;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --sp-xs: 4px; --sp-md: 8px; --sp-lg: 16px; --sp-xl: 24px; --sp-xxl: 32px;
  --t3: 22px; --t3-lh: 31px;
  --t5: 17px; --t5-lh: 25.5px;
  --t6: 15px; --t6-lh: 22.5px;
  --t7: 13px; --t7-lh: 19.5px;
  --panel-w: 420px;
  --peek: 148px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: var(--t5); line-height: var(--t5-lh);
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--brand-text); text-decoration: none; }
h1, h2 { margin: 0; text-wrap: balance; }
:focus-visible { outline: none; box-shadow: 0 0 0 1px #8ac0ff, 0 0 0 3px #b8d9ff; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

#map { position: fixed; inset: 0; background: var(--surface); }

/* Controls floating on the map */
.pill {
  position: fixed; z-index: 500; top: calc(var(--sp-lg) + var(--safe-t)); left: var(--sp-lg);
  height: 38px; padding: 0 var(--sp-lg); border-radius: 10px;
  background: var(--bg); box-shadow: 0 2px 8px rgba(0, 12, 30, .16);
  font-size: var(--t6); font-weight: 600;
  display: inline-flex; align-items: center; gap: var(--sp-md);
}
.brand { font-weight: 800; color: var(--brand); letter-spacing: -0.02em; }
.pill::after { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: translateY(-2px) rotate(45deg); }
.btn {
  height: 48px; padding: 0 var(--sp-lg); border-radius: 14px;
  font-size: var(--t5); font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .1s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-weak { background: var(--brand-soft); color: var(--brand-text); }
.btn-block { width: 100%; height: 56px; border-radius: 16px; }
.btn:disabled { opacity: .4; }
.fab { position: fixed; z-index: 500; right: var(--sp-lg); bottom: calc(var(--peek) + var(--sp-lg) + var(--safe-b)); box-shadow: 0 4px 12px rgba(49, 130, 246, .32); }
.text-btn { font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-muted); padding: var(--sp-md) 0; }

/* Panel: bottom sheet on phones, right column on wide screens */
.panel {
  position: fixed; z-index: 600; left: 0; right: 0; bottom: 0;
  height: 68dvh; transform: translateY(calc(68dvh - var(--peek) - var(--safe-b)));
  background: var(--bg); border-radius: var(--sp-lg) var(--sp-lg) 0 0;
  box-shadow: 0 -2px 16px rgba(0, 12, 30, .12);
  display: flex; flex-direction: column; transition: transform .22s ease;
}
.panel.open { transform: none; }
.handle { flex: none; height: var(--sp-xl); display: flex; align-items: center; justify-content: center; }
.handle::before { content: ''; width: 36px; height: 4px; border-radius: 2px; background: var(--border); }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--sp-xl) calc(var(--sp-xl) + var(--safe-b)); }
.panel:not(.open) .panel-body { overflow: hidden; }

.head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-md); padding-bottom: var(--sp-md); }
.title { font-size: var(--t3); line-height: var(--t3-lh); font-weight: 700; }
.count { font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-muted); }
.back { font-size: var(--t6); line-height: var(--t6-lh); color: var(--text-soft); padding: var(--sp-xs) 0 var(--sp-md); display: inline-flex; align-items: center; gap: var(--sp-md); }
.back::before { content: ''; width: 8px; height: 8px; border-left: 2px solid var(--text-soft); border-bottom: 2px solid var(--text-soft); transform: rotate(45deg); }

.rows { list-style: none; margin: 0; padding: 0; }
.row { width: 100%; text-align: left; padding: var(--sp-md) 0; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-lg); }
.row-main { min-width: 0; flex: 1; }
.cover { flex: none; width: 64px; height: 64px; border-radius: 14px; background: var(--surface); object-fit: cover; display: block; }
.row-name { font-size: var(--t5); line-height: var(--t5-lh); font-weight: 600; }
.row-sub { font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-muted); text-wrap: pretty; }
.row-when { flex: none; font-size: var(--t6); line-height: var(--t6-lh); color: var(--text-soft); font-variant-numeric: tabular-nums; }
.row-when.now { color: var(--brand); font-weight: 600; }
.detail-top { display: flex; align-items: center; justify-content: space-between; }
.hero { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--sp-lg); overflow: hidden; background: var(--surface); margin-bottom: var(--sp-lg); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-credit { padding: 0 0 var(--sp-md); margin: calc(-1 * var(--sp-md)) 0 0; }
.eyebrow { margin: 0; font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--brand-text); }
.empty { padding: var(--sp-xxl) 0; text-align: center; color: var(--text-muted); font-size: var(--t6); line-height: var(--t6-lh); }

.sec { padding-top: var(--sp-xl); }
.sec-title { font-size: var(--t6); line-height: var(--t6-lh); font-weight: 600; color: var(--text-soft); padding-bottom: var(--sp-md); }
.kv { display: flex; justify-content: space-between; gap: var(--sp-lg); padding: var(--sp-md) 0; font-size: var(--t6); line-height: var(--t6-lh); }
.kv dt { color: var(--text-muted); flex: none; }
.kv dd { margin: 0; text-align: right; color: var(--text); }
dl { margin: 0; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xs); }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--sp-md); overflow: hidden; background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--sp-lg) var(--sp-md) var(--sp-xs); font-size: var(--t7); line-height: var(--t7-lh); color: #fff; background: linear-gradient(transparent, rgba(0, 12, 30, .6)); text-align: left; }

/* When the nearby photos were taken, by ten-day bucket */
.bars { display: flex; align-items: flex-end; gap: var(--sp-xs); height: 64px; }
.bar { flex: 1; min-width: 0; background: var(--brand-soft); border-radius: var(--sp-xs) var(--sp-xs) 0 0; }
.bar.peak { background: var(--brand); }
.bar-labels { display: flex; gap: var(--sp-xs); padding-top: var(--sp-xs); }
.bar-labels span { flex: 1; min-width: 0; font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-muted); text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Overlay sheets */
.overlay { position: fixed; z-index: 1000; inset: 0; background: rgba(0, 12, 30, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: var(--sp-lg) var(--sp-lg) 0 0; padding: var(--sp-xl) var(--sp-xl) calc(var(--sp-xl) + var(--safe-b)); }
.sheet .title { padding-bottom: var(--sp-lg); }
.photo-full { width: 100%; max-height: 56dvh; object-fit: contain; border-radius: var(--sp-md); background: var(--surface); display: block; }
.preview { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--sp-md); background: var(--surface); display: block; }
.field { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-lg); min-height: 56px; font-size: var(--t5); line-height: var(--t5-lh); }
.field label { color: var(--text-soft); flex: none; }
.field input, .field select { font: inherit; color: var(--text); border: 0; background: none; text-align: right; padding: var(--sp-md) 0; min-width: 0; }
.mini { position: relative; height: 180px; border-radius: var(--sp-md); overflow: hidden; background: var(--surface); }
.mini > div { height: 100%; }
.mini::after { content: ''; position: absolute; z-index: 500; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 12, 30, .4); pointer-events: none; }
.actions { display: flex; gap: var(--sp-md); padding-top: var(--sp-lg); }
.actions .btn { flex: 1 1 0; }
.error { color: var(--danger); font-size: var(--t7); line-height: var(--t7-lh); padding-top: var(--sp-md); min-height: var(--t7-lh); }
.credit { font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-muted); padding-top: var(--sp-md); margin: 0; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; padding-top: var(--sp-md); }

/* Map markers */
.pin, .dot { display: block; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 12, 30, .4); transform: translate(-50%, -50%); }
.pin { width: 18px; height: 18px; background: var(--brand); }
.pin.sel { width: 26px; height: 26px; background: var(--brand-strong); }
/* A photo with its own coordinates (uploads, citizen observations) */
.dot { width: 12px; height: 12px; background: var(--text-soft); border-width: 2px; }

@media (min-width: 900px) {
  #map { right: var(--panel-w); }
  .panel, .panel.open { top: 0; left: auto; width: var(--panel-w); height: auto; transform: none; border-radius: 0; box-shadow: -1px 0 0 var(--border); transition: none; }
  .panel .panel-body, .panel:not(.open) .panel-body { overflow-y: auto; padding-top: var(--sp-xl); }
  .handle { display: none; }
  .fab { right: calc(var(--panel-w) + var(--sp-xl)); bottom: var(--sp-xl); }
  .overlay { align-items: center; }
  .sheet { border-radius: var(--sp-lg); }
}
