@charset "utf-8";

/* --- 全体的なスタイル --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.main {
    max-width: 1200px;
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff; /* 背景白で見やすく */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

h1 {
    font-size: 1.8em;
    border-bottom: 2px solid #222;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 20px;
    color: #222;
}
h1:first-child { margin-top: 0; }

h2 {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 15px;
    color: #222;
    border-left: 5px solid #222;
    padding-left: 10px;
}

a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #0033AB;
    text-decoration: underline;
}

/* --- コンテンツブロック (レース一覧移植用) --- */
.content-block {
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

/* --- レース一覧テーブルスタイル (race_list.cssより統合) --- */
.race-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

.race-row {
    position: relative;
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.2s;
}
.race-row:hover { background-color: #f0f8ff; }
.race-row td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.race-row:last-child td { border-bottom: none; }

/* R番号ブロック */
.race-num-cell { width: 50px; padding: 0 !important; }
.race-num-block {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    background-color: #333;
    color: white;
    padding: 10px 2px;
    height: 100%;
    min-height: 50px;
}
.race-num-val { font-size: 1.4em; font-weight: bold; line-height: 1; }
.race-num-unit { font-size: 0.8em; font-weight: bold; }

/* レース情報セル */
.race-info-cell { width: auto; padding-left: 15px !important; }
.race-info-row1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.race-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #0033AB;
    line-height: 1.3;
}
.race-class-badge {
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 10px; /* 丸み */
    white-space: nowrap;
    color: #fff;
    font-weight: bold;
}
.race-info-row2 { font-size: 0.9em; color: #555; }
.race-dist { font-weight: bold; margin-right: 10px; }

/* アクションセル */
.race-action-cell { width: 80px; text-align: center; }
.btn-action {
    display: inline-block;
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    font-size: 0.9em;
    text-decoration: none;
    font-weight: bold;
}
.btn-action:hover { background-color: #45a049; text-decoration: none; color: white; }

/* --- 過去の開催日一覧 (グリッドレイアウト) --- */
.past-races-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    align-items: start;
}

.category-column {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.category-column h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    font-size: 1.2em;
    text-align: center;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
}

.year-toggle {
    cursor: pointer;
    font-weight: bold;
    padding: 8px 10px;
    background-color: #f5f5f5;
    margin-bottom: 5px;
    border-radius: 4px;
    user-select: none;
    transition: background-color 0.2s;
}
.year-toggle:hover {
    background-color: #e0e0e0;
}
.toggle-icon {
    display: inline-block;
    width: 1.2em;
    text-align: center;
}

.year-content {
    margin-bottom: 15px;
    padding: 5px 10px;
    border-left: 2px solid #eee;
    margin-left: 10px;
}

.kako ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.kako li {
    margin-bottom: 5px;
    border-bottom: 1px solid #f9f9f9;
}

.kako li a {
    display: block;
    padding: 6px 4px;
    font-size: 0.95em;
    color: #444;
}
.kako li a:hover {
    color: #0033AB;
    background-color: #f0f8ff;
    border-radius: 4px;
}

.place-tag {
    font-size: 0.85em;
    color: #777;
    margin-left: 5px;
}

/* --- PC/SP 切り替え --- */
.sp-only { display: none; }
.pc-only { display: inline; }

/* --- モバイル対応 --- */
@media (max-width: 768px) {
    .main {
        width: 100%;
        margin: 0;
        padding: 10px;
        border-radius: 0;
        box-shadow: none;
    }

    /* レース一覧モバイル調整 */
    .race-action-cell { display: none; } /* ボタン非表示 */
    .race-info-row1 {
        flex-direction: row; /* 横並び維持 */
    }
    .race-name { font-size: 1.1em; }
    
    .sp-only { display: inline; }
    .pc-only { display: none; }
    
    h1 { font-size: 1.5em; margin-top: 20px;}
    h2 { font-size: 1.2em; }
    
    /* 過去一覧を1列に */
    .past-races-grid {
        grid-template-columns: 1fr;
    }
}