/* ---------- Khoảnh khắc: ảnh lụa ---------- */
.featured__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
  max-width: 960px; /* gọn hơn (trước 1080px) để mục ảnh không quá dài, cuộn đỡ lâu */
  margin: 0 auto;
}
.featured__grid img {
  width: 100%; height: 100%;
  aspect-ratio: 4 / 5; /* thấp hơn 2:3 cũ → cả lưới ngắn đi ~25% mà ảnh vẫn dọc */
  object-fit: cover; object-position: 50% 30%; /* cắt bớt phần chân, giữ mặt */
  border-radius: var(--radius);
}
/* Trộn cỡ ảnh, 9 tấm: ảnh đầu lớn, các ảnh còn lại xếp cặp.
   Điện thoại (2 cột): [ A A ] [ B C ] [ D E ] [ F G ] [ H I ] */
.featured__grid img:first-child { grid-column: 1 / -1; aspect-ratio: 1 / 1; object-position: 50% 30%; }
/* Máy tính (3 cột) — ảnh lớn so le hai góc: [ A A B ] [ A A C ] [ D E F ] [ G H H ] [ I H H ] */
@media (min-width: 900px) {
  .featured__grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .featured__grid img:first-child { grid-column: 1 / 3; grid-row: 1 / 3; aspect-ratio: auto; }
  .featured__grid img:nth-child(8):nth-last-child(2) { grid-column: 2 / 4; grid-row: 4 / 6; aspect-ratio: auto; }
}

.zoomable { cursor: zoom-in; transition: opacity .25s; }
.zoomable:hover { opacity: .92; }

/* Nút "Xem tất cả ảnh" dưới lưới — mở màn xem ảnh lớn với toàn bộ album */
.featured__more { margin: 2.5rem auto 0; gap: .5rem; letter-spacing: .08em; }

/* ---------- Cuối trang: ảnh cổng thứ hai ---------- */
.closing { display: grid; background: var(--ink); color: var(--bg); }
/* Điện thoại (chữ nằm dưới ảnh): hiện TRỌN ảnh đúng tỉ lệ gốc 2:3 — không cắt váy, đầu không sát mép.
   Ảnh hoà vào nền trang bằng 3 lớp mặt nạ nhân với nhau: đáy mờ dần (chỉ 12% cuối, không ăn vào váy) ·
   mép trên mờ nhẹ · mép TRÁI mờ nhẹ (bên trái chỉ có phông xám, sáng hơn nền trang → không lộ khối ảnh).
   Mép PHẢI không mờ: vai chú rể chạm tới sát mép ảnh. */
.closing__media img {
  width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 50%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 88%, transparent), linear-gradient(to right, transparent, #000 12%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 88%, transparent), linear-gradient(to right, transparent, #000 12%);
  mask-composite: intersect;
}
.closing__content { padding: 1.5rem 16px 4rem; text-align: center; align-self: center; }
.closing__content { color: #f3e9da; } /* chữ màu kem trên nền tối */
.closing__thanks { margin: 0; text-wrap: balance; }
/* ── ♥ ── : 2 vạch mảnh + trái tim nhỏ ở giữa */
.closing__divider {
  display: flex; align-items: center; justify-content: center; gap: 1.1rem;
  margin: 1rem 0 1.1rem;
}
.closing__divider::before, .closing__divider::after { content: ""; width: clamp(48px, 12vw, 84px); height: 1px; background: currentColor; opacity: .8; }
.closing__divider > i {
  width: 15px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.2 10.6 20C5.4 15.3 2 12.2 2 8.4 2 5.3 4.4 3 7.4 3c1.7 0 3.4.8 4.6 2.1C13.2 3.8 14.9 3 16.6 3 19.6 3 22 5.3 22 8.4c0 3.8-3.4 6.9-8.6 11.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.2 10.6 20C5.4 15.3 2 12.2 2 8.4 2 5.3 4.4 3 7.4 3c1.7 0 3.4.8 4.6 2.1C13.2 3.8 14.9 3 16.6 3 19.6 3 22 5.3 22 8.4c0 3.8-3.4 6.9-8.6 11.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.closing__names { margin: 0; font: 400 var(--fs-h2)/1.3 var(--serif); white-space: pre-line; }
@media (min-width: 900px) {
  .closing { grid-template-columns: 1fr 1fr; }
  .closing__media img {
    height: 100%; aspect-ratio: auto; max-height: 90vh; object-position: 50% 20%;
    -webkit-mask-composite: source-over; mask-composite: add; /* máy tính: 2 lớp CỘNG lại (khác điện thoại) */
    /* máy tính: chữ nằm bên phải ảnh → mờ dần mép phải như cũ, NHƯNG vai chú rể chạm tới ~98% bề ngang ảnh.
       2 lớp mặt nạ cộng lại: lớp 1 mờ mép phải (phần nền phía trên) · lớp 2 hiện đủ phần từ ngang vai trở xuống
       (nền ảnh sát mép phải ở phần dưới vốn đã tối gần bằng nền trang nên không lộ đường ghép) */
    -webkit-mask-image: linear-gradient(to right, #000 72%, transparent), linear-gradient(to bottom, transparent 8%, #000 26%);
    mask-image: linear-gradient(to right, #000 72%, transparent), linear-gradient(to bottom, transparent 8%, #000 26%);
  }
  .closing__content { padding: 4rem 3rem; }
}

/* ---------- Xem ảnh lớn: viên số thứ tự · ảnh lớn · nút tròn · dải ảnh nhỏ ---------- */
.lightbox {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #0f0d0c; /* nền đặc: không lộ trang phía sau */
  color: #fff;
}
.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px max(14px, env(safe-area-inset-bottom));
}
.lightbox::backdrop { background: rgba(15, 13, 12, .7); }
.lightbox__counter {
  justify-self: center;
  margin: 0; padding: .4rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  font-size: var(--fs-sm); font-weight: 500; letter-spacing: var(--ls-button);
  font-variant-numeric: tabular-nums;
}
.lightbox__stage { display: grid; place-items: center; min-height: 0; }
/* Giới hạn theo chiều cao màn hình (trừ viên số thứ tự + dải ảnh nhỏ): % theo ô lưới không có tác dụng */
.lightbox__img {
  max-width: 100%; max-height: calc(100dvh - 190px); width: auto; height: auto;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  user-select: none;
  transition: opacity .25s ease;
}
.lightbox__img.is-loading { opacity: .35; }
/* Nút tròn trắng hai bên, mũi tên đậm */
.lightbox__nav {
  position: absolute; top: 50%; z-index: 1;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  transform: translateY(-50%);
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.lightbox__nav:hover, .lightbox__nav:focus-visible { background: #fff; transform: translateY(-50%) scale(1.06); }
.lightbox__prev { left: max(16px, 2vw); }
.lightbox__next { right: max(16px, 2vw); }
.lightbox__close {
  position: absolute; top: 10px; right: 12px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%;
  background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer;
}
.lightbox__close:hover, .lightbox__close:focus-visible { background: #fff; color: var(--ink); }
/* Dải ảnh nhỏ: khung bo tròn, ảnh đang xem sáng + viền trắng, ảnh khác mờ */
.lightbox__thumbs {
  justify-self: center;
  display: flex; gap: 8px;
  max-width: min(100%, 760px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.lightbox__thumbs::-webkit-scrollbar { display: none; }
.lightbox__thumb {
  flex: 0 0 auto;
  width: 56px; height: 56px; padding: 0;
  border: 0; border-radius: 10px; overflow: hidden;
  background: rgba(255, 255, 255, .08);
  opacity: .5; cursor: pointer;
  scroll-snap-align: center;
  transition: opacity .2s, box-shadow .2s;
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover { opacity: .85; }
.lightbox__thumb.is-active { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.lightbox--single .lightbox__nav, .lightbox--single .lightbox__thumbs, .lightbox--single .lightbox__counter { display: none; }
@media (max-width: 600px) {
  .lightbox__nav { width: 44px; height: 44px; background: rgba(255, 255, 255, .85); }
  .lightbox__prev { left: 8px; } .lightbox__next { right: 8px; }
  .lightbox__thumb { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .zoomable, .lightbox__img, .lightbox__nav, .lightbox__thumb { transition: none; }
}
