/* HAM Bakery — wedding cake gallery + lightbox */
.wedding {
  position: relative; padding: 7rem 0 6rem; overflow: hidden;
  background:
    radial-gradient(60% 50% at 85% 10%, rgba(243, 193, 65, .16), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(79, 91, 42, .1), transparent 70%),
    #fbf6ec;
}
.wed-wrap { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.wed-copy { position: sticky; top: 120px; display: grid; gap: 1.4rem; justify-items: start; }
.wed-copy .lead { max-width: 34ch; }
.wed-copy .h2 { font-size: clamp(1.8rem, 2.6vw, 2.6rem); }
.wed-credit { color: var(--olive); font-weight: 700; font-size: .92rem; text-decoration: none; border-bottom: 1px solid rgba(79, 91, 42, .3); padding-bottom: 2px; }
.wed-credit:hover { border-color: var(--olive); }

.wed-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.wed-item {
  display: block; padding: 0; border: 0; background: #efe6d6; cursor: zoom-in; border-radius: 22px; overflow: hidden;
  aspect-ratio: 4 / 5; box-shadow: 0 18px 40px -22px rgba(43, 33, 28, .45);
  opacity: 0; transform: translateY(40px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * .07s),
    transform .9s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * .07s), box-shadow .4s;
}
.wed-item:nth-child(3n + 2) { margin-top: 64px; }      /* middle column sits lower: a soft staggered mosaic */
.wed-item.in { opacity: 1; transform: none; }
.wed-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.wed-item:hover { box-shadow: 0 26px 50px -22px rgba(43, 33, 28, .55); }
.wed-item:hover img { transform: scale(1.05); }
.wed-item:focus-visible { outline: 3px solid var(--ham); outline-offset: 4px; }

.lightbox { position: fixed; inset: 0; z-index: 700; background: rgba(24, 18, 14, .92); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lb-fig { margin: 0; display: grid; place-items: center; width: 100%; height: 100%; padding: 64px 84px; box-sizing: border-box; }
.lb-fig img { max-width: 100%; max-height: 100%; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lb-fig img.in { animation: lbIn .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } }
.lb-x { position: absolute; top: 18px; right: 18px; z-index: 2; }
.lb-nav {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: rgba(255, 248, 234, .14); color: var(--ivory); font-size: 2rem; line-height: 1; cursor: pointer; transition: background .25s, color .25s;
}
.lb-nav:hover { background: var(--ham); color: var(--ink); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-count { position: absolute; bottom: 20px; left: 50%; translate: -50% 0; color: rgba(255, 248, 234, .75); font-weight: 700; font-size: .9rem; }

@media (max-width: 980px) {
  .wedding { padding: 4.5rem 0 4rem; }
  .wed-wrap { grid-template-columns: 1fr; gap: 2rem; }
  .wed-copy { position: static; }
  /* phones: one swipeable row that peeks at the next photo */
  .wed-gallery {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 4px 16px 18px;
    scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .wed-gallery::-webkit-scrollbar { display: none; }
  .wed-item { flex: 0 0 74%; scroll-snap-align: center; margin-top: 0 !important; opacity: 1; transform: none; }
  .lb-fig { padding: 70px 12px; }
  .lb-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wed-item { opacity: 1; transform: none; transition: none; }
  .wed-item img { transition: none; }
  .lb-fig img.in { animation: none; }
}
