/* ページ全体の背景画像設定 */
body {
    font-family: "Times New Roman", serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.3;  /* 背景画像を30%透過 */
    z-index: -1;  /* 背景がすべてのコンテンツの後ろに表示されるように */
}

/* ヘッダースタイル */
header {
    padding: 20px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    background-color: #ffffff;  /* 白い背景を追加 */
    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;
}

/* コンテナスタイル */
.container {
    display: flex;
    flex: 1;
    margin-top: 80px;
    position: relative;
}

/* ナビゲーションスタイル */
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;
    z-index: 10;
}

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; /* PC表示時にホバーでサブメニューを表示 */
}

.submenu li {
    margin: 10px 0;
}

.submenu li a {
    font-size: 1em;
    color: #333;
}

/* フォームコンテナスタイル */
.form-container {
    position: absolute;
    top: 50%;  /* 垂直方向の中央に配置 */
    left: 50%;  /* 水平方向の中央に配置 */
    transform: translate(-50%, -50%);  /* 中央に揃えるために位置を調整 */
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

h2 {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* フォームスタイル */
main form {
    display: flex;
    flex-direction: column;
    width: 500px;
    max-width: 90%;
}

main form label {
    margin-top: 10px;
}

main form input,
main form textarea {
    margin-top: 5px;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
}

main form textarea {
    height: 300px;
}

main form button {
    margin-top: 15px;
    padding: 10px 15px;
    font-size: 1em;
    color: #fff;
    background-color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

main form button:hover {
    background-color: #555;
}

/* フッタースタイル */
footer {
    padding: 10px;
    width: 100%;
    position: relative;
    bottom: 0;
    left: 0;
    background-color: #ffffff;  /* フッターにも白い背景を追加 */
    text-align: center;
    z-index: 10;
}

/* PC表示時のスタイル */
@media (min-width: 769px) {
    .hamburger {
        display: none;
    }
}

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

    /* ナビゲーションを非表示にする */
    nav {
        display: none;
    }

    /* ハンバーガーメニューが開いたときのスタイル */
   nav {
        display: block;
        position: fixed;
        top: -100vh; /* 修正: 画面の高さ分上に移動 */
        left: 0;
        width: 100%;
        background-color: #fff;
        padding-top: 550px; /* ヘッダーの高さ分余白を追加 */
        z-index: 10;
        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;
    }

    /* フォームコンテナのレイアウト調整 */
    .form-container {

        top: auto;
        left: auto;
        transform: none;
        margin: 100px auto 50px auto; /* 上下のマージンを調整、左右は auto で中央揃え */
        width: 100%; /* 幅を90%に */
        max-width: 600px; /* 最大幅を設定 */
        padding: 20px; /* パディングを追加 */
    }

    main form {
        width: 100%; /* フォームの幅を100%に */
    }
}
