/* ===================================================
   lightbox.css — Lightbox overlay styles
   Loaded on: gallery pages only (project.php)
   =================================================== */


/* ===================================================
   LIGHTBOX
   =================================================== */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

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

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 22, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lb-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  width: 100%;
  animation: scaleIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image area */
.lb-image-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  position: relative;
  gap: 0;
}

#lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-sm);
  transition: transform 0.25s ease, opacity 0.25s ease;
  cursor: pointer;
}

/* Info panel */
.lb-meta-panel {
  flex: 0 0 280px;
  background: rgba(15, 25, 38, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem 1.5rem;
  color: var(--color-white);
  overflow-y: hidden;
  transition: opacity 0.3s ease;
}

.lb-meta-panel .lb-category {
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.lb-meta-panel h3 {
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.lb-meta-panel .lb-desc {
  font-size: 0.83rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
}

.lb-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

/* EXIF data — compact 2-col grid */
.exif-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1rem;
}

.exif-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

.exif-label {
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

/* Navigation row — below image */
.lb-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.75rem 0 0;
}

.lb-nav-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.4rem;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  transition: color 0.2s ease, transform 0.2s ease;
  user-select: none;
  line-height: 1;
}

.lb-nav-btn:hover {
  color: var(--color-accent);
  transform: scale(1.2);
}

.lb-nav-counter {
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
  min-width: 50px;
  text-align: center;
}

/* Close button */
.close-lightbox {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9200;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 25, 38, 0.6);
    border: 1px solid var(--color-accent-dark);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(6px);
    line-height: 1;
}

.close-lightbox:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
  transform: rotate(90deg);
}

/* ===================================================
   RESPONSIVE LIGHTBOX
   ===================================================
   - Desktop (>900px)            → side-by-side (default rules)
   - Tablet (768–900px)          → side-by-side like desktop
   - Mobile landscape (481–767px)→ side-by-side like desktop
   - Mobile portrait (≤767px)    → stacked: image on top, panel below
   =================================================== */

/* Tablet: keep side-by-side, slightly tighter spacing */
@media (max-width: 900px) and (min-width: 768px) {
  .lb-meta-panel {
    flex: 0 0 240px;
    padding: 1.25rem 1.25rem 1.15rem;
  }

  .lb-meta-panel h3 {
    font-size: 1.2rem;
  }

  .lb-meta-panel .lb-desc {
    font-size: 0.8rem;
  }
}

/* Mobile landscape: keep side-by-side, compact */
@media (max-width: 767px) and (orientation: landscape) {
  .lb-body {
    max-height: 95dvh;
  }

  .lb-meta-panel {
    flex: 0 0 200px;
    padding: 1rem 1rem 0.9rem;
  }

  .lb-meta-panel h3 {
    font-size: 1.1rem;
  }

  .lb-meta-panel .lb-desc {
    font-size: 0.78rem;
    margin-bottom: 0.75rem;
  }

  .lb-meta-panel .lb-category {
    font-size: 0.6rem;
    letter-spacing: 2.5px;
  }

  .exif-info {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem 0.75rem;
  }

  .exif-item {
    font-size: 0.76rem;
  }

  #lightbox-img {
    max-height: 80dvh;
  }

  .close-lightbox {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* Mobile portrait: stacked layout — image on top, panel below */
@media (max-width: 767px) and (orientation: portrait) {
  .lb-body {
    flex-direction: column;
    max-height: 95dvh;
  }

  .lb-image-wrap {
    flex: 1 1 auto;
  }

  .lb-meta-panel {
    flex: 0 0 auto;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 1rem 1.25rem 1.25rem;
    overflow-y: hidden;
  }

  .lb-meta-panel h3 {
    font-size: 1.1rem;
  }

  #lightbox-img {
    max-height: 52vh;
  }

  .exif-info {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
}
