﻿body {
    margin: 0;
    padding-top: 80px;
    font-family: "Helvetica", sans-serif;
    background: #f8fafc;
    color: #1e293b;
}

/* ナビ */
/*.nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 40px;
}*/

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 40px;
    background: transparent; /* ← 背景を完全透過 */
    z-index: 1000; /* ← 画像や動画より前に出す */
}

.nav-logo {
    margin-right: 40px;
    /*font-weight: 700;*/
    font-size: 18px;
}

.nav a {
    color: #1e293b;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.3s ease;
}

    .nav a:hover {
        opacity: 0.6;
    }

/* ギャラリー */
.gallery {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}



/*.photo {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}

    .photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: opacity 0.3s ease;*/ /* ← フェード用 */
    /*}*/

    /* ★ カーソルを合わせたときに薄くグレーアウト */
    /*.photo:hover img {
        opacity: 0.8;*/ /* ← 0.6〜0.8 が自然でおすすめ */
    /*}*/

.photo {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 5;
}

    /* 画像 */
    .photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: opacity 0.3s ease;
    }

    /* グレーアウト */
    .photo:hover img {
        opacity: 0.8;
    }

/* キャプション（最初は非表示） */
.caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* ← 完全中央にする魔法 */
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center; /* ← 複数行でも中央揃え */
}

/* ホバー時に文字を表示 */
.photo:hover .caption {
    opacity: 1;
}


/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80%;
    /*border-radius: 12px;*/
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

/* スマホ対応 */
/*@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .nav-logo {
        margin-right: 0;
        margin-bottom: 10px;
    }
}*/

@media (max-width: 768px) {
    /*.nav {
        display: flex;
        flex-wrap: wrap;*/ /* ← これがポイント */
        /*gap: 12px 20px;*/ /* 上下12px、左右20px の余白 */
        /*padding: 20px;
    }*/

    .nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 12px 20px;
        padding: 20px;
        background: transparent; /* ← 透過 */
        z-index: 1000;
    }
html, body {
    overscroll-behavior: auto;
}

/* ホバー時のグレーアウトを無効化 */
    .photo:hover img {
        opacity: 1 !important;
    }

    /* キャプションも表示しない */
    .photo:hover .caption {
        opacity: 0 !important;
    }

    body {
        padding-top: 95px; /* ← スマホは2段になるので余白を増やす */
    }


    .nav-logo {
        width: 100%; /* ← ロゴだけ1行目に固定 */
        margin-bottom: 10px;
        
    }
    .nav a {
        color: #1e293b;
        text-decoration: none;
        font-size: 14px;
        transition: opacity 0.3s ease;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        margin-top:9%;
        overscroll-behavior: none;
    }
}
