/* ========================================================================== 
   交通ルート図専用スタイル (access-route.css)
   概要：PC版(Gridレイアウト)とSP版(Flex縦並び)の出し分け
   ========================================================================== */

/* --------------------------------------------------------------------------
   A. 表示制御（デバイス出し分け）
   -------------------------------------------------------------------------- */
.d-sp-only { display: none !important; }

@media (max-width: 1024px) {
    .d-pc-only { display: none !important; }
    .d-sp-only { display: block !important; }
}

/* --------------------------------------------------------------------------
   B. 共通パーツ：地点（ルートポイント）
   -------------------------------------------------------------------------- */
.route-point {
    background: #fff;
    padding: 18px 8px;
    text-align: center;
    font-weight: bold;
    font-size: 17px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1.3;
    position: relative;
    z-index: 2;
    writing-mode: horizontal-tb !important; 
}

.route-point.start {
    color: #c0392b;
    border: 1px solid #eee;
    min-height: auto !important;
}

.route-point.goal {
    border-radius: 50%;
    background: #5f4528;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    font-size: 18px;
    z-index: 3;
}

/* --------------------------------------------------------------------------
   C. 共通パーツ：ライン・アイコン・時間ラベル (PC)
   -------------------------------------------------------------------------- */
.route-line {
    width: 100%;
    position: relative;
    height: 2px;
    z-index: 1;
}

.car-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 10px;
    z-index: 2;
    font-size: 22px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.route-time {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    background: #fff;
    padding: 2px 8px;
    z-index: 3;
}

/* --------------------------------------------------------------------------
   D. 車ルート設定 (route-body-car)
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
    .route-body-car.d-pc-only {
        display: block;
        width: 100%;
        margin-bottom: 20px;
    }

    .car-route-flow {
        display: grid;
        grid-template-columns: 140px 180px 160px 180px 140px;
        grid-template-rows: 80px 40px 80px;
        align-items: center;
        justify-content: center; 
        gap: 0;
        margin: 0 auto 40px; 
    }

    /* 各地点の配置 (旧インライン) */
    .car-fukuoka { grid-row: 2; grid-column: 1; border-radius: 50px !important; }
    .car-ic { grid-row: 1; grid-column: 3; margin-left: 15px; }
    .car-ship { grid-row: 3; grid-column: 3; margin-left: 15px; }
    .car-goal { grid-row: 1 / span 3; grid-column: 5; width: 140px; height: 140px; margin-left: 20px; }

    /* ラインの配置 (旧インライン) */
    .car-line-1 { grid-row: 1; grid-column: 4; border-top: 2px dashed #7a5a34; }
    .car-line-2 { grid-row: 2; grid-column: 2; }
    .car-line-3 { grid-row: 3; grid-column: 4; border-top: 2px dashed #7a5a34; }

    .car-route-flow .route-time { top: 12px; }
}

.branch-line { position: relative; border-top: 2px dashed #7a5a34 !important; }
.branch-line::after {
    content: ""; position: absolute; right: 0; top: -65px; bottom: -65px;
    width: 2px; border-right: 2px dashed #7a5a34;
}
.merge-line { position: relative; border-top: 2px dashed #7a5a34 !important; }
.merge-line::after {
    content: ""; position: absolute; left: 0; top: -60px; bottom: -60px;
    width: 2px; border-left: 2px dashed #7a5a34;
}

.route-body-car .route-point.start { border-radius: 12px; }
.route-body-car .car-icon { top: -24px; }
.route-body-car .route-time { border: 1.5px solid #d2c3aa; border-radius: 4px; padding: 2px 10px; background: #fff; }
.route-body-car .route-time strong { color: #7a5a34; font-size: 1.1em; }

/* --------------------------------------------------------------------------
   E/F. 公共交通機関ルート設定 (PC)
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
    .public-transport-route-flow,
    .public-transport-route-flow-b {
        display: grid;
        width: 850px; 
        grid-template-columns: 110px 120px 60px 160px 160px 100px 140px;
        grid-template-rows: 70px 40px 70px;
        align-items: center;
        justify-content: start; 
        gap: 0;
        margin: 0 auto 30px; 
    }

    /* --- 公共交通機関 A (新幹線ルート) --- */
    .public-transport-route-flow { margin-bottom: 50px !important; }
    
    .pt-hakata { grid-row: 2; grid-column: 1; border-radius: 50px !important; }
    .pt-line-shinkansen { grid-row: 2; grid-column: 2; border-top: 2px dashed #7a5a34; }
    .pt-chuo-station { grid-row: 1 / span 3; grid-column: 3; }
    .pt-line-bus-tram { grid-row: 2; grid-column: 4; }
    .pt-bus-stop { grid-row: 1; grid-column: 5; border-radius: 12px !important; padding: 10px 5px !important; }
    .pt-tram-stop { grid-row: 3; grid-column: 5; border-radius: 12px !important; padding: 10px 5px !important; }
    .pt-line-walk-a { grid-row: 2; grid-column: 6; margin-left: 0; }

    /* --- 公共交通機関 B (飛行機ルート) --- */
    .pt-tokyo-osaka { grid-row: 2; grid-column: 1; border-radius: 50px !important; }
    .pt-line-flight { grid-row: 2; grid-column: 2; border-top: 2px dashed #7a5a34; }
    .pt-airport { grid-row: 1 / span 3; grid-column: 3; align-self: center; }
    .pt-line-limousine { grid-row: 2; grid-column: 4; border-top: 2px dashed #7a5a34; }
    .pt-tenmonkan { grid-row: 2; grid-column: 5; border-radius: 12px !important; padding: 10px 5px !important; }
    .pt-line-walk-b { grid-row: 2; grid-column: 6; border-top: 2px dashed #ec971f; position: relative; z-index: 1; }
    .pt-line-walk-b .car-icon { background: #fff; }
    .pt-line-walk-b .route-time { top: 12px; border: 1.5px solid #ec971f; }

    /* 共通ゴール地点 */
    .public-transport-route-flow .car-goal,
    .public-transport-route-flow-b .car-goal { 
        grid-row: 1 / span 3; 
        grid-column: 7; 
        width: 140px; 
        height: 140px; 
        margin-left: 20px;
        align-self: center;
    }

    /* 共通ラベル位置調整 */
    .public-transport-route-flow .route-time,
    .public-transport-route-flow-b .route-time { top: 12px; }
}

/* --------------------------------------------------------------------------
   G. 特殊パーツ：縦書き地点 (中央駅・空港)
   -------------------------------------------------------------------------- */
.route-point.vertical {
    writing-mode: vertical-rl !important; 
    text-orientation: upright;
    background: #fff;
    border: 2px solid #5f4528;
    color: #5f4528;
    width: 60px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 17px;
    letter-spacing: 0.1em;
    padding: 10px 0;
    position: relative;
    z-index: 10;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   H. レスポンシブ設定 (SP：縦型ルート表示)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .route-body-sp {
        width: 100%;
        max-width: 360px;
        margin: 0 auto 60px !important; 
        display: flex;
        flex-direction: column;
        align-items: center;
        background: #fdfaf5; 
        padding: 50px 15px 30px;
        border: 1px solid #d2c3aa;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        position: relative;
    }
    
    .route-body-sp .route-point {
        width: 100% !important;
        min-height: 60px !important;
        border-radius: 8px !important;
        font-size: 18px !important;
        margin-left: 0 !important;
        writing-mode: horizontal-tb !important;
        box-shadow: 0 3px 6px rgba(0,0,0,0.08) !important;
    }
    
    .ship-label {
        width: calc(100% + 2px);
        position: absolute;
        top: -1px;
        left: -1px;
        background: #7a5a34;
        color: #fff !important;
        font-size: 16px;
        font-weight: bold;
        padding: 10px;
        text-align: center;
        border-radius: 11px 11px 0 0;
        margin-bottom: 0;
        letter-spacing: 0.05em;
    }
    
    .sp-line {
        width: 2px;
        height: 80px;
        border-left: 2px dashed #7a5a34;
        position: relative;
        margin: 5px auto;
    }
    
    .sp-line.orange { border-left-color: #ec971f; }
    
    .sp-line .route-time {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) !important;
        background: #fff;
        padding: 6px 18px;
        border: 2px solid #7a5a34 !important;
        border-radius: 6px;
        font-size: 15px !important;
        font-weight: bold !important;
        color: #5f4528;
        white-space: nowrap;
        z-index: 5;
    }
    
    .sp-line.orange .route-time { 
        border-color: #ec971f !important; 
        color: #d47500;
    }
    
    .route-body-sp .route-point.goal {
        width: 150px !important;
        height: 150px !important;
        font-size: 19px !important;
        border-radius: 50% !important;
        margin: 15px auto 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
   I. 徒歩ライン（オレンジ統一）
   -------------------------------------------------------------------------- */
.walk-orange {
    border-top: 2px dashed #ec971f !important;
}

.walk-orange::after {
    border-left: 2px dashed #ec971f !important;
}

.walk-orange .route-time {
    border: 1.5px solid #ec971f !important;
}