/* industrial-lightbox.css - індустріальний lightbox styling */

/* Загальний стиль для "zoomable" зображень */
img.zoomable {
  cursor: zoom-in;
  transition: transform 240ms cubic-bezier(.2,.9,.2,1), filter 240ms;
  will-change: transform;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  border-radius: 6px;
  display: inline-block;
  max-width: 100%;
  height: auto;
  outline: none;
}

/* hover невеликий ефект "металевий блиск" */
img.zoomable:hover {
  transform: translateY(-4px) scale(1.02);
  filter: contrast(1.05) saturate(0.95);
}

/* Overlay / backdrop */
#ilb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,12,0.78); /* темний фон */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* активне */
#ilb-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* контейнер для зображення — рамка "метал" */
#ilb-frame {
  max-width: calc(100% - 48px);
  max-height: calc(100% - 48px);
  padding: 18px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  box-shadow:
    0 8px 30px rgba(2,6,12,0.6),
    inset 0 1px 0 rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 240ms cubic-bezier(.2,.9,.2,1);
  position: relative;
  min-width: 220px;
}

/* металевий бордер — тонка об'ємна рамка */
#ilb-frame::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(200,210,215,0.06), rgba(90,95,100,0.06));
  box-shadow: inset 0 2px 8px rgba(255,255,255,0.03);
}

/* всередині frame — зображення */
#ilb-img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  border-radius: 6px;
  box-shadow:
    0 18px 60px rgba(2,6,12,0.7),
    inset 0 1px 0 rgba(255,255,255,0.02);
  transform-origin: center center;
  animation: ilb-pop 220ms cubic-bezier(.2,.9,.2,1) forwards;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(255,255,255,0.01));
}

/* підпис (якщо є alt) */
#ilb-caption {
  margin-top: 12px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-size: 13px;
  color: #cfd6da;
  text-align: center;
  opacity: 0.95;
  max-width: 90%;
  word-break: break-word;
}

/* кнопка закриття */
#ilb-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.12));
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  cursor: pointer;
  color: #dfe6ea;
  font-weight: 700;
  transition: transform 140ms, background 140ms;
  z-index: 100001;
}

/* hover для кнопки */
#ilb-close:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.18));
}

/* анімація з'явлення */
@keyframes ilb-pop {
  0% { transform: scale(0.96) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* адаптивно: зовсім маленькі екрани */
@media (max-width: 420px) {
  #ilb-frame { padding: 10px; border-radius: 8px; }
  #ilb-close { width: 38px; height: 38px; top: 12px; right: 12px; }
  #ilb-caption { font-size: 12px; }
}

/* decorative industrial accents (subtle) */
.ilb-metal-sheen {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.00) 30%, rgba(255,255,255,0.02) 60%, rgba(255,255,255,0.00) 100%);
  pointer-events: none;
  mix-blend-mode: screen;
}
