/* style.css */
body {
    background-color: #fff;
    background-image: linear-gradient(#e7e7e7 3px, transparent 3px), 
                      linear-gradient(90deg, #e7e7e7 3px, transparent 3px);
    background-size: 150px 150px;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    animation: gridAnimation 60s linear infinite;
}

@keyframes gridAnimation {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 70% 100%;
    }
}

.container {
    position: absolute;
    top: 0;
    left: 0;
}

img {
    width: 300px; /* ここで幅を設定 */
    height: auto; /* 高さは自動で調整 */
    margin-top: -1040px;
    display: block;
}

header {
    position: relative; /* デフォルトの相対位置に戻す */
    margin-top: -1400px; /* ナビゲーションバーを少し上に持っていく */
    margin-left: -190px;
    padding: 0; /* 上下のパディングをリセット */
}

nav {
    display: flex; /* フレックスボックスを使用 */
    flex-direction: column; /* 縦方向に並べる */
    align-items: center; /* 中央揃え */
    margin: 0;
    padding: 0;
    list-style: none; /* デフォルトのリストスタイルを削除 */
}

nav ul {
    margin: 0;
    padding: 0;
}

nav li {
    margin: -20px 0; /* アイテム間の垂直間隔を設定 */
}

nav a {
    text-decoration: underline;
    color: rgb(0, 0, 255); /* テキストの色を設定 */
    font-size: 16px; /* フォントサイズを設定 */
    line-height: 2; /* 行間を調整 */
    display: block; /* リンクをブロック要素として表示 */
    padding: 10px; /* 内側のスペースを追加 */
    text-align: right;
    transition: color 0.3s ease; /* カラーの変化にアニメーションを追加 */
}

/* マウスオーバー時のスタイル */
nav a:hover {
    color: #ff2aca; /* マウスオーバー時のテキストカラー */
}

.video-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px; /* 動画の間に隙間を追加 */
    width: 100vmin; /* ビューポートの幅と高さの最小値を基準にする */
    height: 100vmin;
    margin-top: 40px; /* ページの上部にスペースを追加 */
    margin-left: 20px;
    margin-bottom: 1100px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 正方形を作るためのパディング */
    overflow: hidden;
    cursor: pointer; /* マウスオーバーのヒント */
}

.video-wrapper:hover .video-overlay {
    opacity: 1;
}

.video-wrapper:hover video {
    transform: scale(1.1); /* 動画を1.1倍にズーム */
    transition: transform 0.3s ease; /* ズームのアニメーションを追加 */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* 半透明の背景 */
    color: #fff;
    display: flex;
    flex-direction: column; /* 縦方向に並べる */
    align-items: flex-start; /* 左端に揃える */
    justify-content: flex-start; /* 上端に揃える */
    opacity: 0; /* 初期状態では非表示 */
    transition: opacity 0.3s ease; /* フェードインのアニメーション */
    padding: 10px;
    box-sizing: border-box; /* パディングとボーダーを含める */
}

.video-overlay h3 {
    margin: 0;
    font-size: 5.5rem; /* タイトルのフォントサイズを調整 */
    font-family: "Bergen Sans", sans-serif;
    font-weight: 600;
    font-style: normal;
    text-align: left; /* テキストを左寄せ */
    line-height: 1.1; /* 行間を狭くする */
    width: 100%; /* テキストブロックをコンテナの幅に合わせる */
    box-sizing: border-box; /* パディングとボーダーを含める */
}

.video-overlay .small-text {
    font-size: 0.8rem; /* 小さなテキストのサイズ */
    font-family: "Bergen Sans", sans-serif;
    font-weight: 600;
    font-style: normal;
    margin-top: 5px; /* 主なテキストとのスペース */
    text-align: left; /* 小さなテキストも左寄せ */
    width: 100%; /* 小さなテキストをコンテナの幅に合わせる */
    box-sizing: border-box; /* パディングとボーダーを含める */
}

video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 動画をコンテナにフィットさせる */
}

.content {
    /* 他のコンテンツのスタイルをここに追加 */
}

/* モーダルウィンドウのスタイル */
.modal {
    display: none; /* 初期状態では非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000; /* 他のコンテンツの上に表示 */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
    width: 80%;
    max-width: 1000px; /* モーダルの最大幅を設定 */
    padding: 20px;
    box-sizing: border-box;
}

.modal-content iframe {
    width: 100%;
    height: 60vh; /* 高さをビューポートの60%に設定 */
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #000;
    font-size: 2rem; /* フォントサイズを調整 */
    cursor: pointer;
    transition: color 0.3s ease; /* 色の変更にアニメーションを追加 */
}

.modal-close:hover {
    color: rgba(0, 0, 0, 0.6); /* マウスオーバー時に色を薄くする */
}

/* メディアクエリを使用して、スマートフォン向けのスタイルを追加 */
@media screen and (max-width: 768px) {
    body {
        background-size: 100px 100px; /* 背景のサイズを調整 */
        justify-content: flex-start; /* 中央揃えから上揃えに変更 */
        align-items: flex-start; /* 上揃えに変更 */
        padding: 20px; /* スマートフォン用のパディングを追加 */
        flex-direction: column; /* 縦方向に並べる */
    }

    .container {
        display: flex; /* フレックスボックスを使用 */
        justify-content: center; /* 中央揃え */
        align-items: center; /* 縦方向の中央揃え */
        flex-direction: column; /* 縦方向に並べる */
        position: relative; /* 相対位置に戻す */
        top: 20px;
        left: 0;
        width: 100%; /* コンテナの幅を100%に調整 */
    }

    img {
        width: auto; /* 幅を100%に調整 */
        height: 50vmin;
        margin-top: 0; /* マージンをリセット */
    }

    header {
        display: none; /* メニューバーを非表示にする */
        position: relative; /* 相対位置に戻す */
        margin-top: 20px;
        margin-left: auto; /* 左側のマージンを自動に設定 */
        margin-right: auto; /* 右側のマージンを自動に設定 */
        padding: 0;
        width: max-content; /* コンテンツの幅に合わせる */
    }

    nav {
        flex-direction: row; /* 横方向に並べる */
        justify-content: space-around; /* アイテム間にスペースを均等に配置 */
        width: 100%;
    }

    nav li {
        margin: 0; /* マージンをリセット */
    }

    nav a {
        font-size: 14px; /* フォントサイズを小さく */
        padding: 5px; /* パディングを小さく */
        text-align: center; /* テキストを中央揃え */
    }

    .video-container {
        grid-template-columns: 1fr; /* 1列のレイアウトに変更 */
        grid-template-rows: auto; /* 高さを自動調整 */
        width: 85vmin; /* 幅をビューポートの80%に設定 */
        height: auto; /* 高さを自動調整 */
        margin-top: 20px; /* 上部にスペースを追加 */
        margin-left: 10px; /* 左のマージンをリセット */
        margin-bottom: 20px;
        display: flex; /* フレックスボックスを使用 */
        flex-direction: column; /* 縦方向に並べる */
        align-items: center; /* 中央揃え */
    }

    .video-wrapper {
        padding-top: 56.25%; /* 16:9のアスペクト比を維持 */
    }

    .video-overlay h3 {
        font-size: 2rem; /* タイトルのフォントサイズを小さく */
    }

    .video-overlay .small-text {
        font-size: 0.7rem; /* 小さなテキストのサイズを小さく */
    }

    /* メニューバーのレスポンシブ対応 */
    #nav-menu {
        display: block; /* スマートフォンで表示する */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: #fff;
        z-index: 1000;
        padding: 10px;
    }

    #nav-menu ul {
        display: flex; /* フレックスボックスを使用 */
        flex-direction: column; /* 縦方向に並べる */
        align-items: center; /* 中央揃え */
        padding: 0;
    }

    #nav-menu li {
        margin: 10px 0; /* アイテム間の間隔を調整 */
    }

    #nav-menu a {
        font-size: 18px; /* フォントサイズを調整 */
        padding: 10px; /* パディングを調整 */
        text-align: center; /* テキストを中央揃え */
    }
}
