/* サイドナビゲーション制御 */
.col-md-3 {
    display: block; /* 初期状態で表示 */
    transition: all 0.3s ease;
}

/* 全タブでサイドナビゲーションを表示 */
body.tab-overview .col-md-3,
body.tab-part1-1 .col-md-3,
body.tab-part1-2 .col-md-3,
body.tab-part2 .col-md-3 {
    display: block !important;
}

/* デフォルト状態：メインコンテンツ */
.col-md-9 {
    transition: all 0.3s ease;
    max-width: 75% !important;
    padding-left: 15px !important;
}

/* 全タブで通常のメインコンテンツ幅を維持 */
body.tab-overview .col-md-9,
body.tab-part1-1 .col-md-9,
body.tab-part1-2 .col-md-9,
body.tab-part2 .col-md-9 {
    max-width: 75% !important;
    padding-left: 15px !important;
}



/* タブナビゲーション */
.tab-navigation {
    width: 100%;
    display: flex;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(198, 123, 123, 0.12);
    overflow: hidden;
    margin-bottom: 30px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    z-index: 100;
}
.tab-navigation.sticky-top {
    box-shadow: 0 4px 15px rgba(198, 123, 123, 0.25);
    z-index: 1020;
    margin-bottom: 0;
}

.tab-button {
    flex: 1;
    padding: 20px 15px;
    border: none;
    background-color: #f8f9fa;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    text-align: center;
    border-right: 1px solid rgba(198, 123, 123, 0.1);
    position: relative;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background-color: #e9ecef;
    color: #333;
}

.tab-button.active {
    background: linear-gradient(145deg, #c67b7b, #b56f6f);
    color: white;
    font-weight: bold;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

/* タブコンテンツ */
.tab-content {
    display: none;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 6px 25px rgba(198, 123, 123, 0.12);
    min-height: 400px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.sidenav-content {
    display: none !important;  /* !importantで強制 */
}

.sidenav-content.active {
    display: block !important;
}

/* ナビゲーションリンク */
.nav-item {
    margin-bottom: 3px;
}

.nav-link {
    display: block;
    padding: 6px 8px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
    font-size: 0.8rem;
    border-radius: 3px;
    text-align: left;
}

.nav-link:hover {
    border-left-color: #c67b7b;
    background-color: rgba(198, 123, 123, 0.1);
    color: #ecf0f1;
    text-decoration: none;
}

.nav-link.active {
    font-weight: bold;
    color: #c67b7b !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    background-color: rgba(198, 123, 123, 0.15);
    border-left-color: #c67b7b;
}

/* セクションタイトル */
.section-title {
    position: relative;
    background: transparent !important;
    padding: 15px 0 10px 0;
    margin-bottom: 10px;
    color: #333333;
    font-size: 2rem;
    font-weight: 600;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(100% - 80px);
    height: 4px;
    background-color: #c67b7b;
    border-radius: 2px;
}

/* メインコンテンツ */
.main-content {
    width: 100%;
    margin: 0;
    padding: 0;
}

.main-content .container {
    max-width: 1200px;
    padding: 0 15px;
}

/* 横スクロール防止 */
body {
    overflow-x: hidden;
}

/* レスポンシブ対応 */
@media (max-width: 991.98px) {
    .col-md-3 {
        display: none !important; /* モバイル時は強制的に非表示 */
    }
    
    .col-md-9 {
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .nav-link {
        display: inline-block;
        margin-right: 10px;
        margin-bottom: 5px;
        text-align: left;
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    .tab-navigation {
        flex-direction: column;
    }

    .tab-button {
        border-right: none;
        border-bottom: 1px solid rgba(198, 123, 123, 0.1);
        padding: 15px;
        font-size: 0.9rem;
    }

    .tab-button:last-child {
        border-bottom: none;
    }

    .tab-content {
        padding: 20px;
    }
    
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tab-button {
        font-size: 0.8rem;
        padding: 12px 8px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
}

/* 数式全体のサイズ調整 */
.MathJax {
    font-size: 1.2em !important;  /* 大きくする場合 */
}

/* インライン数式のみ */
.MathJax_Display {
    font-size: 1.3em !important;  /* ディスプレイ数式を大きく */
}