.portfolio-page {
  min-height: 100vh;
  background: var(--paper);
}

.portfolio-header {
  position: relative;
  color: var(--soft-black);
  background: rgba(255, 250, 241, 0.96);
  box-shadow: 0 10px 40px rgba(17, 17, 15, 0.07);
}

.portfolio-header .logo-slot {
  width: 8.5rem;
  height: 5.8rem;
}

.portfolio-back {
  align-self: center;
  color: var(--soft-black);
  font-size: 0.82rem;
  font-weight: 720;
  letter-spacing: 0.04em;
}

.portfolio-back span {
  display: inline-block;
  margin-right: 0.35rem;
  color: var(--champagne-gold);
  transition: transform 180ms ease;
}

.portfolio-back:hover span,
.portfolio-back:focus-visible span {
  transform: translateX(-0.25rem);
}

.portfolio-main {
  min-height: 100vh;
  padding: clamp(10rem, 16vw, 14rem) clamp(1.2rem, 6vw, 6rem) clamp(5rem, 10vw, 9rem);
}

.portfolio-intro {
  width: min(74rem, 100%);
  margin: 0 auto;
  padding-bottom: clamp(2.8rem, 6vw, 5rem);
  border-bottom: 1px solid rgba(183, 154, 98, 0.34);
}

.portfolio-intro .eyebrow {
  margin-bottom: 1.25rem;
}

.portfolio-intro h1 {
  max-width: 60rem;
  margin: 0;
  color: var(--soft-black);
  font-size: clamp(3rem, 7vw, 7rem);
  line-height: 0.98;
  text-shadow: none;
}

.portfolio-gallery-shell {
  width: min(74rem, 100%);
  min-height: clamp(13rem, 24vw, 20rem);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  padding-top: clamp(2.5rem, 6vw, 5rem);
}

.portfolio-gallery-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wedding-gallery {
  display: block;
  min-height: 0;
  width: min(95vw, 2400px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.wedding-gallery .portfolio-gallery-label {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.wedding-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.4rem);
}

.wedding-photo {
  grid-column: span 6;
  margin: 0;
}

.wedding-photo--hero {
  grid-column: 1 / -1;
}

.wedding-photo--portrait {
  grid-column: span 6;
}

.wedding-photo--half:nth-child(5),
.wedding-photo--half:nth-child(12) {
  grid-column: span 7;
}

.wedding-photo--half:nth-child(6),
.wedding-photo--half:nth-child(13) {
  grid-column: span 5;
}

.wedding-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.communion-gallery {
  display: block;
  min-height: 0;
  width: min(95vw, 2400px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.communion-gallery .portfolio-gallery-label {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.communion-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.4rem);
}

.communion-photo {
  grid-column: span 7;
  margin: 0;
  overflow: hidden;
  background: #e8e0d7;
}

.communion-photo--hero {
  grid-column: 1 / -1;
}

.communion-photo--portrait {
  grid-column: span 5;
}

.communion-photo--compact {
  grid-column: span 5;
}

.communion-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.events-gallery {
  display: block;
  min-height: 0;
  width: min(95vw, 2048px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.events-gallery .portfolio-gallery-label {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.4rem);
}

.events-photo {
  min-width: 0;
  margin: 0;
}

.events-photo--hero,
.events-feature {
  grid-column: 1 / -1;
}

.events-feature {
  display: grid;
  grid-template-columns: 48fr 52fr;
  align-items: center;
  gap: clamp(0.75rem, 1.6vw, 1.4rem);
}

.events-feature-stack {
  display: grid;
  gap: clamp(0.75rem, 1.6vw, 1.4rem);
}

.events-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.lightbox-trigger:focus-visible {
  outline: 2px solid var(--champagne-gold);
  outline-offset: 4px;
}

.portfolio-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(2.8rem, 5vw, 4.5rem);
  border: 0;
  background: rgba(15, 14, 12, 0.96);
  overflow: hidden;
}

.portfolio-lightbox[open] {
  display: grid;
  place-items: center;
}

.portfolio-lightbox::backdrop {
  background: rgba(15, 14, 12, 0.9);
}

.portfolio-lightbox img {
  grid-area: 1 / 1;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 5.6rem);
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  color: #fffaf1;
  background: rgba(15, 14, 12, 0.44);
  font: 300 1.8rem/1 Georgia, serif;
  cursor: pointer;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.portfolio-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1.2rem, 6vw, 6rem);
  border-top: 1px solid var(--line);
  background: var(--white);
}

.portfolio-footer p {
  margin: 0;
}

.portfolio-footer a {
  color: var(--champagne-gold);
  font-weight: 700;
}

@media (max-width: 600px) {
  .portfolio-header {
    align-items: center;
  }

  .portfolio-header .logo-slot {
    width: 6.6rem;
    height: 4.6rem;
  }

  .portfolio-back {
    max-width: 9rem;
    text-align: right;
  }

  .portfolio-main {
    padding-top: 8.5rem;
  }

  .portfolio-footer {
    flex-direction: column;
  }

  .wedding-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .wedding-gallery {
    width: calc(100vw - 2rem);
  }

  .wedding-photo,
  .wedding-photo--hero,
  .wedding-photo--portrait,
  .wedding-photo--half:nth-child(5),
  .wedding-photo--half:nth-child(6),
  .wedding-photo--half:nth-child(12),
  .wedding-photo--half:nth-child(13) {
    grid-column: 1;
  }

  .communion-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .communion-gallery {
    width: calc(100vw - 2rem);
  }

  .communion-photo,
  .communion-photo--hero,
  .communion-photo--portrait,
  .communion-photo--compact {
    grid-column: 1;
  }

  .events-gallery {
    width: calc(100vw - 2rem);
  }

  .events-grid,
  .events-feature {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .events-feature-stack {
    gap: 0.85rem;
  }

  .portfolio-lightbox {
    padding: 3.6rem 0.75rem;
  }

  .lightbox-nav {
    top: auto;
    bottom: 0.8rem;
    transform: none;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .wedding-grid,
  .communion-grid {
    grid-template-columns: 1fr;
  }

  .events-grid,
  .events-feature {
    grid-template-columns: 1fr;
  }

  .wedding-photo,
  .wedding-photo--hero,
  .wedding-photo--portrait,
  .wedding-photo--half:nth-child(5),
  .wedding-photo--half:nth-child(6),
  .wedding-photo--half:nth-child(12),
  .wedding-photo--half:nth-child(13),
  .communion-photo,
  .communion-photo--hero,
  .communion-photo--portrait,
  .communion-photo--compact {
    grid-column: 1;
  }
}
