/* ========================================================================== 
   交通ルート図専用スタイル (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;
        /* 列数を 5列から 3列（地点・ライン・ホテル）に変更 */
        grid-template-columns: 160px 300px 160px; 
        grid-template-rows: 80px 40px 80px;
        align-items: center;
        /* justify-contentをcenterにすることで全体が中央に寄ります */
        justify-content: center; 
        gap: 0;
        margin: 0 auto 40px; 
        /* 必要に応じて最大幅を設定 */
        max-width: 800px;
    }

    .route-body-car .car-goal {
        /* HTML側の指定(grid-column: 3)に合わせて修正 */
        grid-row: 1 / span 3;
        grid-column: 3;
        width: 140px;
        height: 140px;
        margin-left: 20px;
    }
}

.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 { top: 10px; 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. 飛行機ルート (PC：route-body-plane) 修正版
   ========================================== */
.route-body-plane {
    display: block; /* 中央寄せを安定させるためblockに変更 */
    width: 100%;
    margin-top: 40px;
}

.plane-route-flow {
    display: grid;
    /* 地点とラインの幅を最適化（合計 850px 程度） */
    grid-template-columns: 140px 120px 60px 140px 60px 140px 140px;
    grid-template-rows: 80px 80px;
    align-items: center;
    justify-content: center;
    gap: 20px 10px;
}

/* 各パーツの配置 */
.haneda-ap      { grid-row: 1; grid-column: 1; }
.haneda-line    { grid-row: 1; grid-column: 2; position: relative; }
.itami-ap       { grid-row: 2; grid-column: 1; }
.itami-line     { grid-row: 2; grid-column: 2; position: relative; }
.kago           { grid-row: 1 / span 2; grid-column: 3; }
.kago-tane-line { grid-row: 1 / span 2; grid-column: 4; position: relative; }
.tane           { grid-row: 1 / span 2; grid-column: 5; }
.tane-lex-line  { grid-row: 1 / span 2; grid-column: 6; position: relative; }
.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 !important;
    text-orientation: upright; 
    border: 3px solid #7a5a34; /* ベージュ・ブラウン系に変更 */
    color: #7a5a34;           /* ベージュ・ブラウン系に変更 */
    min-height: 160px; 
    width: 60px; 
    font-size: 18px; 
    letter-spacing: 0.1em;
    padding: 10px 0;
}

/* ライン装飾：飛行機区間（ベージュ・ブラウン系） */
.haneda-line, .itami-line, .kago-tane-line {
    border-top: 2px dashed #7a5a34 !important; /* ベージュ・ブラウン系に変更 */
    height: 2px;
}

.route-body-plane .plane-icon { 
    position: absolute;
    top: -26px; /* アイコンをラインの上に配置 */
    left: 50%;
    transform: translateX(-50%);
    color: #7a5a34; /* ベージュ・ブラウン系に変更 */
    font-size: 20px;
    background: #fff;
    padding: 0 4px;
}

.route-body-plane .plane-line .route-time { 
    top: 10px; /* 時間ラベルをラインの下に配置 */
    color: #7a5a34; /* ベージュ・ブラウン系に変更 */
    border: 1.5px solid #d2c3aa; /* ベージュ系に変更 */
    padding: 2px 8px; 
    border-radius: 4px; 
    background: #fff; 
}

/* ライン装飾：地上移動区間（オレンジ系） */
.tane-lex-line { 
    border-top: 2px dashed #ec971f !important; 
    height: 2px;
}

.tane-lex-line .car-icon { 
    top: -26px;
    color: #ec971f;
    background: #fff;
}

.tane-lex-line .route-time { 
    top: 10px;
    color: #d47500; 
    border: 1.5px solid #ec971f !important; 
    padding: 2px 8px;
}


/* ==========================================
   F. 船ルート (PC：route-body-ship) 修正版
   ========================================== */
.route-body-ship {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    width: 100%;
}

.ship-route-flow {
    display: grid;
    /* 地点、ライン、経由地(名瀬港)、ライン(バス)、ゴールの5カラム構成 */
    grid-template-columns: 160px 160px 80px 140px 160px;
    grid-template-rows: auto auto auto auto;
    align-items: center;
    justify-content: center;
    gap: 10px 15px;
}

/* ラベルカラーをブラウン系に変更 */
.ship-label { 
    font-size: 15px; 
    font-weight: bold; 
    color: #7a5a34; 
    text-align: left; 
}

/* 各パーツのグリッド配置（HTMLのクラス名に準拠） */
.label-1  { grid-row: 1; grid-column: 1 / span 2; align-self: end; } /* フェリーあけぼの等のラベル */
.ship-1   { grid-row: 2; grid-column: 1; }                          /* 鹿児島港 */
.line-1   { grid-row: 2; grid-column: 2; position: relative; border-top: 2px dashed #7a5a34 !important; }

.label-2  { grid-row: 3; grid-column: 1 / span 2; align-self: end; margin-top: 20px; } /* フェリーあまみ等のラベル */
.ship-2   { grid-row: 4; grid-column: 1; }                          /* 鹿児島本港北埠頭 */
.line-2   { grid-row: 4; grid-column: 2; position: relative; border-top: 2px dashed #7a5a34 !important; }

/* 経由地：名瀬港（垂直表示） */
.via-port { 
    grid-row: 2 / span 3; 
    grid-column: 3; 
    writing-mode: vertical-rl !important; 
    text-orientation: upright; 
    border: 3px solid #7a5a34; 
    color: #7a5a34; 
    min-height: 180px; 
    width: 65px; 
    font-size: 18px; 
    letter-spacing: 0.1em;
    padding: 10px 0;
}

/* バス移動区間（オレンジ系を維持） */
.line-bus { 
    grid-row: 2 / span 3; 
    grid-column: 4; 
    position: relative;
    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 { 
    position: absolute;
    top: -26px; /* ラインの上に配置 */
    left: 50%;
    transform: translateX(-50%);
    color: #7a5a34; 
    font-size: 20px;
    background: #fff;
    padding: 0 4px;
}

/* バス区間のアイコン色のみ上書き */
.line-bus .plane-icon {
    color: #ec971f;
}

/* 時間ラベル */
.route-body-ship .route-time { 
    position: absolute;
    top: 10px; /* ラインの下に配置 */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #7a5a34; 
    border: 1.5px solid #d2c3aa; 
    padding: 2px 8px; 
    border-radius: 4px; 
    background: #fff; 
    font-size: 13px;
}

/* バス区間の時間ラベル枠色のみ上書き */
.line-bus .route-time {
    border-color: #ec971f;
}

/* --------------------------------------------------------------------------
   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; 
    }

    .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;
    }
}

/* --------------------------------------------------------------------------
   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;
}



/* ==========================================================================
   6. 路線バスアクセス案内
   PC・SP共通
   ========================================================================== */

/* --- バス案内全体 --- */
.access-bus-guide {
    width: 100%;
    max-width: 850px;
    margin: 60px auto 20px;
    padding: 35px 30px;
    background: #fdfaf5;
    border: 1px solid #d2c3aa;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* --- 見出し --- */
.bus-guide-header {
    text-align: center;
    margin-bottom: 30px;
}

.bus-guide-label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #7a5a34;
    letter-spacing: 0.2em;
    margin-bottom: 8px;
}

.bus-guide-header h3 {
    font-size: 22px;
    font-weight: bold;
    color: #5f4528;
    line-height: 1.5;
    margin: 0;
}

/* --- ルート全体 --- */
.bus-route-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* --- 乗車・降車地点 --- */
.bus-route-point {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 65px;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #d2c3aa;
    border-radius: 8px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.bus-route-point strong {
    font-size: 18px;
    font-weight: bold;
    color: #5f4528;
    line-height: 1.4;
}

.bus-point-label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: #7a5a34;
    margin-bottom: 5px;
}

/* --- ホテル到着地点 --- */
.bus-route-goal {
    background: #5f4528;
    border-color: #5f4528;
}

.bus-route-goal strong {
    color: #fff;
}

/* --- 接続ライン --- */
.bus-route-connection {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 110px;
    padding: 12px 0;
    box-sizing: border-box;
}

/* 縦方向の破線 */
.bus-route-connection::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 2px dashed #7a5a34;
    transform: translateX(-50%);
    z-index: 0;
}

/* --- バス・徒歩アイコン --- */
.bus-route-icon {
    position: relative;
    z-index: 1;
    display: block;
    padding: 2px 10px;
    background: #fdfaf5;
    font-size: 24px;
    line-height: 1.3;
}

/* --- 所要時間 --- */
.bus-route-time {
    position: relative;
    z-index: 1;
    display: block;
    padding: 5px 15px;
    background: #fff;
    border: 1.5px solid #d2c3aa;
    border-radius: 5px;
    font-size: 15px;
    font-weight: bold;
    color: #5f4528;
    text-align: center;
    white-space: nowrap;
}

/* --- 行き先・方面 --- */
.bus-route-direction {
    position: relative;
    z-index: 1;
    display: block;
    padding: 3px 12px;
    background: #fdfaf5;
    font-size: 13px;
    color: #7a5a34;
    text-align: center;
    line-height: 1.5;
}

/* --- 徒歩区間（オレンジ系） --- */
.bus-route-connection.walk::before {
    border-left-color: #ec971f;
}

.bus-route-connection.walk .bus-route-time {
    border-color: #ec971f;
    color: #d47500;
}

/* --- 注釈 --- */
.bus-guide-note {
    max-width: 650px;
    margin: 25px auto 20px;
    font-size: 13px;
    line-height: 1.8;
    color: #555;
    text-align: center;
}

/* --- 注釈：共通CSSとの競合対策 --- */
.access-bus-guide .bus-guide-note {
    display: block;
    max-width: 650px;
    margin: 25px auto 20px;
    padding: 0;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.8;
    color: #555;
    text-align: center;
}

/* --- 外部リンク --- */
.bus-guide-link-area {
    text-align: center;
    margin-top: 20px;
}

.bus-guide-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    padding: 12px 25px;
    background: #5f4528;
    color: #fff !important;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    line-height: 1.5;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.bus-guide-link:hover {
    background: #7a5a34;
}

.bus-guide-link span {
    font-size: 16px;
}

/* --- 外部リンク：共通CSSとの競合対策 --- */
.access-bus-guide .bus-guide-link-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.access-bus-guide .bus-guide-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    padding: 12px 25px;
    background-color: #5f4528;
    color: #fff !important;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
    text-decoration: none !important;
    text-align: center;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.access-bus-guide .bus-guide-link:hover {
    background-color: #7a5a34;
    color: #fff !important;
    text-decoration: none !important;
}

.access-bus-guide .bus-guide-link span {
    display: inline-block;
    color: inherit;
    font-size: 16px;
}

/* ==========================================================================
   7. 路線バスアクセス案内 SP調整
   ========================================================================== */
@media (max-width: 768px) {

    .access-bus-guide {
        margin: 40px auto 20px;
        padding: 30px 15px;
    }

    .bus-guide-header {
        margin-bottom: 25px;
    }

    .bus-guide-header h3 {
        font-size: 19px;
    }

    .bus-route-point {
        min-height: 60px;
        padding: 12px 15px;
    }

    .bus-route-point strong {
        font-size: 17px;
    }

    .bus-route-connection {
        min-height: 100px;
    }

    .bus-route-time {
        font-size: 14px;
    }

    .bus-route-direction {
        font-size: 12px;
    }

    .bus-guide-note {
        font-size: 12px;
        text-align: left;
    }

    .bus-guide-link {
        width: 100%;
        padding: 12px 15px;
        font-size: 13px;
    }

    /* --- 注釈：SP表示の競合対策 --- */
    .access-bus-guide .bus-guide-note {
        font-size: 12px;
        text-align: left;
    }

    /* --- 外部リンク：SP表示の競合対策 --- */
    .access-bus-guide .bus-guide-link {
        width: 100%;
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* ==========================================================================
   8. 路線バスアクセス案内 PC表示の最適化
   ※既存の車・飛行機・船ルートには影響なし
   ========================================================================== */
@media (min-width: 1025px) {

    /* --- バス案内全体 --- */
    .access-bus-guide {
        max-width: 750px;
        margin: 45px auto 20px;
        padding: 30px 35px;
    }

    /* --- 見出しとルート図の間隔 --- */
    .bus-guide-header {
        margin-bottom: 25px;
    }

    /* --- ルート図の横幅を抑える --- */
    .bus-route-flow {
        max-width: 400px;
    }

    /* --- 乗車・降車地点 --- */
    .bus-route-point {
        min-height: 60px;
        padding: 12px 20px;
    }

    /* --- バス移動区間 --- */
    .bus-route-connection {
        min-height: 90px;
        padding: 8px 0;
        gap: 4px;
    }

    /* --- 徒歩移動区間は短めに --- */
    .bus-route-connection.walk {
        min-height: 75px;
    }

    /* --- 移動時間の表示 --- */
    .bus-route-time {
        font-size: 14px;
        padding: 4px 12px;
    }

    /* --- 行き先表示 --- */
    .bus-route-direction {
        font-size: 12px;
        padding: 2px 10px;
    }

    /* --- 注釈 --- */
    .bus-guide-note {
        margin: 20px auto 15px;
    }

    /* --- 公式サイトリンク --- */
    .bus-guide-link-area {
        margin-top: 15px;
    }

    /* --- 注釈：PC表示の競合対策 --- */
    .access-bus-guide .bus-guide-note {
        margin: 20px auto 15px;
    }

    /* --- 公式サイトリンク：PC表示の競合対策 --- */
    .access-bus-guide .bus-guide-link-area {
        margin-top: 15px;
    }
}
