/* JMA Warning Widget
   画面最前面に固定表示し、ドラッグで移動できるウィンドウ。
   幅は画面の35vw固定。高さは項目数に応じて自動調整し、
   最大35vh(初期の想定サイズ=画面の約1/8相当)を超える場合のみ内部スクロールする。 */

.jma-warning-widget {
  position: fixed;
  top: 4vh;
  right: 2vw;
  width: 35vw;
  height: auto;
  max-height: 35vh;
  min-width: 220px;
  z-index: 999998;
  background: rgba(255, 255, 255, 0.97);
  border: 2px solid #333;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

.jma-warning-widget * {
  box-sizing: border-box;
}

.jma-warning-widget__header {
  flex: 0 0 auto;
  background: #2c2c2c;
  color: #fff;
  padding: .5rem .75rem;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.jma-warning-widget__header.is-dragging {
  cursor: grabbing;
}

.jma-warning-widget__title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .03em;
}

.jma-warning-widget__debug {
  flex: 0 0 auto;
  margin: 0;
  padding: .3rem .7rem 0;
  font-size: .68rem;
  color: #1a73e8;
  font-family: monospace;
}

.jma-warning-widget__headline {
  flex: 0 0 auto;
  margin: 0;
  padding: .4rem .7rem 0;
  font-size: .8rem;
  color: #555;
  line-height: 1.4;
}

.jma-warning-widget__list {
  flex: 1 1 auto;
  margin: 0;
  padding: .6rem .7rem;
  overflow-y: auto;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.jma-warning-item {
  padding: .5rem .7rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
}

/* 気象庁公式の配色に準拠: 特別警報=紫、警報=赤、注意報=黄 */
.jma-warning-level-special {
  background: #8b00ff;
  color: #fff;
}

.jma-warning-level-warning {
  background: #e60012;
  color: #fff;
}

.jma-warning-level-advisory {
  background: #f5c800;
  color: #333;
}

.jma-warning-level-unknown {
  background: #888;
  color: #fff;
}

/* 地震情報(震度・震源地・津波コメント) */
.jma-warning-level-earthquake {
  background: #a0522d;
  color: #fff;
}

/* 降灰予報 */
.jma-warning-level-ash {
  background: #6d6259;
  color: #fff;
}

.jma-warning-item__title {
  display: block;
  font-size: 1.1rem;
  margin: 0 0 .2rem;
}

.jma-warning-item__detail {
  display: block;
  font-size: .85rem;
  font-weight: 400;
  margin: 0 0 .1rem;
}

/* 地域名の「先頭数件+他N件(タップで展開)」表示 */
.jma-area-list__toggle {
  display: inline-block;
  background: rgba(255, 255, 255, .35);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: .05em .65em;
  margin-left: .35em;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: .85em;
  line-height: 1.4;
}

.jma-area-list__toggle:hover,
.jma-area-list__toggle:active {
  background: rgba(255, 255, 255, .55);
}

.jma-area-list__rest {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.jma-warning-none {
  background: none;
  color: #555;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  padding: .75rem .5rem;
}

.jma-warning-widget__credit {
  flex: 0 0 auto;
  margin: 0;
  padding: .2rem .7rem .4rem;
  font-size: .65rem;
  color: #999;
  text-align: right;
}

.jma-warning-widget.is-dragging {
  opacity: .88;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

@media (max-width: 480px) {
  .jma-warning-widget {
    width: 60vw;
    max-height: 40vh;
  }
}
