/* Thiệp cưới Duy Ngọc & Thùy Dung — tokens and components from the design canvas */

:root {
  --tim: #D283AE;          /* accent purple */
  --tim-dam: #B5628F;      /* hover / focus */
  --muc: #5E2F48;          /* ink */
  --muc-phu: #8A5872;      /* secondary text */
  --vien: #DDA3C2;         /* input border */
  --vien-nhat: #EBC3D7;    /* dividers */
  --vien-the: #F2D5E4;     /* card border */
  --gach: #DBA4C1;         /* short rule, dashed */
  --nen-chon: #FBEFF5;     /* selected / tile */
  --giay: #FFFEFB;         /* paper */
  --nen-thiep: #FAF9F4;    /* card background */
  --nen-trang: #EEEBE3;    /* page background */
  --loi: #8E2A44;
  --loi-nen: #FCEEF1;
  --loi-vien: #D08FA2;

  /* Phông giống thiệp mẫu: tên và số dùng serif nét tương phản cao, chữ thường dùng serif kiểu Times */
  --f-serif: 'Noto Serif Display', 'Times New Roman', serif;
  --f-script: 'Noto Serif Display', 'Times New Roman', serif;
  --f-sans: 'Tinos', 'Times New Roman', Times, serif;

  --bong: drop-shadow(0 18px 28px rgba(110, 50, 82, 0.18));
  --tim-nen: #D283AE;     /* nền tím của các phần được bọc (đã nhạt hơn #D283AE) */
  --rong-thiep: 662px;     /* bề rộng cột thiệp trên màn hình lớn (trước đây 480px) */
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--nen-trang);
  color: var(--muc);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
p, h1, h2, h3, dl, dd, ul { margin: 0; }
[hidden] { display: none !important; }

a { color: var(--tim); }
a:hover { color: var(--tim-dam); }
input::placeholder, textarea::placeholder { color: #9A6A83; opacity: 1; }
input:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--tim-dam);
  outline-offset: 2px;
}
.lua-chon:focus-within { outline: 2px solid var(--tim-dam); outline-offset: 2px; }

.an-di {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.trang-tri { position: absolute; pointer-events: none; }

/* ---------- shared type ---------- */
.tieu-de {
  font-family: var(--f-serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: 0.14em;
  color: var(--muc);
}
.nhan {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muc);
}
.nhan--phu { color: var(--muc-phu); }
.mo-ta {
  max-width: 290px;
  margin: 8px auto 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muc-phu);
}
.gach-ngan { width: 40px; height: 1px; margin: 0 auto 20px; background: var(--gach); }
.duong-ke { width: 100%; height: 1px; background: var(--vien-nhat); }
.duong-ke--thiep { margin: 28px 0; }
.duong-ke--su-kien { margin: 24px 0; }

/* ---------- buttons ---------- */
.nut {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 26px;
  border: 0;
  border-radius: 27px;
  background: var(--nut-bg, var(--muc));
  color: var(--nut-fg, #FFFFFF);
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.nut:hover { color: var(--nut-fg, #FFFFFF); filter: brightness(0.94); }
.nut[disabled] { cursor: progress; opacity: 0.8; }
.nut--vua { display: inline-flex; width: auto; min-width: 220px; }
.nut svg { flex: none; }

.nut-vien {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--vien);
  border-radius: 22px;
  background: var(--giay);
  color: var(--muc);
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.nut-vien[disabled] { cursor: not-allowed; opacity: 0.6; }

.quay {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 35%, transparent);
  border-top-color: currentColor;
  animation: quay 0.8s linear infinite;
}
@keyframes quay { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .quay { animation-duration: 2.4s; } }

/* ============================================================
   1 · Mở thiệp (cover)
   ============================================================ */
.bia {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;   /* theo chiều cao thật khi thanh địa chỉ điện thoại co lại, không hở dải nền dưới */
  padding: clamp(24px, 3vw, 40px) 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bia { position: relative; overflow: hidden; }
.bia__khung { position: relative; z-index: 1; width: 100%; max-width: 520px; min-height: 480px; display: flex; box-shadow: 0 18px 28px rgba(110, 50, 82, 0.18); border-radius: 14px; }
.bia__the {
  position: relative;
  flex: 1;
  overflow: hidden;
  padding: 44px 24px 52px;
  background: var(--giay);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.bia__hoa-tren { left: 0; top: 0; width: 150px; height: 190px; }
.bia__hoa-duoi { right: 0; bottom: 0; width: 170px; height: 144px; }
.bia__tim {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--tim);
  display: flex; align-items: center; justify-content: center;
}
.bia__ten {
  position: relative;
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.25;
  color: var(--tim);
}
.bia__va { font-family: var(--f-serif); font-size: 22px; line-height: 1.4; }
.bia__chia {
  position: relative;
  margin: 18px 0 0;
  display: flex; align-items: center; gap: 12px;
  color: var(--tim);
}
.bia__chia span { width: 60px; height: 1px; background: var(--vien-nhat); }
.bia__ngay, .bia__moi {
  position: relative;
  font-family: var(--f-serif);
  font-size: 20px;
  line-height: 1.4;
}
.bia__ngay { margin: 12px 0 0; color: var(--muc); }
.bia__moi { margin: 22px 0 0; color: var(--muc-phu); }
.bia__mo {
  position: relative;
  margin: 24px 0 0;
  min-height: 52px;
  padding: 0 40px;
  border: 0;
  border-radius: 28px;
  background: var(--tim);
  color: #FFFFFF;
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 19px;
  cursor: pointer;
}
.bia__mo:hover { background: var(--tim-dam); }

/* Ánh sáng phía sau thẻ: các quầng sáng trôi chậm và những tia sáng xoay nhẹ, tạo chiều sâu */
.anh-sang { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.anh-sang::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 1200px; height: 1200px;
  margin: -600px 0 0 -600px;
  will-change: transform;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 9deg, rgba(255, 255, 255, 0.7) 14deg, rgba(255, 255, 255, 0) 19deg 30deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.5) 35%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.5) 35%, transparent 62%);
  animation: tia 70s linear infinite, tia-nhap 6s ease-in-out infinite alternate;
}
.anh-sang i {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--a) 0%, var(--b) 42%, rgba(255, 255, 255, 0) 72%);
  animation: sang var(--t) ease-in-out var(--d) infinite alternate;
}
.anh-sang i:nth-child(1) { --a: rgba(255, 255, 255, 1); --b: rgba(240, 190, 214, 0.75); --mx: 50px; --my: -30px; --t: 10s; --d: 0s;
  left: 50%; top: 50%; width: 980px; height: 980px; margin: -490px 0 0 -490px; }
.anh-sang i:nth-child(2) { --a: rgba(255, 214, 236, 0.95); --b: rgba(236, 176, 214, 0.6); --mx: 150px; --my: 90px; --t: 13s; --d: -3s;
  left: 2%; top: 6%; width: 520px; height: 520px; }
.anh-sang i:nth-child(3) { --a: rgba(236, 180, 210, 0.95); --b: rgba(214, 140, 180, 0.6); --mx: -170px; --my: -110px; --t: 15s; --d: -7s;
  right: 0; bottom: 0; width: 580px; height: 580px; }
.anh-sang i:nth-child(4) { --a: rgba(255, 214, 228, 0.95); --b: rgba(236, 170, 200, 0.55); --mx: -120px; --my: 140px; --t: 11s; --d: -2s;
  right: 10%; top: 0; width: 360px; height: 360px; }
@keyframes sang {
  0%   { transform: translate3d(0, 0, 0) scale(0.8); opacity: 0.45; }
  50%  { transform: translate3d(var(--mx), var(--my), 0) scale(1.2); opacity: 1; }
  100% { transform: translate3d(calc(var(--mx) * -0.7), calc(var(--my) * -0.8), 0) scale(0.95); opacity: 0.7; }
}
@keyframes tia { to { transform: rotate(360deg); } }
@keyframes tia-nhap { from { opacity: 0.35; } to { opacity: 0.85; } }

/* Màn bên trong: nền cố định theo màn hình, thiệp cuộn phía trên */
.anh-sang.anh-sang--co-dinh, .hoa-roi.hoa-roi--co-dinh { position: fixed; }  /* ghép 2 class để thắng .hoa-roi / .anh-sang đứng sau */

/* Hoa cẩm tú cầu rơi: lớp sau thẻ (xa, nhỏ) và lớp trước thẻ (gần, lớn, mờ hơn) */
.hoa-roi { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hoa-roi--sau { z-index: 0; }
.hoa-roi--truoc { z-index: 2; }
.hoa-roi i {
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--s);
  opacity: var(--o);
  will-change: transform;
  animation: roi var(--t) linear var(--d) infinite;
}
.hoa-roi i::after { content: ""; position: absolute; inset: -8px; }   /* vùng bấm rộng hơn bông hoa */
.hoa-roi .no { position: absolute; display: block; pointer-events: none; will-change: transform, opacity; }
.hoa-roi .no.vong { border: 1.5px solid rgba(214, 140, 180, 0.9); border-radius: 50%; box-shadow: 0 0 10px rgba(240, 190, 214, 0.8); }
.hoa-roi .no svg { display: block; width: 100%; height: 100%; }
.hoa-roi img {
  display: block; width: 100%; height: auto;
  }
@keyframes roi {
  0%   { transform: translate3d(0, -60px, 0) rotate(0deg); }
  25%  { transform: translate3d(var(--dx), 28svh, 0) rotate(90deg); }
  50%  { transform: translate3d(calc(var(--dx) * -0.4), 56svh, 0) rotate(190deg); }
  75%  { transform: translate3d(var(--dx), 84svh, 0) rotate(280deg); }
  100% { transform: translate3d(0, calc(100lvh + 60px), 0) rotate(360deg); }
}
/* Bản nhẹ cho điện thoại / máy yếu: bỏ tia xoay và bớt quầng sáng */
.nhe .anh-sang::before { display: none; }
.nhe .anh-sang i:nth-child(3), .nhe .anh-sang i:nth-child(4) { display: none; }
.nhe .anh-sang i:nth-child(1) { width: 640px; height: 640px; margin: -320px 0 0 -320px; }
/* Tab đang ẩn: dừng mọi chuyển động */
.tam-dung .hoa-roi i, .tam-dung .anh-sang i, .tam-dung .anh-sang::before { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .hoa-roi { display: none; }
  .anh-sang i, .anh-sang::before { animation: none; }
}

@media (max-width: 600px) {
  .bia { padding: 0 20px; }
  .bia__khung { min-height: 620px; }
  .bia__the { padding: 62px 20px 64px; }
  .bia__hoa-tren { width: 130px; height: 164px; }
  .bia__hoa-duoi { width: 150px; height: 127px; }
  .bia__tim { width: 64px; height: 64px; }
  .bia__tim svg { width: 30px; height: 30px; }
  .bia__ten { font-size: 46px; }
  .bia__va { font-size: 22px; }
  .bia__ngay, .bia__moi { font-size: 20px; }
  .bia__mo { font-size: 18px; }
}

/* ============================================================
   Thiệp đầy đủ (single column, shared by desktop and phone)
   ============================================================ */
.trang { padding: clamp(0px, 3vw, 40px) 0; }
.thiep {
  position: relative;
  max-width: var(--rong-thiep);
  margin: 0 auto;
  container-type: inline-size;   /* để các phần theo bề rộng thiệp dùng đơn vị cqw */
  overflow: hidden;
  background: var(--nen-thiep);
  z-index: 1;
  box-shadow: 0 12px 30px rgba(110, 50, 82, 0.18);
}
.thiep:focus, .cam-on:focus { outline: none; }  /* focus chỉ để đặt vị trí cho trình đọc màn hình, không phải ô nhập */
.thiep.vua-mo { animation: hien 0.6s ease-out; }
@keyframes hien { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { .thiep.vua-mo { animation: none; } }

.muc { position: relative; overflow: hidden; padding: 44px 24px; text-align: center; }
.su-kien { position: relative; overflow: hidden; }
.loi-moi, .su-kien, .su-kien__the { text-align: center; }
.xac-nhan { position: relative; }
.nut-vien[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
.nut-vien { text-decoration: none; }
.nut-vien:hover { color: var(--muc); }

/* ---- Màn thiệp mời cưới ----
   Nền hoa cẩm tú cầu gồm hai mảnh: hoa trên neo trên cùng, hoa dưới neo dưới cùng, nên màn cao bao nhiêu cũng khớp.
   "multiply" biến nền trắng của ảnh thành màu giấy của thiệp. */
.bia-thiep {
  position: relative; overflow: hidden; text-align: center;
  padding: 29cqw 20px 40cqw;
  background-color: var(--nen-thiep);
  background-image: url("img/nen-bia-tren.webp"), url("img/nen-bia-duoi.webp");
  background-position: top center, bottom center;
  background-size: 100% auto, 100% auto;
  background-repeat: no-repeat;
  background-blend-mode: multiply, multiply;
}
.bia-thiep__nho { font-family: var(--f-serif); font-size: 13px; letter-spacing: 0.14em; color: var(--muc); }
.bia-thiep__san { position: relative; width: 100%; aspect-ratio: 592 / 560; margin-top: 5cqw; }
.bia-thiep__anh {
  position: absolute; margin: 0;
  width: 33.4%; aspect-ratio: 198 / 305;
  border: 4px solid #D283AE;
  background: var(--giay);
  box-shadow: 0 10px 22px rgba(110, 50, 82, 0.25);
  transform: translate(-50%, -50%) rotate(var(--g));
}
.bia-thiep__anh img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bia-thiep__anh--1 { left: 34%; top: 35.4%; --g: -16deg; }
.bia-thiep__anh--2 { left: 68.1%; top: 66.1%; --g: 13deg; }
.bia-thiep__anh--1 img { object-position: 50% 20%; }
.bia-thiep__ten { position: absolute; margin: 0; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bia-thiep__ten span { font-family: var(--f-serif); font-size: clamp(11px, 2.3cqw, 14px); color: var(--muc-phu); }
.bia-thiep__ten b { font-family: var(--f-serif); font-weight: 400; font-size: clamp(16px, 4cqw, 26px); letter-spacing: 0.04em; color: var(--tim); white-space: nowrap; }
.bia-thiep__ten--dau { left: 71%; top: 18%; }
.bia-thiep__ten--re { left: 28%; top: 73.2%; }
.bia-thiep .nhan { margin: 4cqw 0 0; color: var(--muc-phu); }
.bia-thiep__cap-doi {
  margin: 12px 0 0;
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--f-serif); font-weight: 500; font-size: 38px; line-height: 1.16; color: var(--muc);
}
.bia-thiep__cap-doi em { font-size: 30px; color: var(--tim); }
.bia-thiep__ngay { margin: 14px 0 0; font-size: 13px; font-weight: 500; letter-spacing: 0.24em; }

/* ---- Lời mời ---- */
.loi-moi { padding: 40px 18px 44px; display: flex; flex-direction: column; align-items: center; }
.nhan-cuoi { width: 100%; display: flex; align-items: center; gap: 16px; }
.nhan-cuoi > span { flex: 1; height: 1px; background: var(--vien-nhat); }
.nhan-cuoi img { flex: none; filter: drop-shadow(0 10px 12px rgba(110, 50, 82, 0.22)); }
.nhan-cuoi-hang { padding: 0 28px 26px; }
.nhan-cuoi-hang .nhan-cuoi img { width: 124px; height: 160px; }
.loi-moi__chu {
  margin: 16px 0 0;
  max-width: 300px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.9;
}
.loi-moi__doi { margin: 22px 0 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.loi-moi__ten { font-family: var(--f-script); font-size: 42px; line-height: 1.25; color: var(--tim); }
.loi-moi__va { margin: 2px 0 0; font-family: var(--f-script); font-size: 34px; line-height: 1.2; color: var(--tim); }
.hai-ho { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hai-ho > div { display: flex; flex-direction: column; gap: 8px; }
.hai-ho h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; color: var(--tim); }
.hai-ho__cha-me { font-size: 12px; font-weight: 500; letter-spacing: 0.05em; line-height: 1.8; }
.hai-ho__dia-chi { font-size: 12.5px; line-height: 1.6; color: var(--muc-phu); }

/* ---- Album (coverflow) ---- */
.album { padding: 44px 0; }
.album__san {
  position: relative;
  height: 320px;
  margin: 22px 0 0;
  touch-action: pan-y;   /* vuốt ngang để đổi ảnh, vuốt dọc vẫn cuộn trang */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.album__san.dang-keo { cursor: grabbing; }
.album__anh {
  position: absolute;
  left: 50%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: top 0.4s ease, width 0.4s ease, height 0.4s ease, margin-left 0.4s ease, opacity 0.4s ease;
}
.album__anh img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; -webkit-user-drag: none; }
.album__anh[data-vi="-2"], .album__anh[data-vi="2"] { top: 60px; width: 110px; height: 200px; border-radius: 12px; opacity: 0.35; z-index: 1; }
.album__anh[data-vi="-1"], .album__anh[data-vi="1"] { top: 30px; width: 150px; height: 260px; border-radius: 14px; opacity: 0.6; z-index: 2; }
.album__anh[data-vi="-2"] { margin-left: -204px; }
.album__anh[data-vi="-1"] { margin-left: -170px; }
.album__anh[data-vi="0"] {
  top: 0; width: 216px; height: 320px; margin-left: -108px;
  border-radius: 18px; opacity: 1; z-index: 3; cursor: inherit;
  filter: drop-shadow(0 12px 18px rgba(110, 50, 82, 0.25));
}
.album__anh[data-vi="1"] { margin-left: 20px; }
.album__anh[data-vi="2"] { margin-left: 94px; }
@media (prefers-reduced-motion: reduce) { .album__anh { transition: none; } }
.album__cham { margin: 16px 0 0; display: flex; justify-content: center; gap: 2px; }
.album__cham button {
  width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.album__cham button::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--vien-nhat);
}
.album__cham button[aria-current="true"]::before { background: var(--muc); }

/* ---- Thông tin tiệc cưới ---- */
.su-kien { padding: 44px 20px; }
.the-hoa { position: relative; margin: 122px 0 0; }
.the-hoa__hoa { right: -20px; bottom: 100%; margin-bottom: -6px; width: 150px; height: 127px; }
.su-kien__the {
  position: relative;
  padding: 30px 22px 28px;
  background: var(--giay);
  border: 1px solid var(--vien-the);
  border-radius: 18px;
  display: flex; flex-direction: column; align-items: center;
}
.su-kien__gio {
  margin: 8px 0 0;
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: var(--tim);
}
.su-kien__ngay { margin: 12px 0 0; display: flex; align-items: center; gap: 14px; font-family: var(--f-serif); }
.su-kien__so { font-weight: 700; font-size: 68px; line-height: 1; }
.su-kien__thang {
  display: flex; flex-direction: column; align-items: flex-start;
  font-weight: 500; font-size: 20px; line-height: 1.35; letter-spacing: 0.06em;
}
.su-kien__am-lich { margin: 10px 0 0; font-size: 13px; font-style: italic; }

.dem-nguoc { margin: 22px 0 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dem-nguoc__o { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dem-nguoc__o > div {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 0 8px; background: var(--nen-chon); border-radius: 12px;
}
.dem-nguoc__so {
  font-family: var(--f-serif); font-weight: 600; font-size: 28px; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.dem-nguoc__don-vi { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; color: var(--muc-phu); }

.lich-trinh { margin: 22px 0 0; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lich-trinh p {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.06em;
}
.lich-trinh span { display: flex; color: var(--tim); }

.lich {
  margin: 22px 0 0; width: 100%; padding: 14px 12px;
  border: 1px solid var(--vien-nhat); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.lich__thang { font-family: var(--f-serif); font-weight: 600; font-size: 15px; }
.lich__luoi { width: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; justify-items: center; }
.lich__thu {
  height: 28px; display: flex; align-items: center;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--muc-phu);
}
.lich__ngay {
  position: relative; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muc-phu);
}
.lich__ngay--cuoi { color: #FFFFFF; font-size: 12.5px; font-weight: 600; }
.lich__ngay--cuoi svg { position: absolute; left: -4px; top: -3px; }
.lich__ngay--cuoi span { position: relative; }

.su-kien__noi {
  margin: 8px 0 0; font-family: var(--f-serif); font-weight: 500;
  font-size: 21px; line-height: 1.35; letter-spacing: 0.03em; color: var(--tim);
}
.su-kien__dia-chi { margin: 6px 0 0; font-size: 12.5px; font-weight: 500; letter-spacing: 0.08em; }
.su-kien__sanh { margin: 4px 0 0; font-size: 13px; color: var(--muc-phu); }

.ban-do { margin: 18px 0 0; width: 100%; border: 1px solid var(--vien-nhat); border-radius: 14px; overflow: hidden; text-align: left; }
.ban-do__dau { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--giay); }
.ban-do__dau p:first-child { font-size: 14px; font-weight: 600; }
.ban-do__dau p + p { font-size: 12.5px; color: var(--muc-phu); }
.ban-do__dau a { margin: 2px 0 0; font-size: 13px; font-weight: 600; }
.ban-do__khung { display: block; width: 100%; height: 160px; border: 0; border-top: 1px solid var(--vien-nhat); }
.su-kien .nut { margin-top: 22px; }

/* Placeholder box (things still to fill in) */
.cho-trong {
  flex: none;
  background: var(--nen-chon);
  border: 1.5px dashed var(--gach);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 12px;
  color: var(--muc-phu);
  font-size: 13px; line-height: 1.4; text-align: center;
}

/* ---- Xác nhận tham dự ---- */
.xac-nhan { padding: 0 0 48px; }
.xac-nhan__dau { padding: 44px 24px 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.xac-nhan__hoi {
  font-family: var(--f-serif); font-style: italic; font-weight: 500;
  font-size: 26px; line-height: 1.3; color: var(--tim);
}
.xac-nhan__dau .tieu-de { margin: 6px 0 0; }
.xac-nhan__dau .mo-ta { margin: 10px 0 0; }

.bieu-mau { margin: 28px 0 0; padding: 0 24px; display: flex; flex-direction: column; gap: 24px; }
.bieu-mau__truong { display: flex; flex-direction: column; gap: 24px; transition: opacity 0.2s; }
.bieu-mau[aria-busy="true"] .bieu-mau__truong { opacity: 0.6; }
.o-nhap { display: flex; flex-direction: column; gap: 8px; }
.o-nhap > label, .nhom legend { font-size: 14px; font-weight: 600; color: var(--muc); }
.phu { font-weight: 400; color: var(--muc-phu); }
.o-nhap input, .o-nhap textarea {
  width: 100%;
  border: 1px solid var(--vien);
  border-radius: 12px;
  background: var(--giay);
  color: var(--muc);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.5;
}
.o-nhap input { height: 52px; padding: 0 16px; }
.o-nhap textarea { height: 112px; padding: 12px 16px; resize: none; }
.o-nhap input[aria-invalid="true"] { border: 2px solid var(--loi); }

.nhom { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.nhom legend { padding: 0; margin: 0 0 8px; }
.nhom__cot { display: flex; flex-direction: column; gap: 10px; }
.nhom__doi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nhom__so { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.nhom[aria-invalid="true"] .lua-chon { border-color: var(--loi); }
.bao-loi { font-size: 13.5px; font-weight: 500; color: var(--loi); }

.lua-chon {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--vien);
  background: var(--giay);
  font-size: 15px;
  font-weight: 400;
  color: var(--muc);
  cursor: pointer;
}
.lua-chon input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.lua-chon__nut {
  width: 20px; height: 20px; flex: none;
  border-radius: 50%; border: 1.5px solid var(--vien);
  display: flex; align-items: center; justify-content: center;
}
.lua-chon__nut::after { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.lua-chon:has(input:checked) {
  border: 2px solid var(--tim);
  background: var(--nen-chon);
  font-weight: 600;
  padding: 0 15px;
}
.lua-chon:has(input:checked) .lua-chon__nut { border-color: var(--tim); }
.lua-chon:has(input:checked) .lua-chon__nut::after { background: var(--tim); }

.lua-chon--so { justify-content: center; height: 48px; min-height: 0; padding: 0; font-size: 16px; font-weight: 500; }
.lua-chon--so:has(input:checked) { background: var(--tim); color: #FFFFFF; padding: 0; }

.bieu-mau__trang-thai { margin: -8px 0 0; text-align: center; font-size: 13.5px; line-height: 1.55; color: var(--muc-phu); }

.thong-bao-loi {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--loi-vien); border-radius: 12px;
  background: var(--loi-nen); color: var(--loi);
}
.thong-bao-loi svg { flex: none; margin-top: 1px; }
.thong-bao-loi div { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.thong-bao-loi p:first-child { font-size: 15px; font-weight: 600; }
.thong-bao-loi p + p { font-size: 14px; line-height: 1.55; color: var(--muc); }

/* Success */
.cam-on { padding: 20px 24px 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cam-on__dau {
  width: 56px; height: 56px; border: 1.5px solid var(--tim); border-radius: 50%; color: var(--tim);
  display: flex; align-items: center; justify-content: center;
}
.cam-on h3 {
  margin: 18px 0 0; font-family: var(--f-serif); font-style: italic; font-weight: 500;
  font-size: 38px; line-height: 1.25; color: var(--tim);
}
.cam-on__nhan { margin: 8px 0 0; font-size: 15.5px; line-height: 1.6; }
.cam-on dl {
  margin: 26px 0 0; width: 100%; padding: 6px 20px;
  background: var(--giay); border: 1px solid var(--vien-the); border-radius: 16px;
  display: flex; flex-direction: column; text-align: left;
}
.cam-on dl div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: 14.5px; }
.cam-on dl div + div { border-top: 1px solid var(--nen-chon); }
.cam-on dt { color: var(--muc-phu); }
.cam-on dd { font-weight: 600; text-align: right; }
.cam-on .mo-ta { max-width: 300px; margin: 24px 0 0; }
.cam-on .nut { margin-top: 22px; }
.nut-chu {
  margin: 6px 0 0; min-height: 48px; padding: 0 16px; border: 0; background: none;
  display: inline-flex; align-items: center;
  font-family: var(--f-sans); font-size: 15px; font-weight: 600; color: var(--tim);
  text-decoration: underline; cursor: pointer;
}
.nut-chu:hover { color: var(--tim-dam); }

/* ---- Sổ lưu bút ---- */
.luu-but .the-hoa { margin: 112px 0 0; }
.luu-but .the-hoa__hoa { left: -24px; right: auto; width: 140px; height: 118px; transform: scaleX(-1); }
.luu-but ul { position: relative; list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.luu-but li {
  padding: 14px 16px;
  background: var(--giay);
  border: 1px solid var(--vien-nhat);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 6px;
  text-align: left;
}
.luu-but__dau { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.luu-but__ten { font-family: var(--f-serif); font-weight: 700; font-size: 15px; }
.luu-but__luc { flex: none; font-size: 12px; color: var(--muc-phu); }
.luu-but li p { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.luu-but .nut { margin-top: 22px; }

/* ---- Hộp quà mừng ---- */
.qua-mung { min-height: 520px; }
.qua-mung .mo-ta { max-width: 300px; }
.phong-bi { margin: 28px 0 0; display: flex; justify-content: center; gap: 22px; }
.phong-bi button {
  width: 136px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--f-sans);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.phong-bi__hinh {
  position: relative; display: block; width: 132px; height: 202px;
  filter: drop-shadow(0 10px 14px rgba(110, 50, 82, 0.22));
  transition: transform 0.25s ease;
}
.phong-bi button:first-child .phong-bi__hinh { transform: rotate(-6deg); }
.phong-bi button:last-child .phong-bi__hinh { transform: rotate(6deg); }
.phong-bi button:hover .phong-bi__hinh { transform: rotate(0) translateY(-4px); }
.phong-bi__hinh::before {
  content: ""; position: absolute; inset: 3px;
  background: var(--giay); border: 1px solid var(--vien-the);
}
.phong-bi__hinh img { position: relative; width: 132px; height: 202px; }
.phong-bi__nhan { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; color: var(--muc); }
.qua-mung__goi-y { margin: 14px 0 0; font-size: 13px; color: var(--muc-phu); }

.hop-qua {
  width: calc(100% - 32px);
  max-width: 400px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--giay);
  color: var(--muc);
}
.hop-qua::backdrop { background: rgba(70, 30, 52, 0.5); }
.hop-qua__dau {
  position: relative; padding: 14px 52px;
  background: var(--muc); color: #FFFFFF; text-align: center;
  font-family: var(--f-serif); font-weight: 700; font-size: 17px; letter-spacing: 0.12em;
}
.hop-qua__dong {
  position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; padding: 0;
  border: 0; background: none; color: #FFFFFF; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.hop-qua__than { padding: 20px 14px 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hop-qua__nguoi { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.hop-qua__ten { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.hop-qua__qr { width: 124px; height: 124px; border-radius: 12px; }
.hop-qua__ngan-hang { margin: 4px 0 0; font-size: 12px; color: var(--muc-phu); }
.hop-qua__stk { font-size: 12.5px; font-weight: 500; letter-spacing: 0.06em; }
.hop-qua__chu-tk { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.hop-qua .nut-vien { margin: 4px 0 0; }

/* ---- Chân thiệp ---- */
.chan-thiep {
  position: relative; overflow: hidden; height: max(470px, 97.9cqw);
  padding: 36px 28px 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.chan-thiep__hoa { left: 0; bottom: 0; width: 100%; height: auto; }
.chan-thiep .nhan-cuoi { position: relative; }
.chan-thiep .nhan-cuoi img { width: 84px; height: 101px; }
.chan-thiep__loi {
  position: relative; margin: 14px 0 0;
  font-family: var(--f-serif); font-style: italic; font-weight: 500;
  font-size: 24px; line-height: 1.4; color: var(--tim);
}
.chan-thiep .nhan { position: relative; margin: 8px 0 0; }



/* ============================================================
   Khung tím bọc phần thông tin (từ "Trân trọng kính mời")
   Chữ trên nền tím là trắng; các "tờ giấy" bên trong (thẻ tiệc, lịch, ô nhập, lời chúc…) giữ nền sáng, chữ tối.
   ============================================================ */
.vien-tim {
  --muc: #FFFFFF; --muc-phu: #FDF3F8; --tim: #FFFFFF;
  --nut-bg: #FFFFFF; --nut-fg: #B5628F;
  position: relative;
  margin: 0 15cqw 36px;            /* cách rìa thiệp 15% mỗi bên */
  border-radius: 32px;
  background: var(--tim-nen);
  color: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(110, 50, 82, 0.28);
}
@container (max-width: 560px) {    /* điện thoại: 15% quá hẹp để đặt form và lịch, nên chỉ chừa 14px */
  .vien-tim { margin-inline: 14px; border-radius: 26px; }
}
.vien-tim .muc { padding-inline: 18px; }
.vien-tim .bieu-mau, .vien-tim .xac-nhan__dau { padding-inline: 18px; }
.vien-tim .duong-ke { background: rgba(255, 255, 255, 0.35); }
.vien-tim .gach-ngan { background: rgba(255, 255, 255, 0.6); }
.vien-tim .hai-ho h3 { color: #FDF3F8; }
.vien-tim .bao-loi { color: #FFD6E0; }
.vien-tim .o-nhap input[aria-invalid="true"], .vien-tim .nhom[aria-invalid="true"] .lua-chon { border-color: #FFC2D1; }
.vien-tim .nut-chu { text-decoration: underline; }
.vien-tim :is(input, textarea, a, button):focus-visible, .vien-tim .lua-chon:focus-within { outline-color: #FFFFFF; }

/* Các tờ giấy sáng màu: trả biến màu về chữ tối */
.vien-tim :is(.luu-but li, .o-nhap input, .o-nhap textarea, .lua-chon, .cam-on dl) {
  --muc: #5E2F48; --muc-phu: #8A5872; --tim: #D283AE;
  --nut-bg: #5E2F48; --nut-fg: #FFFFFF;
  color: var(--muc);
}
.vien-tim .thong-bao-loi { --muc: #5E2F48; --muc-phu: #8A5872; --tim: #D283AE; }
.vien-tim .lua-chon--so:has(input:checked) { background: #5E2F48; border-color: #5E2F48; color: #FFFFFF; }

.bia-thiep + .vien-tim { margin-top: 28px; }

/* ---- Nhẫn cưới làm đường phân chia giữa hai họ và album ---- */
.nhan-cuoi-hang { padding: 0 28px; }

/* ---- Album: ảnh trải gần hết bề rộng thiệp, cách mép ngoài 10% ----
   Mọi kích thước tính theo bề rộng thiệp (cqw): ảnh xa ngoài cùng nằm đúng từ 10% đến 90%. */
.album { padding: 34px 0 44px; }
.album__san { height: 62.7cqw; }
.album__anh[data-vi="-2"], .album__anh[data-vi="2"] { top: 11.8cqw; width: 21.6cqw; height: 39cqw; }
.album__anh[data-vi="-1"], .album__anh[data-vi="1"] { top: 5.9cqw; width: 29.4cqw; height: 51cqw; }
.album__anh[data-vi="-2"] { margin-left: -40cqw; }
.album__anh[data-vi="-1"] { margin-left: -33.3cqw; }
.album__anh[data-vi="0"] { top: 0; width: 42.3cqw; height: 62.7cqw; margin-left: -21.15cqw; }
.album__anh[data-vi="1"] { margin-left: 3.9cqw; }
.album__anh[data-vi="2"] { margin-left: 18.4cqw; }

/* ---- Thông tin tiệc cưới: không bọc ngoài, chính thẻ bên trong là khung tím, chữ trắng ---- */
.su-kien__the {
  --muc: #FFFFFF; --muc-phu: #FDF3F8; --tim: #FFFFFF;
  --nut-bg: #FFFFFF; --nut-fg: #B5628F;
  background: var(--tim-nen);
  border-color: var(--tim-nen);
  color: #FFFFFF;
  box-shadow: 0 14px 30px rgba(110, 50, 82, 0.28);
}
.su-kien__the .dem-nguoc__o > div { background: rgba(255, 255, 255, 0.14); }
.su-kien__the .duong-ke { background: rgba(255, 255, 255, 0.35); }
.su-kien__the .lich { border-color: rgba(255, 255, 255, 0.4); }
.su-kien__the .lich__ngay--cuoi { color: var(--tim-nen); }
.su-kien__the .lich__ngay--cuoi svg { fill: #FFFFFF; }
.su-kien__the .ban-do { border-color: rgba(255, 255, 255, 0.4); }
.su-kien__the .ban-do__dau { background: rgba(255, 255, 255, 0.1); }
.su-kien__the .ban-do__khung { border-top-color: rgba(255, 255, 255, 0.4); }
.su-kien__the :is(a, button):focus-visible { outline-color: #FFFFFF; }

/* ---- Hộp quà mừng: hai phong bì tím chồng lên nhau ---- */
.phong-bi { margin: 30px 0 0; padding-bottom: 6px; }
.phong-bi button { position: relative; width: 150px; gap: 16px; }
.phong-bi button + button { margin-left: -50px; z-index: 2; }
.phong-bi__hinh { width: 148px; height: 227px; }
.phong-bi__hinh img { width: 148px; height: 227px; }
.phong-bi__hinh::before { background: var(--tim-nen); border: 1px solid #BE6E99; }
.phong-bi button:first-child .phong-bi__hinh { transform: rotate(-9deg); }
.phong-bi button:last-child .phong-bi__hinh { transform: rotate(8deg) translateY(16px); }
.phong-bi button:hover .phong-bi__hinh { transform: rotate(0) translateY(-6px); }
.phong-bi button:last-child { margin-top: 0; }
.phong-bi__nhan { color: #B5628F; }
.qua-mung .tieu-de { color: #B5628F; }

/* ---- Hai họ: địa chỉ thẳng hàng, có nhãn "Địa chỉ:" ---- */
.hai-ho { grid-template-rows: auto auto auto; column-gap: 16px; row-gap: 8px; }
.hai-ho > div { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 8px; align-content: start; }
.hai-ho__dia-chi b { display: block; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 2px; color: var(--muc); }

/* ---- Đường phân chia bằng ảnh hai viên đá ---- */
.nhan-cuoi-hang--2vien { padding-top: 6px; }
.nhan-cuoi-hang--2vien .nhan-cuoi img {
  width: clamp(150px, 36cqw, 230px); height: auto; aspect-ratio: 760 / 489;
}

/* ---- Thông tin tiệc cưới: thu nhỏ chữ để ăn khớp các khung bên dưới; bỏ hoa trang trí ---- */
.su-kien { padding: 30px 0 44px; }
.su-kien .the-hoa { margin: 22px 15cqw 0; }
.luu-but .the-hoa { margin: 22px 0 0; }
@container (max-width: 560px) { .su-kien .the-hoa { margin-inline: 14px; } }
.su-kien__the { padding: 24px 18px 22px; }
.su-kien__gio { margin-top: 6px; font-size: 20px; }
.su-kien__ngay { margin-top: 10px; gap: 12px; }
.su-kien__so { font-size: 46px; }
.su-kien__thang { font-size: 15px; }
.su-kien__am-lich { margin-top: 6px; font-size: 12.5px; }
.dem-nguoc { margin-top: 18px; gap: 8px; }
.dem-nguoc__o { gap: 6px; }
.dem-nguoc__o > div { padding: 8px 0 6px; border-radius: 10px; }
.dem-nguoc__so { font-size: 21px; }
.dem-nguoc__don-vi { font-size: 10.5px; }
.lich-trinh { margin-top: 18px; }
.lich-trinh svg { width: 22px; height: 22px; }
.lich { margin-top: 18px; padding: 12px 10px; gap: 4px; }
.lich__thang { font-size: 14px; }
.lich__thu { height: 24px; font-size: 11px; }
.lich__ngay { width: 30px; height: 30px; font-size: 12.5px; }
.lich__ngay--cuoi { font-size: 12px; }
.lich__ngay--cuoi svg { width: 37px; height: 37px; left: -3.5px; top: -3px; }
.duong-ke--su-kien { margin: 18px 0; }
.su-kien__noi { margin-top: 6px; font-size: 17px; }
.su-kien__dia-chi { margin-top: 4px; font-size: 12px; }
.su-kien__sanh { margin-top: 2px; font-size: 12.5px; }
.ban-do { margin-top: 14px; }
.ban-do__dau { padding: 10px 12px; }
.ban-do__dau p:first-child { font-size: 13.5px; }
.ban-do__dau p + p { font-size: 12px; }
.ban-do__dau a { font-size: 12.5px; }
.ban-do__khung { height: 140px; }
.su-kien .nut { margin-top: 18px; }

/* ---- Màn mở thiệp: thẻ dọc 9:16, nền là ảnh bìa hoa cẩm tú cầu và nơ ---- */
.bia .bia__khung {
  width: min(100%, 420px, calc(88svh * 9 / 16));
  max-width: none; min-height: 0;
  aspect-ratio: 9 / 16;
}
.bia .bia__the {
  background: #FFFFFF url("img/anh-bia.webp") center / cover no-repeat;
  padding: 0 22px 8%;
}
.bia .bia__tim { width: 50px; height: 50px; }
.bia .bia__tim svg { width: 26px; height: 26px; }
.bia .bia__ten { font-size: 42px; margin-top: 14px; }
.bia .bia__va { font-size: 20px; }
.bia .bia__chia { margin-top: 14px; }
.bia .bia__ngay, .bia .bia__moi { font-size: 18px; }
.bia .bia__ngay { margin-top: 10px; }
.bia .bia__moi { margin-top: 18px; }
.bia .bia__mo { margin-top: 20px; min-height: 48px; padding: 0 36px; font-size: 17px; }
@media (max-width: 600px) {
  .bia .bia__khung { width: min(100%, 420px); min-height: 0; }
  .bia .bia__the { padding: 0 20px 8%; }
}

/* ---- Bản đồ: không còn khối chữ phía trên, bản đồ đi liền ngay sau địa chỉ ---- */
.ban-do__khung { border-top: 0; margin: 0; }
.hai-ho__cp { display: block; font-size: 11.5px; font-weight: 400; letter-spacing: 0.04em; line-height: 1.5; opacity: 0.92; }

/* Màn mở thiệp: ảnh nhẫn hai viên kim cương (đã tách nền) thay cho biểu tượng trái tim */
.bia .bia__nhan { width: 156px; height: auto; aspect-ratio: 760 / 489; filter: drop-shadow(0 8px 10px rgba(110, 50, 82, 0.28)); }
.bia .bia__ten { margin-top: 8px; }

/* ============ Phông mới: tinh chỉnh cỡ / độ đậm ============ */
.tieu-de { font-family: var(--f-sans); font-weight: 700; letter-spacing: 0.08em; }
.bia__ten, .loi-moi__ten, .bia-thiep__cap-doi { font-weight: 300; }
.loi-moi__va { font-style: italic; font-weight: 300; }
.su-kien__so { font-weight: 400; }
.dem-nguoc__so, .lich__thang { font-weight: 500; }

/* Tên cô dâu chú rể và tên bố mẹ không bao giờ xuống dòng: chữ co lại theo bề rộng thiệp */
.loi-moi__ten { white-space: nowrap; font-size: min(38px, 8.2cqw); line-height: 1.3; }
.loi-moi__va { font-size: min(30px, 7cqw); }
.hai-ho h3 { font-weight: 400; }
.hai-ho__cha-me { font-weight: 700; white-space: nowrap; letter-spacing: 0; font-size: min(13px, 2.75cqw); }
.hai-ho { column-gap: 12px; }
.hai-ho__cp { font-weight: 400; }
.bia .bia__ten { white-space: nowrap; }

/* Màn mở thiệp: nhẫn nhỏ thay cho chữ & giữa tên hai người */
.bia .bia__va-nhan { width: 68px; height: auto; margin: 6px 0; filter: drop-shadow(0 5px 6px rgba(110, 50, 82, 0.25)); }

/* Màn mở thiệp: tên khách mời theo tên, ngay dưới "Thân mời"; tên dài tự xuống dòng */
.bia__khach {
  position: relative;
  max-width: 100%;
  margin: 4px 0 0;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: min(26px, 6.6vw);
  line-height: 1.25;
  color: var(--tim);
  text-align: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* Ảnh nhẫn làm đường phân chia: giữ tỷ lệ gốc của ảnh */
.nhan-cuoi-hang--2vien .nhan-cuoi img { aspect-ratio: auto; }

/* ============ Bó hoa cạnh các khung ============ */
.vien-tim { overflow: visible; }
.bo-hoa {
  --w: clamp(96px, 27cqw, 180px);
  position: absolute; z-index: 3; top: -30px;
  width: var(--w); height: auto;
  pointer-events: none;
  transform-origin: 50% 92%;
  filter: drop-shadow(0 6px 8px rgba(110, 50, 82, 0.22));
}
.bo-hoa--phai { right: calc(var(--w) * -0.55); }
.bo-hoa--trai { left: calc(var(--w) * -0.55); scale: -1 1; }
@media (hover: hover) {
  .bo-hoa { pointer-events: auto; cursor: default; }
  .bo-hoa:hover { animation: dung-dua 1.4s ease-in-out; }
}
@keyframes dung-dua {
  0%, 100% { rotate: 0deg; }
  18% { rotate: -4deg; }
  40% { rotate: 3deg; }
  62% { rotate: -2deg; }
  82% { rotate: 1deg; }
}
@media (prefers-reduced-motion: reduce) { .bo-hoa:hover { animation: none; } }
@container (max-width: 560px) {   /* điện thoại: khung sát mép, nên bó hoa nhỏ hơn và lùi vào trong để không bị mép thiệp cắt */
  .bo-hoa { --w: 92px; top: -44px; }
  .bo-hoa--phai { right: calc(var(--w) * -0.18); }
  .bo-hoa--trai { left: calc(var(--w) * -0.18); }
}

/* ============================================================
   Cập nhật: tông hồng #D283AE, nền hoa vẽ nét mờ, album có nút + xem ảnh lớn
   ============================================================ */

/* Nền thiệp: hoa cẩm tú cầu vẽ nét, hồng nhạt, mờ phía sau nội dung */
.thiep {
  background-color: var(--nen-thiep);
  background-image: url("img/nen-hoa-net.webp");
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-position: center top;
}

/* Đường phân chia bằng nhẫn / hoa: thu nhỏ còn khoảng 70% */
.nhan-cuoi-hang .nhan-cuoi img { width: 87px; height: 112px; }
.nhan-cuoi-hang--hoa { padding-top: 4px; }
.nhan-cuoi-hang--hoa .nhan-cuoi img {
  width: clamp(105px, 25.2cqw, 161px); height: auto; aspect-ratio: 640 / 860;
  filter: drop-shadow(0 6px 8px rgba(110, 50, 82, 0.12));
}

/* Album: nút trước / sau hai bên */
.album__khung { position: relative; }
.album__nut {
  position: absolute; z-index: 5; top: 50%;
  width: 42px; height: 42px; padding: 0; margin-top: -21px;
  border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--tim-dam);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(110, 50, 82, 0.2);
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.2s;
}
.album__nut:hover { background: #FFFFFF; transform: scale(1.06); }
.album__nut--truoc { left: max(8px, 3cqw); }
.album__nut--sau { right: max(8px, 3cqw); }
.album__anh[data-vi="0"] { cursor: zoom-in; }
.album__goi-y { margin: 4px 0 0; font-size: 12.5px; font-style: italic; color: var(--muc-phu); }
@container (max-width: 560px) {
  .album__nut { width: 36px; height: 36px; margin-top: -18px; }
  .album__nut svg { width: 18px; height: 18px; }
}

/* Chân thiệp: bỏ nhẫn, gạch ngang hai bên câu chào, hoa kéo sát lên */
.chan-thiep { height: auto; padding: 40px 28px 0; }
.chan-thiep__dong { position: relative; width: 100%; display: flex; align-items: center; gap: 14px; }
.chan-thiep__dong > span { flex: 1; min-width: 20px; height: 1px; background: var(--vien-nhat); }
.chan-thiep__loi { margin: 0; white-space: nowrap; font-size: min(24px, 5.6cqw); }
.chan-thiep__hoa {
  position: relative; display: block;
  width: calc(100% + 56px); max-width: none; height: auto;
  margin: -10cqw -28px 0;   /* phần trên của ảnh trong suốt, nên kéo hoa sát lên câu chào */
  pointer-events: none;
}
.chan-thiep__dong, .chan-thiep .nhan { z-index: 1; }

/* ---------- Xem ảnh lớn ---------- */
html:has(.xem-anh[open]) { overflow: hidden; }
.xem-anh {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(38, 16, 28, 0.97);
  color: #FFFFFF;
  overflow: hidden;
}
.xem-anh[open] { display: flex; flex-direction: column; animation: hien-mo 0.25s ease-out; }
.xem-anh::backdrop { background: rgba(38, 16, 28, 0.6); }
@keyframes hien-mo { from { opacity: 0; } }
.xem-anh__dau {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px 20px;
}
.xem-anh__dem { font-family: var(--f-serif); font-size: 15px; letter-spacing: 0.12em; opacity: 0.9; font-variant-numeric: tabular-nums; }
.xem-anh__cong-cu { display: flex; gap: 6px; }
.xem-anh__nut, .xem-anh__chuyen {
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.xem-anh__nut:hover, .xem-anh__chuyen:hover { background: rgba(210, 131, 174, 0.55); }
.xem-anh__nut[disabled] { opacity: 0.35; cursor: default; background: rgba(255, 255, 255, 0.12); }
.xem-anh :is(button):focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }

.xem-anh__san { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.xem-anh__day { display: flex; height: 100%; will-change: transform; transition: transform 0.38s cubic-bezier(.2, .7, .2, 1); }
.xem-anh__day.dang-keo, .xem-anh__o img.dang-keo { transition: none; }
.xem-anh__o {
  flex: 0 0 100%; height: 100%; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 6px 76px;
  overflow: hidden;
}
.xem-anh__o img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transform-origin: center center;
  transition: transform 0.25s ease;
  -webkit-user-drag: none; pointer-events: none;
}
.xem-anh__san { cursor: grab; }
.xem-anh__san.dang-phong { cursor: move; }
.xem-anh__chuyen { position: absolute; z-index: 2; top: 50%; width: 50px; height: 50px; margin-top: -25px; }
.xem-anh__chuyen--truoc { left: 16px; }
.xem-anh__chuyen--sau { right: 16px; }

.xem-anh__dai {
  flex: none; display: flex; gap: 8px;
  justify-content: safe center;
  overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
}
.xem-anh__dai::-webkit-scrollbar { display: none; }
.xem-anh__nho {
  flex: none; width: 64px; height: 64px; padding: 0;
  border: 2px solid transparent; border-radius: 10px;
  background: none; overflow: hidden; cursor: pointer;
  opacity: 0.5; transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}
.xem-anh__nho img { width: 100%; height: 100%; object-fit: cover; }
.xem-anh__nho:hover { opacity: 0.85; }
.xem-anh__nho[aria-selected="true"] { opacity: 1; border-color: var(--tim); transform: translateY(-2px); }

@media (max-width: 600px) {
  .xem-anh__o { padding: 4px 10px; }
  .xem-anh__chuyen { width: 40px; height: 40px; margin-top: -20px; background: rgba(0, 0, 0, 0.32); }
  .xem-anh__chuyen--truoc { left: 8px; }
  .xem-anh__chuyen--sau { right: 8px; }
  .xem-anh__nho { width: 52px; height: 52px; border-radius: 8px; }
  .xem-anh__dau { padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .xem-anh__day, .xem-anh__o img { transition: none; }
  .xem-anh[open] { animation: none; }
}

/* ============================================================
   Cập nhật 27/11: hoa nổi 3D, nền hoa nét ở màn mở thiệp, album 8 ảnh
   ============================================================ */

/* Bóng đổ nhiều lớp (ánh sáng từ góc trên bên trái) để hoa nổi lên khỏi mặt giấy */
:root {
  --bong-noi:
    drop-shadow(1px 2px 1px rgba(94, 47, 72, 0.20))
    drop-shadow(5px 9px 8px rgba(110, 50, 82, 0.20))
    drop-shadow(10px 20px 22px rgba(110, 50, 82, 0.14));
  --bong-noi-nhe:
    drop-shadow(1px 2px 1px rgba(94, 47, 72, 0.14))
    drop-shadow(3px 7px 7px rgba(110, 50, 82, 0.16))
    drop-shadow(0 14px 18px rgba(110, 50, 82, 0.10));
}

/* Màn mở thiệp: mặt thiệp trơn cùng màu giấy với thiệp bên trong (không họa tiết) */
.bia .bia__the { background: var(--nen-thiep); }
/* Hai cụm hoa (đã tách nền từ ảnh bìa) đặt đúng chỗ cũ, nổi lên và "thở" nhẹ */
.bia__hoa-noi {
  position: absolute; pointer-events: none; height: auto; max-width: none;
  filter: var(--bong-noi);
  will-change: transform;
  animation: hoa-noi 7s ease-in-out infinite;
}
.bia__hoa-noi--tren { top: 0; right: 0; width: 44.45%; transform-origin: 100% 0; }
.bia__hoa-noi--duoi { left: 0; bottom: 0; width: 55.56%; transform-origin: 0 100%; animation-delay: -3.5s; }
@keyframes hoa-noi {
  0%, 100% { transform: scale(1.02); }
  50%      { transform: scale(1.055); }
}
.tam-dung .bia__hoa-noi { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .bia__hoa-noi { animation: none; transform: scale(1.03); } }

/* Nhẫn giữa tên cô dâu chú rể: ảnh nhẫn mới, giữ cùng bề rộng */
.bia .bia__va-nhan { width: 68px; height: auto; }

/* Hoa đầu trang và chân trang của thiệp bên trong: ảnh tách nền + bóng đổ cho nổi khối */
.bia-thiep { background-image: none; }
.bia-thiep::before, .bia-thiep::after {
  content: ""; position: absolute; left: 0; right: 0; z-index: 0; pointer-events: none;
  background-repeat: no-repeat; background-size: 100% auto;
  filter: var(--bong-noi-nhe);
}
.bia-thiep::before { top: 0; aspect-ratio: 736 / 300; background-image: url("img/nen-bia-tren-tach.webp"); background-position: top center; }
.bia-thiep::after { bottom: 0; aspect-ratio: 736 / 428; background-image: url("img/nen-bia-duoi-tach.webp"); background-position: bottom center; }
.bia-thiep > * { position: relative; z-index: 1; }
.chan-thiep__hoa { filter: var(--bong-noi-nhe); }

/* Bó hoa cạnh các khung: hạ xuống một chút (trừ ở sổ lưu bút) */
.bo-hoa { top: -6px; }
.bo-hoa.bo-hoa--giu { top: -30px; }
@container (max-width: 560px) {
  .bo-hoa { top: -34px; }   /* điện thoại: hạ ít hơn để không đè lên tiêu đề */
  .bo-hoa.bo-hoa--giu { top: -44px; }
}

/* Album 8 ảnh: các ảnh ngoài tầm nhìn nằm khuất sau ảnh giữa */
.album__anh[data-vi="an"] {
  top: 11.8cqw; width: 21.6cqw; height: 39cqw; margin-left: -10.8cqw;
  border-radius: 12px; opacity: 0; z-index: 0; pointer-events: none;
}

/* ============================================================
   Cập nhật 27/11 (lần 2)
   ============================================================ */

/* Màn mở thiệp: máy tính dùng thẻ vuông, điện thoại giữ thẻ dọc 9:16 */
@media (min-width: 601px) {
  .bia .bia__khung { width: min(100%, 620px, 86svh); aspect-ratio: 1 / 1; }
  .bia .bia__the { padding: 0 22px; }
  /* thẻ vuông thấp hơn nên cụm hoa tính theo chiều cao để không lấn vào chữ */
  .bia__hoa-noi--tren { width: auto; height: 34%; }
  .bia__hoa-noi--duoi { width: auto; height: 54%; }
}

/* Chữ dày nét hơn một chút cho dễ đọc */
body { -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; -webkit-text-stroke: 0.2px currentColor; }
.bia__ten, .bia-thiep__cap-doi, .loi-moi__va { font-weight: 400; }
.bia-thiep__ten b { font-weight: 500; }
.bia__ngay, .bia__moi, .bia-thiep__nho { font-weight: 500; }
.su-kien__gio, .su-kien__noi, .xac-nhan__hoi, .chan-thiep__loi, .cam-on h3 { font-weight: 600; }
.nhan, .lich-trinh p, .su-kien__dia-chi, .dem-nguoc__don-vi { font-weight: 700; }
.mo-ta, .album__goi-y, .su-kien__sanh, .su-kien__am-lich { -webkit-text-stroke: 0.3px currentColor; }

/* Lời mời: tên cô dâu chú rể in đậm */
.loi-moi__ten { font-weight: 700; font-size: min(32px, 7.4cqw); }
.qua-mung__goi-y { margin-top: 26px; }


/* Hai họ: "Nhà trai/Nhà gái" và "Địa chỉ:" cùng phông, cùng cỡ, không đậm;
   tên ông bà và địa chỉ chi tiết cùng phông, cùng cỡ; "(Cố phụ)" cùng dòng với tên ông */
.hai-ho { --co-ho: min(13px, 2.6cqw); }
.hai-ho h3, .hai-ho__dia-chi b {
  font-family: var(--f-sans); font-size: 12px; font-weight: 400; letter-spacing: 0.14em;
}
.hai-ho__dia-chi b { color: #FDF3F8; margin-bottom: 4px; }
.hai-ho__cha-me, .hai-ho__dia-chi { font-family: var(--f-sans); font-size: var(--co-ho); line-height: 1.7; }
.hai-ho__dia-chi { color: var(--muc); }
.hai-ho__cp { display: inline; font-size: inherit; letter-spacing: 0; opacity: 0.92; }
@container (max-width: 560px) {
  .vien-tim .loi-moi { padding-inline: 12px; }
  .hai-ho { column-gap: 8px; --co-ho: 2.75cqw; }
}

/* Thông tin tiệc cưới: ngày tháng năm cùng một dòng, cùng cỡ chữ */
.su-kien__ngay {
  margin: 6px 0 0; display: block;
  font-family: var(--f-serif); font-weight: 600; font-size: 20px; line-height: 1.4; letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Hộp quà mừng: thiệp bên trong phong bì màu trắng, viền cùng màu phong bì; tên tách khỏi phong bì */
.phong-bi__hinh::before { background: #FFFFFF; border: 1px solid #E8B6CE; }
.phong-bi { gap: 0; }
.phong-bi button { gap: 30px; }
.phong-bi button + button { margin-left: -36px; }
.phong-bi__nhan { position: relative; z-index: 3; }
.phong-bi button:first-child .phong-bi__nhan { translate: -14px 18px; }
.phong-bi button:last-child .phong-bi__nhan { translate: 14px 18px; }   /* hai nhãn cùng một hàng, nằm dưới mép phong bì */

/* Mã QR thật: nền trắng, bo góc */
img.hop-qua__qr { width: 150px; height: 150px; object-fit: contain; background: #FFFFFF; border: 1px solid var(--vien-the); padding: 6px; }

/* ============================================================
   Cập nhật 27/11 (lần 3)
   ============================================================ */

/* Tên cô dâu chú rể ở phần lời mời: phông viết tay nét đều, không có nét thanh quá mảnh */
.loi-moi__ten {
  font-family: 'Dancing Script', var(--f-serif);
  font-weight: 700; font-size: min(44px, 9.4cqw); line-height: 1.25;
  -webkit-text-stroke: 0;
}

/* Hoa đầu trang (Save the date) và hoa chân trang: nổi khối và "thở" nhẹ như màn mở thiệp */
.bia-thiep::before, .bia-thiep::after, .chan-thiep__hoa {
  filter: var(--bong-noi);
  will-change: transform;
  animation: hoa-noi 7s ease-in-out infinite;
}
.bia-thiep::before { transform-origin: 50% 0; }
.bia-thiep::after { transform-origin: 50% 100%; animation-delay: -3.5s; }
.chan-thiep__hoa { transform-origin: 50% 100%; animation-delay: -2s; }
.tam-dung .bia-thiep::before, .tam-dung .bia-thiep::after, .tam-dung .chan-thiep__hoa { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .bia-thiep::before, .bia-thiep::after, .chan-thiep__hoa { animation: none; transform: scale(1.03); }
}

/* Hộp quà: hai cột chia chung hàng (subgrid) để tên, mã QR, ngân hàng, số TK, chủ TK, nút luôn thẳng hàng */
.hop-qua__than {
  grid-template-rows: repeat(6, auto);
  column-gap: 12px; row-gap: 0;
  padding: 20px clamp(10px, 4vw, 18px) 22px;
}
.hop-qua__nguoi {
  display: grid; grid-template-rows: subgrid; grid-row: span 6;
  justify-items: center; align-items: start; gap: 0;
}
.hop-qua__ten { margin: 0 0 10px; align-self: end; }
.hop-qua__qr, img.hop-qua__qr {
  width: min(150px, 100%); height: auto; aspect-ratio: 1; padding: 6px;
  border-radius: 12px; box-sizing: border-box;
}
.cho-trong.hop-qua__qr { border-width: 1.5px; }
.hop-qua__ngan-hang { margin: 10px 0 2px; }
.hop-qua__stk { margin: 0 0 2px; }
.hop-qua__chu-tk { font-size: clamp(10.5px, 3vw, 12px); letter-spacing: 0.02em; text-wrap: balance; }
.hop-qua .nut-vien { margin: 10px 0 0; align-self: end; }

/* ============================================================
   Cập nhật 27/11 (lần 4): bó hoa cành dài 2 lớp, sổ lưu bút cuộn
   ============================================================ */

/* Bó hoa gồm 2 bản chồng khít nhau:
   - lớp trước: chỉ phần cụm hoa và lá trên cùng, nổi trên khung như cũ;
   - lớp sau: cả bó với cành dài, nằm SAU khung tím nên phần cành dài không bao giờ che chữ
     (máy tính thấy cành buông ngoài mép khung, điện thoại cành khuất sau khung). */
.bo-hoa--truoc { clip-path: inset(0 0 47% 0); }
.bo-hoa--sau { z-index: -1; pointer-events: none !important; }
@media (hover: hover) {
  .bo-hoa--truoc:hover + .bo-hoa--sau { animation: dung-dua 1.4s ease-in-out; }
}
@media (prefers-reduced-motion: reduce) { .bo-hoa--truoc:hover + .bo-hoa--sau { animation: none; } }

/* Sổ lưu bút: danh sách lời chúc có khung cuộn riêng */
.luu-but__dem { margin: 0 0 10px; font-size: 12.5px; letter-spacing: 0.04em; color: #FDF3F8; text-align: center; }
.luu-but__ds {
  max-height: min(440px, 62svh);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 6px 2px 0; margin-right: -6px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.75) rgba(255, 255, 255, 0.15);
  --mo-tren: 0px; --mo-duoi: 0px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--mo-tren), #000 calc(100% - var(--mo-duoi)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--mo-tren), #000 calc(100% - var(--mo-duoi)), transparent 100%);
}
.luu-but__ds.mo-tren { --mo-tren: 28px; }
.luu-but__ds.mo-duoi { --mo-duoi: 44px; }
.luu-but__ds::-webkit-scrollbar { width: 5px; }
.luu-but__ds::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
.luu-but__ds::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.75); border-radius: 3px; }
.luu-but__ds:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 4px; }
.loi-moi__chu { text-wrap: balance; }
@container (max-width: 560px) {
  .the-hoa .bo-hoa { top: -58px; }   /* điện thoại: thẻ tiệc cưới có chữ sát mép trên, nên đẩy bó hoa lên cao hơn */
}

/* ============================================================
   Cập nhật 27/11 (lần 5)
   ============================================================ */

/* Bó hoa mới: lá dồn sát cụm hoa nên lớp trước hiện tới 58% chiều cao ảnh */
.bo-hoa--truoc { clip-path: inset(0 0 42% 0); }

/* Phần lời mời: bó hoa ở rìa trái, cụm hoa nằm ngang giữa tên chú rể và tên cô dâu.
   Đặt trong khối tên (căng hết bề ngang) rồi bù lại phần đệm của khung để bám đúng mép trái. */
.loi-moi { --dem-le: 18px; }
.loi-moi__doi { position: relative; align-self: stretch; }
.bo-hoa.bo-hoa--ten {
  top: calc(50% - var(--w) * 0.36);
  left: calc(var(--w) * -0.55 - var(--dem-le));
}
@container (max-width: 560px) {
  .loi-moi { --dem-le: 12px; }
  .bo-hoa.bo-hoa--ten { --w: 76px; top: calc(50% - var(--w) * 0.56); left: calc(var(--w) * -0.22 - var(--dem-le)); }
}

/* Album: ảnh chính to hơn, ảnh hai bên nhỏ lại (tính theo bề rộng thiệp, cqw) */
.album__san { height: 76cqw; }
.album__anh[data-vi="0"] { top: 0; width: 51cqw; height: 76cqw; margin-left: -25.5cqw; }
.album__anh[data-vi="-1"], .album__anh[data-vi="1"] { top: 17cqw; width: 24cqw; height: 42cqw; border-radius: 12px; }
.album__anh[data-vi="-2"], .album__anh[data-vi="2"] { top: 24cqw; width: 16cqw; height: 28cqw; border-radius: 10px; }
.album__anh[data-vi="-1"] { margin-left: -38cqw; }
.album__anh[data-vi="1"] { margin-left: 14cqw; }
.album__anh[data-vi="-2"] { margin-left: -45cqw; }
.album__anh[data-vi="2"] { margin-left: 29cqw; }
.album__anh[data-vi="an"] { top: 24cqw; width: 16cqw; height: 28cqw; margin-left: -8cqw; }

/* Nhẫn cưới: sáng nhẹ hơn ảnh gốc một chút (màn mở thiệp + đường phân chia bên trong thiệp).
   Lọc sáng đặt trước drop-shadow để bóng đổ không bị sáng theo. */
.bia .bia__va-nhan {
  filter: brightness(1.07) drop-shadow(0 5px 6px rgba(110, 50, 82, 0.25));
}
.nhan-cuoi-hang:not(.nhan-cuoi-hang--hoa) .nhan-cuoi img {
  filter: brightness(1.1) drop-shadow(0 10px 12px rgba(110, 50, 82, 0.22));
}

/* Bó hoa có nơ (lần 6): cành ngắn hơn, lá tới khoảng 66% chiều cao ảnh */
.bo-hoa--truoc { clip-path: inset(0 0 34% 0); }
/* Bó hoa phần lời mời nằm ở khoảng trống giữa hai tên: hiện trọn cả cành và nơ */
.bo-hoa--ten.bo-hoa--truoc { clip-path: none; }

/* Lần 7: cả khóm hoa (hoa, lá, cành, nơ) nằm chung một lớp, nổi trên cùng, không còn nửa nằm sau khung */
.bo-hoa--truoc { clip-path: none; z-index: 5; }
.bo-hoa--sau { display: none; }
@container (max-width: 560px) {
  /* điện thoại: khóm hoa ở thẻ tiệc cưới nhỏ hơn và sát mép trái để nơ không chạm dòng chữ đầu */
  .the-hoa .bo-hoa { --w: 78px; top: -50px; }
  .the-hoa .bo-hoa--trai { left: calc(var(--w) * -0.32); }
}

/* Lần 8: khóm hoa dại (khom-hoa.webp) cao và dày hơn bó cũ, nên thu nhỏ lại và đẩy ra mép ngoài
   để hoa, lá không che chữ trong khung. */
.bo-hoa { width: calc(var(--w) * 0.78); }
@container (min-width: 561px) {
  .bo-hoa--phai { right: calc(var(--w) * -0.6); }
  .bo-hoa--trai { left: calc(var(--w) * -0.6); }
  .bo-hoa.bo-hoa--ten { left: calc(var(--w) * -0.6 - var(--dem-le)); top: calc(50% - var(--w) * 0.62); }
}

/* Lần 9: chỉnh vị trí từng khóm hoa (màn hình rộng) */
@container (min-width: 561px) {
  .bo-hoa.bo-hoa--ten { left: calc(var(--w) * -0.5 - var(--dem-le)); }   /* lời mời: vào trong một chút */
  .the-hoa .bo-hoa--trai { left: calc(var(--w) * -0.52); top: -34px; }   /* tiệc cưới: lên trên và sang phải */
  .vien-tim > .bo-hoa--phai { right: calc(var(--w) * -0.5); }            /* xác nhận tham dự: sang trái */
}

/* ============================================================
   Nút nổi: nhạc nền và tự cuộn
   ============================================================ */
.dieu-khien {
  position: fixed; z-index: 30;
  right: max(14px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.dieu-khien__nut {
  position: relative;
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--vien-nhat); background: rgba(255, 254, 251, 0.94); color: var(--tim-dam);
  box-shadow: 0 6px 16px rgba(110, 50, 82, 0.22);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.dieu-khien__nut:hover { background: var(--nen-chon); }
.dieu-khien__nut[aria-pressed="true"] { background: var(--tim); border-color: var(--tim); color: #fff; }
.dieu-khien__nut[aria-pressed="true"] .khi-tat,
.dieu-khien__nut[aria-pressed="false"] .khi-bat { display: none; }
/* vòng lan nhẹ khi nhạc đang phát */
#nut-nhac[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 2px solid var(--tim); animation: lan-nhac 2.2s ease-out infinite; pointer-events: none;
}
@keyframes lan-nhac { from { transform: scale(1); opacity: 0.7; } to { transform: scale(1.55); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #nut-nhac[aria-pressed="true"]::after { animation: none; opacity: 0; } }

/* Sổ lưu bút khi chưa có lời chúc nào */
.luu-but__trong { padding: 18px 8px; font-size: 15px; font-style: italic; color: #FDF3F8; text-align: center; }

/* ============================================================
   Điện thoại (≤600px): khóm hoa to và đung đưa, khung thoáng hơn, nền phủ kín
   ============================================================ */

/* Khóm hoa cạnh khung: màn cảm ứng không có :hover nên tự đung đưa nhẹ, lệch pha từng khóm */
@keyframes dung-dua-nhe {
  0%, 100% { rotate: -2deg; }
  50%      { rotate: 2.5deg; }
}
@media (hover: none) {
  .bo-hoa--truoc { animation: dung-dua-nhe 4.6s ease-in-out infinite; }
  .the-hoa .bo-hoa--truoc { animation-delay: -1.5s; }
  .vien-tim > .bo-hoa--phai { animation-delay: -3s; animation-duration: 5.2s; }
  .bo-hoa--giu.bo-hoa--truoc { animation-delay: -2.2s; }
  .tam-dung .bo-hoa--truoc { animation-play-state: paused; }
}
@media (hover: none) and (prefers-reduced-motion: reduce) { .bo-hoa--truoc { animation: none; } }

@media (max-width: 600px) {
  /* khóm hoa to hơn (gần tỷ lệ bản máy tính so với bề rộng thiệp), vẫn lùi vào trong mép thiệp */
  .bo-hoa { --w: 118px; top: -52px; }
  .bo-hoa.bo-hoa--giu { --w: 104px; top: -80px; left: calc(var(--w) * -0.3); }   /* sổ lưu bút: lên cao, ra mép để không che dòng mô tả */
  .vien-tim > .bo-hoa--phai { right: calc(var(--w) * -0.26); }
  .the-hoa .bo-hoa { --w: 104px; top: -74px; }
  .the-hoa .bo-hoa--trai { left: calc(var(--w) * -0.3); }
  .bo-hoa.bo-hoa--ten { --w: 90px; top: calc(50% - var(--w) * 0.62); left: calc(var(--w) * -0.24 - var(--dem-le)); }

  /* khung tím và thẻ tiệc cưới lùi vào khỏi mép màn hình (máy tính lùi 15%, điện thoại 7% để còn chỗ cho form và lịch) */
  .vien-tim, .su-kien .the-hoa { margin-inline: 7cqw; }
  /* khoảng đệm trong các khung tím: chữ không dính sát viền */
  .vien-tim .loi-moi { --dem-le: 18px; padding-inline: 18px; }
  .hai-ho { --co-ho: 2.4cqw; column-gap: 8px; }
  .loi-moi__ten { font-size: 8.2cqw; }   /* khung hẹp hơn nên tên cô dâu chú rể nhỏ lại, không chạm viền */
  .vien-tim .muc, .vien-tim .bieu-mau, .vien-tim .xac-nhan__dau { padding-inline: 18px; }
  .vien-tim .cam-on { padding-inline: 18px; }
  .su-kien__the { padding: 26px 18px 24px; }

  /* màn bên trong: thiệp phủ kín bề ngang nên bỏ dải đệm trên/dưới (từng lộ nền xám) */
  .trang { padding: 0; }
  /* màu nền gốc trùng màu thiệp: không lộ dải khác màu khi kéo quá đà hay ở vùng tai thỏ / thanh home */
  body:has(#trang-thiep:not([hidden])) { background: var(--nen-thiep); }
  /* hoa rơi màn bên trong: nổi trên thiệp (thiệp phủ kín màn hình), mờ hơn và không chặn chạm vào nội dung */
  .hoa-roi.hoa-roi--co-dinh { z-index: 2; }
  .hoa-roi--co-dinh i { pointer-events: none; }
  /* viewport-fit=cover: chừa tai thỏ khi xoay ngang */
  .bia { padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
}
