/* ============================================================
   岡山県冬期道路気象情報システム - 共通スタイルシート
   ============================================================ */

/* 全要素のサイズ計算を「枠線込み」に統一し、はみ出しを防止 */
* {
    box-sizing: border-box;
}

/* ------------------------------------------------------------
   全体レイアウト
   ------------------------------------------------------------ */
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: #f4f7f9;
    margin: 0;
    padding: 15px;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%; /* 親要素の幅いっぱいに指定 */
}

/* ページメインタイトル：フッターと同じ配色 (#2c3e50) */
h1.main-title {
    background: #2c3e50; /* フッター背景色と同期 */
    color: #ffffff;     /* 文字色は白 */
    padding: 12px 20px;
    margin: 0 0 15px 0;
    font-size: 18px;
    border-left: 8px solid #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ------------------------------------------------------------
   エリア切り替えタブ（ナビゲーション）
   ------------------------------------------------------------ */
.tab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 0;
}

.tab-button {
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #ced4da;
    color: #495057;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-button.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* ------------------------------------------------------------
   カメラカード グリッドレイアウト
   ------------------------------------------------------------ */
.camera-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 初期値：スマホ2列 */
    gap: 10px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .camera-grid {
        grid-template-columns: repeat(3, 1fr); /* タブレット3列 */
        gap: 15px;
    }
}

@media (min-width: 1024px) {
    .camera-grid {
        grid-template-columns: repeat(4, 1fr); /* PC4列 */
        gap: 20px;
    }
}

/* ------------------------------------------------------------
   カメラカード（個別の表示ユニット）
   ------------------------------------------------------------ */
.camera-card {
    background: white;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

/* カード上部：路線・地点名エリア */
.card-header {
    padding: 8px 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    min-height: 45px;
}

.road-name {
    font-size: 10px;
    color: #6c757d;
    margin-bottom: 2px;
}

.station-name {
    font-size: 14px;
    font-weight: bold;
    color: #0056b3;
    text-decoration: none;
    display: block;
}

/* 画像エリア：4:3のアスペクト比を維持 */
.card-image-box {
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* カード下部：観測データエリア */
.card-footer {
    padding: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 5px;
}

.data-table th {
    background: #f1f3f5;
    font-size: 10px;
    padding: 3px;
    border: 1px solid #dee2e6;
}

.data-table td {
    text-align: center;
    padding: 5px 2px;
    border: 1px solid #dee2e6;
    font-size: 16px;
    font-weight: bold;
    font-family: Verdana, sans-serif;
}

.unit {
    font-size: 10px;
    font-weight: normal;
    margin-left: 1px;
}

.diff-up {
    color: #d32f2f; /* 降雪差分用カラー */
}

.obs-time-bottom {
    font-size: 10px;
    color: #adb5bd;
    text-align: right;
}

/* ------------------------------------------------------------
   積雪サマリーマップ（視覚化エリア）修正版
   ------------------------------------------------------------ */
.map-section {
    margin-top: 40px;
    background: #fff;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    width: 100%; /* コンテナ幅に固定 */
}

.map-title {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

.map-visual {
    width: 100%;
    min-height: 200px;
    background: #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    justify-content: center;
}

.map-dot {
    width: 55px;
    height: 55px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 積雪深別の色分け */
.level-0 { background: #adb5bd; }
.level-1 { background: #5dade2; }
.level-2 { background: #2e86c1; }
.level-3 { background: #1b4f72; }

.legend {
    margin-top: 15px;
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-color { width: 15px; height: 15px; border-radius: 2px; }

/* スマホ向けの微調整 */
@media (max-width: 767px) {
    .container { padding: 5px; overflow-x: hidden; }
    .station-name { font-size: 12px; }
    .data-table td { font-size: 14px; }
    h1 { font-size: 16px; padding: 10px 15px; }
}