/* Photos エリアのコンテナ */
.photos {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 0 40px;
}

/* ページ内の見出し */
.photos h2 {
    font-family: "Bitter", serif;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
}

.photos h2::after {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    background-color: var(--black);
    margin-top: 20px;
}

/* 写真のリストコンテナ */
.photo_list {
    margin: 48px 0;
}

/* ギャラリーグリッドのレイアウト */
.gallery-grid {
    display: grid;
    gap: 24px;
    /* デスクトップで1行4枚程度になるように調整 */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* 写真アイテムのコンテナ */
.gallery-item {
    background-color: var(--bg-gray);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

/* 縦横比を正方形に固定するコンテナ */
.gallery-item .image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 縦幅を横幅と同じにして正方形にする */
    overflow: hidden;
}

/* サムネイル画像本体 */
.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 縦横比を維持しつつ、コンテナに合わせて切り抜く */
    display: block;
}

/* 一覧ではキャプションを非表示にする */
.caption {
    display: none;
}

/* --- モーダルウィンドウ --- */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    margin: 10px auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
}

#modal-caption {
    color: #f1f1f1;
    padding: 15px;
    text-align: center;
    font-size: 1.2em;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* --- モバイル用 --- */
@media (max-width:800px) {
    /* Photos エリア */
    .photos {
        padding: 0 16px;
    }
    /* モバイルで1行2枚になるように調整 */
    .gallery-grid {
        gap: 16px;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}