/* ─── Portfolio Lightbox ──────────────────────────────────
   Painel escuro imersivo: imagem em destaque, navegação
   prev/next, contador e CTA de conversão regional.        */

.portfolio__item { cursor: pointer; }

.portfolio-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: none;
  margin: 0;
  padding: 1.5rem;
  background: rgba(7, 12, 20, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.portfolio-lightbox::backdrop { background: transparent; }
.portfolio-lightbox:not([open]) { display: none; }

.portfolio-lightbox[open] { animation: lb-fade .25s ease-out; }
.portfolio-lightbox[open] .portfolio-lightbox__content { animation: lb-rise .3s cubic-bezier(.16, 1, .3, 1); }

/* ── Painel ── */
.portfolio-lightbox__content {
  width: min(940px, 100%);
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  display: flex;
  flex-direction: column;
  background: #0e1622;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
  overflow: hidden;
}

/* ── Palco da imagem ── */
.portfolio-lightbox__stage {
  position: relative;
  background: #060b13;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.portfolio-lightbox__img {
  display: block;
  width: 100%;
  max-height: min(60vh, 560px);
  object-fit: contain;
  opacity: 1;
  transition: opacity .22s ease;
}
.portfolio-lightbox__img.is-loading { opacity: 0; }

/* ── Controles sobre a imagem (vidro escuro) ── */
.portfolio-lightbox__close,
.portfolio-lightbox__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(10, 16, 26, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, .9);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.portfolio-lightbox__close:hover,
.portfolio-lightbox__nav:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.portfolio-lightbox__close:focus-visible,
.portfolio-lightbox__nav:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.portfolio-lightbox__close {
  top: .875rem;
  right: .875rem;
  width: 42px;
  height: 42px;
}

.portfolio-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
}
.portfolio-lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }
.portfolio-lightbox__nav--prev { left: .875rem; }
.portfolio-lightbox__nav--next { right: .875rem; }

.portfolio-lightbox__counter {
  position: absolute;
  top: 1.1rem;
  left: 1.1rem;
  padding: .3rem .75rem;
  border-radius: 100px;
  background: rgba(10, 16, 26, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .85);
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

/* ── Legenda ── */
.portfolio-lightbox__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.4rem 1.75rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.portfolio-lightbox__meta { min-width: 0; }

.portfolio-lightbox__badge {
  display: inline-block;
  padding: .26rem .7rem;
  border-radius: 100px;
  background: rgba(255, 107, 53, .14);
  border: 1px solid rgba(255, 107, 53, .35);
  color: var(--orange);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}

.portfolio-lightbox__service {
  margin: 0 0 .3rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

.portfolio-lightbox__location {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .75rem;
  color: rgba(255, 255, 255, .6);
  font-size: .85rem;
  font-weight: 600;
}
.portfolio-lightbox__location svg { color: var(--orange); flex-shrink: 0; }

.portfolio-lightbox__description {
  margin: 0;
  max-width: 52ch;
  color: rgba(255, 255, 255, .68);
  font-size: .9rem;
  line-height: 1.55;
}

/* ── CTA de conversão ── */
.portfolio-lightbox__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}

.portfolio-lightbox__cta {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.5rem;
  border-radius: var(--radius);
  background: #25d366;
  color: #fff;
  font-size: .92rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 26px rgba(37, 211, 102, .35);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.portfolio-lightbox__cta:hover, .portfolio-lightbox__cta:focus-visible {
  background: #128c7e;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 211, 102, .45);
}

.portfolio-lightbox__note {
  color: rgba(255, 255, 255, .45);
  font-size: .72rem;
  font-weight: 600;
  text-align: center;
}

/* ── Animações ── */
@keyframes lb-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lb-rise {
  from { transform: translateY(18px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .portfolio-lightbox[open],
  .portfolio-lightbox[open] .portfolio-lightbox__content { animation: none; }
  .portfolio-lightbox__img { transition: none; }
}

/* ── Responsivo ── */
@media (max-width: 640px) {
  .portfolio-lightbox { padding: .75rem; }
  .portfolio-lightbox__content { max-height: calc(100dvh - 1.5rem); }
  .portfolio-lightbox__img { max-height: 46vh; }
  .portfolio-lightbox__close { top: .6rem; right: .6rem; width: 38px; height: 38px; }
  .portfolio-lightbox__nav { width: 40px; height: 40px; }
  .portfolio-lightbox__nav--prev { left: .6rem; }
  .portfolio-lightbox__nav--next { right: .6rem; }
  .portfolio-lightbox__caption {
    flex-direction: column;
    align-items: stretch;
    gap: 1.1rem;
    padding: 1.15rem 1.25rem 1.3rem;
    overflow-y: auto;
  }
  .portfolio-lightbox__cta { justify-content: center; }
}
