.lightbox{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 18, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: lb-in .18s ease-out;
}
.lightbox[hidden]{ display: none !important; }

@keyframes lb-in{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

.lightbox-figure{
  max-width: min(1600px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#lb-image{
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
#lb-image.is-transparent{
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #d6dae3 25%, transparent 25%),
    linear-gradient(-45deg, #d6dae3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d6dae3 75%),
    linear-gradient(-45deg, transparent 75%, #d6dae3 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.lightbox-caption{
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  color: #f3f4f8;
}
.lb-info{ flex: 1; min-width: 0; }
.lb-info h2{ font-size: 18px; font-weight: 600; }
.lb-info p{ color: #b9bdc9; font-size: 13px; margin-top: 4px; }
.lb-meta{
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #8b91a3;
}
.lb-tags{
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lb-tags .tag{
  padding: 2px 8px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  font-size: 12px;
}
.lb-ai{
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,.05);
  border-left: 3px solid var(--color-accent, #3a72e8);
  border-radius: 6px;
  color: #c9cdd9;
  font-size: 12px;
  line-height: 1.6;
  max-height: 96px;
  overflow-y: auto;
  word-break: break-all;
}

.lb-actions{
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
#lb-index{ font-size: 13px; color: #8b91a3; }
.lb-download{
  padding: 8px 18px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  transition: background .2s, transform .1s;
}
.lb-download:hover{ background: var(--color-accent-strong); transform: translateY(-1px); }

.lb-copy{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, transform .1s, border-color .2s;
}
.lb-copy svg{ flex-shrink: 0; }
.lb-copy svg, .lb-copy span{ pointer-events: none; }
.lb-copy:hover{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
  transform: translateY(-1px);
}
.lb-copy:active{ transform: translateY(0) scale(.97); }
.lb-copy:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }

.lightbox-close,
.lightbox-nav{
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 28px;
  line-height: 44px;
  text-align: center;
  transition: background .2s;
}
.lightbox-close:hover,
.lightbox-nav:hover{ background: rgba(255,255,255,.18); }
.lightbox-close{ top: 18px; right: 18px; font-size: 22px; }
.lightbox-nav{ top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev{ left: 18px; }
.lightbox-nav.next{ right: 18px; }

@media (max-width: 720px){
  .lightbox{ padding: 12px; }
  .lightbox-caption{ flex-direction: column; align-items: stretch; }
  .lb-actions{ justify-content: space-between; }
  .lightbox-nav{ width: 36px; height: 36px; line-height: 36px; font-size: 22px; }
  .lightbox-close{ top: 10px; right: 10px; }
}
