/* Lightbox / Modal Styles */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,23,20,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  width: min(860px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  padding-top: 20px;
}

.lightbox.open .lightbox-panel {
  transform: translateY(0) scale(1);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-close:hover {
  background: var(--accent-light);
  border-color: var(--border-hover);
  color: var(--accent);
}

.lightbox-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 12px;
}

.lightbox-image-wrap {
  background: var(--bg-alt);
  border-radius: 8px 0 0 8px;
  min-height: unset;
  height: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 0;
}

.lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.lightbox-img.visible {
  display: block;
}

.lightbox-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  opacity: 0.4;
}

.lightbox-img-placeholder.hidden {
  display: none;
}

.lightbox-info {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lightbox-number {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}

.lightbox-desc {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lb-tag {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
}

.lightbox-links {
  margin-top: auto;
}

.lb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.lb-link:hover {
  background: var(--accent-light);
}

.lb-link-disabled {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-faint);
}

/* Mobile Carousel */
.mobile-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px 24px;
  width: 100%;
}

.mobile-frame {
  width: 200px;
  height: 400px;
  border-radius: 28px;
  border: 6px solid var(--text);
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(26,23,20,0.25), inset 0 0 0 1px rgba(255,255,255,0.1);
  background: #000;
  flex-shrink: 0;
}

.mobile-slides {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-slide {
  min-width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.mobile-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.carousel-prev,
.carousel-next {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.carousel-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-hover);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: var(--accent);
  width: 18px;
  border-radius: 3px;
}

/* Desktop Lightbox Layout */
.lightbox-panel.lightbox-desktop {
  width: min(1100px, 95vw);
}

.lightbox-panel.lightbox-desktop .lightbox-content {
  grid-template-columns: 1fr;
}

.lightbox-panel.lightbox-desktop .lightbox-image-wrap {
  border-radius: 8px 8px 0 0;
  border-right: none;
  border-bottom: 1px solid var(--border);
  min-height: unset;
}

.lightbox-panel.lightbox-desktop .lightbox-info {
  padding: 28px 36px;
}

.lightbox-info-desktop {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.lightbox-info-desktop .lightbox-tags {
  justify-content: flex-end;
}

.desktop-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
}

.desktop-slides-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 6px 6px 0 0;
}

.desktop-slides {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: flex-start;
}

.desktop-slide {
  min-width: 100%;
  flex-shrink: 0;
}

.desktop-slide img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  object-position: top center;
  display: block;
  background: var(--bg-alt);
}

@media (max-width: 640px) {
  .lightbox-content {
    grid-template-columns: 1fr;
  }

  .lightbox-image-wrap {
    min-height: 200px;
    border-radius: 8px 8px 0 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .lightbox-info {
    padding: 24px 20px;
  }
}
