dialog {
    padding: 0;
    border: none;
    background: transparent;
    max-width: 90vw;
    max-height: 90vh;
    justify-content: center;
    align-items: center;
    margin: auto;
}
dialog[open] {
    display: flex;
}

dialog img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.9);
}





.carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.carousel-track {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;     /* enables swipe-to-snap behavior */
    scroll-behavior: smooth;
    gap: 0;
}

.carousel-track::-webkit-scrollbar {
    display: none;                      /* hides the scrollbar visually */
}

.carousel-slide {
    flex: 0 0 100%;                     /* each slide takes up the full width of the carousel */
    scroll-snap-align: center;          /* makes each slide "snap" into place when scrolling stops */
}

.carousel-slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
}

.carousel-slide figcaption {
    text-align: center;
    padding: 10px;
    font-size: 14px;
    color: #666;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }