/*switcher common sculpture&exibition*/

.sculpturs {
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/*switcher sculpture */

.Sc {
    width: 80%;
    margin-left: 10%;
    margin-right: 10%;
    align-items: baseline;
    height: auto;
}

.type {
    display: block;
    margin-left: 3%;
    margin-right: 3%;
    width: 31%;
    text-align: left;
    background-color: #D9D9D9;
    transition: all 1s;
    cursor: pointer;
}

.type > img {
    width: 100%;
    object-fit: contain;
    padding: 20%;
}

.left {
    width: fit-content;
    margin-top: -15%;
    margin-left: 5%;
    margin-bottom: -10%;
    text-align: left;
    transition: all 1s;
    opacity: 0.8;
}

.left > h2 {
    font-weight: normal;
    font-size: larger;
    text-align: center;
}

/*switcher exhibition*/

.type2 {
    display: block;
    width: 30%;
    margin-left: 2%;
    margin-right: 2%;
    text-align: left;
    background-color: transparent;
    transition: all 1s;
    cursor: pointer;
}

.type2 > img {
    width: 80%;
    margin-left: 10%;
    margin-right: 10%;
    object-fit: contain;
    transition: all 1s;
}

/*collection*/

.collection {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(160px, 200px));
    text-align: center;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 5%;
}

.cell {
    display: block;
    margin: 5%;
}

.cell img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: all 1s;
}

/* Performance and preview additions; original layout above is unchanged. */

.gallery-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.gallery-image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.pagination {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0 16px 45px;
}

.pagination button {
    min-width: 100px;
    padding: 9px 16px;
    border: 1px solid black;
    border-radius: 999px;
    color: black;
    background: white;
    cursor: pointer;
}

.pagination button:disabled {
    cursor: default;
    opacity: 0.3;
}

.pagination span {
    min-width: 100px;
    font-size: 0.85rem;
    text-align: center;
}

.type:focus-visible,
.type2:focus-visible,
.gallery-image-button:focus-visible,
.pagination button:focus-visible {
    outline: 1px solid black;
    outline-offset: 4px;
}

body.has-dialog {
    overflow: hidden;
}

.lightbox {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    color: white;
    background: rgba(15, 15, 15, 0.97);
    user-select: auto;
}

.lightbox::backdrop {
    background: rgba(0, 0, 0, 0.82);
}

.lightbox[open] {
    display: grid;
    grid-template-columns: minmax(54px, 0.16fr) minmax(0, 1fr) minmax(54px, 0.16fr);
    align-items: center;
}

.lightbox figure {
    display: grid;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    grid-template-rows: minmax(0, 1fr) auto;
    margin: 0;
    padding: 54px 0 24px;
}

.lightbox-image-wrap {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    place-items: center;
}

.lightbox-image-wrap::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    content: "";
    animation: spin 700ms linear infinite;
}

.lightbox.is-loaded .lightbox-image-wrap::before {
    display: none;
}

.lightbox img {
    z-index: 1;
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 145px);
    object-fit: contain;
    opacity: 0;
    transition: opacity 180ms ease;
}

.lightbox.is-loaded img {
    opacity: 1;
}

.lightbox figcaption {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-top: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
}

.lightbox figcaption small {
    color: rgba(255, 255, 255, 0.5);
}

.lightbox-close,
.lightbox-nav {
    border: 0;
    color: white;
    background: transparent;
    cursor: pointer;
}

.lightbox-close {
    position: fixed;
    z-index: 2;
    top: 16px;
    right: 22px;
    width: 44px;
    height: 44px;
    font-size: 2rem;
}

.lightbox-nav {
    width: 54px;
    height: 54px;
    justify-self: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    font-size: 1.2rem;
}

.lightbox-nav:hover,
.lightbox-close:hover {
    color: black;
    background: white;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
    .collection {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 10px;
    }

    .pagination span {
        order: -1;
        width: 100%;
    }

    .lightbox[open] {
        grid-template-columns: 1fr;
    }

    .lightbox figure {
        grid-column: 1;
        grid-row: 1;
        padding: 58px 16px 78px;
    }

    .lightbox-nav {
        position: fixed;
        z-index: 2;
        bottom: 14px;
    }

    .lightbox-previous { left: 20px; }
    .lightbox-next { right: 20px; }

    .lightbox figcaption {
        flex-direction: column;
        gap: 2px;
    }
}

