/* GJC Portfolio Gallery — masonry grid with image + video items. */
.gjc-portfolio-gallery {
  --gjc-gallery-gap: 10px;
  --gjc-gallery-cols: 3;
  --gjc-gallery-cols-tablet: 2;
  --gjc-gallery-cols-mobile: 1;
  position: relative;
  display: block;
}
.gjc-portfolio-gallery.is-masonry .gjc-portfolio-gallery__item {
  position: absolute;
  top: 0;
  left: 0;
  width: calc((100% - (var(--gjc-gallery-cols) - 1) * var(--gjc-gallery-gap)) / var(--gjc-gallery-cols));
  margin: 0;
  padding: 0;
}
.gjc-portfolio-gallery:not(.is-masonry) {
  display: grid;
  grid-template-columns: repeat(var(--gjc-gallery-cols), 1fr);
  gap: var(--gjc-gallery-gap);
  align-items: start;
}
.gjc-portfolio-gallery:not(.is-masonry) .gjc-portfolio-gallery__more {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  margin-top: 1.5rem;
  grid-column: 1 / -1;
  justify-self: center;
}
.gjc-portfolio-gallery__link {
  display: block;
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--e-global-color-primary, #050505) 6%, transparent);
}
.gjc-portfolio-gallery:not(.is-masonry) .gjc-portfolio-gallery__item {
  padding-bottom: 0;
}
.gjc-portfolio-gallery__link {
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.gjc-portfolio-gallery__image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 320ms ease;
}
.gjc-portfolio-gallery__link:hover .gjc-portfolio-gallery__image,
.gjc-portfolio-gallery__link:focus-visible .gjc-portfolio-gallery__image {
  transform: scale(1.04);
}
/* Play control: circular dark button with white triangle (gjc-player style) */
.gjc-portfolio-gallery__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--e-global-color-primary, #0c0c0e) 42%, transparent);
  border: 1px solid color-mix(in srgb, var(--e-global-color-surface, #ffffff) 18%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
  color: var(--e-global-color-surface, #ffffff);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--e-global-color-primary, #050505) 40%, transparent);
  pointer-events: none;
  z-index: 3;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.25s, border-color 0.25s;
}
.gjc-portfolio-gallery__play svg {
  display: block;
  margin-left: 3px;
  width: 1.75rem;
  height: 1.75rem;
}
.gjc-portfolio-gallery__link:hover .gjc-portfolio-gallery__play,
.gjc-portfolio-gallery__link:focus-visible .gjc-portfolio-gallery__play {
  transform: translate(-50%, -50%) scale(1.06);
  background: color-mix(in srgb, var(--e-global-color-primary, #0c0c0e) 60%, transparent);
  border-color: color-mix(in srgb, var(--e-global-color-surface, #ffffff) 32%, transparent);
}

/* Load more */
.gjc-portfolio-gallery__more {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 0.5rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-family: var(--e-global-typography-accent-font-family, sans-serif);
  font-size: var(--e-global-typography-accent-font-size, 0.8125rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--e-global-color-primary, #050505);
  background: transparent;
  border: 0.0625rem solid var(--e-global-color-primary, #050505);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.gjc-portfolio-gallery__more:hover,
.gjc-portfolio-gallery__more:focus-visible {
  color: var(--e-global-color-accent, #e3185c);
  border-color: var(--e-global-color-accent, #e3185c);
}

@media (max-width: 1024px) {
  .gjc-portfolio-gallery:not(.is-masonry) {
    grid-template-columns: repeat(var(--gjc-gallery-cols-tablet), 1fr);
  }
  .gjc-portfolio-gallery.is-masonry .gjc-portfolio-gallery__item {
    width: calc((100% - (var(--gjc-gallery-cols-tablet) - 1) * var(--gjc-gallery-gap)) / var(--gjc-gallery-cols-tablet));
  }
}
@media (max-width: 767px) {
  .gjc-portfolio-gallery:not(.is-masonry) {
    grid-template-columns: repeat(var(--gjc-gallery-cols-mobile), 1fr);
  }
  .gjc-portfolio-gallery.is-masonry .gjc-portfolio-gallery__item {
    width: calc((100% - (var(--gjc-gallery-cols-mobile) - 1) * var(--gjc-gallery-gap)) / var(--gjc-gallery-cols-mobile));
  }
}
@media (prefers-reduced-motion: reduce) {
  .gjc-portfolio-gallery__image,
  .gjc-portfolio-gallery__play {
    transition: none;
  }
}

/* Lightbox */
.gjc-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--e-global-color-primary, #050505) 88%, transparent);
  padding: 2rem;
}
.gjc-gallery-lightbox.is-open { display: flex; }
.gjc-gallery-lightbox__stage {
  max-width: min(90vw, 1200px);
  max-height: 85vh;
  display: grid;
  place-items: center;
}
.gjc-gallery-lightbox__image,
.gjc-gallery-lightbox__frame {
  max-width: min(90vw, 1200px);
  max-height: 80vh;
  display: block;
  box-shadow: 0 1.5rem 3rem color-mix(in srgb, var(--e-global-color-primary, #050505) 60%, transparent);
}
.gjc-gallery-lightbox__frame {
  width: min(90vw, 1200px);
  aspect-ratio: 16 / 9;
  border: 0;
  background: var(--e-global-color-primary, #050505);
}
#gjc-gallery-lightbox .gjc-gallery-lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--e-global-color-900224d, #ffffff);
  cursor: pointer;
  transition: color 160ms ease, opacity 160ms ease;
}
#gjc-gallery-lightbox .gjc-gallery-lightbox__close:hover,
#gjc-gallery-lightbox .gjc-gallery-lightbox__close:focus-visible {
  color: color-mix(in srgb, var(--e-global-color-accent, #e3185c) 80%, transparent);
}
.gjc-gallery-lightbox__close svg { width: 1.25rem; height: 1.25rem; display: block; }
@media (prefers-reduced-motion: reduce) {
  .gjc-gallery-lightbox { transition: none; }
}
