/* 積雪・降雪のページ（/v2/snow/・snow-page.js）に固有の見た目。
   レイアウト・上部バー・パネル・シートはホームと同じ top.css を使い、ここでは違う所だけを書く（2026-10-09） */

/* ===== 地図の上：指標の切り替え ===== */
.snow-controls {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  right: 60px;
  display: grid;
  justify-items: start;
  gap: 6px;
  pointer-events: none;
}
.snow-controls .seg {
  pointer-events: auto;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.snow-controls .seg::-webkit-scrollbar {
  display: none;
}
.snow-controls .seg[hidden] {
  display: none;
}
.snow-controls .seg button {
  display: block;
  padding: 8px 12px 7px;
  font: 500 13px/1.2 var(--ui);
  color: var(--graphite);
  white-space: nowrap;
}
.snow-controls .seg button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.snow-windows button {
  font-family: var(--data) !important;
  font-size: 12px !important;
  padding: 6px 10px 5px !important;
}

/* ===== 地図の上：気象庁の面 ===== */
.snow-gridctl {
  position: absolute;
  z-index: 500;
  right: 12px;
  bottom: 26px;
  max-width: min(320px, calc(100% - 24px));
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(17, 26, 34, 0.12);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--graphite);
}
.snow-gridctl.is-off {
  opacity: 0.75;
}
.snow-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
}
.snow-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
  margin: 0;
}
.snow-gridctl.is-off .snow-toggle {
  color: var(--mist);
  cursor: default;
}
.snow-slider {
  display: grid;
  gap: 3px;
}
.snow-slider[hidden] {
  display: none;
}
.snow-slider input {
  width: 100%;
  accent-color: var(--ink);
  margin: 0;
}
.snow-slider span {
  font-family: var(--data);
  font-size: 11px;
}
.snow-grid-note {
  font-size: 10px;
  line-height: 1.5;
  color: var(--graphite);
}
.foot .attrib a {
  color: inherit;
  word-break: break-all;
}
.leaflet-pane .snow-grid-tiles {
  image-rendering: pixelated;
}

/* ===== 凡例 ===== */
.snow-legend {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 26px;
  max-width: calc(100% - 24px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 7px 10px 6px;
  display: grid;
  gap: 5px;
  pointer-events: none;
}
.snow-legend-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--graphite);
}
.snow-legend-bar {
  display: flex;
  padding-bottom: 13px;
}
.snow-legend-cell {
  position: relative;
  width: 26px;
  height: 9px;
}
.snow-legend-cell:first-child {
  border-radius: 3px 0 0 3px;
}
.snow-legend-cell:last-child {
  border-radius: 0 3px 3px 0;
}
.snow-legend-cell small {
  position: absolute;
  left: 0;
  top: 12px;
  transform: translateX(-50%);
  font: 500 10px/1 var(--data);
  color: var(--graphite);
  white-space: nowrap;
}
/* 凡例と面の操作が重なる狭い画面では、面の操作を凡例の上に積む */
@media (max-width: 700px) {
  /* 面の説明は狭い画面では地図を隠すので出さない（同じことを「データについて」に書いている） */
  .snow-grid-note {
    display: none;
  }
  .snow-gridctl {
    left: 12px;
    right: auto;
    bottom: 80px;
  }
  .snow-legend-cell {
    width: 22px;
  }
}

/* ===== 地図の地点の値の札 ===== */
.snow-chip-wrap {
  background: none;
  border: 0;
}
.snow-chip {
  display: inline-block;
  transform: translate(-50%, -50%);
  font: 600 12px/1 var(--data);
  padding: 3px 5px 2px;
  border-radius: 9px;
  white-space: nowrap;
  box-shadow:
    0 0 0 1.5px #fff,
    0 1px 4px rgba(17, 26, 34, 0.35);
  cursor: pointer;
}
/* 窓の中に欠けた時間がある値（ランキングから外している値）は薄く */
.snow-chip.is-partial {
  opacity: 0.45;
}
.snow-chip-arrow {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  margin-right: 3px;
}
/* 風の矢印（風速の地図だけ） */
.snow-arrow-wrap {
  background: none;
  border: 0;
  pointer-events: none;
}
.snow-arrow {
  display: block;
  overflow: visible;
  transform-origin: 50% 50%;
}
.snow-arrow line {
  stroke: #111a22;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.snow-arrow path {
  fill: #111a22;
}
.snow-legend-note {
  max-width: 300px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--graphite);
}
/* 札を出す縮尺では点を隠す（同じ地点を2つ重ねない） */
.snow-chips-on .leaflet-snowStations-pane {
  opacity: 0;
  pointer-events: none;
}

/* ===== パネル ===== */
.snow-intro {
  gap: 6px;
}
.snow-intro h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.snow-intro p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--graphite);
}
.snow-obs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-family: var(--data);
  font-size: 12px !important;
  color: var(--ink) !important;
}
.snow-count {
  color: var(--mist);
}
.snow-msg {
  background: var(--wash);
  border-radius: 8px;
  padding: 10px 12px;
}
.snow-msg[hidden] {
  display: none;
}

.snow-find {
  gap: 0;
  position: relative;
}
.snow-search-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  display: grid;
}
.snow-search-list[hidden] {
  display: none;
}
.snow-search-list button {
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 6px;
  font: 14px var(--ui);
  color: var(--ink);
  cursor: pointer;
}
.snow-search-list button:hover,
.snow-search-list button:focus-visible {
  background: var(--wash);
}
.snow-search-none {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--mist);
}

.snow-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ランキング */
.snow-rank {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.snow-rank li + li {
  border-top: 1px solid var(--wash);
}
.snow-rank-item {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 118px;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--ui);
}
.snow-rank-item:hover,
.snow-rank-item:focus-visible {
  background: var(--snow);
}
.snow-rank-n {
  font: 600 12px var(--data);
  color: var(--mist);
  text-align: right;
}
.snow-rank-name {
  display: grid;
  min-width: 0;
}
.snow-rank-name b {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.snow-rank-name small {
  font-size: 11px;
  line-height: 1.5;
  color: var(--graphite);
}
.snow-rank-val {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3px;
  padding-bottom: 6px;
}
.snow-rank-val i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  border-radius: 2px;
}
.snow-rank-val b {
  font: 600 17px/1 var(--data);
  color: var(--ink);
}
.snow-rank-val small {
  font-size: 11px;
  color: var(--graphite);
}
.snow-rank-empty,
.snow-rank-more {
  padding: 10px 2px;
  font-size: 13px;
  color: var(--graphite);
}
.snow-excluded {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--mist);
}
.snow-madeby {
  margin: 0;
  font-size: 11px;
  color: var(--mist);
}
.snow-about a {
  color: var(--link);
}
.snow-excluded[hidden] {
  display: none;
}

.snow-about ul {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--graphite);
}

/* ===== 地点の詳細（シート） ===== */
@media (min-width: 1024px) {
  .snow-sheet {
    width: 520px;
  }
}
.snow-sheet .sheet-body {
  padding: 4px 18px 24px;
  display: grid;
  /* 行は中身の高さ（overflow: hidden の欄が、シートの高さに合わせて潰れないように） */
  grid-auto-rows: max-content;
  gap: 16px;
  align-content: start;
}
.sd-meta {
  margin: 0;
  font-size: 13px;
  color: var(--graphite);
}
.sd-warn {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fdf0ee;
  color: #8a2a22;
  font-size: 13px;
}
.sd-note {
  margin: 0;
  font-size: 12px;
  color: var(--mist);
}
.sd-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.sd-stat {
  background: var(--paper);
  padding: 10px 11px 9px;
  display: grid;
  align-content: start;
  gap: 3px;
}
.sd-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--graphite);
}
.sd-stat-value {
  font: 600 22px/1.1 var(--data);
  color: var(--ink);
}
.sd-stat-unit {
  font: 500 12px var(--ui);
  color: var(--graphite);
  margin-left: 3px;
}
.sd-stat-sub {
  font-size: 11px;
  line-height: 1.45;
  color: var(--mist);
}
@media (max-width: 420px) {
  .sd-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.sd-sec {
  display: grid;
  gap: 8px;
}
.sd-sec h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--graphite);
}
.sd-facts {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}
.sd-range {
  width: fit-content;
}
.sd-range[hidden],
.linkish[hidden] {
  display: none;
}
.sd-range button {
  padding: 6px 12px 5px;
  font: 500 12px var(--ui);
  color: var(--graphite);
}
.sd-range button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.linkish {
  justify-self: start;
  border: 0;
  background: none;
  padding: 0;
  font: 500 12px var(--ui);
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}
.sd-near-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.sd-near-list a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  color: var(--link);
}
.sd-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== グラフ ===== */
.sc-area {
  position: relative;
  min-height: 120px;
}
.sc-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  user-select: none;
}
.sc-title {
  font: 700 11px var(--ui);
  fill: var(--graphite);
}
.sc-tick {
  font: 500 10px var(--data);
  fill: var(--mist);
}
.sc-key {
  font: 500 10px var(--ui);
  fill: var(--graphite);
}
.sc-empty {
  margin: 0;
  padding: 24px 0;
  font-size: 13px;
  color: var(--mist);
  text-align: center;
}
.sc-tip {
  position: absolute;
  top: 0;
  z-index: 3;
  min-width: 150px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(17, 26, 34, 0.16);
  padding: 7px 9px;
  display: grid;
  gap: 3px;
  pointer-events: none;
  font-size: 11px;
}
.sc-tip[hidden] {
  display: none;
}
.sc-tip-time {
  font: 600 11px var(--data);
  color: var(--ink);
  margin-bottom: 2px;
}
.sc-tip-row {
  display: grid;
  grid-template-columns: 10px auto 1fr;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sc-tip-row i {
  width: 10px;
  height: 2px;
  border-radius: 1px;
}
.sc-tip-row b {
  font: 600 12px var(--data);
  color: var(--ink);
}
.sc-tip-row span {
  color: var(--graphite);
}
.sc-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.sc-table-wrap[hidden] {
  display: none;
}
.sc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.sc-table th {
  position: sticky;
  top: 0;
  background: var(--snow);
  font-weight: 500;
  color: var(--graphite);
  text-align: right;
  padding: 6px 8px;
  white-space: nowrap;
}
.sc-table td {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 4px 8px;
  border-top: 1px solid var(--wash);
  white-space: nowrap;
}
.sc-table th:first-child,
.sc-table td:first-child {
  text-align: left;
}
