/* スクロールスパイ適用範囲 */
.scrollspy-container {
    position: relative;
}

/* デスクトップ: 右側固定ナビゲーション */
.local-nav {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: all 0.3s ease;
    opacity: 1;
    pointer-events: auto;
}

/* デスクトップ: 範囲外で非表示 */
.local-nav.nav-hidden {
    opacity: 0;
    pointer-events: none;
}

/* デスクトップ時のheight指定 */
@media (min-width: 1200px) {
    .local-nav {
        height: 100vh;
    }
    
    /* デスクトップ: fixed状態 */
    .local-nav.nav-fixed {
        position: fixed;
        top: 0;
        bottom: auto;
    }
    
    /* デスクトップ: absolute bottom状態 */
    .local-nav.nav-bottom {
        position: absolute;
        top: auto;
        bottom: 0;
    }
}

.nav-list {
    list-style: none;
    width: 100%;
}

.nav-item {
    margin-bottom: 12px;
}

.nav-item:last-child {
    margin-bottom: 0;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: #fff;
    text-decoration: none;
    border-radius: 1px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-color: rgba(255,255,255, 0.2);
    background-color: rgba(255,255,255, 0.2);
}

.nav-link:hover {
    /*
    border-color: rgba(10,186,181, 1);
    background-color: rgba(10,186,181, 0.4);
    */
    color: #fff;
    transform: translateX(-2px);
}

.nav-link.active {
    color: white;
    font-weight: 600;
    transform: translateX(-4px);
    border-color: rgba(10,186,181, 1);
    background-color: rgba(10,186,181, 0.4);
}

.section {
    min-height: 100vh;
    padding: 60px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.section:nth-child(odd) {
    background-color: #f9f9f9;
}

.section h1,
.section h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.section p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #666;
    text-align: center;
    max-width: 600px;
}

/* ヘッダー・フッターセクション（ナビゲーション範囲外） */
.header-section,
.footer-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 40px;
}

.header-section h1,
.footer-section h1 {
    color: white;
    font-size: 3em;
    margin-bottom: 20px;
}

.header-section p,
.footer-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2em;
}

/* モバイル: 下部固定横並び */
@media (max-width: 1199px) {
    .local-nav {
        position: absolute; /* 初期はabsolute */
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: auto;
        height: auto;
        padding: 15px 0;
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        align-items: stretch;
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        background-color: rgba(0,0,0, 0.6);
        backdrop-filter: blur(3px);
    }
    
    /* モバイル: 範囲外で非表示 */
    .local-nav.nav-hidden {
        transform: translateY(100%);
    }
    
    /* モバイル: fixed状態（ナビ高さ分スクロール後） */
    .local-nav.nav-fixed {
        position: fixed;
        bottom: 0;
    }
    
    /* モバイル: bottom状態 */
    .local-nav.nav-bottom {
        position: absolute;
        bottom: 0;
    }
    
    .nav-list {
        display: flex;
        flex-direction: row;
        gap: 15px;
        padding: 0 20px;
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x mandatory;
        width: 100%;
    }
    
    .nav-list::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .nav-link {
        padding: 12px 16px;
        font-size: 14px;
        white-space: nowrap;
        min-width: 80px;
        scroll-snap-align: center;
        border: 1px solid transparent;
        transform: none;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    .nav-link.active {
        border-color: rgba(10,186,181, 1);
        background-color: rgba(10,186,181, 0.4);
        transform: none;
    }
}