/* ============================================================
   lightbox.css
   Static layout only — JS handles all animation timing.

   EDGE NOTE: overlay uses visibility/pointer-events instead
   of display:none/flex so the flex layout is always computed
   and inline rect positioning works before transitions fire.
   ============================================================ */


/* ── OVERLAY ── */

#lb-overlay {
  display: flex;               /* always in layout — JS controls visibility */
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0);
}


/* ── WINDOW ── */

#lb-window {
  position: fixed;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
  /* left / top / width / height set by JS */
}

/* four corner brackets */
#lb-window::before,
#lb-window::after,
#lb-window .lb-corner-bl,
#lb-window .lb-corner-br {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 10;
}
#lb-window::before { top:-1px;    left:-1px;  border-top:    1px solid #0B62D9; border-left:  1px solid #0B62D9; }
#lb-window::after  { top:-1px;    right:-1px; border-top:    1px solid #0B62D9; border-right: 1px solid #0B62D9; }
.lb-corner-bl      { bottom:-1px; left:-1px;  border-bottom: 1px solid #0B62D9; border-left:  1px solid #0B62D9; }
.lb-corner-br      { bottom:-1px; right:-1px; border-bottom: 1px solid #0B62D9; border-right: 1px solid #0B62D9; }

.lb-border {
  position: absolute; inset: -1px;
  border: 1px solid rgba(11,98,217,0.35);
  pointer-events: none; z-index: 9;
}
.lb-border-outer {
  position: absolute; inset: -6px;
  border: 1px solid rgba(11,98,217,0.10);
  pointer-events: none; z-index: 0;
}


/* ── TITLE BAR ── */

#lb-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #040810;
  border-bottom: 1px solid rgba(11,98,217,0.28);
  padding: 0.45rem 0.8rem;
  gap: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.lb-titlebar-left {
  display: flex; align-items: center;
  gap: 0.6rem; min-width: 0; overflow: hidden;
}

.lb-dots  { display: flex; gap: 5px; flex-shrink: 0; }
.lb-dot   { width: 7px; height: 7px; border-radius: 50%; background: rgba(11,98,217,0.3); }
.lb-dot.active { background: #0B62D9; }

.lb-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; color: #4a6580;
  letter-spacing: 0.12em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-title span { color: #0B62D9; }

#lb-close {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; color: #4a6580;
  background: none;
  border: 1px solid rgba(11,98,217,0.2);
  padding: 0.15rem 0.5rem;
  cursor: pointer; letter-spacing: 0.1em;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
  line-height: 1.4; flex-shrink: 0;
}
#lb-close:hover {
  color: #fff; border-color: #0B62D9;
  box-shadow: 0 0 8px rgba(11,98,217,0.4);
}


/* ── IMAGE AREA ── */

#lb-img-wrap {
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

#lb-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  opacity: 0;  /* JS fades this in */
}

/* CRT scanline overlay */
#lb-img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0,0,0,0.05) 2px, rgba(0,0,0,0.05) 4px
  );
  pointer-events: none; z-index: 2;
}

/* corner data labels */
.lb-img-corner {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.48rem; color: rgba(11,98,217,0.5);
  letter-spacing: 0.1em;
  pointer-events: none; z-index: 3;
  line-height: 1.6; opacity: 0; /* JS fades in */
}
.lb-img-corner.tl { top: 0.55rem;  left:  0.65rem; }
.lb-img-corner.tr { top: 0.55rem;  right: 0.65rem; text-align: right; }
.lb-img-corner.bl { bottom: 2.2rem; left: 0.65rem; }
.lb-img-corner.br { bottom: 2.2rem; right: 0.65rem; text-align: right; }


/* ── STATUS BAR ── */

#lb-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #040810;
  border-top: 1px solid rgba(11,98,217,0.18);
  padding: 0.3rem 0.8rem;
  flex-shrink: 0;
  position: relative; z-index: 5;
  gap: 0.5rem; overflow: hidden;
}

.lb-status-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.48rem; color: #2a3f55;
  letter-spacing: 0.1em; white-space: nowrap;
}
.lb-status-item span { color: #4a6580; }

#lb-statusbar::before {
  content: '';
  position: absolute; left: -40%; top: 0;
  height: 1px; width: 40%;
  background: #0B62D9;
  animation: lb-sweep 2.6s ease-in-out infinite;
}

@keyframes lb-sweep {
  0%   { left: -40%; opacity: 0.8; }
  70%  { left: 110%; opacity: 0.8; }
  100% { left: 110%; opacity: 0;   }
}


/* ── HINT ── */

#lb-hint {
  position: absolute; bottom: 0.55rem;
  left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.44rem; color: rgba(74,101,128,0.4);
  letter-spacing: 0.14em;
  pointer-events: none; z-index: 4; white-space: nowrap;
}
