* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #fff;
  color: #000;
}

.back-link {
  position: fixed;
  top: 2rem;
  left: 2rem;
  color: #000;
  text-decoration: none;
  font-size: 0.75rem;
  z-index: 100;
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.back-link:hover {
  border-bottom: 1px solid #000;
}

.gallery {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 6rem 3rem 8rem;
}

.photo-item {
  position: absolute;
  z-index: 1;
}

.photo-item:hover {
  z-index: 40;
}

.photo-wrapper {
  cursor: pointer;
}

.photo-image {
  position: relative;
  display: block;
  background: #c87747;
}

.photo-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 0.35s ease;
}

.photo-wrapper:hover img {
  filter: grayscale(1) invert(1) contrast(0.86) brightness(1.1) sepia(0.52) hue-rotate(350deg) saturate(0.48);
}

.photo-caption {
  margin-top: 5px;
  font-size: 0.6rem;
  font-weight: 300;
  font-style: italic;
  color: #b3b3b3;
  letter-spacing: 0.3px;
}

.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 300;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.97);
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-inner img {
  max-width: 90vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  display: block;
}

.lightbox-info {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: #b3b3b3;
}

.lightbox-date {
  color: #000;
  margin-bottom: 0.35rem;
}

.lightbox-notes {
  margin-top: 0.5rem;
  max-width: 320px;
  white-space: pre-wrap;
  color: #b3b3b3;
  font-style: italic;
}

.lightbox-close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  color: #000;
  cursor: pointer;
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  z-index: 301;
}

.lightbox-close:hover {
  border-bottom: 1px solid #000;
}

.lightbox-close:hover {
  border-bottom: 1px solid #000;
}

.lightbox-admin {
  margin-top: 1.25rem;
  text-align: center;
}

.lightbox-admin-actions {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.lightbox-admin-btn {
  background: none;
  border: none;
  border-bottom: 1px solid #000;
  font-family: inherit;
  font-size: 0.65rem;
  color: #000;
  cursor: pointer;
  padding: 0.35rem 0;
}

.lightbox-admin-btn:hover {
  opacity: 0.5;
}

.lightbox-edit-form {
  margin-top: 1rem;
  text-align: left;
  max-width: 240px;
}

.lightbox-edit-form label {
  display: block;
  font-size: 0.6rem;
  color: #999;
  margin-bottom: 0.25rem;
  font-style: italic;
}

.lightbox-edit-form input,
.lightbox-edit-form select {
  width: 100%;
  border: none;
  border-bottom: 1px solid #ddd;
  padding: 0.35rem 0;
  margin-bottom: 0.75rem;
  background: transparent;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 300;
}

.lightbox-edit-form textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid #ddd;
  padding: 0.35rem 0;
  margin-bottom: 0.75rem;
  background: transparent;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 300;
  resize: vertical;
  min-height: 3rem;
  line-height: 1.5;
}

.lightbox-edit-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-style: normal;
  color: #000;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.lightbox-edit-form .checkbox-label input {
  width: auto;
  margin: 0;
}

.lightbox-edit-form button {
  background: none;
  border: none;
  border-bottom: 1px solid #000;
  font-family: inherit;
  font-size: 0.65rem;
  cursor: pointer;
  margin-right: 1rem;
  padding: 0.35rem 0;
}

@media (max-width: 600px) {
  .gallery {
    padding: 5rem 0 6rem;
  }

  .back-link {
    left: 0.75rem;
  }
}
