@layer component.state {
  .gallery__lightbox {
    position: fixed;
    inset: 0;
    width: 100dvw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.85);
    &:popover-open {
      display: flex;
      flex-direction: column;
    }
  }

  .gallery__lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
    padding: 0.5rem;
    border: 0;
    background: none;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }

  .gallery__lightbox__main {
    overflow-x: auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    scroll-snap-type: x mandatory;
  }

  .gallery__lightbox__item {
    min-width: 100dvw;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    img {
      object-fit: contain;
      max-width: 100%;
      max-height: 100%;
    }
  }
}
