
/* 全体的な設定 */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ヘッダー */
.header {
    /* サイドバーの幅分、左に余白を設ける */
    margin-left: 200px; /* サイドバーの幅と同じ */
    margin-right: 0px; /* サイドバーの幅と同じ */
    margin-top: 0px; /* サイドバーの幅と同じ */

    background-color: #AAAAAA;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    position: relative; /* 他の要素との重なり順を定義するためにpositionを設定 */
    z-index: 1; /* サイドバーよりは後ろに配置 */
}

/* サイトタイトルリンクのスタイル */
.site-title-link {
    font-size: 1.5em;
    font-weight: bold;
    margin-left: 300px;
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.site-title-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ハンバーガーメニュー（スマホ表示のみ） */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.hamburger-menu span:last-child {
    margin-bottom: 0;
}

/* コンテンツコンテナ（PC表示用） */
.container {
    display: flex;
    flex: 1;
    padding-top: 0;
    /* container 自体はサイドバーの右隣に配置され、
       その中に main-content が入るので margin-left は不要 */
    margin-left: 0;
}

/* サイドバー（PC表示） */
.sidebar {
    width: 220px;
    background-color: #071265;
    padding: 20px;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow-y: auto;
    position: fixed; /* サイドバーは固定 */
    top: 0; /* 画面上部から開始 */
    left: 0; /* 画面左端に配置 */
    height: 100vh; /* 画面いっぱいの高さ */
    z-index: 2; /* ヘッダー（z-index: 1）より手前に配置 */
}

.sidebar nav ul {
    list-style: none; /* 箇条書きの点を削除 */
    padding: 0 !important; /* ここでulの左パディングを完全に削除（!importantで強制） */
    margin: 0 !important; /* ulのマージンも念のため削除（!importantで強制） */
    display: flex;
    flex-direction: column;
}

.sidebar nav li {
    margin-bottom: 10px; /* 各項目の下部に余白を追加 */
    border-right: none !important; /* 念のため右側のボーダーを削除（!importantで強制） */
    border-left: none !important; /* ここで左側のボーダーを削除（!importantで強制） */
}

.sidebar nav a {
    text-decoration: none; /* リンクの下線を削除 */
    color: #ffffff;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    border-right: none !important; /* 念のため右側のボーダーを削除（!importantで強制） */
    border-left: none !important; /* ここで左側のボーダーを削除（!importantで強制） */
    outline: none !important;
}

.sidebar nav a:hover {
    background-color: #96A2F8;
}

.sidebar nav a:focus {
    outline: none !important;
}


/* メインコンテンツ */
.main-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    margin-left: 0; /* 以前設定していたものを削除または0に */
}

/* オーバーレイ（スマホメニュー表示時） */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.is-active {
    display: block;
    opacity: 1;
    visibility: visible;
}



@media (max-width: 900px) {

.site-title-link {
    margin-left: 200px;
}


/* メディアクエリ：スマホ表示 (768px未満) */
@media (max-width: 767px) {
    .header {
        position: fixed; /* スマホではヘッダーは固定 */
        top: 0;
        left: 0;
        z-index: 1000; /* スマホではヘッダーを最前面に */
        width: 100%; /* 幅を画面いっぱいに */
        margin-left: 0; /* サイドバーの余白は不要 */
    margin-top: 0px; /* サイドバーの幅と同じ */

    }

    .hamburger-menu {
        display: block;
        margin-right: 15px;
    }


.site-title-link {
    margin-left: 0px;
}

    .sidebar {
        position: fixed;
        top: 0;
        left: -65%;
        width: 65%;
        height: 100vh;
        z-index: 1000; /* スマホではサイドバーをヘッダーより手前に */
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        transition: left 0.3s ease;
        padding-top: 60px; /* ヘッダーの高さ分開ける */
    }

    .sidebar.is-active {
        left: 0;
    }

    .container {
        flex-direction: column;
        padding-top: 0px; /* スマホではヘッダーの高さ分余白が必要 */
        margin-left: 0; /* スマホではサイドバーが重なるため、左マージンは不要 */
    }

    .main-content {
        padding-top: 0;
        flex-grow: 1;
        overflow-y: auto;
        margin-left: 0;
    }
}