/* Bootstrapの上に載せる最小限の上書きのみ。レイアウト・配色の大半はBootstrapに委譲する。 */

.sidebar {
  width: 320px;
}

/* API通信中(loading=true)に表示する、クリックを塞ぐローディングオーバーレイ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.loading-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1.25rem 1.75rem;
  min-width: 260px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* 地図部分(サイドバー+地図の行)は高さを固定し、下にFAQ・お問い合わせを続けられるようにする
   (以前はhtml,body自体をvh-100+overflow:hiddenで固定し、地図が画面を占有していた)。 */
.map-row {
  height: 900px;
}
@media (max-width: 991.98px) {
  .map-row {
    height: 480px;
  }
}

/* 地図より下(FAQ・お問い合わせ・フッター)は薄いクリーム色のライトテーマにする。
   data-bs-theme="light"だけだとCSS変数(--bs-body-color等)は正しく再定義されるが、
   h1-h6等は継承されたcolorをそのまま使うため、明示的に指定しないと上位(dark)の
   文字色のままになってしまう。 */
.below-map {
  background-color: #faf6ec;
  color: var(--bs-body-color);
}

/* Bootstrapはoffcanvas-lgが静的サイドバー化するデスクトップ幅(lg以上)で
   .offcanvas-body の flex-grow を0・overflow-yをvisibleに上書きするため、
   中身が増えるとサイドバー枠からはみ出すだけでスクロールしなかった。
   枠の高さいっぱいに広げた上でoverflow-yを効かせ直す。 */
@media (min-width: 992px) {
  .offcanvas-lg.sidebar {
    /* .offcanvas-lgはこの幅ではdisplay:blockになる(flexにはならない)。
       高さを確定させた上でoverflow-yを隠し、子のoffcanvas-bodyをheight:100%で
       ぴったり収めて内側だけスクロールさせる。 */
    height: 100%;
    overflow-y: hidden;
  }
  .offcanvas-lg.sidebar .offcanvas-body {
    height: 100%;
    overflow-y: auto;
  }
}

#map {
  position: absolute;
  inset: 0;
}

.attribution-note {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 5;
  pointer-events: none;
}

.legend-title {
  font-size: 12px;
  color: var(--bs-secondary-color);
  margin-bottom: 6px;
}
.legend-scale {
  height: 10px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--bs-secondary-color);
}

.maplibregl-popup-content {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--bs-border-color);
}
.maplibregl-popup-tip {
  border-top-color: var(--bs-body-bg) !important;
  border-bottom-color: var(--bs-body-bg) !important;
}
.popup-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.graph-panel {
  background: var(--bs-body-bg);
  z-index: 5;
}
.chart-wrap {
  position: relative;
  height: 260px;
}
