/* ========================================================================== 
   交通ルート図専用スタイル (access-route.css)
   ========================================================================== */

/* --- 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; /* 15pxから拡大：ゆとりを確保 */
    text-align: center;
    font-weight: bold;
    font-size: 17px; /* 15pxから拡大：視認性アップ */
    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;
}

.route-point.start {
    color: #c0392b;
    border: 1px solid #eee;
}

.route-point.goal {
    border-radius: 50%;
    background: #0a6a80;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    font-size: 18px; /* ゴール地点を強調 */
}

/* --- C. 共通：ラインとアイコン (PC用) --- */
.route-line, .plane-line {
    width: 100%;
    position: relative;
    height: 2px;
}

.car-icon, .plane-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 10px; /* 余白を広げて線と重ならないように */
    z-index: 1;
    font-size: 22px; /* アイコンを大きく */
}

.route-time {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px; /* テキスト拡大 */
    font-weight: bold;
}

/* ==========================================
   D. 車ルート (PC：route-body-car)
   ========================================== */
.route-body-car {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.car-route-flow {
    display: grid;
    grid-template-columns: 160px 160px 160px;
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 35px 20px; /* 上下ギャップを少し広げて視認性確保 */
    margin: 0 auto;
}

.nishino-ap   { grid-row: 1; grid-column: 1; }
.nishino-line { grid-row: 1; grid-column: 2; border-top: 2px dashed #3b82a0; }
.airport-ap   { grid-row: 2; grid-column: 1; }
.airport-line { grid-row: 2; grid-column: 2; border-top: 2px dashed #3b82a0; }
.space-ap     { grid-row: 3; grid-column: 1; }
.space-line   { grid-row: 3; grid-column: 2; border-top: 2px dashed #3b82a0; }
.car-goal     { grid-row: 1 / span 3; grid-column: 3; width: 140px; height: 140px; margin-left: 10px; }

.route-body-car .route-point.start { border-radius: 12px; }
.route-body-car .car-icon { top: -24px; } /* アイコン拡大に合わせて位置調整 */
.route-body-car .route-time { top: 10px; border: 1.5px solid #c9a300; border-radius: 4px; padding: 2px 10px; background: #fff; }
.route-body-car .route-time strong { color: #b38f00; font-size: 1.1em; }

/* ==========================================
   E. 飛行機ルート (PC：route-body-plane)
   ========================================== */
.route-body-plane {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.plane-route-flow {
    display: grid;
    grid-template-columns: 140px 120px 60px 120px 60px 120px 140px;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 30px 10px;
}

.haneda-ap    { grid-row: 1; grid-column: 1; }
.haneda-line  { grid-row: 1; grid-column: 2; }
.itami-ap     { grid-row: 2; grid-column: 1; }
.itami-line   { grid-row: 2; grid-column: 2; }
.kago         { grid-row: 1 / span 2; grid-column: 3; }
.kago-tane-line { grid-row: 1 / span 2; grid-column: 4; }
.tane         { grid-row: 1 / span 2; grid-column: 5; }
.tane-lex-line { grid-row: 1 / span 2; grid-column: 6; border-top: 2px dashed #ec971f !important; }
.lex          { grid-row: 1 / span 2; grid-column: 7; width: 140px; height: 140px; }

.route-body-plane .route-point.start { border-radius: 50px; }
.route-body-plane .route-point.vertical { 
    writing-mode: vertical-rl; text-orientation: upright; 
    border: 3px solid #0a6a80; color: #0a6a80; min-height: 160px; width: 60px; 
    font-size: 18px; /* 縦書き地点のフォントを大きく */
    letter-spacing: 0.1em;
}
.route-body-plane .plane-line { border-top: 2px dashed #3b82a0; }
.route-body-plane .plane-icon { top: -16px; color: #3b82a0; }
.route-body-plane .route-time { top: 12px; color: #0a6a80; border: 1px solid #3b82a0; padding: 1px 6px; border-radius: 4px; background: #fff; }

/* ==========================================
   F. 船ルート (PC：route-body-ship)
   ========================================== */
.route-body-ship {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.ship-route-flow {
    display: grid;
    grid-template-columns: 160px 160px 80px 140px 160px;
    grid-template-rows: auto auto auto auto;
    align-items: center;
    gap: 10px 15px;
}

.ship-label { font-size: 15px; font-weight: bold; color: #0a6a80; text-align: left; }
.label-1 { grid-row: 1; grid-column: 1 / span 2; align-self: end; }
.label-2 { grid-row: 3; grid-column: 1 / span 2; align-self: end; margin-top: 20px; }

.ship-1  { grid-row: 2; grid-column: 1; }
.line-1  { grid-row: 2; grid-column: 2; border-top: 2px dashed #3b82a0; }
.ship-2  { grid-row: 4; grid-column: 1; }
.line-2  { grid-row: 4; grid-column: 2; border-top: 2px dashed #3b82a0; }
.via-port { grid-row: 2 / span 3; grid-column: 3; writing-mode: vertical-rl; text-orientation: upright; border: 3px solid #0a6a80; color: #0a6a80; min-height: 180px; width: 65px; font-size: 18px; letter-spacing: 0.1em;}
.line-bus { grid-row: 2 / span 3; grid-column: 4; border-top: 2px dashed #ec971f !important; }
.lex-goal { grid-row: 2 / span 3; grid-column: 5; width: 140px; height: 140px; }

.route-body-ship .route-point.start { border-radius: 50px; }
.route-body-ship .plane-icon { top: -14px; color: #3b82a0; font-size: 18px; }
.route-body-ship .route-time { top: 8px; color: #0a6a80; border: 1px solid #3b82a0; padding: 1px 6px; border-radius: 4px; background: #fff; }

/* ==========================================
   G. レスポンシブ (SP：完全独立型ルート表示)
   ========================================== */
@media (max-width: 1024px) {
    /* ルート1つ分の塊に大きな余白を持たせる */
    .route-body-sp {
        width: 100%;
        max-width: 340px; /* 320pxから少し拡大 */
        margin: 0 auto 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* 地点ボックスの共通化 */
    .route-body-sp .route-point {
        width: 100% !important;
        min-height: 56px !important;
        border-radius: 8px !important;
        writing-mode: horizontal-tb !important;
        height: auto !important;
        margin: 0 !important;
        padding: 14px 10px !important;
        font-size: 17px !important; /* SPでもハッキリ見えるサイズ */
    }

    /* 船・飛行機共通のラベルをSPでも見やすく */
    .route-body-sp .ship-label {
        font-size: 16px;
        color: #333; /* 濃い色にして視認性アップ */
        margin-bottom: 12px;
        text-align: center;
        width: 100%;
        display: block;
        font-weight: bold;
    }

    /* 縦線（点線） */
    .sp-line {
        width: 2px;
        height: 70px; /* 少し長くしてテキストの重なりを防ぐ */
        border-left: 2px dashed #3b82a0;
        position: relative;
        margin: 10px 0;
    }
    .sp-line.orange { border-left-color: #ec971f !important; }

    /* 線上の時間ラベル：SPでは全てのルートでスタイルを統一 */
    .sp-line .route-time {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) !important;
        background: #fff;
        padding: 6px 15px; /* ラベルを大きく */
        border: 1.5px solid #3b82a0 !important;
        border-radius: 6px;
        font-size: 15px; /* SPでの視認性を最優先 */
        white-space: nowrap;
        color: #0a6a80 !important;
        font-weight: bold;
        z-index: 5;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    /* オレンジ色の線（送迎バス等）の場合はラベルの色も合わせる */
    .sp-line.orange .route-time {
        border-color: #ec971f !important;
        color: #ec971f !important;
    }
    
    /* 車ルートSP表示時にPC版の黄色文字設定が残らないようにクリア */
    .sp-line .route-time strong {
        color: inherit !important;
        font-size: inherit !important;
    }

    /* ゴール地点の形状維持 */
    .route-body-sp .route-point.goal {
        width: 140px !important;
        height: 140px !important;
        border-radius: 50% !important;
        margin-top: 15px !important;
        font-size: 18px !important;
    }
}