/* ========================================
   subway-stats.css
   札幌市営地下鉄 乗車人員統計ページ
   ======================================== */

/* --- コンテンツ幅（detail.cssと統一） --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- パンくずリスト（detail.cssと統一） --- */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 1rem 0 2rem;
    padding: 0 1rem;
    font-size: 0.9rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: ">";
    margin: 0 0.5rem;
    color: #999;
}

.breadcrumb a {
    color: #1a73e8;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* --- h1（detail.cssと統一） --- */
.subway-stats-page h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #333;
    line-height: 1.3;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.8rem;
}

/* --- h2（detail.cssと統一） --- */
.subway-stats-page h2 {
    font-size: 1.4rem;
    margin: 2rem 0 1.5rem;
    color: #49303C;
    border-top: 2px solid #49303C;
    border-bottom: 2px solid #49303C;
    padding: 1rem 0.8rem;
}

/* --- ページ全体 --- */
.subway-stats-page {
    padding: 0 0 40px;
}

/* --- イントロ文 --- */
.subway-intro {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.subway-intro p {
    margin: 0 0 8px;
}

.subway-intro p:last-child {
    margin-bottom: 0;
}

.subway-source {
    font-size: 0.85rem;
    color: #777;
    margin-top: 10px !important;
}

.subway-source a {
    color: #1a73e8;
}

/* --- 年ブロック --- */
.year-block {
    margin-bottom: 35px;
}

/* --- 年間集計リンク --- */
.year-link {
    margin: 0.5rem 0 1rem;
}

.year-link a {
    display: inline-block;
    padding: 6px 16px;
    background: #f0f4ff;
    border: 1px solid #c5d5f5;
    border-radius: 6px;
    color: #1a73e8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.year-link a:hover {
    background: #dce8ff;
}

/* --- 月グリッド --- */
.month-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

@media (max-width: 600px) {
    .month-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 400px) {
    .month-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.month-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.month-cell--active {
    background: linear-gradient(135deg, #1a73e8, #1557b0);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.month-cell--active:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.4);
}

.month-cell--empty {
    background: #eee;
    color: #bbb;
    cursor: default;
}

.month-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.month-label {
    font-size: 0.75rem;
    margin-top: 3px;
}

/* --- データなし --- */
.subway-empty {
    text-align: center;
    padding: 40px;
    color: #888;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ===== 月別詳細ページ ===== */

/* --- 前月・翌月ナビ --- */
.subway-nav-months {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 10px;
}

.subway-nav-months a,
.subway-nav-months span {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-prev,
.nav-next {
    min-width: 80px;
    text-align: center;
}

.subway-nav-months a.nav-prev,
.subway-nav-months a.nav-next {
    background: #1a73e8;
    color: #fff;
}

.subway-nav-months a.nav-prev:hover,
.subway-nav-months a.nav-next:hover {
    background: #1557b0;
}

.subway-nav-months a.nav-index {
    background: #ecf0f1;
    color: #2c3e50;
}

.subway-nav-months a.nav-index:hover {
    background: #bdc3c7;
}

.subway-nav-months .disabled {
    background: #eee;
    color: #bbb;
    cursor: default;
}

/* --- サマリーカード --- */
.subway-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.summary-card {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.summary-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.summary-card--total {
    background: linear-gradient(135deg, #2F3849, #2F3849);
    color: #fff;
    border: none;
    grid-column: 1 / -1;
}

.summary-card--total .summary-label {
    color: rgba(255, 255, 255, 0.8);
}

.summary-card--total .summary-value {
    color: #fff;
    font-size: 1.8rem;
}

.summary-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2F3849;
}

.summary-unit {
    font-size: 0.7em;
    font-weight: 400;
    margin-left: 2px;
}

/* --- グラフセクション --- */
.chart-section {
    margin-bottom: 35px;
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
}

/* chart-section内のh2 */
.chart-section h2 {
    margin-top: 0;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .chart-wrapper {
        height: 300px;
    }
}

.chart-reference {
    font-size: 0.8rem;
    color: #999;
    text-align: right;
}

.chart-reference a {
    color: #999;
    text-decoration: underline;
}

/* --- データテーブル --- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.subway-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

.subway-table th,
.subway-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: right;
}

.subway-table th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    font-size: 0.75rem;
}

.subway-table th:first-child,
.subway-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.subway-table tbody tr:hover {
    background: #f0f7ff;
}

.td-total {
    font-weight: 700;
    color: #2F3849;
}