/* リセット・タイポグラフィ・ボタン・上部バー・スマホ下部操作バー */

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--snow);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
.num {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
}

/* ===== 上部バー ===== */
.bar {
  position: sticky;
  top: 0;
  /* 詳細シートの幕（.sheet-backdrop 1200）と詳細シート（.sheet 1201）より前に出す。下に隠れると、詳細を
     開いている間はメニューも言語も押せなかった（CEO 指摘 2026-10-06）。写真の拡大表示（.lightbox 1300）よりは後ろ */
  z-index: 1250;
  height: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px)
    max(16px, env(safe-area-inset-right, 0px)) 0
    max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand svg {
  flex: none;
}
.brand-text {
  display: grid;
  line-height: 1.15;
  min-width: 0;
}
.brand-ja {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand-en {
  font-family: var(--data);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--mist);
  white-space: nowrap;
}
.bar-spacer {
  flex: 1;
}
.lang {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.lang button {
  border: 0;
  background: none;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--graphite);
  cursor: pointer;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .brand-en {
    display: none;
  }
  .lang button {
    padding: 5px 7px;
  }
  .bar {
    gap: 8px;
  }
}
.lang button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
}
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line, #c9d1d8);
}
.bar .btn-primary {
  display: none;
}
.menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.menu-btn {
  border: 0;
  background: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 8px;
}

/* メニュー・ドロップダウン（試作v2にはなかった新規コンポーネント：メニュー項目を実装する変更5のため） */
.menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1050;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(17, 26, 34, 0.16);
  padding: 6px;
  display: grid;
  gap: 2px;
  min-width: 200px;
}
.menu-dropdown a,
.menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.menu-dropdown a:hover,
.menu-dropdown button:hover {
  background: var(--wash);
}

/* 準備中バッジ・無効ボタン（フィールドメモ：変更4） */
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== スマホ下部の操作バー ===== */
.action-bar {
  position: fixed;
  z-index: 1100;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  backdrop-filter: blur(8px);
}
.action-bar .btn {
  padding: 12px 14px;
  font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* 地図を飛ばしている間は点・線・範囲を隠す（v2/js/map.js の hideShapesWhileFlying・2026-10-08）。
   飛ぶ途中の Leaflet は、この層を拡大の倍率のまま引き伸ばし、丸い点が画面いっぱいに広がって見えた */
.leaflet-container.is-flying .leaflet-overlay-pane,
.leaflet-container.is-flying .leaflet-marker-pane,
.leaflet-container.is-flying .leaflet-shadow-pane {
  visibility: hidden;
}
