/* =========================================================
   GALLERY LIST
   ========================================================= */

.gallery-list {
  background: var(--color-background-light);
}

.gallery-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-xl) 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.gallery-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-default), box-shadow var(--transition-default), border-color var(--transition-default);
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  text-decoration: none;
  color: inherit;
}

/* Preview area */
.gallery-card__preview {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-sage);
  overflow: hidden;
}

/* Stacked photos */
.gallery-card__stack {
  position: absolute;
  inset: 0;
}

.gallery-card__stack-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.gallery-card__stack-img[style*="--i: 2"] {
  transform: rotate(-4deg) scale(0.92) translate(-6px, 4px);
  z-index: 1;
  filter: brightness(0.85);
}

.gallery-card__stack-img[style*="--i: 1"] {
  transform: rotate(2deg) scale(0.96) translate(4px, 2px);
  z-index: 2;
  filter: brightness(0.92);
}

.gallery-card__stack-img[style*="--i: 0"] {
  transform: none;
  z-index: 3;
}

.gallery-card:hover .gallery-card__stack-img[style*="--i: 2"] {
  transform: rotate(-6deg) scale(0.9) translate(-10px, 6px);
}

.gallery-card:hover .gallery-card__stack-img[style*="--i: 1"] {
  transform: rotate(3deg) scale(0.94) translate(8px, 3px);
}

/* Empty preview */
.gallery-card__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-text-muted);
}

.gallery-card__empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

/* Lock preview */
.gallery-card--locked .gallery-card__preview {
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
}

.gallery-card__lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: var(--space-sm);
  color: rgba(255, 255, 255, 0.7);
}

.gallery-card__lock svg {
  width: 48px;
  height: 48px;
}

.gallery-card__lock span {
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Card body */
.gallery-card__body {
  padding: var(--space-md);
}

.gallery-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gallery-card__date {
  font-size: var(--font-size-caption);
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gallery-card__count {
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
}

.gallery-card__title {
  margin: 0;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gallery-card__lock-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}


/* =========================================================
   GALLERY UNLOCK
   ========================================================= */

.gallery-unlock {
  background: var(--color-background-light);
}

.gallery-unlock__card {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.gallery-unlock__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(56, 102, 65, 0.10);
  color: var(--color-primary);
}

.gallery-unlock__icon svg {
  width: 36px;
  height: 36px;
}

.gallery-unlock__title {
  font-size: var(--font-size-heading);
  margin-bottom: var(--space-sm);
}

.gallery-unlock__text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.gallery-unlock__card .form-unlock {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.gallery-unlock__card input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-body);
  outline: none;
  transition: border-color var(--transition-default);
}

.gallery-unlock__card input[type="password"]:focus {
  border-color: var(--color-primary);
}

.gallery-unlock__card .btn {
  width: 100%;
}

.gallery-unlock__error {
  color: #dc3545;
  font-size: var(--font-size-caption);
  margin-top: var(--space-xs);
}

.form-unlock__input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-body);
  outline: none;
  transition: border-color var(--transition-default);
  margin-bottom: var(--space-sm);
}

.form-unlock__input:focus {
  border-color: var(--color-primary);
}


/* =========================================================
   GALLERY DETAIL — PHOTO GRID
   ========================================================= */

.gallery-photos {
  background: var(--color-background-light);
}

.gallery-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.gallery-photo-btn {
  aspect-ratio: 1;
  overflow: hidden;
  border: none;
  padding: 0;
  background: var(--color-sage);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: block;
}

.gallery-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-photo-btn:hover .gallery-photo-img {
  transform: scale(1.05);
  filter: brightness(0.9);
}


/* =========================================================
   LIGHTBOX
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__img-wrap {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-default);
}

.lightbox__close:hover {
  color: #fff;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  font-size: 48px;
  line-height: 1;
  width: 56px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-default);
  padding: 0;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

.lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--font-size-caption);
  letter-spacing: 0.08em;
}

/* hero eyebrow link */
.page-hero__eyebrow-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--transition-default);
}

.page-hero__eyebrow-link:hover {
  color: var(--color-secondary);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lightbox__nav {
    font-size: 32px;
    width: 40px;
    height: 56px;
  }
}
