.photographer-portfolio-carousel {
  --portfolio-gap: clamp(12px, 2vw, 24px);
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
}

.photographer-portfolio-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 12px;
}

.photographer-portfolio-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.photographer-portfolio-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.photographer-portfolio-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--portfolio-columns) - 1) * var(--portfolio-gap)) / var(--portfolio-columns));
  grid-template-rows: repeat(2, auto);
  gap: var(--portfolio-gap);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x pan-y;
}

.photographer-portfolio-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.photographer-portfolio-track.has-overflow {
  cursor: grab;
}

.photographer-portfolio-carousel.is-vertical .photographer-portfolio-track {
  grid-template-rows: 1fr;
}

.photographer-portfolio-track.is-dragging,
.photographer-portfolio-track.is-autoplaying {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  user-select: none;
}

.photographer-portfolio-track.is-autoplaying {
  cursor: grab;
}

.photographer-portfolio-card {
  grid-row: var(--portfolio-row);
  grid-column: var(--portfolio-column);
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
}

.photographer-portfolio-carousel.has-original-images .photographer-portfolio-card {
  align-self: start;
}

.photographer-portfolio-cover {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #222;
  color: #fff;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.photographer-portfolio-track:focus,
.photographer-portfolio-track:focus-visible,
.photographer-portfolio-cover:focus,
.photographer-portfolio-cover:focus-visible {
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

.photographer-portfolio-cover.is-disabled {
  cursor: default;
}

.photographer-portfolio-carousel.has-horizontal-images .photographer-portfolio-cover {
  aspect-ratio: 3 / 2;
}

.photographer-portfolio-carousel.has-squared-images .photographer-portfolio-cover {
  aspect-ratio: 1 / 1;
}

.photographer-portfolio-carousel.has-vertical-images .photographer-portfolio-cover {
  aspect-ratio: 2 / 3;
}

.photographer-portfolio-cover img,
.photographer-portfolio-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.photographer-portfolio-carousel.has-original-images .photographer-portfolio-cover img {
  height: auto;
  object-fit: contain;
}

.photographer-portfolio-carousel.has-original-images .photographer-portfolio-placeholder {
  aspect-ratio: 4 / 3;
}

.photographer-portfolio-placeholder {
  background: linear-gradient(135deg, #444, #111);
}

.photographer-portfolio-cover:hover img,
.photographer-portfolio-cover:focus-visible img {
  transform: scale(1.025);
}

.photographer-portfolio-cover.is-disabled:hover img {
  transform: none;
}

.photographer-portfolio-title {
  display: block;
  margin-top: 10px;
  font-size: 13px !important;
  color: var(--portfolio-title-color, currentColor);
  font: inherit;
  font-family: var(--portfolio-title-font-family, inherit);
  font-weight: 300;
}

.photographer-portfolio-carousel.has-title-align-left .photographer-portfolio-title {
  text-align: left;
}

.photographer-portfolio-carousel.has-title-align-center .photographer-portfolio-title {
  text-align: center;
}

.photographer-portfolio-carousel.has-title-align-right .photographer-portfolio-title {
  text-align: right;
}

.photographer-portfolio-lightbox {
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
}

.photographer-portfolio-lightbox[open] {
  display: block;
}

.photographer-portfolio-lightbox::backdrop {
  background: #000;
}

.photographer-portfolio-lightbox-viewport {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  touch-action: pan-x;
  cursor: grab;
}

.photographer-portfolio-lightbox-viewport::-webkit-scrollbar {
  display: none;
}

.photographer-portfolio-lightbox-viewport:focus,
.photographer-portfolio-lightbox-viewport:focus-visible {
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

.photographer-portfolio-lightbox-viewport.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}

.photographer-portfolio-lightbox-strip {
  display: flex;
  width: max-content;
  min-width: 100%;
  height: 100%;
  background: #000;
}

.photographer-portfolio-lightbox-strip.has-single {
  justify-content: center;
}

.photographer-portfolio-lightbox-strip.is-hinting {
  animation: photographer-portfolio-swipe-hint 0.9s 0.3s ease-in-out both;
}

@keyframes photographer-portfolio-swipe-hint {
  0%, 100% {
    transform: translateX(0);
  }
  45% {
    transform: translateX(-28px);
  }
  70% {
    transform: translateX(8px);
  }
}

.photographer-portfolio-lightbox-slide {
  display: grid;
  position: relative;
  box-sizing: border-box;
  flex: 0 0 100vw;
  place-items: center;
  width: 100vw;
  height: 100%;
  margin: 0;
  padding: max(16px, 2.5vw);
  overflow: hidden;
  background: #000;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.photographer-portfolio-lightbox-slide.is-portrait {
  flex-basis: calc(100vw / var(--portrait-columns, 2));
  width: calc(100vw / var(--portrait-columns, 2));
}

.photographer-portfolio-lightbox.is-loading::after {
  position: fixed;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  animation: photographer-portfolio-loader 0.8s linear infinite;
}
@keyframes photographer-portfolio-loader {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.photographer-portfolio-lightbox-slide img {
  display: block;
  width: auto !important;
  min-width: 0;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  user-select: none;
}

.photographer-portfolio-lightbox-slide figcaption {
  position: absolute;
  z-index: 2;
  right: clamp(16px, 3vw, 48px);
  bottom: max(42px, calc(env(safe-area-inset-bottom) + 32px));
  left: clamp(16px, 3vw, 48px);
  margin: 0;
  padding: 18px 12px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
  color: #fff;
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.photographer-portfolio-lightbox-slide.has-error {
  display: none;
}

.photographer-portfolio-lightbox button {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 32px;
}

.photographer-portfolio-lightbox button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
.photographer-portfolio-lightbox-close {
  position: fixed;
  z-index: 5;
  top: max(12px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  line-height: 1;
}

.photographer-portfolio-lightbox-status {
  position: fixed;
  z-index: 5;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.photographer-portfolio-single-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wp--preset--spacing--40, 24px);
  margin-top: var(--wp--preset--spacing--50, 32px);
}

.photographer-portfolio-single-gallery img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 700px) {
  .photographer-portfolio-track {
    grid-auto-columns: calc(
      (100% - (var(--portfolio-mobile-columns) - 1) * var(--portfolio-gap)) / var(--portfolio-mobile-columns)
    );
  }
  .photographer-portfolio-card {
    grid-row: var(--portfolio-mobile-row);
    grid-column: var(--portfolio-mobile-column);
  }
  .photographer-portfolio-lightbox {
    width: 100vw;
    height: 100dvh;
  }
  .photographer-portfolio-lightbox-slide,
  .photographer-portfolio-lightbox-slide.is-portrait {
    flex-basis: 100vw;
    width: 100vw;
    padding: max(12px, 3vw);
  }
  .photographer-portfolio-single-gallery {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) and (pointer: coarse) {
  .photographer-portfolio-lightbox-slide,
  .photographer-portfolio-lightbox-slide.is-portrait {
    flex-basis: 100vw;
    width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photographer-portfolio-track {
    scroll-behavior: auto;
  }
  .photographer-portfolio-cover img {
    transition: none;
  }
  .photographer-portfolio-lightbox.is-loading::after {
    animation: none;
  }
  .photographer-portfolio-lightbox-strip.is-hinting {
    animation: none;
  }
}
