/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: var(--space-md);
}

.photo-cell {
  aspect-ratio: 1 / 1;
  width: 100%;
  padding: 0;
  border: none;
  background-color: transparent;
  cursor: pointer;
  display: block;
}

.photo-cell.placeholder {
  border: 1px dashed var(--dash);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-cell.placeholder::before {
  content: attr(data-placeholder);
  color: var(--ink-muted);
  font-size: var(--size-label);
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Lightbox */
.lightbox {
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(246, 241, 229, 0.95); /* Cream paper with opacity */
}

.lightbox-track-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lightbox-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease-out;
  touch-action: pan-y;
}

.lightbox-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.lightbox-btn {
  position: absolute;
  background: transparent;
  border: none;
  color: var(--ink);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  cursor: pointer;
}

.lightbox-close {
  top: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
}

.lightbox-prev, .lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
}

.lightbox-prev {
  left: var(--space-xs);
}

.lightbox-next {
  right: var(--space-xs);
}

.lightbox-counter {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-secondary);
  z-index: 101;
}
