/* Galleria dinamica dei componenti: stili circoscritti alla Home. */
.component-gallery {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 2.4vw, 36px);
}

.component-gallery::before {
  display: none;
}

.component-gallery .component-shot,
.component-gallery .component-shot--01,
.component-gallery .component-shot--02,
.component-gallery .component-shot--03,
.component-gallery .component-shot--04,
.component-gallery .component-shot--05,
.component-gallery .component-shot--06,
.component-gallery .component-shot--07,
.component-gallery .component-shot--08,
.component-gallery .component-shot--09,
.component-gallery .component-shot--10,
.component-gallery .component-shot--11,
.component-gallery .component-shot--12 {
  position: relative;
  inset: auto;
  width: auto;
  min-width: 0;
  aspect-ratio: 4 / 3;
  z-index: auto;
  grid-column: auto;
}

.component-card__trigger,
.component-card__slides {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.component-card__trigger {
  z-index: 1;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #06152a;
  color: inherit;
  cursor: zoom-in;
  appearance: none;
}

.component-card__trigger:focus-visible {
  outline: 3px solid var(--ice);
  outline-offset: -5px;
}

.component-shot .component-card__slide {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.01) !important;
  filter: brightness(0.94) saturate(0.98);
  transition:
    opacity 700ms var(--ease),
    filter 500ms var(--ease),
    transform 700ms var(--ease);
  pointer-events: none;
}

.component-shot .component-card__slide.is-active {
  z-index: 1;
  opacity: 1;
}

.component-shot:hover .component-card__slide.is-active,
.component-card__trigger:focus-visible .component-card__slide.is-active {
  transform: scale(1.025) !important;
  filter: brightness(1.05) saturate(1.02);
}

.component-card__position {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  min-width: 52px;
  padding: 7px 9px;
  border: 1px solid rgba(168, 225, 255, 0.32);
  background: rgba(2, 8, 18, 0.8);
  color: var(--ice);
  font-family: monospace;
  font-size: 0.68rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-align: center;
  backdrop-filter: blur(8px);
}

.component-gallery .component-shot figcaption {
  min-width: min(84%, 330px);
  pointer-events: none;
}

body.component-lightbox-open {
  overflow: hidden;
}

.component-lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: clamp(10px, 2vw, 28px);
  place-items: center;
  overflow: auto;
  background: rgba(1, 5, 13, 0.94);
  opacity: 0;
  transition: opacity 220ms ease;
}

.component-lightbox[hidden] {
  display: none;
}

.component-lightbox.is-open {
  opacity: 1;
}

.component-lightbox__dialog {
  position: relative;
  display: grid;
  width: min(1320px, 100%);
  height: min(930px, calc(100dvh - clamp(20px, 4vw, 56px)));
  min-width: 0;
  min-height: 320px;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(168, 225, 255, 0.28);
  background: #020812;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62);
  outline: none;
}

.component-lightbox__stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: minmax(0, 1fr);
  padding: 58px 8px 16px;
  place-items: center;
  overflow: hidden;
  touch-action: pan-y;
}

.component-lightbox__image {
  grid-column: 2;
  grid-row: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 90vw;
  max-height: 86dvh;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  transition: opacity 180ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.component-lightbox__image.is-changing {
  opacity: 0.25;
}

.component-lightbox__close,
.component-lightbox__nav {
  display: grid;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid rgba(168, 225, 255, 0.34);
  background: rgba(2, 8, 18, 0.84);
  color: var(--white);
  line-height: 1;
  place-items: center;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.component-lightbox__close:hover,
.component-lightbox__close:focus-visible,
.component-lightbox__nav:hover,
.component-lightbox__nav:focus-visible {
  border-color: var(--ice);
  background: rgba(12, 58, 96, 0.9);
  color: var(--ice);
  outline: none;
}

.component-lightbox__close {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  width: 50px;
  height: 50px;
  font-size: 2rem;
  font-weight: 300;
}

.component-lightbox__nav {
  position: relative;
  z-index: 3;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: 54px;
  height: 64px;
  font-size: 2.3rem;
  transform: none;
}

.component-lightbox__nav--prev {
  grid-column: 1;
}

.component-lightbox__nav--next {
  grid-column: 3;
}

.component-lightbox__meta {
  display: flex;
  min-width: 0;
  min-height: 60px;
  padding: 12px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(168, 225, 255, 0.18);
  color: var(--white);
}

.component-lightbox__title,
.component-lightbox__counter {
  margin: 0;
}

.component-lightbox__title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  letter-spacing: -0.01em;
}

.component-lightbox__counter {
  flex: 0 0 auto;
  color: var(--ice);
  font-family: monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

@media (max-width: 980px) {
  .component-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .component-gallery {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .component-gallery .component-shot,
  .component-gallery .component-shot--01,
  .component-gallery .component-shot--02,
  .component-gallery .component-shot--03,
  .component-gallery .component-shot--04,
  .component-gallery .component-shot--05,
  .component-gallery .component-shot--06,
  .component-gallery .component-shot--07,
  .component-gallery .component-shot--08,
  .component-gallery .component-shot--09,
  .component-gallery .component-shot--10,
  .component-gallery .component-shot--11,
  .component-gallery .component-shot--12 {
    display: grid;
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    grid-template-rows: auto 78px;
  }

  .component-gallery .component-shot__media {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .component-gallery .component-shot figcaption {
    position: relative;
    inset: auto;
    width: 100%;
    min-width: 0;
    height: 78px;
    padding: 12px 14px 14px;
    align-content: center;
  }

  .component-card__position {
    top: 12px;
    right: 12px;
  }

  .component-lightbox {
    padding: 6px;
  }

  .component-lightbox__dialog {
    width: 100%;
    height: calc(100dvh - 12px);
    min-height: 0;
  }

  .component-lightbox__stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) 48px;
    padding: 56px 8px 4px;
  }

  .component-lightbox__image {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    height: 100%;
    max-width: 94vw;
    max-height: 82dvh;
  }

  .component-lightbox__nav {
    grid-row: 2;
    width: 48px;
    height: 48px;
    transform: none;
  }

  .component-lightbox__nav--prev {
    grid-column: 1;
  }

  .component-lightbox__nav--next {
    grid-column: 2;
  }

  .component-lightbox__meta {
    min-height: 56px;
    padding: 9px 14px;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
  }

  .component-lightbox__title {
    display: block;
    min-width: 0;
    max-width: calc(100% - 62px);
    font-size: clamp(0.82rem, 3.8vw, 0.98rem);
    line-height: 1.2;
  }

  .component-lightbox__counter {
    font-size: 0.72rem;
  }
}

@media (max-width: 360px) {
  .component-gallery {
    gap: 20px;
  }

  .component-gallery .component-shot,
  .component-gallery .component-shot--01,
  .component-gallery .component-shot--02,
  .component-gallery .component-shot--03,
  .component-gallery .component-shot--04,
  .component-gallery .component-shot--05,
  .component-gallery .component-shot--06,
  .component-gallery .component-shot--07,
  .component-gallery .component-shot--08,
  .component-gallery .component-shot--09,
  .component-gallery .component-shot--10,
  .component-gallery .component-shot--11,
  .component-gallery .component-shot--12 {
    grid-template-rows: auto 82px;
  }

  .component-gallery .component-shot figcaption {
    height: 82px;
  }

  .component-lightbox__meta {
    gap: 8px;
  }

  .component-lightbox__title {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .component-shot .component-card__slide,
  .component-lightbox,
  .component-lightbox__image,
  .component-lightbox__close,
  .component-lightbox__nav {
    transition: none;
  }

  .component-shot .component-card__slide,
  .component-shot:hover .component-card__slide.is-active,
  .component-card__trigger:focus-visible .component-card__slide.is-active {
    transform: none !important;
  }
}
