/*
 * Hephaestusによる情報神殿 装飾法典 Final Version (真・完全無欠版)
 */

/* ============================================= */
/* 0. 共通コンポーネント                         */
/* ============================================= */
.analysis-header { display: flex; align-items: center; gap: 20px; background-color: #ffffff; padding: 25px 30px; border-radius: 12px; margin-bottom: 40px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #e3eaf2; }
.analysis-header img { height: 80px; width: auto; }
.analysis-header h1 { font-size: 2em; color: var(--primary-color); margin-bottom: 10px; font-weight: bold; }
.analysis-header p { color: #4a5568; margin: 0; line-height: 1.8; font-size: 1.05em; }
.info-tabs { display: flex; justify-content: center; margin-bottom: 30px; border-bottom: 2px solid #e2e8f0; }
.info-tabs .tab-link { padding: 12px 30px; text-decoration: none; color: #718096; font-size: 1.2em; font-weight: bold; border-bottom: 4px solid transparent; margin-bottom: -2px; transition: all 0.3s ease; }
.info-tabs .tab-link:hover { color: var(--primary-color); }
.info-tabs .tab-link.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.loading-message { text-align: center; padding: 60px 20px; color: #718096; font-size: 1.1em; }
.spinner { width: 50px; height: 50px; border: 4px solid #edf2f7; border-top: 4px solid var(--secondary-color); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 25px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.advice-box { margin-top: 60px; background-color: #f7fafc; padding: 30px; border-radius: 12px; border-left: 6px solid var(--secondary-color); box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.advice-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.advice-header img { height: 45px; width: auto; }
.advice-header h3 { font-size: 1.6em; color: var(--primary-color); margin: 0; font-weight: bold; }
.advice-box p { font-size: 1.15em; margin-bottom: 15px; color: #2d3748; }
.advice-box ul { padding-left: 25px; margin-top: 15px; }
.advice-box li { margin-bottom: 12px; line-height: 1.8; color: #4a5568; font-size: 1.05em; }

/* ============================================= */
/* 1. 共通カードスタイル (統一された美)           */
/* ============================================= */
.info-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    padding: 0; /* 内部の余白は子要素で管理 */
    border: 1px solid #edf2f7;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.info-card:hover { transform: translateY(-2px); box-shadow: 0 15px 40px rgba(0,0,0,0.12); }

/* カード種別を示す左ボーダー */
.earthquake-card { border-left: 8px solid #0055a5; }
.special-info-card, .clyzer-card { border-left: 8px solid var(--accent-color); }
.weather-card { border-left: 8px solid var(--secondary-color); } /* デフォルト */
.tsunami-card { border-left: 8px solid #2990CB; }
.volcano-card { border-left: 8px solid #7B33A8; }

/* ヘッダー */
.info-header {
    padding: 25px 30px 20px 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    background: #fff;
}
.info-header-left { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.info-header h3 { font-size: 1.8em; margin: 0; line-height: 1.3; color: #1a202c; font-weight: bold; }
.info-name {
    font-size: 0.9em;
    background: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 0.05em;
    display: inline-block;
}

/* ボディとセクション */
.info-body, .weather-body, .tsunami-body { padding: 0 30px 30px 30px; }
.info-section, .weather-section, .tsunami-section {
    padding-top: 25px;
    margin-top: 25px;
    border-top: 1px dashed #e2e8f0;
}
.info-section:first-child, .weather-section:first-child, .tsunami-section:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}
.info-section h4, .weather-section h4, .tsunami-section h4 {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #2d3748;
    display: flex;
    align-items: center;
}
.info-section h4::before, .weather-section h4::before, .tsunami-section h4::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background-color: var(--secondary-color);
    margin-right: 10px;
    border-radius: 2px;
}

/* フッター */
.info-footer {
    padding: 20px 30px;
    background-color: #f8fafc;
    border-top: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    color: #718096;
}
.info-time-block { display: flex; flex-direction: column; gap: 4px; }

/* ============================================= */
/* 2. 地震・長周期地震動 専用スタイル             */
/* ============================================= */
.detail-button {
    background-color: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.detail-button:hover { background-color: var(--primary-color); color: #fff; }

.eq-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}
.eq-detail-item {
    padding: 15px;
    border-radius: 10px;
    background-color: #f7fafc;
    border: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
}
.eq-detail-item strong { font-size: 0.85em; color: #718096; margin-bottom: 5px; }
.eq-detail-item span { font-size: 1.6em; font-weight: bold; color: #2d3748; }

/* 震度・階級の色定義 (ボーダーで表現し可読性確保) */
.eq-detail-item.egic-level-info { border-left: 6px solid #cbd5e0; }
.eq-detail-item { border-left-width: 6px; border-left-style: solid; }

/* 震度色 (P2P地震情報互換) */
.egic-level-0 { border-left-color: #3F4842; }
.egic-level-1 { border-left-color: #899499; }
.egic-level-2 { border-left-color: #2990CB; }
.egic-level-3 { border-left-color: #4FAE74; }
.egic-level-4 { border-left-color: #DFCA5C; }
.egic-level-5_weak, .egic-level-45 { border-left-color: #DAAC41; }
.egic-level-5_strong, .egic-level-50 { border-left-color: #D69129; }
.egic-level-6_weak, .egic-level-55 { border-left-color: #BF6129; }
.egic-level-6_strong, .egic-level-60 { border-left-color: #A8312A; }
.egic-level-7, .egic-level-70 { border-left-color: #8C3BBE; }

/* 長周期地震動階級色 */
.lpeq-class-0 { border-left-color: #cbd5e0; }
.lpeq-class-1 { border-left-color: #DAAC41; }
.lpeq-class-2 { border-left-color: #D69129; }
.lpeq-class-3 { border-left-color: #AC5725; }
.lpeq-class-4 { border-left-color: #7D34A9; }

.max-scale-points { font-size: 1.05em; line-height: 1.8; color: #2d3748; }
.free-comment {
    padding: 20px;
    background-color: #fffaf0;
    border-radius: 10px;
    border-left: 6px solid var(--accent-color);
    color: #2d3748;
    line-height: 1.8;
    font-weight: 500;
    white-space: pre-wrap;
}

/* ============================================= */
/* 3. モーダル専用スタイル                       */
/* ============================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(26,32,44, 0.6); backdrop-filter: blur(2px); z-index: 1100; display: flex; justify-content: center; align-items: center; padding: 20px; }
.modal-content { background: #fff; padding: 30px; border-radius: 16px; width: 100%; max-width: 800px; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.modal-close-btn { position: absolute; top: 20px; right: 25px; font-size: 2.5rem; color: #a0aec0; background: none; border: none; cursor: pointer; line-height: 1; transition: color 0.2s; }
.modal-close-btn:hover { color: #4a5568; }
#modal-title { font-size: 1.8em; color: var(--primary-color); margin-top: 0; margin-bottom: 25px; padding-right: 40px; }

.table-container table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-container th { background-color: #f7fafc; color: #718096; font-weight: bold; padding: 15px; text-align: left; border-bottom: 2px solid #e2e8f0; position: sticky; top: 0; }
.table-container td { padding: 15px; border-bottom: 1px solid #edf2f7; color: #2d3748; vertical-align: top; }
.table-container tr:last-child td { border-bottom: none; }

/* ============================================= */
/* 4. 気象・津波・火山 各種専用スタイル          */
/* ============================================= */
/* 気象レベル色 */
.weather-card.lv5 { border-left-color: #000000; } .alert-level.lv5 { background-color: #000000; color: #fff; }
.weather-card.lv4 { border-left-color: #800080; } .alert-level.lv4 { background-color: #800080; color: #fff; }
.weather-card.lv3 { border-left-color: #dc143c; } .alert-level.lv3 { background-color: #dc143c; color: #fff; }
.weather-card.lv2 { border-left-color: #DAA520; } .alert-level.lv2 { background-color: #DAA520; color: #000; }
.weather-card.typhoon { border-left-color: #2990CB; }

/* 火山レベル色 */
.info-card.volcano.lv5 { border-left-color: #7B33A8; }
.info-card.volcano.lv4 { border-left-color: #D82200; }
.info-card.volcano.lv3 { border-left-color: #E67814; }
.info-card.volcano.lv2 { border-left-color: #F5D22B; }
.info-card.volcano.lv1 { border-left-color: #D4D9DB; }

/* 津波レベル色 */
.tsunami-card.great { border-left-color: #6808A3; } .tsunami-great-text { color: #6808A3; }
.tsunami-card.warning { border-left-color: #D82200; } .tsunami-warning-text { color: #D82200; }
.tsunami-card.watch { border-left-color: #DAA520; } .tsunami-watch-text { color: #DAA520; }
.tsunami-card.forecast { border-left-color: #2990CB; }
.tsunami-card.observation { border-left-color: #0055a5; }

/* 特殊コンポーネント */
.alert-level { padding: 6px 12px; border-radius: 6px; font-weight: bold; font-size: 0.95em; display: inline-block; }
.typhoon-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; background-color: #f7fafc; padding: 20px; border-radius: 12px; border: 1px solid #edf2f7; }
.impact-box { padding: 20px; background-color: #fffaf0; border-left: 6px solid var(--accent-color); border-radius: 8px; color: #2d3748; font-weight: bold; }
.action-hints { padding-left: 20px; color: #2d3748; }
.action-hints li { margin-bottom: 8px; }
.tsunami-group-header { background-color: #f7fafc; padding: 12px 15px; border-radius: 8px; font-weight: bold; color: var(--primary-color); margin-bottom: 10px; border-left: 4px solid var(--secondary-color); }
/* ============================================= */
/* 5. 津波神殿 (美化改修)                       */
/* ============================================= */

.tsunami-card .info-body {
    padding-bottom: 10px; /* フッターとの間隔を調整 */
}

/* 津波予報・観測グループのヘッダー */
.tsunami-group-header {
    background-color: #f7fafc;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    color: #4a5568;
    margin-top: 20px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    font-size: 1.1em;
}
.tsunami-section:first-child .tsunami-group-header:first-of-type {
    margin-top: 0;
}

/* 予報・観測リスト全体のスタイル */
.tsunami-card .area-list,
.tsunami-card .station-list {
    list-style: none;
    padding-left: 0;
    margin-top: 8px;
    display: block; /* flexboxを解除し、縦並びに */
}

/* リスト項目（地名・観測点）のスタイル */
.tsunami-card .area-list li,
.tsunami-card .station-list li {
    font-size: 1.1em;
    color: #2d3748;
    padding: 12px 15px;
    border-bottom: 1px solid #edf2f7;
    display: flex; /* Flexboxで内部要素を配置 */
    justify-content: space-between; /* 両端揃え */
    align-items: center;
}
.tsunami-card .area-list li:last-child,
.tsunami-card .station-list li:last-child {
    border-bottom: none;
}
.tsunami-card .area-list li::before,
.tsunami-card .station-list li::before {
    content: '?';
    font-size: 0.8em;
    margin-right: 12px;
    color: var(--secondary-color);
}

/* 到達時刻・観測状況のスタイル */
.arrival-time {
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
    background-color: #718096;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
    white-space: nowrap;
}

.tsunami-card .station-list strong {
    font-weight: normal; /* "観測点:" の太字を解除し、リストのスタイルに統一 */
}

/* フッターとの区切りを明確に */
.tsunami-card .info-footer {
    margin-top: 10px; /* bodyのpadding-bottomと合わせて調整 */
}

/* トップページ・さんぽカード専用 */
.feature-card-link { text-decoration: none; }
.sanpo-card {
    border-color: #276749;
    transition: all 0.3s ease;
}
.sanpo-card:hover {
    border-color: #38a169;
    box-shadow: 0 15px 40px rgba(56, 161, 105, 0.2);
}
.sanpo-card .feature-button {
    background-color: #38a169;
}
/* ============================================= */
/*  お知らせ（News）関連 完全版                  */
/* ============================================= */

/* 一覧ページ (.news-list-wrapper) */
.news-list-wrapper {
    padding: 0 !important; /* カードのパディングを消して端まで使う */
    overflow: hidden;
}
.news-row-link {
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
}
.news-row-link:last-child { border-bottom: none; }
.news-row-link:hover { background-color: #f8fbff; }

.news-row {
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.news-date {
    font-weight: bold;
    color: var(--secondary-color);
    background: #ebf8ff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.95em;
    white-space: nowrap;
    display: inline-block;
}
.news-title {
    font-size: 1.15em;
    margin: 0;
    color: #2d3748;
    flex-grow: 1;
    font-weight: bold;
    line-height: 1.5;
}
.news-arrow {
    color: #cbd5e0;
    font-weight: bold;
}

/* 個別記事ページ (.news-article-card) */
.news-article-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 50px; /* たっぷり余白 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    max-width: 900px;
    margin: 0 auto;
}
.news-article-header {
    border-bottom: 2px solid #eaf2fa;
    padding-bottom: 20px;
    margin-bottom: 30px;
}
.news-article-date {
    display: block;
    color: #718096;
    font-weight: bold;
    margin-bottom: 10px;
}
.news-article-header h1 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.4;
}

.news-article-body {
    font-size: 1.1em;
    line-height: 2;
    color: #2d3748;
    margin-bottom: 50px;
}
.news-article-body h2 {
    font-size: 1.6em;
    border-left: 6px solid var(--secondary-color);
    padding-left: 15px;
    margin: 40px 0 20px 0;
    color: var(--primary-color);
}
.news-article-body p { margin-bottom: 25px; }

.news-article-footer {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #eee;
}
.back-btn {
    background-color: #718096 !important;
    font-size: 1em !important;
    padding: 12px 30px !important;
}
.back-btn:hover { background-color: #4a5568 !important; }

/* スマホ対応 */
@media (max-width: 600px) {
    .news-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .news-arrow { display: none; }
    .news-article-card { padding: 25px; }
    .news-article-header h1 { font-size: 1.6em; }
}
/* ============================================= */
/*  ニュース記事内の魂の比率修正                 */
/* ============================================= */
.news-article-body .commentary img {
    width: 60px !important;
    height: auto !important;
    flex-shrink: 0 !important;
    max-width: none !important; /* 他のスタイルによる干渉を排除 */
}

/* ついでに、ニュース内の吹き出しも美しく整える */
.news-article-body .commentary {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}
.news-article-body .commentary .bubble {
    padding: 18px 22px;
    border-radius: 18px;
    position: relative;
    line-height: 1.8;
    font-size: 1em;
    width: 100%;
    border: 1px solid;
}
/* 色分け定義 (static-page-style.css と同等のものを確保) */
.news-article-body .chisamaru-comment .bubble { background-color:#ebf8ff; color:#2c5282; border-color:#bee3f8; }
.news-article-body .chisamaru-comment .bubble::before { content:''; position:absolute; top:20px; left:-9px; width:0; height:0; border:9px solid transparent; border-right-color:#bee3f8; }
.news-article-body .correct-comment { flex-direction: row-reverse; }
.news-article-body .correct-comment .bubble { background-color:#f7fafc; color:#4a5568; border-color:#e2e8f0; }
.news-article-body .correct-comment .bubble::before { content:''; position:absolute; top:20px; right:-9px; width:0; height:0; border:9px solid transparent; border-left-color:#e2e8f0; }
.news-article-body .connect-comment { flex-direction: row-reverse; }
.news-article-body .connect-comment .bubble { background-color:#fffaf0; color:#744210; border-color:#feebc8; }
.news-article-body .connect-comment .bubble::before { content:''; position:absolute; top:20px; right:-9px; width:0; height:0; border:9px solid transparent; border-left-color:#feebc8; }