/* Responsive couple gallery and countdown — 12 photos total. */
.announcement__second-page,
.announcement__third-page {
  min-height: 100svh;
  background:
    radial-gradient(circle at 12% 8%, rgba(18, 64, 26, 0.045), transparent 28rem),
    #faf6ee;
  overflow: hidden;
}

.gallery-page {
  position: relative;
  z-index: 1;
  width: min(92vw, 1320px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(6.5rem, 9vw, 9rem) 0 clamp(3rem, 6vw, 6rem);
}

.gallery-story__layout {
  display: grid;
  grid-template-columns: minmax(17rem, 0.78fr) minmax(30rem, 1.35fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  max-width: 1120px;
  margin: 0 auto clamp(2.5rem, 5vw, 5rem);
}

.gallery-story__copy {
  text-align: left;
}

.gallery-story__copy h2,
.gallery-finale__heading h2,
.wedding-countdown h2 {
  color: #12401a;
  letter-spacing: -0.065em;
  margin: 0.65rem 0 0;
  font-family: "Bodoni Moda", serif;
  font-size: clamp(3.4rem, 6.8vw, 6.8rem);
  font-weight: 500;
  line-height: 0.88;
}

.gallery-story__copy > p:last-child {
  max-width: 25rem;
  margin: 1.45rem 0 0;
  font-family: Italianno, cursive;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.04;
}

.gallery-story__portraits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.gallery-photo {
  position: relative;
  isolation: isolate;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(18, 64, 26, 0.07), transparent 55%),
    #eee8da;
  box-shadow: 0 18px 45px rgba(25, 45, 28, 0.13);
}

.gallery-photo img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-position, 50% 50%);
  opacity: 1;
  transition: transform 700ms cubic-bezier(0.23, 1, 0.32, 1);
}

.gallery-photo--loaded img {
  opacity: 1;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .gallery-photo--loaded:hover img {
    transform: scale(1.025);
  }
}

.gallery-photo__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(18, 64, 26, 0.52);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "Tenor Sans", sans-serif;
  font-size: 0.62rem;
}

.gallery-photo--loaded .gallery-photo__placeholder {
  display: none;
}

.gallery-photo--oval {
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(18, 64, 26, 0.34);
  border-radius: 50% / 43%;
  box-shadow:
    0 0 0 0.65rem #faf6ee,
    0 0 0 calc(0.65rem + 1px) rgba(18, 64, 26, 0.23),
    0 24px 50px rgba(25, 45, 28, 0.15);
}

.gallery-grid {
  display: grid;
  gap: clamp(1.25rem, 2vw, 2rem);
  width: 90%;
  max-width: 1152px;
  margin-inline: auto;
}

.gallery-grid--opening,
.gallery-grid--finale {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.gallery-grid--opening .gallery-photo:nth-child(-n + 2),
.gallery-grid--finale .gallery-photo:nth-child(-n + 2) {
  grid-column: span 6;
  aspect-ratio: 3 / 2;
}

.gallery-grid--opening .gallery-photo:nth-child(n + 3),
.gallery-grid--finale .gallery-photo:nth-child(n + 3) {
  grid-column: span 4;
  aspect-ratio: 2 / 3;
}

.gallery-grid--finale { margin-top: clamp(2rem, 4vw, 3.5rem); }

.gallery-finale__heading {
  text-align: center;
}

.gallery-finale__heading h2 {
  font-size: clamp(3rem, 6vw, 5.8rem);
}

.wedding-countdown {
  text-align: center;
  padding: clamp(5rem, 9vw, 8rem) 0 clamp(1rem, 3vw, 2rem);
}

.wedding-countdown h2 {
  font-size: clamp(3.2rem, 7vw, 6.2rem);
}

.wedding-countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: min(100%, 860px);
  margin: clamp(2.4rem, 5vw, 4rem) auto 0;
  border-top: 1px solid rgba(18, 64, 26, 0.4);
  border-bottom: 1px solid rgba(18, 64, 26, 0.4);
}

.wedding-countdown__grid > div {
  padding: clamp(1.4rem, 4vw, 2.6rem) 0;
  border-right: 1px solid rgba(18, 64, 26, 0.24);
}

.wedding-countdown__grid > div:last-child {
  border-right: 0;
}

.wedding-countdown__grid strong,
.wedding-countdown__grid span {
  display: block;
}

.wedding-countdown__grid strong {
  color: #12401a;
  font-family: "Bodoni Moda", serif;
  font-size: clamp(2.25rem, 6vw, 5rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wedding-countdown__grid span,
.wedding-countdown__status {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "Tenor Sans", sans-serif;
  font-size: clamp(0.48rem, 1vw, 0.66rem);
}

.wedding-countdown__grid span {
  margin-top: 0.7rem;
}

.wedding-countdown__status {
  margin: 1.5rem 0 0;
}

.wedding-countdown__monogram {
  width: 3rem;
  height: 3rem;
  margin: 2.25rem auto 0;
}

@media (min-width: 701px) and (max-width: 1024px) {
  .gallery-page {
    width: min(94vw, 980px);
  }

  .gallery-story__layout {
    grid-template-columns: minmax(15rem, 0.7fr) minmax(24rem, 1.3fr);
    gap: 2.5rem;
  }

}

@media (max-width: 700px) {
  .announcement__second-page,
  .announcement__third-page {
    min-height: auto;
  }

  .gallery-page {
    width: min(92vw, 34rem);
    min-height: auto;
    padding: 6.5rem 0 4rem;
  }

  .gallery-story__layout {
    display: block;
    margin-bottom: 2rem;
  }

  .gallery-story__copy {
    text-align: center;
  }

  .gallery-story__copy > p:last-child {
    margin-left: auto;
    margin-right: auto;
  }

  .gallery-story__portraits {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: min(76vw, 19rem);
    margin: 2.5rem auto 0;
  }

  .gallery-photo--oval:nth-child(2) {
    transform: none;
  }

  .gallery-grid--opening,
  .gallery-grid--finale {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 1.25rem;
    width: 90%;
  }

  .gallery-grid--opening .gallery-photo:nth-child(n),
  .gallery-grid--finale .gallery-photo:nth-child(n) {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .gallery-photo--vertical {
    aspect-ratio: 2 / 3;
  }

  .gallery-photo--horizontal {
    aspect-ratio: 3 / 2;
  }

  .gallery-finale__heading h2 {
    font-size: clamp(2.8rem, 15vw, 4.5rem);
  }

  .wedding-countdown {
    padding-top: 4.25rem;
  }

  .wedding-countdown__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wedding-countdown__grid > div:nth-child(2) {
    border-right: 0;
  }

  .wedding-countdown__grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(18, 64, 26, 0.24);
  }
}

/* Foreground gallery frames and individual-photo viewer. */
.gallery-photo {
  cursor: zoom-in;
  outline: none;
}

.gallery-photo::before,
.gallery-photo::after,
.gallery-lightbox__frame::before,
.gallery-lightbox__frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.gallery-photo::before {
  inset: clamp(0.35rem, 0.8vw, 0.7rem);
  border: clamp(3px, 0.36vw, 6px) solid rgba(246, 239, 220, 0.96);
  box-shadow:
    0 0 0 1px rgba(18, 64, 26, 0.55),
    inset 0 0 0 1px rgba(18, 64, 26, 0.34),
    inset 0 0 18px rgba(22, 43, 25, 0.16);
}

.gallery-photo::after {
  inset: clamp(0.7rem, 1.35vw, 1.1rem);
  border: 1px solid rgba(250, 246, 238, 0.88);
  box-shadow: 0 0 0 1px rgba(18, 64, 26, 0.2);
}

.gallery-photo--oval::before,
.gallery-photo--oval::after {
  border-radius: 50% / 43%;
}

.gallery-photo:focus-visible {
  box-shadow:
    0 0 0 4px #faf6ee,
    0 0 0 7px rgba(18, 64, 26, 0.82),
    0 18px 45px rgba(25, 45, 28, 0.13);
}

.gallery-lightbox-open,
.gallery-lightbox-open body {
  overflow: hidden;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(2.75rem, 1fr) minmax(0, auto) minmax(2.75rem, 1fr);
  place-items: center;
  gap: clamp(0.5rem, 2vw, 2rem);
  padding: clamp(1rem, 3vw, 3rem);
  background:
    radial-gradient(circle at center, rgba(250, 246, 238, 0.22), transparent 55%),
    rgba(8, 18, 10, 0.92);
  backdrop-filter: blur(12px);
}

.gallery-lightbox__frame {
  position: relative;
  grid-column: 2;
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: min(82vw, 1200px);
  max-height: 88svh;
  padding: clamp(0.9rem, 2vw, 1.75rem);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 253, 246, 0.98), rgba(225, 214, 187, 0.98));
  border: 1px solid rgba(18, 64, 26, 0.62);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.48),
    inset 0 0 0 5px rgba(250, 246, 238, 0.94),
    inset 0 0 0 7px rgba(18, 64, 26, 0.26);
}

.gallery-lightbox__frame::before {
  inset: 0.45rem;
  border: 1px solid rgba(18, 64, 26, 0.42);
}

.gallery-lightbox__frame::after {
  inset: clamp(0.72rem, 1.45vw, 1.25rem);
  border: 2px solid rgba(255, 253, 246, 0.88);
  box-shadow: 0 0 0 1px rgba(18, 64, 26, 0.24);
}

.gallery-lightbox__image {
  display: block;
  position: relative;
  z-index: 1;
  max-width: min(76vw, 1120px);
  max-height: calc(88svh - clamp(1.8rem, 4vw, 3.5rem));
  width: auto;
  height: auto;
  object-fit: contain;
}

.gallery-lightbox button {
  color: #faf6ee;
  background: rgba(18, 64, 26, 0.74);
  border: 1px solid rgba(250, 246, 238, 0.58);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.gallery-lightbox button:hover {
  background: rgba(18, 64, 26, 0.96);
}

.gallery-lightbox button:active {
  transform: scale(0.97);
}

.gallery-lightbox__close {
  position: absolute;
  z-index: 3;
  top: clamp(1rem, 3vw, 2.25rem);
  right: clamp(1rem, 3vw, 2.25rem);
  padding: 0.7rem 1rem;
  font-family: "Tenor Sans", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-lightbox__previous,
.gallery-lightbox__next {
  display: grid;
  place-items: center;
  width: clamp(2.75rem, 5vw, 4rem);
  height: clamp(2.75rem, 5vw, 4rem);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
}

.gallery-lightbox__previous {
  grid-column: 1;
  justify-self: end;
}

.gallery-lightbox__next {
  grid-column: 3;
  justify-self: start;
}

@media (max-width: 700px) {
  .gallery-photo::before {
    inset: 0.4rem;
    border-width: 3px;
  }

  .gallery-photo::after {
    inset: 0.72rem;
  }

  .gallery-lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 1rem;
    padding: 3.75rem 1rem 1rem;
  }

  .gallery-lightbox__frame {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: calc(100vw - 2rem);
    max-height: calc(100svh - 7.5rem);
  }

  .gallery-lightbox__image {
    max-width: calc(100vw - 4rem);
    max-height: calc(100svh - 10rem);
  }

  .gallery-lightbox__previous,
  .gallery-lightbox__next {
    grid-row: 2;
  }

  .gallery-lightbox__previous {
    grid-column: 1;
    justify-self: end;
  }

  .gallery-lightbox__next {
    grid-column: 2;
    justify-self: start;
  }
}

/* Exact user-supplied frame artwork — replaces all temporary CSS-drawn frames. */
.gallery-photo::before,
.gallery-photo::after,
.gallery-lightbox__frame::before,
.gallery-lightbox__frame::after {
  display: none !important;
}

.gallery-photo {
  background: #faf6ee;
  box-shadow: 0 16px 42px rgba(25, 45, 28, 0.11);
}

.gallery-photo__image {
  z-index: 1 !important;
  opacity: 1 !important;
}

.gallery-photo__frame {
  position: absolute !important;
  z-index: 3 !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill !important;
  object-position: center !important;
  opacity: 1 !important;
  pointer-events: none;
  transform: none !important;
  transition: none !important;
}

.gallery-photo--oval {
  border: 0;
  border-radius: 50% / 43%;
  box-shadow: 0 22px 52px rgba(25, 45, 28, 0.14);
}

/* Desktop: centered introduction with one portrait on each side. */
.gallery-story__layout {
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.72fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4.5rem);
  max-width: 1240px;
}

.gallery-story__copy {
  text-align: center;
}

.gallery-story__copy > p:last-child {
  margin-left: auto;
  margin-right: auto;
}

.gallery-story__portrait {
  width: min(100%, 21rem);
  justify-self: center;
}

.gallery-grid--finale {
  margin-top: 0;
}

/* Counting down title uses the invitation script and all units stay on one line. */
.wedding-countdown > .announcement__continuation-kicker {
  font-family: Italianno, cursive;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.wedding-countdown__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Lightbox uses the matching supplied frame for the selected orientation. */
.gallery-lightbox__frame {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48);
}

.gallery-lightbox__image {
  position: relative;
  z-index: 1;
  display: block;
  max-width: min(74vw, 1080px);
  max-height: 84svh;
  object-fit: contain;
}

.gallery-lightbox__frame-art {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.gallery-lightbox__frame--oval {
  border-radius: 50% / 43%;
  overflow: hidden;
}

@media (min-width: 701px) and (max-width: 1024px) {
  .gallery-story__layout {
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.74fr) minmax(0, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 700px) {
  .gallery-story__layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 3rem;
  }

  .gallery-story__copy {
    order: 0;
  }

  .gallery-story__portrait--left {
    order: 1;
    margin-top: 2.75rem;
  }

  .gallery-story__portrait--right {
    order: 2;
    margin-top: 2rem;
  }

  .gallery-story__portrait {
    width: min(72vw, 18rem);
  }

  .wedding-countdown__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .wedding-countdown__grid > div {
    min-width: 0;
    padding: 1.15rem 0.15rem;
    border-right: 1px solid rgba(18, 64, 26, 0.24) !important;
    border-bottom: 0 !important;
  }

  .wedding-countdown__grid > div:last-child {
    border-right: 0 !important;
  }

  .wedding-countdown__grid strong {
    font-size: clamp(1.45rem, 9vw, 2.2rem);
  }

  .wedding-countdown__grid span {
    font-size: clamp(0.36rem, 2.2vw, 0.5rem);
    letter-spacing: 0.08em;
  }

  .gallery-lightbox__image {
    max-width: calc(100vw - 3rem);
    max-height: calc(100svh - 9rem);
  }
}

/* Faded landscape footer behind the countdown. */
.wedding-countdown {
  position: relative;
  isolation: isolate;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  padding-left: max(5vw, 1rem);
  padding-right: max(5vw, 1rem);
}

.wedding-countdown::before,
.wedding-countdown::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wedding-countdown::before {
  z-index: -2;
  background: url("/media/countdown-footer.webp") center 46% / cover no-repeat;
  opacity: 0.16;
  filter: saturate(0.58) contrast(0.84);
}

.wedding-countdown::after {
  z-index: -1;
  background: rgba(250, 246, 238, 0.7);
}

.wedding-countdown > .announcement__continuation-kicker,
.wedding-countdown__status {
  font-family: Italianno, cursive;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.wedding-countdown__status {
  margin-top: 1.7rem;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
}

/* V9 photo/frame scale: photo = 75% of prior display; supplied frame = 125% of photo. */
.gallery-photo {
  width: 75%;
  justify-self: center;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.gallery-photo__image {
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 68%, rgba(0, 0, 0, 0.94) 80%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 68%, rgba(0, 0, 0, 0.94) 80%, transparent 100%);
}

.gallery-photo__frame {
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  width: 125% !important;
  height: 125% !important;
  transform: translate(-50%, -50%) !important;
}

/* Exact requested frame-one alignment corrections. */
.gallery-photo--horizontal .gallery-photo__frame {
  transform: translate(-50%, -50%) translateY(-2px) !important;
}

.gallery-photo--vertical .gallery-photo__frame {
  transform: translate(-50%, -50%) translateX(2px) !important;
}

.gallery-story__portrait {
  width: min(75%, 15.75rem);
}

/* The individual viewer uses the same 75% photo / 125% supplied-frame ratio. */
.gallery-lightbox__image {
  max-width: min(55.5vw, 810px);
  max-height: 63svh;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 70%, rgba(0, 0, 0, 0.95) 82%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 70%, rgba(0, 0, 0, 0.95) 82%, transparent 100%);
}

.gallery-lightbox__frame-art {
  inset: auto;
  top: 50%;
  left: 50%;
  width: 125%;
  height: 125%;
  transform: translate(-50%, -50%);
}

.gallery-lightbox__frame--horizontal .gallery-lightbox__frame-art {
  transform: translate(-50%, -50%) translateY(-2px);
}

.gallery-lightbox__frame--vertical .gallery-lightbox__frame-art {
  transform: translate(-50%, -50%) translateX(2px);
}

/* Keep image 1 visible as a faded countdown background while text stays clear. */
.wedding-countdown::before {
  opacity: 0.24;
  filter: saturate(0.62) contrast(0.88);
}

.wedding-countdown::after {
  background: rgba(250, 246, 238, 0.58);
}

@media (max-width: 700px) {
  .gallery-story__portrait {
    width: min(54vw, 13.5rem);
  }

  .gallery-lightbox__image {
    max-width: calc((100vw - 3rem) * 0.75);
    max-height: calc((100svh - 9rem) * 0.75);
  }
}

.gallery-photo__frame,
.gallery-lightbox__frame-art {
  max-width: none !important;
  max-height: none !important;
}

/* Clarified centered frame assets: no x/y correction is needed. */
.gallery-photo--horizontal .gallery-photo__frame,
.gallery-photo--vertical .gallery-photo__frame,
.gallery-lightbox__frame--horizontal .gallery-lightbox__frame-art,
.gallery-lightbox__frame--vertical .gallery-lightbox__frame-art {
  transform: translate(-50%, -50%) !important;
}

.gallery-photo--couple {
  aspect-ratio: 2000 / 1429;
  border-radius: 50%;
}

.gallery-story__portrait {
  width: min(75%, 18rem);
}

@media (max-width: 700px) {
  .gallery-story__portrait {
    width: min(60vw, 15rem);
  }
}

/* V10: couple pictures remain vertical inside the centered oval artwork. */
.gallery-photo--couple {
  aspect-ratio: 2 / 3;
  border-radius: 50% / 44%;
}

/* Even four-edge gradient fade—left, right, top, and bottom. */
.gallery-photo__image,
.gallery-lightbox__image {
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-composite: intersect;
}

/* V10 countdown background: original image with only a 20% ivory fade. */
.wedding-countdown::before {
  opacity: 1;
  filter: none;
}

.wedding-countdown::after {
  background: rgba(250, 246, 238, 0.2);
}

.wedding-countdown__grid {
  background: rgba(250, 246, 238, 0.48);
  box-shadow: 0 18px 54px rgba(18, 64, 26, 0.12);
  backdrop-filter: blur(5px);
}

.wedding-countdown > .announcement__continuation-kicker,
.wedding-countdown > h2,
.wedding-countdown__status {
  text-shadow:
    0 1px 0 rgba(250, 246, 238, 0.98),
    0 2px 12px rgba(250, 246, 238, 0.82);
}

/* V10: one equal visual gap across all four photo rows. */
.announcement {
  --gallery-row-gap: clamp(2rem, 3vw, 2.8rem);
}

.announcement__second-page,
.announcement__third-page,
.gallery-page {
  min-height: auto;
}

.announcement__third-page {
  border-top: 0;
}

.gallery-grid {
  row-gap: var(--gallery-row-gap);
  column-gap: var(--gallery-row-gap);
}

.gallery-page--story {
  padding-bottom: calc(var(--gallery-row-gap) / 2);
}

.gallery-page--finale {
  padding-top: calc(var(--gallery-row-gap) / 2);
}

@media (max-width: 700px) {
  .announcement {
    --gallery-row-gap: 1.5rem;
  }

  .gallery-grid--opening,
  .gallery-grid--finale {
    gap: var(--gallery-row-gap);
  }
}

/* V10: smaller Meet the Couple typography. */
.gallery-story__copy h2 {
  font-size: clamp(2.7rem, 4.8vw, 4.8rem);
  line-height: 0.92;
}

.gallery-story__copy > p:last-child {
  max-width: 20rem;
  margin-top: 1rem;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.08;
}

@media (max-width: 700px) {
  .gallery-story__copy h2 {
    font-size: clamp(2.65rem, 13vw, 3.8rem);
  }

  .gallery-story__copy > p:last-child {
    max-width: 17rem;
    font-size: clamp(1.3rem, 6.5vw, 1.7rem);
  }
}

/* V10: supplied frame color faded by exactly 10%. */
.gallery-photo__frame,
.gallery-lightbox__frame-art {
  opacity: 0.9 !important;
}

/* V12: requested additive spacing and oval couple-photo gradient. */
.announcement {
  --gallery-row-gap: calc(clamp(2rem, 3vw, 2.8rem) + 20px);
}

.gallery-story__layout {
  margin-bottom: calc(clamp(2.5rem, 5vw, 5rem) + 10px);
}

.wedding-countdown {
  margin-top: 10px;
}

.gallery-photo--couple {
  overflow: hidden;
  border-radius: 50% / 44%;
}

.gallery-photo--couple .gallery-photo__image {
  -webkit-mask-image: radial-gradient(ellipse at center, #000 64%, rgba(0, 0, 0, 0.9) 78%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 64%, rgba(0, 0, 0, 0.9) 78%, transparent 100%);
}

@media (max-width: 700px) {
  .announcement {
    --gallery-row-gap: 44px;
  }

  .gallery-story__layout {
    margin-bottom: 58px;
  }
}

/* V13: 50px from the final gallery row to the countdown. */
.wedding-countdown {
  margin-top: 50px;
}

/* Keep the complete supplied oval frame visible; crop only the photograph. */
.gallery-photo--couple {
  overflow: visible;
  border-radius: 0;
}

.gallery-photo--couple .gallery-photo__image {
  border-radius: 50%;
  clip-path: ellipse(50% 50% at 50% 50%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 66%, rgba(0, 0, 0, 0.94) 80%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 66%, rgba(0, 0, 0, 0.94) 80%, transparent 100%);
}

.gallery-photo--couple .gallery-photo__frame {
  overflow: visible;
  clip-path: none;
}

/* V13 footer: image inset from both sides, no fade, all-white typography. */
.wedding-countdown {
  --countdown-side-inset: min(100px, 8vw);
  color: #fff;
}

.wedding-countdown::before {
  inset: 0 var(--countdown-side-inset);
  opacity: 1;
  filter: none;
  background-size: cover;
}

.wedding-countdown::after {
  inset: 0 var(--countdown-side-inset);
  background: transparent;
}

.wedding-countdown,
.wedding-countdown h2,
.wedding-countdown .announcement__continuation-kicker,
.wedding-countdown__status,
.wedding-countdown__value,
.wedding-countdown__label {
  color: #fff !important;
}

.wedding-countdown__grid {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  backdrop-filter: none;
}

.wedding-countdown__grid > div {
  border-color: rgba(255, 255, 255, 0.5) !important;
}

.wedding-countdown > .announcement__continuation-kicker,
.wedding-countdown > h2,
.wedding-countdown__status,
.wedding-countdown__value,
.wedding-countdown__label {
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.72);
}

@media (min-width: 701px) {
  .wedding-countdown {
    --countdown-side-inset: 100px;
  }
}

@media (max-width: 700px) {
  .wedding-countdown {
    --countdown-side-inset: 20px;
  }
}

/* V13 final color cleanup. */
.gallery-photo--couple {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.wedding-countdown__grid strong,
.wedding-countdown__grid span {
  color: #fff !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.78);
}

.gallery-photo--couple:focus,
.gallery-photo--couple:focus-visible {
  outline: none;
}

.gallery-photo--couple:focus-visible .gallery-photo__frame {
  filter: drop-shadow(0 0 8px rgba(18, 64, 26, 0.42));
}

.gallery-photo--couple:focus-visible .gallery-photo__frame {
  filter: none;
}

.gallery-photo--couple:focus-visible .gallery-photo__image {
  filter: drop-shadow(0 0 8px rgba(18, 64, 26, 0.42));
}

.gallery-photo--couple:focus-visible {
  box-shadow: none;
}

/* V14: cropped footer image spans the page edge to edge. */
.wedding-countdown {
  --countdown-side-inset: 0px !important;
}

.wedding-countdown::before,
.wedding-countdown::after {
  inset-inline: 0;
}

/* V14: stronger full-perimeter gradient fade on oval photographs only. */
.gallery-photo--couple .gallery-photo__image,
.gallery-lightbox__frame--oval .gallery-lightbox__image {
  border-radius: 50%;
  clip-path: ellipse(50% 50% at 50% 50%);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    #000 0%,
    #000 58%,
    rgba(0, 0, 0, 0.92) 70%,
    rgba(0, 0, 0, 0.58) 82%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse at center,
    #000 0%,
    #000 58%,
    rgba(0, 0, 0, 0.92) 70%,
    rgba(0, 0, 0, 0.58) 82%,
    transparent 100%
  );
}

.gallery-photo--couple .gallery-photo__frame,
.gallery-lightbox__frame--oval .gallery-lightbox__frame-art {
  -webkit-mask-image: none;
  mask-image: none;
}

/* ================================================================
 * V17 FINAL EDITABLE OVERRIDES
 * Change the values in assets/EDIT-WEBSITE-HERE.js, not this file.
 * ================================================================ */
:root {
  --edit-desktop-couple-gap-extra: 10px;
  --edit-mobile-bottom-spacing: 0px;
  --edit-oval-fade-solid: 54%;
  --edit-oval-fade-mid: 78%;
}

/* Desktop: 10px more breathing room on both sides of the centered copy. */
@media (min-width: 1025px) {
  .gallery-story__layout {
    column-gap: calc(clamp(2rem, 4vw, 4.5rem) + var(--edit-desktop-couple-gap-extra));
  }
}

/* Only the portrait pixels fade; the supplied oval frame remains complete. */
.gallery-photo--couple .gallery-photo__image,
.gallery-lightbox__frame--oval .gallery-lightbox__image {
  border-radius: 50%;
  clip-path: ellipse(50% 50% at 50% 50%);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    #000 0%,
    #000 var(--edit-oval-fade-solid),
    rgba(0, 0, 0, 0.88) var(--edit-oval-fade-mid),
    rgba(0, 0, 0, 0.44) 88%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse at center,
    #000 0%,
    #000 var(--edit-oval-fade-solid),
    rgba(0, 0, 0, 0.88) var(--edit-oval-fade-mid),
    rgba(0, 0, 0, 0.44) 88%,
    transparent 100%
  );
}

/* Couple lightbox: crop the photo to an oval but show the entire 125% frame. */
.gallery-lightbox__frame--oval {
  width: min(42vw, 27rem);
  max-width: none;
  max-height: 70svh;
  aspect-ratio: 2 / 3;
  overflow: visible !important;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.gallery-lightbox__frame--oval .gallery-lightbox__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.gallery-lightbox__frame--oval .gallery-lightbox__frame-art {
  top: 50%;
  left: 50%;
  width: 125%;
  height: 125%;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  object-fit: fill;
  clip-path: none;
  -webkit-mask-image: none;
  mask-image: none;
}



@media (max-width: 700px) {
  .gallery-lightbox__frame--oval {
    width: min(70vw, 18rem);
    max-height: 66svh;
  }

  /* Remove the blank paper tail after the countdown on phones. */
  .announcement__third-page,
  .gallery-page--finale,
  .wedding-countdown {
    margin-bottom: 0 !important;
    padding-bottom: var(--edit-mobile-bottom-spacing) !important;
  }

  .wedding-countdown__monogram {
    margin-bottom: 0 !important;
  }
}


