/* ============================================
   LIGHTBOX - Light Hunters Photography
   Accessible, responsive image lightbox overlay
   ============================================ */

/* --- Overlay Backdrop --- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lightbox-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* --- Image Container --- */
.lightbox__image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-overlay.is-active .lightbox__image {
  opacity: 1;
  transform: scale(1);
}

/* Loading state */
.lightbox__image-wrap::before {
  content: '';
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: lightbox-spin 0.8s linear infinite;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.lightbox__image-wrap.is-loaded::before {
  opacity: 0;
}

@keyframes lightbox-spin {
  to { transform: rotate(360deg); }
}

/* --- Close Button --- */
.lightbox__close {
  position: absolute;
  top: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 24px);
  z-index: 10002;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  font-size: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.lightbox__close:focus-visible {
  outline: 3px solid var(--color-accent, #c97a50);
  outline-offset: 2px;
}

.lightbox__close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* --- Navigation Arrows --- */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10001;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #fff;
  font-size: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.08);
}

.lightbox__nav:focus-visible {
  outline: 3px solid var(--color-accent, #c97a50);
  outline-offset: 2px;
}

.lightbox__nav svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.lightbox__nav--prev {
  left: clamp(12px, 2vw, 32px);
}

.lightbox__nav--next {
  right: clamp(12px, 2vw, 32px);
}

/* Hide nav when only 1 image */
.lightbox-overlay[data-count="1"] .lightbox__nav {
  display: none;
}

/* --- Counter --- */
.lightbox__counter {
  position: absolute;
  bottom: clamp(12px, 2vw, 28px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  padding: 0.4rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* Hide counter when only 1 image */
.lightbox-overlay[data-count="1"] .lightbox__counter {
  display: none;
}

/* --- Caption (optional, from alt text) --- */
.lightbox__caption {
  position: absolute;
  bottom: clamp(50px, 5vw, 72px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  max-width: 80vw;
  padding: 0.4rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.8125rem;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.is-active .lightbox__caption {
  opacity: 1;
}

/* --- Body scroll lock --- */
body.lightbox-open {
  overflow: hidden;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .lightbox__nav {
    width: 44px;
    height: 44px;
  }

  .lightbox__nav svg {
    width: 18px;
    height: 18px;
  }

  .lightbox__close {
    width: 44px;
    height: 44px;
  }

  .lightbox__close svg {
    width: 18px;
    height: 18px;
  }

  .lightbox__image {
    border-radius: 4px;
  }
}

@media (max-width: 480px) {
  .lightbox__nav--prev {
    left: 6px;
  }

  .lightbox__nav--next {
    right: 6px;
  }

  .lightbox__nav {
    width: 40px;
    height: 40px;
  }
}

/* --- Lightbox-enabled gallery items --- */
.lightbox-trigger {
  cursor: zoom-in;
}

.lightbox-trigger:focus-visible {
  outline: 3px solid var(--color-accent, #c97a50);
  outline-offset: 2px;
  border-radius: var(--radius-lg, 24px);
}

/* --- Instagram CTA Section --- */
.instagram-cta {
  text-align: center;
  padding: clamp(48px, 6vw, 80px) 0;
  background: var(--gradient-soft, linear-gradient(135deg, #f5efe8 0%, #fde8d8 50%, #f5d5c0 100%));
}

.instagram-cta__icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  background: var(--gradient-accent, linear-gradient(135deg, #f0956a 0%, #e87a48 100%));
  border-radius: var(--radius, 16px);
  color: #fff;
}

.instagram-cta__icon svg {
  width: 28px;
  height: 28px;
}

.instagram-cta h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 0.5rem;
}

.instagram-cta p {
  color: var(--color-text-muted, #717171);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.instagram-cta__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.instagram-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  background: var(--color-white, #fff);
  border: 1.5px solid var(--color-border, #e8e8e8);
  border-radius: var(--radius-full, 9999px);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-black, #1a1a1a);
  transition: all 0.2s ease;
}

.instagram-cta__link:hover,
.instagram-cta__link:focus-visible {
  border-color: var(--color-accent, #c97a50);
  color: var(--color-accent-dark, #b5612e);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.instagram-cta__link:focus-visible {
  outline: 3px solid var(--color-accent, #c97a50);
  outline-offset: 2px;
}

.instagram-cta__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --- Footer Social with SVG Icons --- */
.footer__social a svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
