/* ==========================================================
   access.css  ―  アクセスページ専用スタイル
   他の CSS は 1 文字も変更しない。このファイルのみに記述。
   ========================================================== */


/* ============================================
   Hero Image
   ============================================ */
.access-hero {
    width: 100%;
    height: 700px;
    overflow: hidden;
}

.access-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}


/* ============================================
   Content Section
   ============================================ */
.access-section {
    padding-top: 90px;
    padding-bottom: 110px;
}

.access-inner {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}


/* ============================================
   Google Map Button
   ============================================ */
.access-map-wrap {
    text-align: center;
    margin-bottom: 80px;
}

.access-map-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 60px;
    border: 1px solid #afa69a;
    background-color: transparent;
    color: #493d37;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none;
    box-sizing: border-box;
    transition: opacity 0.3s;
}

.access-map-btn:hover {
    opacity: 0.7;
}


/* ============================================
   Section Navigation (anchor links)
   ============================================ */
.access-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 60px;
    padding: 0;
}

.access-nav-link {
    font-family: var(--font-serif, "Hiragino Mincho ProN", serif);
    font-size: 20px;
    font-weight: 600;
    color: #493d37;
    text-decoration: none;
    border-bottom: 1px solid #493d37;
    padding: 0 0 5px;
    letter-spacing: 0.05em;
    line-height: 1.5;
    white-space: nowrap;
    word-break: keep-all;
    transition: opacity 0.3s;
}

.access-nav-link:hover {
    opacity: 0.7;
}


/* ============================================
   Content Blocks
   ============================================ */
.access-block {
    margin-bottom: 120px;
}

.access-block:last-child {
    margin-bottom: 0;
}

.access-block .access-h2 {
    margin-top: 0;
    margin-bottom: 60px;
    text-align: center;
}


/* ============================================
   Route Grid  ―  共通
   ============================================ */
.route-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    align-items: stretch;
}

.route-col {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

/* 左スパイン x=26px を絶対配置で全高に引く（background-size の % 計算に依存しない確実な方法） */
.route-col::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 26px;
    width: 1px;
    background-color: #7f6760;
}

/* デスクトップ: trigger は非表示、accordion-body はレイアウトに影響しない */
.route-accordion-trigger {
    display: none;
}

.route-accordion-body {
    display: contents;
}

/* ---- ボックス（灰色ノード） ---- */
.route-box {
    width: 300px;
    height: 60px;
    background-color: #afa69a;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-align: center;
    box-sizing: border-box;
    padding: 0 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* ---- 区間ステップ（左軸縦線 ＋ テキスト） ---- */
/*
 * 縦線を ::before 擬似要素で描画（top:0 → bottom:0 で確実につながる）。
 * フレックスの stretch に頼らないため隙間が生じない。
 *   列左端 → 縦線: 26px
 *   縦線 → テキスト: 18px  →  padding-left 合計: 26+1+18 = 45px
 */
.route-step {
    position: relative;
    box-sizing: border-box;
    padding-left: 45px;
}

/* 縦線本体（要素の上端〜下端を貫通） */
.route-step::before {
    content: '';
    position: absolute;
    left: 26px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #7f6760;
}

/* 分岐内のステップ縦線は route-col::before(x=26px) と
   route-fork-group::before(x=163px) が描画するため不要 */
.route-split-col .route-step::before {
    display: none;
}

/* HTML 側の .route-step__line div は不要だが残しても無害に非表示 */
.route-step__line {
    display: none;
}

.route-step__text {
    display: block;
    padding-top: 30px;
    padding-bottom: 30px;
    font-size: 16px;
    color: #493d37;
    letter-spacing: 0.05em;
    line-height: 1.6;
}


/* ============================================
   Route Split  ―  名古屋方面 分岐
   ============================================ */

/*
 * 左軸スパイン設計:
 *   メイン列スパイン  x = 26px
 *   左サブ列スパイン  x = 26px（メインと同軸 → T字）
 *   右サブ列スパイン  x = 128(左列) + 9(gap) + 26 = 163px
 *
 * 構造:  岡谷JCT box
 *         ↓  (route-step の線が x=26px を継続)
 *        route-fork-top   … x=26px 縦線 + 下端横バー(26→163px)
 *         ↓
 *        route-split      … 左128px / 右163px
 *         ↓
 *        route-fork-bottom … 上端横バー(26→163px) + x=26px 縦線
 *         ↓
 *        しげの家 box
 */

/* フォークグループ: space-between の影響を受けないよう fork-top/split/fork-bottom を1ブロック化 */
.route-fork-group {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

/* 右スパイン(x=163px)を fork-group 全高に1本で引く */
.route-fork-group::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 163px;
    width: 1px;
    background-color: #7f6760;
}

/* 分岐トップ: x=26px 縦線(全高+2px下方延長) + 横バー(下端 26→163px) */
/* background-image で右スパイン(x=163px)を確実に描画（height:30px 明示なので 100% が確実に機能する） */
.route-fork-top {
    width: 300px;
    height: 30px;
    position: relative;
    flex-shrink: 0;
}

/* fork-top 左スパインは route-col::before が全高を描画するため不要 */

/* fork-top 横バーは不要（削除済み） */

/* 合流ボトム: 横バー(上端 26→163px) + x=26px 縦線(全高+2px上方延長) */
/* background-image で右スパイン(x=163px)を確実に描画 */
.route-fork-bottom {
    width: 300px;
    height: 30px;
    position: relative;
    flex-shrink: 0;
}

/* fork-bottom 左スパインは route-col::before が全高を描画するため不要 */

/* fork-bottom 横バーは不要（削除済み） */

/* 2列コンテナ: 左128px / gap9px / 右163px = 合計300px */
.route-split {
    width: 300px;
    display: flex;
    gap: 9px;
    flex-shrink: 0;
}

/* 左サブ列（128px）: スパインは route-col::before（x=26px）で引き継がれる */
.route-split-col:first-child {
    flex: 0 0 128px;
    display: flex;
    flex-direction: column;
}

/* 右サブ列（163px）: 右スパインを自列 x=26px（= route-col x=163px）に絶対配置 */
.route-split-col:last-child {
    flex: 0 0 163px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 右スパインは .route-fork-group::before で一括描画するため、個別の線は不要 */

/* 分岐内ステップテキスト: 折り返し禁止（はみ出し許容） */
.route-split-col .route-step__text {
    white-space: nowrap;
    overflow: visible;
}

/*
 * 二重スペース防止:
 *   route-fork-top/bottom がすでに 30px を提供するため、
 *   サブ列の先頭ステップは padding-top: 0、
 *   末尾ステップは padding-bottom: 0 に揃える。
 */
.route-split-col .route-step:first-child .route-step__text {
    padding-top: 0;
}

.route-split-col .route-step:last-child .route-step__text {
    padding-bottom: 0;
}

/* 分岐内ボックス（サブ列全幅） */
.route-box--split {
    width: 100%;
    height: 60px;
    background-color: #afa69a;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-align: center;
    box-sizing: border-box;
    padding: 4px 6px;
    line-height: 1.4;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}


/* ============================================
   Notes  ―  電車セクション注釈
   ============================================ */
.access-notes {
    margin-top: 110px;
    text-align: center;
}

.access-notes-inner {
    display: inline-block;
    text-align: left;
    font-size: 16px;
    color: #493d37;
    letter-spacing: 0.05em;
    line-height: 2;
}

.access-note-item {
    display: block;
}

.access-note-item + .access-note-item {
    margin-top: 0.5em;
}

.access-note-sub {
    display: block;
    padding-left: 1.5em;
    margin-top: 0;
}

.access-note-item--gap {
    display: block;
    margin-top: 0.8em;
}


/* ============================================
   Mobile Responsive  ―  768px 以下
   ============================================ */
@media (max-width: 768px) {

    /* Hero */
    .access-hero {
        height: 56.25vw;
        min-height: 240px;
    }

    /* Section */
    .access-section {
        padding-top: 12.31vw;
        padding-bottom: 18.46vw;
    }

    .access-inner {
        padding: 0 16.92vw;
    }

    /* Map button */
    .access-map-wrap {
        margin-bottom: 12.31vw;
    }

    .access-map-btn {
        width: 100%;
        max-width: 300px;
        height: 13.85vw;
        min-height: 50px;
        font-size: 4.31vw;
    }

    /* Nav links */
    .access-nav {
        gap: 6.15vw;
        margin-bottom: 12.31vw;
    }

    .access-nav-link {
        font-size: 4.31vw;
        white-space: nowrap;
        word-break: keep-all;
    }

    /* Block h2 */
    .access-block .access-h2 {
        font-size: 6.15vw;
        margin-bottom: 9.23vw;
    }

    .access-block {
        margin-bottom: 18.46vw;
    }

    /* Route grid → 縦積み */
    .route-grid {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .route-col {
        width: 100%;
        max-width: 300px;
        justify-content: flex-start;
    }

    .route-box {
        width: 100%;
        max-width: 300px;
    }

    /* ---- アコーディオン ---- */
    .route-accordion-trigger {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 60px;
        background-color: var(--bg-color, #e4dfd6);
        color: #493d37;
        font-size: 16px;
        font-weight: 400;
        letter-spacing: 0.05em;
        text-align: center;
        box-sizing: border-box;
        padding: 0 10px;
        cursor: pointer;
        position: relative;
        z-index: 1;
        border-top: 1px solid #afa69a;
    }

    .route-col:last-child .route-accordion-trigger {
        border-bottom: 1px solid #afa69a;
    }

    .route-accordion-trigger::after {
        content: '+';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        font-weight: 300;
        color: #493d37;
        line-height: 1;
    }

    .route-col.is-open .route-accordion-trigger::after {
        content: '−';
    }

    .route-accordion-body {
        display: none;
        flex-direction: column;
    }

    .route-col.is-open .route-accordion-body {
        display: flex;
    }

    /* スパインは開いた時のみ表示 */
    .route-col::before {
        display: none;
    }

    .route-col.is-open::before {
        display: block;
    }

    /* Fork / Split: コンテンツ幅に収める */
    .route-fork-group {
        width: 100%;
    }

    .route-fork-top,
    .route-fork-bottom {
        width: 100%;
    }

    .route-split {
        width: 100%;
        gap: 6px;
    }

    .route-split-col:first-child {
        flex: 0 0 42%;
    }

    .route-split-col:last-child {
        flex: 1 1 0;
        min-width: 0;
    }

    .route-fork-group::before {
        left: calc(42% + 6px + 20px);
    }

    .route-split-col .route-step {
        padding-left: 30px;
    }

    .route-split-col .route-step__text {
        font-size: 11px;
        white-space: normal;
        line-height: 1.5;
    }

    .route-box--split {
        font-size: 10px;
        height: 50px;
        padding: 4px 4px;
    }

    /* スパイン位置は固定 26px（route-step::before と統一） */
    .route-col::before {
        left: 26px;
    }

    /* Notes */
    .access-notes {
        margin-top: 18.46vw;
    }

    .access-notes-inner {
        font-size: 3.38vw;
    }
}
