body {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  background: #35496f;
  color: #d8d8d8;
}

.gallery-hero {
  padding: 80px 24px;
  text-align: center;
  background:
    linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)),
    url('/assets/bear.webp');
  background-size: cover;
  background-position: center 15%;
  color: white;
}

.gallery-hero h1 {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 4rem);
}

.gallery-hero p {
  margin-top: 12px;
  opacity: .92;
}

.gallery-main {
  max-width: 1400px;
  margin: auto;
  padding: 40px 24px 80px;
}

.back-link {
  display: inline-block;
  margin-bottom: 30px;
  color: #cfbc9a;
  text-decoration: none;
  font-weight: bold;
}

.back-link:hover {
  text-decoration: underline;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.gallery-photo {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  transition: transform .25s ease, box-shadow .25s ease;
  display: block;
}

.gallery-photo:hover img {
  transform: scale(1.025);
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}

.loading {
  text-align: center;
  color: #bdbdbd;
  padding: 40px;
  font-size: 1.1rem;
}

.auth-gate {
  display: flex;
  justify-content: center;
  padding: 30px 0 60px;
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,.1);
  padding: 36px 32px;
  text-align: center;
}

.auth-card h2 {
  margin: 0 0 12px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.5rem;
  color: #1f1f1f;
}

.auth-card p {
  margin: 0 0 24px;
  color: #555;
  font-size: .95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.auth-form[hidden] {
  display: none;
}

.auth-form label {
  font-size: .85rem;
  font-weight: bold;
  color: #333;
}

.auth-form input {
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

.auth-form input:focus {
  outline: none;
  border-color: #1f1f1f;
}

.auth-form button {
  margin-top: 6px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: #1f1f1f;
  color: white;
  font-size: .95rem;
  font-weight: bold;
  cursor: pointer;
}

.auth-form button:hover {
  background: #3a3a3a;
}

.auth-form button:disabled {
  background: #999;
  cursor: not-allowed;
}

.auth-form .auth-secondary {
  margin-top: 0;
  background: transparent;
  color: #1f1f1f;
  border: 1px solid #ccc;
  font-weight: normal;
}

.auth-form .auth-secondary:hover {
  background: #eee;
}

.auth-sent-to {
  font-size: .9rem;
  color: #555;
  margin-bottom: 4px !important;
}

.auth-error {
  color: #a12626;
  font-size: .9rem;
  margin: 4px 0 0;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 999px;
  background: white;
  color: #111;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  z-index: 10001;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 72px;
  border: none;
  background: rgba(255,255,255,.85);
  color: #111;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
  border-radius: 12px;
  z-index: 10000;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: white;
}

@media (max-width: 768px) {
  .gallery-main {
    padding: 30px 14px 60px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  .lightbox {
    padding: 14px;
  }

  .lightbox-nav {
    width: 44px;
    height: 60px;
    font-size: 38px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }
}

