/* ===================================================================
   Tsunami Alert Component
   - A standalone stylesheet for the tsunami alert grid.
=================================================================== */

/* ▼ 1. コンテナ基本スタイル
------------------------------------------------- */
.tsunami-alert {
  margin: 1.6rem auto;
  padding: 1.2rem 0 1.6rem 0rem;
  background: #fff;
  border: 2.5px solid #f2e700;
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.045);
  max-width: 940px;
  box-sizing: border-box;
}


/* ▼ 2. 見出し (h2) と点滅ラベル
------------------------------------------------- */
.tsunami-alert h2 {
  margin-bottom: 0.8em;
  padding: 0 1.2em;
  background: #fff;
  color: #b40016; /* デフォルトカラー */
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  box-sizing: border-box;
}

.tsunami-alert .tsunami-label {
  animation: tsunami-alert-blink 1s infinite alternate;
  -webkit-animation: tsunami-alert-blink 1s infinite alternate;
  font-weight: bold;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.tsunami-alert .tsunami-label.normal {
  animation: none;
  -webkit-animation: none;
}

.tsunami-alert .tsunami-label a {
  transition: color 0.2s;
}

.tsunami-alert .tsunami-label a:hover {
  text-decoration: underline;
}

.tsunami-alert .headline-underline {
  width: 100%;
  height: 0;
  border-bottom: 2px solid #ffe000;  /* 注意報カラー */
  margin: 0 auto 1em auto;
  /* PCサイズのときの余白、ここでコントロール */
}

.tsunami-alert .headline-underline.caution {
  border-bottom-color: #ffe000;
}
.tsunami-alert .headline-underline.warning {
  border-bottom-color: #ff4444;
}
.tsunami-alert .headline-underline.normal {
  border-bottom-color: #8bc34a;
}

/* ▼ 3. 状態別スタイル (警報・注意報・通常)
------------------------------------------------- */
/* 警報 (Warning) */
.tsunami-alert.warning h2 {
  color: #b40016;
  border-bottom-color: #ff4444; /* 警報レッド */
}
.tsunami-alert .tsunami-label.warning { color: #ff4444; }
.tsunami-alert .tsunami-label.warning a { color: #ff4444; }
.tsunami-alert .tsunami-label.warning a:hover { color: #b40016; }

/* 注意報 (Caution) */
.tsunami-alert.caution h2 { color: #a88800; }
.tsunami-alert .tsunami-label.caution { color: #e0b000; }
.tsunami-alert .tsunami-label.caution a { color: #e0b000; }
.tsunami-alert .tsunami-label.caution a:hover { color: #a88800; }

/* 通常 (Normal) */
.tsunami-alert.normal h2 { color: #4a7500; }
.tsunami-alert .tsunami-label.normal { color: #5a8c00; }
.tsunami-alert .tsunami-label.normal a { color: #5a8c00; }
.tsunami-alert .tsunami-label.normal a:hover { color: #3f6600; }


/* ▼ 4. カードグリッドとカード本体
------------------------------------------------- */
.tsunami-alert .alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1.35rem 2rem;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 1.3rem auto;
  box-sizing: border-box;
  padding: 0 1.2rem;
}

.tsunami-alert .alert-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5em 1.2em;
  background: #fff;
  border: 3px solid; /* 色は状態クラスで指定 */
  border-left-width: 10px;
  border-radius: 13px;
  box-shadow: 0 1.5px 8px rgba(0,0,0,0.045);
  min-height: 108px;
  font-size: 1.09rem;
  box-sizing: border-box;
  transition: box-shadow 0.17s, border-color 0.17s;
}

/* カードの状態別配色 */
.tsunami-alert .alert-card.warning { border-color: #ff4444; background: #fff4f2; }
.tsunami-alert .alert-card.caution { border-color: #ffe000; background: #fffde7; }
.tsunami-alert .alert-card.normal  { border-color: #8bc34a; background: #f3fff0; }

/* カード内テキスト要素 */
.tsunami-alert .alert-card .area { font-weight: bold; font-size: 1.12em; margin-bottom: 0.15em; color: #232323; }
.tsunami-alert .alert-card .desc { font-size: 0.97em; margin-bottom: 0.06em; color: #555; }
.tsunami-alert .alert-card .height { font-size: 1.07em; font-weight: bold; margin-top: 0.13em; color: #c00; }


/* ▼ 5. 各種ノート・メッセージ要素
------------------------------------------------- */
/* 最上部ノート */
.tsunami-alert .tsunami-top-note {
  display: flex;
  flex-flow: column;
  gap: 1em; /* pタグ間の余白 */
  margin: 1.3em 1.2em 1.3em 1.2em;
  padding: 1.1em 1.4em;
  background: #f3f5f7;
  border-radius: 14px;
  box-shadow: 0 1.5px 7px rgba(60,80,100,0.04);
  color: #444;
  font-size: 1.02rem;
  line-height: 1.7;
}
.tsunami-alert .tsunami-top-note p {
  margin: 0; /* 親のgapで余白を管理するためリセット */
  font-size: 0.9rem;
  text-indent: 1rem;
  text-align: justify;
  font-feature-settings: "pkna";
  line-height: 1.5rem;
  color: #555555;
}

/* 観測値注記 (見出し直下) */
.tsunami-alert .tsunami-observed-note {
  margin: 0 1.2em 1.6em 1.2em;
  padding-bottom: 0.5em; /* 見た目の調整 */
  background: #fff;
  border-bottom: 1px solid #232323;
  color: #232323;
  font-size: 1.10rem;
  font-weight: 500;
}
.tsunami-alert .tsunami-observed-note strong {
  display: block;
  margin-bottom: 0.5em;
  font-size: 1.12em;
}
.tsunami-alert .tsunami-observed-note a {
  color: #0983e3;
  font-size: 0.98em;
  transition: color 0.2s;
}
.tsunami-alert .tsunami-observed-note a:hover {
  color: #1764b0;
}

/* 注意メッセージ */
.tsunami-alert .alert-message {
  margin: 1.6em 1.2em 0em 1.2em;
  padding: 0.8em 1em;
  background: #fefbe7;
  border-radius: 22px;
  box-shadow: 0 2px 10px rgba(220,200,40,0.03);
  color: #a57700;
  font-size: 1.13rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.75;
  transition: box-shadow 0.2s;
}


/* ▼ 6. アニメーション定義
------------------------------------------------- */
@keyframes tsunami-alert-blink {
  from { opacity: 1; }
  to { opacity: 0.2; }
}
@-webkit-keyframes tsunami-alert-blink {
  from { opacity: 1; }
  to { opacity: 0.2; }
}


/* ===================================================================
   7. レスポンシブデザイン
=================================================================== */

@media (max-width: 768px) {
  .tsunami-alert {
    padding: 0.7rem 0rem 1.1rem 0rem;
    max-width: 99vw;
  }
  .tsunami-alert h2 {
    font-size: 1.3rem;
    font-feature-settings: "palt";
    margin-bottom: 0.5em;
  }
  .tsunami-alert .alert-timestamp {
    display: block;
    font-size: 1.1rem;
    margin-top: 0.2em;
  }
  .tsunami-alert .headline-underline {
    margin: 0 auto 0em auto;  /* スマホは余白を縮めてギュッと */
  }
  .tsunami-alert .tsunami-top-note {
    padding: 0.8em 1em;
    margin: 1em 1.2em 1em 1.2em;
    gap: 0.8em;
  }
  .tsunami-alert .tsunami-observed-note {
    margin: 0 1.2em 1em 1.2em;
    font-size: 1rem;
  }
  .tsunami-alert .tsunami-observed-note strong {
    font-size: 1em;
  }
  .tsunami-alert .tsunami-observed-note p {
    font-size: 0.9rem;
  }
  .tsunami-alert .alert-grid {
    gap: 1rem; /* 縦横の隙間を均等に */
    margin-bottom: 0;
    max-width: 98vw;
  }
  .tsunami-alert .alert-card {
    font-size: 1.00rem;
    min-height: 85px;
    padding: 0.7em 0.8em;
    border-radius: 9px;
    margin: 0;   /* 念のため強制 */
  }
  .tsunami-alert .alert-message {
    padding: 0.6em 0.7em;
    font-size: 1.00rem;
    border-radius: 12px; /* 少し丸みを調整 */
  }
}

@media (max-width: 560px) {
  .tsunami-alert .alert-grid {
    grid-template-columns: 1fr;
  }
  .tsunami-alert .alert-card {
    min-width: 0;
    width: 100%;
  }
}