/**
 * Portfolio — premium gallery
 * Light editorial stage, equal cells, soft radius + airy gaps.
 */

.page-portfolio {
  --ws-gal-ink: #17171a;
  --ws-gal-muted: rgba(23, 23, 26, 0.58);
  --ws-gal-line: rgba(23, 23, 26, 0.1);
  --ws-gal-bg: #f7f5f1;
  --ws-gal-stage: #f3f1ec;
  --ws-gal-brand: var(--ws-brand, #cd2525);
}

.page-portfolio .ws-gallery {
  background: var(--ws-gal-bg);
  color: var(--ws-gal-ink);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.page-portfolio .ws-gallery__intro {
  padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(1.75rem, 3.5vw, 2.5rem);
  border-bottom: 1px solid var(--ws-gal-line);
  text-align: center;
}

.page-portfolio .ws-gallery__intro-copy {
  max-width: 34rem;
  margin-inline: auto;
}

.page-portfolio .ws-gallery__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--ws-gal-ink);
}

.page-portfolio .ws-gallery__lead {
  margin: 0 auto;
  max-width: 38ch;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ws-gal-muted);
}

.page-portfolio .ws-gallery__stage {
  background: var(--ws-gal-stage);
  padding: clamp(2rem, 4vw, 3rem) 0 0;
}

.page-portfolio .ws-gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.85rem, 1.6vw, 1.15rem);
}

@media (min-width: 576px) {
  .page-portfolio .ws-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .page-portfolio .ws-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .page-portfolio .ws-gallery__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.page-portfolio .ws-gallery__item {
  margin: 0;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.45s ease;
}

.page-portfolio .ws-gallery__item.is-enter {
  opacity: 0;
  transform: translateY(14px);
}

.page-portfolio .ws-gallery__shot {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: #e8e4dc;
  text-decoration: none;
  color: inherit;
}

.page-portfolio .ws-gallery__shot picture,
.page-portfolio .ws-gallery__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

.page-portfolio .ws-gallery__shot img {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
  filter: saturate(0.98) contrast(1.01);
}

.page-portfolio .ws-gallery__veil {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.page-portfolio .ws-gallery__expand {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.3s ease, transform 0.35s ease, background 0.3s ease;
  pointer-events: none;
}

.page-portfolio .ws-gallery__expand i {
  font-size: 1rem;
  line-height: 1;
}

.page-portfolio .ws-gallery__shot:hover img,
.page-portfolio .ws-gallery__shot:focus-visible img {
  transform: scale(1.04);
  filter: saturate(1.04) contrast(1.03);
}

.page-portfolio .ws-gallery__shot:hover .ws-gallery__veil,
.page-portfolio .ws-gallery__shot:focus-visible .ws-gallery__veil {
  opacity: 1;
}

.page-portfolio .ws-gallery__shot:hover .ws-gallery__expand,
.page-portfolio .ws-gallery__shot:focus-visible .ws-gallery__expand {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.page-portfolio .ws-gallery__shot:focus-visible {
  outline: 2px solid var(--ws-gal-brand);
  outline-offset: 3px;
}

.page-portfolio .ws-gallery__footer {
  padding-top: clamp(2.75rem, 5vw, 4rem);
}

.page-portfolio .ws-gallery__footer-text {
  margin: 0 0 1.25rem;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ws-gal-muted);
}

.page-portfolio .ws-gallery__cta {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0.85rem 2.25rem;
  border: 1px solid var(--ws-gal-brand);
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ws-gal-brand) !important;
  background: transparent;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.page-portfolio .ws-gallery__cta:hover,
.page-portfolio .ws-gallery__cta:focus-visible {
  transform: translateY(-1px);
  background: var(--ws-gal-brand);
  color: #fff !important;
}

.mfp-bg.ws-gallery-mfp-bg {
  background: #111;
  opacity: 0.88;
}

.mfp-wrap.ws-gallery-mfp .mfp-content {
  max-width: min(1100px, 94vw);
}

.mfp-wrap.ws-gallery-mfp .mfp-figure::after {
  box-shadow: none;
  background: transparent;
}

.mfp-wrap.ws-gallery-mfp .mfp-bottom-bar {
  display: none;
}

.mfp-wrap.ws-gallery-mfp .mfp-close {
  color: #fff !important;
  opacity: 0.7;
}

@media (max-width: 575.98px) {
  .page-portfolio .ws-gallery__expand {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }

  .page-portfolio .ws-gallery__veil {
    opacity: 0.28;
  }
}
