body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f0f0f0;
}

header {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    height: 200px; /* ここで高さを固定 */
    overflow: hidden;
    cursor: pointer;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.thumbnail-container:hover .thumbnail-container img {
    transform: scale(1.05);
}

.thumbnail-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2; /* Ensure caption is on top of the image */
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none; /* Allows clicking through to the container */
    transition: background 0.3s;
}

.thumbnail-container:hover .thumbnail-caption {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-artist-name {
    margin: 0;
    padding: 10px;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    text-align: right;
}


/* Lightbox styles */
.lightbox {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 70vh; /* Adjusted to make space for comments */
    object-fit: contain;
}

.lightbox-caption {
    color: white;
    text-align: center;
    padding: 15px;
    width: 100%;
    max-width: 600px;
}

.artist-name {
    font-size: 1.2em;
    margin: 0 0 10px 0;
}

.interactive-elements {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.like-button {
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    border: 1px solid #fff;
    background-color: transparent;
    color: #fff;
}

.like-button.liked {
    background-color: #ff69b4;
    border-color: #ff69b4;
}

.comments-section {
    text-align: left;
    max-height: 15vh; /* Limit height and allow scrolling */
    overflow-y: auto;
    width: 100%;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

.comments-list .comment-item {
    margin-bottom: 5px;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    font-size: 0.9em;
}

.comment-form {
    display: flex;
    gap: 5px;
}

.comment-input {
    flex-grow: 1;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.comment-submit {
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    background-color: #4CAF50;
    color: white;
}

/* Navigation and Close buttons */
.close-btn, .prev-button, .next-button {
    position: absolute;
    cursor: pointer;
    color: white;
    font-size: 3em;
    user-select: none; /* Prevents text selection */
    z-index: 1001;
}

.close-btn {
    top: 15px;
    right: 35px;
}

.prev-button, .next-button {
    top: 50%;
    transform: translateY(-50%);
}

.prev-button {
    left: 15px;
}

.next-button {
    right: 15px;
}

.profile-container {
    width: 80px; /* プロフィール画像のコンテナの幅 */
    height: 80px; /* プロフィール画像のコンテナの高さ */
    border-radius: 50%; /* 円形にする */
    overflow: hidden; /* はみ出た部分を隠す */
    margin: 10px auto; /* 中央寄せ */
    border: 2px solid white;
}

#lightbox-prof-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像をコンテナに合わせてトリミング */
}

/* Responsive adjustments for gallery grid */
@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Smaller thumbnails on mobile */
    }

    .thumbnail-container {
        height: auto; /* Allow height to adjust based on content */
    }

    .thumbnail-container img {
        height: auto; /* Ensure image scales with container */
    }
}