/* style.css — スマホ縦長ファースト、中央揃え、青春カラー、カード風吹き出し */

/* reset & base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: "Hiragino Sans","Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(135deg,#fff0f6,#e8f7ff); /* 淡い青春トーン */
  color: #222;
  -webkit-tap-highlight-color: transparent;
}

/* header */
.site-header {
  padding: 12px 16px;
  text-align: center;
  background: linear-gradient(90deg,#94b9ff,#e894ff);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.site-header h1 { margin: 0; font-size: 1.1rem; }
.site-header .sub { margin-top: 6px; font-size: 0.85rem; opacity: .95; }

/* tabs */
.tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.tab-button {
  padding: 8px 10px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.95);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.tab-button.active {
  background: linear-gradient(90deg,#94b9ff,#e894ff);
  color: #fff;
  font-weight: 700;
}

/* main */
.main {
  display: block;
  padding: 10px 8px 80px; /* bottom padding to avoid overlap with list-toggle */
}

/* wrapper: CENTER-align */
.map-wrapper {
  width: 100%;
  display: flex;
  justify-content: center; /* 中央揃え */
  align-items: center;
  padding: 8px;
  touch-action: pan-y; /* page scroll allowed */
}

/* map: inline-block so its width = image displayed width */
.map {
  display: inline-block;
  position: relative;
  border-radius: 12px;
  overflow: visible;
  background: #fff;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 8px 20px rgba(0,0,0,0.10);
}

/* image: height-based fit (vertical-first) */
.map img#mapImage {
  height: calc(100vh - 170px); /* header+tabs+margins を差し引いた高さ（スマホ縦長最適） */
  width: auto;
  max-width: 92vw;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* interactions happen on pins */
  border-radius: 8px;
}

/* pins overlay */
#pins {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* default: clicks pass through; pins themselves enable pointer-events */
}

/* pin */
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  width: 40px;
  height: 40px;
  z-index: 6;
}
.pin img { width: 100%; height: 100%; display:block; }

/* tooltip (card) */
.tooltip {
  position: absolute;
  z-index: 9;
  transform: translate(-50%, -120%);
  display: none;
  min-width: 200px;
  max-width: 86vw;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  background: #fff;
  overflow: hidden;
  animation: tooltipEnter .18s ease;
}
@keyframes tooltipEnter {
  from { opacity: 0; transform: translate(-50%,-115%) scale(.99); }
  to { opacity: 1; transform: translate(-50%,-120%) scale(1); }
}
.tooltip-card { position: relative; display:block; }
.tooltip-header {
  background: linear-gradient(90deg,#94b9ff,#e894ff);
  color: #fff;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
}
.tooltip-body { padding: 10px 12px; text-align: left; color: #222; font-size: 0.95rem; }
.tooltip-body img { width: 100%; border-radius: 8px; display:block; margin-bottom: 8px; object-fit: cover; }
.tooltip-body p { margin: 0; line-height: 1.4; color: #444; }
.tooltip .link { display:inline-block; margin-top:8px; color:#2b7bd3; text-decoration: none; font-weight:600; }

/* tooltip close button */
.tooltip .close-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(255,255,255,0.85);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* list toggle button */
.list-toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  background: linear-gradient(90deg,#94b9ff,#e894ff);
  color: #fff;
  border: none;
  padding: 12px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  font-weight: 700;
  cursor: pointer;
}

/* bottom list panel (sheet) */
.list-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: #fff;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.18);
  transform: translateY(110%);
  transition: transform .28s cubic-bezier(.2,.9,.2,1);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
}
.list-panel.open { transform: translateY(0); }
.list-panel-header { display:flex; align-items:center; justify-content:space-between; padding:12px; border-bottom:1px solid #eee; }
.list-content { overflow:auto; padding:8px 12px 24px; }

/* shop list rows */
.shop-item { display:flex; gap:10px; padding:10px; border-radius:10px; align-items:center; cursor:pointer; transition: background .12s ease; }
.shop-item:hover { background: rgba(220,235,255,0.6); }
.shop-thumb { width:64px; height:64px; border-radius:8px; object-fit:cover; flex:0 0 64px; }
.shop-meta { text-align:left; flex:1; }
.shop-title { font-weight:700; margin:0; font-size:0.98rem; }
.shop-desc { margin:6px 0 0; font-size:0.9rem; color:#555; }

/* responsive */
@media (min-width: 720px) {
  .map img#mapImage { height: calc(100vh - 200px); }
  .pin { width: 48px; height: 48px; }
  .tooltip { min-width: 240px; }
}

/* utility */
.hidden { display: none !important; }

::-webkit-scrollbar {
  width: 15px;
}
::-webkit-scrollbar-track {
  background-color: #3b3b3b;
}
::-webkit-scrollbar-thumb {
  background-color: #b3d3e2;
  border-radius: 15px;
}
