/* =============================================================
   MODAL.CSS — Password gate modal
   ============================================================= */

/* -------------------------------------------------------------
   Overlay — blurred backdrop, covers full viewport
   ------------------------------------------------------------- */
.pw-overlay {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(12.5px);
  -webkit-backdrop-filter: blur(12.5px);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  /* visibility (not just opacity) so the contents are genuinely
     unfocusable while closed, for browsers without `inert`. Flipping it
     only after the fade completes keeps the close animation visible. */
  visibility: hidden;
  transition: opacity 200ms ease, visibility 0s linear 200ms;
}

.pw-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 200ms ease, visibility 0s;
}

/* -------------------------------------------------------------
   Modal card
   ------------------------------------------------------------- */
.pw-modal {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-card);
  padding: 32px;
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* -------------------------------------------------------------
   Input field
   ------------------------------------------------------------- */
.pw-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.pw-label {
  font-family: var(--font-primary);
  font-size: var(--scale-2);   /* 14.4px */
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text-dark);
}

.pw-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 12px 16px;
  font-family: var(--font-primary);
  font-size: var(--scale-2);   /* 14.4px */
  font-weight: 400;
  color: var(--color-text-primary);
  background: var(--color-bg);
  outline: none;
  transition: border-color var(--transition-fast);
}

.pw-input::placeholder {
  color: #b3b3b3;
}

.pw-input--error {
  border-color: #900b09;
}

.pw-error {
  font-family: var(--font-primary);
  font-size: var(--scale-2);   /* 14.4px */
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.pw-error.is-error {
  color: #900b09;
}

/* -------------------------------------------------------------
   Action buttons
   ------------------------------------------------------------- */
.pw-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pw-btn {
  font-family: var(--font-primary);
  font-size: var(--scale-2);   /* 14.4px */
  font-weight: 700;
  line-height: 1;
  border-radius: var(--border-radius-lg);
  padding: 12px 24px;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.pw-btn:hover {
  opacity: 0.75;
}

.pw-btn--back {
  background: transparent;
  border: 1px solid #2c2c2c;
  color: var(--color-text-dark);
}

.pw-btn--enter {
  background: #2c2c2c;
  border: 1px solid #2c2c2c;
  color: #f5f5f5;
}

/* =============================================================
   Photo Lightbox
   ============================================================= */

.photo-lb {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.photo-lb.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Close button */
.photo-lb__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  z-index: 10;
}

.photo-lb__close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Prev / next arrows */
.photo-lb__nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  z-index: 10;
}

.photo-lb__nav:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Image container — clips overflow during zoom */
.photo-lb__img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  max-width: min(88vw, 1100px);
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  flex-shrink: 0;
}

.photo-lb__img {
  display: block;
  max-width: min(88vw, 1100px);
  max-height: 80vh;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
  opacity: 0;
  border-radius: 8px;
}

/* Footer — caption + counter */
.photo-lb__footer {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  padding: 10px 20px;
  white-space: nowrap;
}

.photo-lb__caption {
  display: flex;
  align-items: center;
  gap: 10px;
}

.photo-lb__title {
  font-family: var(--font-accent);
  font-size: var(--scale-2);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.photo-lb__sub {
  font-family: var(--font-primary);
  font-size: var(--scale-1);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
}

.photo-lb__counter {
  font-family: 'Courier New', monospace;
  font-size: var(--scale-1);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.05em;
}

/* Zoom hint */
.photo-lb__hint {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-primary);
  font-size: var(--scale-1);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* =============================================================
   Lightbox — mobile
   ============================================================= */
@media (max-width: 600px) {
  /* Arrows float over the image instead of sitting beside it */
  .photo-lb__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.1);
    z-index: 10;
  }

  .photo-lb__nav--prev { left: 12px; }
  .photo-lb__nav--next { right: 12px; }

  /* Image takes full available width */
  .photo-lb__img-wrap {
    max-width: 100vw;
    max-height: 72vh;
    border-radius: 0;
  }

  .photo-lb__img {
    max-width: 100vw;
    max-height: 72vh;
  }

  /* Footer pill — shrink and constrain to screen width */
  .photo-lb__footer {
    bottom: 16px;
    gap: 12px;
    padding: 8px 14px;
    max-width: calc(100vw - 32px);
  }

  /* Zoom hint not useful on touch */
  .photo-lb__hint { display: none; }
}
