/* WDM Foto — Lightbox Cinematográfico com Download Fácil */
.wdm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8, 12, 14, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wdm-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* Barra Superior */
.wdm-lightbox-header {
  height: 64px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 10;
  flex-shrink: 0;
}
.wdm-lightbox-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.wdm-lightbox-counter {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--wdm-accent, #ef8135);
  white-space: nowrap;
}
.wdm-lightbox-caption {
  font-size: 14px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 450px;
}
.wdm-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Botões de Ação do Lightbox */
.wdm-lightbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}
.wdm-lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}
.wdm-lightbox-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Botão Salvar Foto em Destaque */
.wdm-lightbox-btn.wdm-lightbox-save {
  background: var(--wdm-accent, #ef8135);
  border-color: var(--wdm-accent, #ef8135);
  color: #111c22;
  box-shadow: 0 4px 16px rgba(239, 129, 53, 0.35);
}
.wdm-lightbox-btn.wdm-lightbox-save:hover {
  background: #ff9b57;
  color: #0b1418;
  box-shadow: 0 6px 20px rgba(239, 129, 53, 0.55);
}

/* Botão Fechar */
.wdm-lightbox-close {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}
.wdm-lightbox-close:hover {
  background: rgba(224, 20, 43, 0.85);
  border-color: rgba(224, 20, 43, 1);
}

/* Palco Central da Imagem */
.wdm-lightbox-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 64px;
  overflow: hidden;
  touch-action: pan-y;
}
.wdm-lightbox-img-holder {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wdm-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, opacity;
}
.wdm-lightbox-img.loading {
  opacity: 0.3;
  filter: blur(8px);
}
.wdm-lightbox-spinner {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--wdm-accent, #ef8135);
  border-radius: 50%;
  animation: wdmLbSpin 0.8s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.wdm-lightbox-spinner.visible {
  opacity: 1;
}
@keyframes wdmLbSpin {
  to { transform: rotate(360deg); }
}

/* Setas de Navegação */
.wdm-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(17, 28, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.wdm-lightbox-nav:hover {
  background: rgba(239, 129, 53, 0.9);
  color: #111c22;
  border-color: #ef8135;
  transform: translateY(-50%) scale(1.08);
}
.wdm-lightbox-prev { left: 16px; }
.wdm-lightbox-next { right: 16px; }

/* Barra Inferior com Atalhos e Dicas */
.wdm-lightbox-footer {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
  color: #94a3b8;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  flex-shrink: 0;
}
.wdm-lightbox-hint kbd {
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  color: #f1f5f9;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
  .wdm-lightbox-stage {
    padding: 6px 10px;
  }
  .wdm-lightbox-header {
    height: 58px;
    padding: 0 12px;
  }
  .wdm-lightbox-caption {
    display: none;
  }
  .wdm-lightbox-nav {
    display: none; /* No mobile usa swipe gestual ou botão inferior */
  }
  .wdm-lightbox-footer {
    height: 54px;
    padding: 0 12px;
    justify-content: space-between;
  }
  .wdm-lightbox-hint {
    display: none;
  }
  .wdm-lightbox-btn span {
    font-size: 12px;
  }
  .wdm-lightbox-btn {
    padding: 8px 12px;
  }
}
