.gallery {
    position: relative;
    height: 100dvh;
    min-height: 100svh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    align-items: center;
    transition: transform 0.6s ease;
    cursor: grab;
    user-select: none;
    will-change: transform;
    touch-action: pan-y;
}

.gallery-track:active {
    cursor: grabbing;
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.gallery-item img {
    max-width: 90%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 1.5rem;
    display: block;
    border-radius: 1rem;
    transform: scale(0.98);
}

.gallery-btn {
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    background: var(--bg-button);
    color: var(--text-on-dark);
    border: none;
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
}
.gallery-btn.prev { left: 0.5rem; }
.gallery-btn.next { right: 0.5rem; }

.gallery-hint {
    color: var(--background);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-style: italic;
    margin: 0.5rem 0;
}

.gallery h1 {
    font-size: 2rem;
    color: var(--background);
    text-align: left;
    margin-bottom: 1rem;
}

.gallery p {
    text-align: right;
    color: var(--text-on-dark);
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 0.8rem;
    margin-left: auto;
    width: 80%;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100svh;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  cursor: default;
  padding: 0;
}

#lightboxModal .modal-content {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

#lightboxModal .close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: var(--text-on-dark);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
}

#lightboxModal .prev,
#lightboxModal .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #fff;
  background: rgba(0,0,0,0.25);
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  z-index: 10010;
}
#lightboxModal .prev:hover,
#lightboxModal .next:hover {
  background: rgba(0,0,0,0.5);
}
#lightboxModal .prev { left: 1rem; }
#lightboxModal .next { right: 1rem; }