/* ============ Thiệp cưới Thái & Huyền ============ */
:root {
  --paper: #f5f4f2;
  --paper-2: #efedea;
  --ink: #262626;
  --ink-2: #4a4a4a;
  --muted: #8b8783;
  --line: #d9d5d0;
  --wine: #5e2b33;
  --wine-2: #7a3a44;
  --white: #fff;
  --serif: "EB Garamond", "Times New Roman", Times, serif;
  --display: "Cormorant Garamond", "EB Garamond", "Times New Roman", serif;
  --script: "Great Vibes", "Snell Roundhand", cursive;
  --card-w: 520px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: #e7e4e0;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}
body.is-locked { overflow: hidden; height: 100%; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- Khung thiệp ---------- */
.card {
  position: relative;
  max-width: var(--card-w);
  margin: 0 auto;
  background: var(--paper) url("../img/paper.webp") repeat center top / 480px;
  box-shadow: 0 0 60px rgba(0, 0, 0, .08);
  min-height: 100vh;
}
@media (min-width: 600px) {
  body { padding: 28px 0; }
  .card { border-radius: 18px; overflow: hidden; }
}

.sec { padding: 72px 28px 40px; text-align: center; scroll-margin-top: 0; }
.eyebrow {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 0 0 34px;
  color: var(--ink);
}
.title--plain { text-transform: none; font-size: 25px; }
.title--plain:first-letter { text-transform: uppercase; }
#profile .title--plain { text-transform: uppercase; }

.photo { margin: 0 auto; overflow: hidden; background: var(--paper-2); }
.photo img { width: 100%; height: auto; }
.photo--rounded { border-radius: 14px; }
.photo--bw img { filter: grayscale(1) contrast(1.02); }
.script {
  font-family: var(--script);
  font-size: 40px;
  line-height: 1.2;
  color: var(--ink-2);
  margin: 40px 0 14px;
}
.script--sm { font-size: 34px; margin: 0 0 8px; }
.amp { font-family: var(--display); font-style: italic; color: var(--muted); padding: 0 .35em; }

/* ---------- Hero ---------- */
.hero { padding-top: 52px; }
.hero__names { font-size: 19px; margin-bottom: 30px; letter-spacing: .01em; }
.hero__photo { max-width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.hero__date { color: var(--ink-2); font-size: 18px; }

/* ---------- Lời mời ---------- */
.invite__hello { font-size: 19px; margin: 14px 0 12px; }
.invite__text { text-wrap: pretty; font-size: 17px; color: var(--ink-2); line-height: 1.95; margin-bottom: 40px; }
.invite .photo { max-width: 460px; }

/* ---------- Thông tin lễ cưới ---------- */
.parents { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 44px; }
.parents__col { padding: 4px 12px; }
.parents__col + .parents__col { border-left: 1px solid var(--line); }
.parents__role { font-size: 14px; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.parents__name { font-weight: 600; font-size: 17px; line-height: 1.9; }
.parents__addr { text-wrap: balance; font-size: 15px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.announce { font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); line-height: 2.2; margin-bottom: 28px; }
.couple__name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(27px, 7.6vw, 42px);
  line-height: 1.15;
  color: var(--wine);
  letter-spacing: .01em;
}
.couple__rank { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.couple__amp { font-family: var(--display); font-size: 30px; color: var(--muted); margin: 14px 0 10px; }

/* ---------- Profile ---------- */
.profile__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile__item { margin: 0; }
.profile__item .photo { display: block; width: 100%; padding: 0; border: 0; }
.profile__item figcaption { margin-top: 14px; font-size: 22px; letter-spacing: .04em; line-height: 1.3; }
.profile__item figcaption span { display: block; font-size: 14px; color: var(--muted); letter-spacing: .1em; }

/* ---------- Hai lễ ---------- */
.event { padding: 18px 0 10px; scroll-margin-top: 12px; border-radius: 16px; transition: background-color 1.2s var(--ease), box-shadow 1.2s var(--ease); }
.event.is-target { background: rgba(255,255,255,.6); box-shadow: 0 0 0 1px rgba(94,43,51,.18), 0 12px 32px rgba(94,43,51,.08); }
.event__side { font-size: 16px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 18px; }
.event__time { font-size: 22px; letter-spacing: .1em; margin-bottom: 4px; }
.event__date { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.event__dow, .event__month { font-size: 14px; white-space: nowrap; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.event__dow { text-align: right; padding-right: 18px; }
.event__month { text-align: left; padding-left: 18px; }
.event__day {
  font-family: var(--display);
  font-size: 76px;
  line-height: 1.1;
  padding: 0 24px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink);
}
.event__year { font-size: 18px; color: var(--muted); letter-spacing: .1em; margin-top: 4px; }
.event__lunar { font-style: italic; color: var(--muted); font-size: 16px; margin-top: 18px; }
.divider { height: 1px; background: var(--line); margin: 34px 0; }

.countdown { margin: 30px auto 6px; }
.countdown__label { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.countdown__grid { display: flex; justify-content: center; align-items: flex-end; gap: 8px; }
.countdown__grid div { min-width: 56px; display: flex; flex-direction: column-reverse; align-items: center; }
.countdown__grid b { font-family: var(--display); font-weight: 500; font-variant-numeric: lining-nums tabular-nums; font-size: 34px; line-height: 1.1; color: var(--ink); }
.countdown__grid span { font-size: 14px; color: var(--muted); }
.countdown__grid i { font-style: normal; color: var(--muted); padding-bottom: 8px; }
.countdown__done { color: var(--wine); font-style: italic; }

.venue { margin-top: 34px; }
.venue__label { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.venue__addr { text-wrap: balance; font-size: 17px; margin: 8px 0 16px; color: var(--ink-2); }
.map {
  position: relative;
  height: 240px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map__load { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; color: var(--muted); }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--ink-2);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  font-size: 16px;
  text-decoration: none;
  transition: background .25s, color .25s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--ghost { background: transparent; margin-top: 26px; }
.btn--sm { min-height: 38px; padding: 6px 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
@media (hover: hover) {
  .btn:hover { background: var(--ink); color: #fff; }
  .btn--dark:hover { background: var(--wine); border-color: var(--wine); }
}
.link-rsvp { display: inline-block; margin-top: 18px; color: var(--wine); font-style: italic; text-decoration: none; border-bottom: 1px solid rgba(94,43,51,.3); }

/* ---------- Lịch ---------- */
.calendar { margin-top: 60px; }
.calendar__big { font-size: 30px; letter-spacing: .06em; }
.calendar__sub { color: var(--ink-2); margin-bottom: 22px; }
.calendar__grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  row-gap: 8px; max-width: 360px; margin: 0 auto;
  border-top: 1px solid var(--line); padding-top: 18px;
}
.calendar__grid span { display: grid; place-items: center; height: 40px; font-size: 16px; }
.calendar__grid .is-head { color: var(--ink-2); font-size: 15px; }
.calendar__grid .is-groom { background: var(--ink); color: #fff; border-radius: 50%; width: 40px; margin: 0 auto; }
.calendar__grid .is-bride { box-shadow: inset 0 0 0 1px var(--ink); border-radius: 50%; width: 40px; margin: 0 auto; }
.calendar__legend { margin-top: 18px; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.dot--ring { box-shadow: inset 0 0 0 1px var(--ink); }
.dot--fill { background: var(--ink); }

/* ---------- Album ---------- */
.gallery__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.gallery__col { display: flex; flex-direction: column; gap: 10px; }
.gallery__col--offset { margin-top: 12px; }
.gallery__item {
  display: block; padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  background: var(--paper-2); position: relative;
}
.gallery__item img { width: 100%; transition: transform .8s var(--ease); }
@media (hover: hover) { .gallery__item:hover img { transform: scale(1.04); } }

/* ---------- Mừng cưới ---------- */
.gift__text { color: var(--ink-2); margin-bottom: 30px; line-height: 1.9; }
.acc { max-width: 380px; margin: 0 auto; display: grid; gap: 14px; }
.acc__item { background: #fff; border-radius: 6px; overflow: hidden; text-align: left; }
.acc__item summary {
  list-style: none; cursor: pointer; padding: 16px 20px; background: var(--paper-2);
  text-align: center; position: relative; font-size: 17px;
}
.acc__item summary::-webkit-details-marker { display: none; }
.acc__item summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px;
  border-left: 1.5px solid var(--ink); border-top: 1.5px solid var(--ink);
  transform: translateY(-25%) rotate(45deg); transition: transform .25s;
}
.acc__item:not([open]) summary::after { transform: translateY(-75%) rotate(225deg); }
.acc__body { padding: 16px 22px 18px; }
.acc__name { text-transform: uppercase; letter-spacing: .03em; font-size: 16px; }
.acc__bank { color: var(--ink-2); margin: 2px 0 12px; }
.acc__no { letter-spacing: .04em; }

/* ---------- RSVP ---------- */
.rsvp__intro { color: var(--ink-2); margin-bottom: 30px; line-height: 1.9; }
.form { text-align: left; max-width: 420px; margin: 0 auto; }
.form__choices { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.form__choices legend { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block; padding: 13px 16px 13px 46px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.75); font-size: 17px; line-height: 1.35; transition: border-color .2s, background .2s;
  position: relative;
}
.choice span::before {
  content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  border-radius: 50%; border: 1.5px solid var(--muted); background: #fff; transition: all .2s;
}
.choice small { display: block; color: var(--muted); font-size: 14px; }
.choice input:checked + span { border-color: var(--wine); background: #fff; box-shadow: 0 0 0 1px var(--wine); }
.choice input:checked + span::before { border-color: var(--wine); box-shadow: inset 0 0 0 4px #fff; background: var(--wine); }
.choice input:focus-visible + span { outline: 2px solid var(--wine); outline-offset: 2px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 17px; /* >=16px: iOS không tự zoom */
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.85); color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(94,43,51,.12); }
.field.is-invalid input { border-color: #b3261e; }
.form__err { color: #b3261e; font-size: 14px; margin-top: 4px; min-height: 0; }
.form__err:empty { display: none; }
.form__status { margin-top: 14px; text-align: center; font-size: 16px; min-height: 1.4em; }
.form__status.is-error { color: #b3261e; }
.form__status.is-busy { color: var(--muted); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rsvp__done { max-width: 420px; margin: 0 auto; background: rgba(255,255,255,.8); border-radius: 16px; padding: 28px 22px; border: 1px solid var(--line); }
.rsvp__done p + p { color: var(--ink-2); line-height: 1.8; }

/* ---------- Cảm ơn ---------- */
.thanks { position: relative; margin-top: 50px; color: #fff; text-align: center; }
.thanks img { width: 100%; }
.thanks::before, .thanks::after { content: ""; position: absolute; left: 0; right: 0; height: 26%; z-index: 1; pointer-events: none; }
.thanks::before { top: 0; background: linear-gradient(var(--paper), rgba(245,244,242,0)); }
.thanks::after { bottom: 0; background: linear-gradient(rgba(245,244,242,0), var(--paper)); }
.thanks__text {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center;
  gap: 22px; padding: 0 24px; background: rgba(0,0,0,.18);
  font-size: 15px; letter-spacing: .14em; line-height: 2; text-shadow: 0 1px 8px rgba(0,0,0,.35);
}
.footer { text-align: center; padding: 26px 0 40px; color: var(--muted); font-size: 14px; letter-spacing: .2em; border-top: 1px solid var(--line); margin: 0 28px; }

/* ---------- Hiệu ứng xuất hiện ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Màn hình mở thiệp ---------- */
.cover {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  text-align: center; overflow: hidden;
}
.cover__panel {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background: var(--paper) url("../img/paper.webp") repeat center / 480px;
  transition: transform 1.5s cubic-bezier(.7, 0, .2, 1);
}
.cover__panel--left { left: 0; box-shadow: inset -30px 0 40px -30px rgba(0,0,0,.12); }
.cover__panel--right { right: 0; box-shadow: inset 30px 0 40px -30px rgba(0,0,0,.12); }
.cover__content { position: relative; padding: 24px 28px calc(24px + env(safe-area-inset-bottom)); max-width: 460px; transition: opacity .6s, transform .8s var(--ease); }
.cover__names { margin: 18px 0 22px; font-weight: 400; }
.cover__names span { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(27px, 7.4vw, 40px); line-height: 1.25; color: var(--wine); }
.cover__names .amp { font-size: 28px; padding: 4px 0; color: var(--muted); }
.cover__invite { color: var(--ink-2); font-size: 17px; line-height: 1.8; }
.cover__venue { margin-top: 14px; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--wine); }
.seal {
  width: 92px; height: 92px; margin: 34px auto 10px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #f6e9ea;
  background: radial-gradient(circle at 35% 30%, #8a4450, var(--wine) 60%, #451d24);
  box-shadow: 0 8px 20px rgba(94,43,51,.35), inset 0 0 0 5px rgba(255,255,255,.08), inset 0 0 0 7px rgba(0,0,0,.08);
  animation: pulse 2.4s ease-in-out infinite;
}
.seal__mono { font-family: var(--display); font-size: 28px; letter-spacing: .02em; }
.seal__mono i { font-size: 18px; padding: 0 2px; opacity: .8; }
.cover__hint { font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.cover.is-opening .cover__content { opacity: 0; transform: scale(.96); }
.cover.is-opening .cover__panel--left { transform: translateX(-102%); }
.cover.is-opening .cover__panel--right { transform: translateX(102%); }
.cover.is-gone { display: none; }

/* ---------- Nút nhạc ---------- */
.music {
  position: fixed; z-index: 40; top: calc(14px + env(safe-area-inset-top)); right: 14px;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.88); color: var(--wine); display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.1); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
@media (min-width: 600px) { .music { right: calc(50% - var(--card-w) / 2 + 14px); top: 42px; } }
.music__disc { width: 28px; height: 28px; }
.music.is-playing .music__disc { animation: spin 4s linear infinite; }
.music__off { position: absolute; width: 30px; height: 1.5px; background: currentColor; transform: rotate(-45deg); }
.music.is-playing .music__off { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.music-tip { position: fixed; z-index: 41; top: calc(68px + env(safe-area-inset-top)); right: 12px; animation: drop .5s var(--ease); }
@media (min-width: 600px) { .music-tip { right: calc(50% - var(--card-w) / 2 + 12px); top: 96px; } }
.music-tip button {
  border: 0; border-radius: 999px; padding: 10px 18px; background: var(--wine); color: #fff; font-size: 15px;
  box-shadow: 0 6px 18px rgba(94,43,51,.35); animation: pulse 1.8s ease-in-out infinite;
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* Trình phát YouTube: ẩn, chỉ hiện khi trình duyệt bắt buộc chạm trực tiếp vào video */
.yt { position: fixed; z-index: 42; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 200px; opacity: 0; pointer-events: none; }
.yt iframe { width: 200px; height: 113px; display: block; border: 0; border-radius: 8px; }
.yt__label, .yt__close { display: none; }
.yt.is-visible { opacity: 1; pointer-events: auto; background: #fff; padding: 8px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.yt.is-visible .yt__label { display: block; font-size: 13px; text-align: center; margin-bottom: 6px; color: var(--wine); }
.yt.is-visible .yt__close { display: block; position: absolute; top: -12px; left: -12px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 18px; line-height: 1; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(20,18,18,.96); touch-action: none; animation: fade .3s; }
.lightbox__stage { position: absolute; inset: 0; overflow: hidden; }
.lightbox__slide {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 56px 8px 64px;
  transition: transform .45s var(--ease), opacity .45s var(--ease);
}
.lightbox__slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox__btn { position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff; border-radius: 50%; width: 46px; height: 46px; font-size: 30px; line-height: 1; display: grid; place-items: center; z-index: 2; }
.lightbox__close { top: calc(10px + env(safe-area-inset-top)); right: 10px; }
.lightbox__prev { left: 10px; top: 50%; margin-top: -23px; }
.lightbox__next { right: 10px; top: 50%; margin-top: -23px; }
.lightbox__bar { position: absolute; left: 0; right: 0; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 18px; align-items: center; color: #ddd; font-size: 15px; z-index: 2; }
.lightbox__bar button { border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 14px; }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: all .3s; z-index: 70; white-space: nowrap;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .sec { padding-left: 18px; padding-right: 18px; }
  .event__day { font-size: 62px; padding: 0 16px; }
  .event__dow { padding-right: 14px; }
  .event__month { padding-left: 14px; }
  .countdown__grid div { min-width: 46px; }
  .countdown__grid b { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .seal, .music-tip button, .music.is-playing .music__disc { animation: none; }
  .cover__panel { transition-duration: .01s; }
}
