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

.artwork-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
}

.artwork-card:hover {
    transform: translateY(-5px);
}

.artwork-card img {
    width: 100%;
    height: 200px; /* サムネイルの高さ固定 */
    object-fit: cover; /* 画像がアスペクト比を維持しつつコンテナを埋める */
    display: block;
}

.artwork-card h3 {
    font-size: 1.1em;
    margin: 10px 10px 5px;
    color: #333;
}

.artwork-card p {
    font-size: 0.9em;
    color: #666;
    margin: 0 10px 10px;
}

.artwork-card .artwork-status {
    font-style: italic;
    color: #888;
    margin: 0 10px 10px;
}

.artwork-card .artwork-scores ul {
    list-style: none;
    padding: 0;
    margin: 10px;
}

.artwork-card .artwork-scores li {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 3px;
}

.lightbox {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* 画面の高さに固定 */
    overflow-y: auto; /* ライトボックス全体がスクロール */
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* 上部に寄せる */
}



.lightbox-content-wrapper {
    display: flex;
    max-width: 90%;
    height: auto; /* コンテンツの高さに合わせて自動調整 */
    min-height: 200px; /* 最小の高さを設定 */
    /* margin: 70px auto 20px auto; */ /* 削除 */
    background-color: #000;
    flex-direction: row; /* PCデフォルトは横並び */
    align-items: flex-start; /* 上部に寄せる */
    justify-content: center; /* 横方向中央揃え */
    gap: 20px; /* 画像とキャプションの間隔 */
    padding: 10px; /* コンテンツラッパー内の余白 */
    padding-top: 70px; /* ヘッダーの高さ分 */
    box-sizing: border-box; /* パディングを幅に含める */
    /* overflow-y: auto; */ /* 親要素がスクロールするため削除 */
}







.lightbox-image {



    max-width: 60%; /* PCでの画像の最大幅 */



    max-height: 100%;



    object-fit: contain;



}







#lightbox-caption {



    width: 35%; /* PCでのキャプションの幅 */



    text-align: left; /* キャプションのテキストを左寄せ */



    color: #ccc;



    padding: 10px 0;



    height: auto;



    overflow-y: auto; /* キャプションが長い場合にスクロール */



    max-height: 100%; /* 親要素の高さに合わせる */



}







#lightbox-caption h2 {



    color: #fff;



    margin-bottom: 5px;



}







#lightbox-caption p {



    color: #eee;



    margin-bottom: 5px;



}







#lightbox-caption ul {



    list-style: none;



    padding: 0;



    margin: 10px 0;



    text-align: left;



    max-width: 100%; /* 親要素の幅に合わせる */



}







#lightbox-caption li {



    color: #fff;



    margin-bottom: 5px;



    font-size: 0.95em;



}







#lightbox-caption .explanation {



    font-size: 0.85em;



    color: #bbb;



    margin-top: 2px;



    line-height: 1.4;



}

/* Lightbox styles */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    padding-top: 50px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
}

#lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: auto;
}

#lightbox-caption h2 {
    color: #fff;
    margin-bottom: 5px;
}

#lightbox-caption p {
    color: #eee;
    margin-bottom: 5px;
}

#lightbox-caption ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#lightbox-caption li {
    color: #fff;
    margin-bottom: 5px;
    font-size: 0.95em;
}

#lightbox-caption .explanation {
    font-size: 0.85em;
    color: #bbb;
    margin-top: 2px;
    line-height: 1.4;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.menu-bar .button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

/* Mobile styles for lightbox */
@media (max-width: 768px) {
    .lightbox-content-wrapper {
        flex-direction: column; /* モバイルでは縦並び */
        max-width: 95%;
        height: auto; /* コンテンツの高さに合わせて自動調整 */
        min-height: 200px; /* 最小の高さを設定 */
        /* margin: 70px auto 20px auto; */ /* 削除 */
        padding: 10px;
        padding-top: 70px; /* ヘッダーの高さ分 */
        /* overflow-y: auto; */ /* 親要素がスクロールするため削除 */
    }

    .lightbox-image {
        max-width: 90%; /* モバイルでは画像を大きく表示 */
        max-height: none; /* 高さを自動調整 */
        height: auto; /* 高さを自動調整 */
    }

    #lightbox-caption {
        width: 90%; /* モバイルではキャプションの幅を広げる */
        text-align: left; /* モバイルでは左寄せ */
        padding: 10px 0;
        max-height: none; /* 高さを自動調整 */
        height: auto; /* 高さを自動調整 */
    }

    #lightbox-caption ul {
        text-align: left; /* リストは左寄せを維持 */
    }
}
