/* ベーススタイル */
body {
    font-family: "Times New Roman", serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #333;
    display: flex;
    flex-direction: column;
    /* min-height: 100vh; 削除 */
}

/* ヘッダースタイル */
header {
    padding: 20px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
    font-family: Arial, sans-serif;
}

header h1 .home-link {
    text-decoration: none;
    color: inherit;
}

/* ハンバーガーメニューのスタイル */
.hamburger {
    display: none; /* PC表示時は非表示 */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 30;
    position: fixed;
    top: 25px;
    right: 25px;
}

.hamburger span {
    display: block;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
}

/* ナビゲーションスタイル */
nav {
    padding: 20px;
    width: 250px;
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 10;
    background: transparent;
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: relative;
}

nav ul li {
    margin: 20px 0;
    position: relative;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 1.2em;
}

/* サブメニューのスタイル */
nav ul .submenu {
    display: none;
    padding-left: 20px;
}

nav ul li:hover > .submenu {
    display: block; /* メニューにホバーしたらサブメニューを表示 */
}

.submenu li {
    margin: 0;
}

.submenu li a {
    font-size: 1em;
    color: #333;
    display: block;
    padding: 10px 0;
}

/* メインコンテンツスタイル */
main {
    flex: 1; /* 追加 */
    margin-top: 100px;
    margin-left: 150px;
    padding: 20px;
}

.casestudy-title {
    font-size: 3em;
    margin-bottom: 40px;
    text-align: center;
}

/* 画像のスタイル */
.casestudy-images {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.casestudy-images img {
    width: calc(100% / 3 - 20px);
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

/* 動画ボックスのスタイル */
.casestudy-video {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.casestudy-video iframe {
    max-width: 100%;
    border: none;
}

/* テキストボックスのスタイル */
.casestudy-textbox {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.0em;
    line-height: 1.6;
}

/* フッタースタイル */
footer {
    padding: 10px;
    text-align: center;
    width: 100%;

    z-index: 10;
}

/* PC表示時の固定レイアウト対応 */
@media (min-width: 769px) {
    .hamburger {
        display: none;
    }

    body {
        overflow-x: auto;
    }

    .container {
        width: 1550px;
        margin: 0 auto;

    }

    /* 画像サイズを1.5倍にする */
    .casestudy-images img {
        width: 450px;
        height: 562.5px; /* 4:5の比率 */
    }
}

/* スマホ表示時のスタイル */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    /* ナビゲーションメニューの初期状態を上に隠す */
    nav {
        display: block;
        position: fixed;
        top: -100vh; /* 修正: 画面の高さ分上に移動 */
        left: 0;
        width: 100%;
        background-color: #fff;
        padding-top: 550px; /* ヘッダーの高さ分余白を追加 */
        z-index: 20;
        overflow-y: auto; /* コンテンツが多い場合はスクロール */
        transition: top 0.5s ease; /* アニメーションを追加 */
    }
    /* メニューが開いたときのスタイル */
    nav.open {
        top: 0; /* メニューを表示 */
    }

    nav ul {
        list-style-type: none;
        padding: 0;
        margin: 0;
    }

    nav ul li {
        margin: 20px 0;
        text-align: center; /* テキストを中央揃え */
    }

    nav ul li a {
        font-size: 1.5em;
        color: #333;
        text-decoration: none;
    }

    /* サブメニューのスタイル */
    nav ul .submenu {
        display: none;
    }

    /* サブメニューの開閉 */
    nav ul li.open > .submenu {
        display: block;
    }

    /* サブメニューのリンクスタイル */
    .submenu li a {
        font-size: 1em;
        padding: 10px;
        display: block;
        color: #333;
    }

    /* コンテナのマージンを調整 */
    .container {
        flex-direction: column;
        margin-top: 80px;
    }

    main {
        margin-top: 0;
        margin-left: 0;
        padding: 10px;
        margin-bottom: 200px; /* フッターとの間隔を追加 */
    }

    .casestudy-images {
        flex-direction: column;
        align-items: center;
    }

    .casestudy-images img {
        width: 100%;
        height: auto;
        margin-bottom: 0px;
    }
}
