/* ═══════════════════════════════════════════
   HeroLightbox — fullscreen photo viewer
   ═══════════════════════════════════════════ */

/* ── Root overlay ── */
.hero-lb {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease;
}
.hero-lb--enter { opacity: 0; }
.hero-lb--open  { opacity: 1; }
.hero-lb--exit  { opacity: 0; pointer-events: none; }

/* ── Backdrop ── */
.hero-lb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  transition: background 0.35s ease;
}
.hero-lb--enter .hero-lb__backdrop { background: rgba(0, 0, 0, 0); }

/* ── Inner container ── */
.hero-lb__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1280px;
  width: 100%;
  height: 100%;
  padding: 16px 24px;
  box-sizing: border-box;
}

/* ── Top bar ── */
.hero-lb__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 0 8px;
  flex-shrink: 0;
}

.hero-lb__counter {
  font-family: var(--tv-mono, 'Space Mono', 'Courier New', monospace);
  font-size: 0.85rem;
  color: var(--tv-muted, rgba(232, 221, 208, 0.45));
  letter-spacing: 0.04em;
}
.hero-lb__counter-cur {
  font-weight: 600;
}

/* ── Cover button ── */
.hero-lb__cover-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--tv-muted, rgba(232, 221, 208, 0.45));
  font-family: var(--tv-mono, 'Space Mono', 'Courier New', monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.hero-lb__cover-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  color: var(--tv-text, #e8ddd0);
  border-color: rgba(255, 255, 255, 0.3);
}
.hero-lb__cover-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.hero-lb__cover-btn--done {
  border-color: rgba(200, 144, 94, 0.5);
  color: #c8905e;
  background: rgba(200, 144, 94, 0.12);
}
.hero-lb__cover-btn--error {
  border-color: rgba(220, 80, 80, 0.5);
  color: #dc5050;
  background: rgba(220, 80, 80, 0.12);
}

.hero-lb__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--tv-text, #e8ddd0);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.hero-lb__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Stage (photo + arrows) ── */
.hero-lb__stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  position: relative;
  gap: 12px;
}

/* ── Photo ── */
.hero-lb__photo {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Slide animations ── */
.hero-lb__slide--next {
  animation: hero-slide-right 280ms cubic-bezier(0.22, 0.68, 0.36, 1) both;
}
.hero-lb__slide--prev {
  animation: hero-slide-left 280ms cubic-bezier(0.22, 0.68, 0.36, 1) both;
}

@keyframes hero-slide-right {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes hero-slide-left {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Arrow buttons ── */
.hero-lb__arrow {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tv-text, #e8ddd0);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.hero-lb__arrow:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.06);
}
.hero-lb__arrow:active {
  transform: scale(0.96);
}
.hero-lb__arrow--loading {
  cursor: default;
  opacity: 0.6;
}
.hero-lb__arrow--loading:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: none;
}

/* ── Spinner ── */
.hero-lb__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--tv-text, #e8ddd0);
  border-radius: 50%;
  animation: hero-spin 0.7s linear infinite;
}
@keyframes hero-spin {
  to { transform: rotate(360deg); }
}

/* ── Meta ── */
.hero-lb__meta {
  padding: 8px 0 4px;
  font-size: 0.82rem;
  color: var(--tv-muted, rgba(232, 221, 208, 0.45));
  text-align: center;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.hero-lb__meta-album {
  font-family: var(--tv-serif, 'Cormorant Garamond', Georgia, serif);
  font-style: italic;
}
.hero-lb__meta-file {
  font-family: var(--tv-mono, 'Space Mono', 'Courier New', monospace);
  font-size: 0.78rem;
}

/* ── Thumbnail strip ── */
.hero-lb__strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  justify-content: center;
  padding: 8px 0 4px;
  flex-shrink: 0;
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hero-lb__strip::-webkit-scrollbar {
  display: none;
}

.hero-lb__thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 2px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.55;
}
.hero-lb__thumb:hover {
  opacity: 0.85;
}
.hero-lb__thumb--active {
  border-color: #f5e6c8;
  opacity: 1;
}
.hero-lb__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════
   Mobile (<=768px)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero-lb__inner {
    max-width: 100vw;
    padding: 12px 12px;
  }

  .hero-lb__arrow {
    display: none;
  }

  .hero-lb__thumb {
    width: 44px;
    height: 44px;
  }

  .hero-lb__photo {
    max-height: calc(100vh - 180px);
  }

  .hero-lb__meta {
    font-size: 0.76rem;
  }
}

/* ═══════════════════════════════════════════
   Reduced motion
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .hero-lb,
  .hero-lb__backdrop,
  .hero-lb__close,
  .hero-lb__arrow,
  .hero-lb__thumb {
    transition: none;
  }

  .hero-lb__slide--next,
  .hero-lb__slide--prev {
    animation: none;
  }

  .hero-lb__spinner {
    animation: none;
  }
}
