/* ===== Thiệp cưới — Sang trọng, hiện đại, tone trắng ===== */
:root {
  --white: #ffffff;
  --ivory: #faf9f6;
  --cream: #f7f5f0;
  --gold: #b9a46c;
  --gold-dark: #9a854e;
  --ink: #2f2c27;
  --gray: #7a766e;
  --serif: "Cormorant Infant", serif;
  --script: "Great Vibes", cursive;
  --script-main: "Carattere", cursive;
  --amp-font: "Fuzzy Bubbles", cursive;
  --sans: "Be Vietnam Pro", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.12rem;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.script { font-family: var(--script); font-weight: 400; }
.amp { font-family: var(--amp-font); color: var(--gold); font-size: 0.5em; vertical-align: middle; }

/* dòng chữ chính: tên cặp đôi, tiêu đề mục */
.hero-names,
.section-title {
  font-family: var(--script-main);
  font-weight: 400;
}

/* ===== Nút ===== */
.btn {
  display: inline-block;
  padding: 0.8rem 2.2rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  background: transparent;
  border-radius: 999px;
  transition: all 0.3s ease;
}
.btn:hover { background: var(--gold); color: var(--white); }

.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }

.btn-line { font-size: 0.8rem; padding: 0.5rem 1.4rem; margin-top: 1rem; }

/* ===== Màn hình mở thiệp ===== */
.cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(252, 251, 247, 0.78), rgba(250, 249, 246, 0.9)),
    url("https://images.unsplash.com/photo-1519225421980-715cb0215aed?auto=format&fit=crop&w=1600&q=80") center / cover no-repeat fixed,
    var(--cream);
  padding: 1.5rem;
  transition: opacity 0.9s ease, visibility 0.9s;
  overflow: hidden;
}

/* khung viền gold ôm màn hình */
.cover::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(185, 164, 108, 0.5);
  pointer-events: none;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(185, 164, 108, 0.25);
  pointer-events: none;
}
.cover.closed { opacity: 0; visibility: hidden; }

/* --- Cánh hoa rơi --- */
.petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.petals span {
  position: absolute;
  top: -5vh;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #ffffff, #ece2cb);
  border-radius: 80% 0 80% 0;
  opacity: 0.85;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  animation: petalFall linear infinite;
}
.petals span:nth-child(1) { left: 6%;  animation-duration: 10s; animation-delay: 0s; }
.petals span:nth-child(2) { left: 20%; animation-duration: 13s; animation-delay: 2.5s; width: 10px; height: 10px; }
.petals span:nth-child(3) { left: 34%; animation-duration: 9s;  animation-delay: 5s; }
.petals span:nth-child(4) { left: 48%; animation-duration: 14s; animation-delay: 1s; width: 11px; height: 11px; }
.petals span:nth-child(5) { left: 62%; animation-duration: 11s; animation-delay: 4s; }
.petals span:nth-child(6) { left: 74%; animation-duration: 12s; animation-delay: 7s; width: 9px; height: 9px; }
.petals span:nth-child(7) { left: 86%; animation-duration: 10s; animation-delay: 3s; }
.petals span:nth-child(8) { left: 94%; animation-duration: 15s; animation-delay: 6s; width: 12px; height: 12px; }
@keyframes petalFall {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); }
  25%  { transform: translateY(28vh) translateX(-18px) rotate(140deg); }
  50%  { transform: translateY(55vh) translateX(14px) rotate(280deg); }
  75%  { transform: translateY(80vh) translateX(-12px) rotate(420deg); }
  100% { transform: translateY(108vh) translateX(10px) rotate(560deg); }
}

.cover-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  max-width: 460px;
}

.cover-ornament {
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.cover-greet {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  color: #211e19;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.95), 0 0 26px rgba(255, 255, 255, 0.85);
}
.cover-greet strong { color: #8a7440; font-weight: 700; }

.cover-msg {
  font-style: italic;
  font-size: 1.08rem;
  font-weight: 500;
  color: #4d483e;
  margin: 0.3rem 0 2.4rem;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.95), 0 0 22px rgba(255, 255, 255, 0.85);
}

/* --- Phong bì (nhìn từ mặt sau, 4 nếp gấp chéo) --- */
.envelope {
  position: relative;
  width: min(460px, 88vw);
  aspect-ratio: 16 / 11;
  margin: 0 auto 2.6rem;
  cursor: pointer;
  perspective: 1100px;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.16));
  transition: transform 0.3s ease;
  animation: envFloat 3.2s ease-in-out infinite;
}
.envelope:hover { transform: scale(1.03); }
@keyframes envFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}
.cover.opening .envelope { animation: none; }

.env-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #ece7da 0%, #ded7c4 100%);
  border: 1px solid #d5cdba;
  border-radius: 12px;
  z-index: 1;
}

/* viền bóng trong tạo chiều sâu */
.envelope::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 22px rgba(105, 98, 80, 0.12), inset 0 -2px 6px rgba(105, 98, 80, 0.08);
  z-index: 6;
  pointer-events: none;
}

.env-letter {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 7%;
  bottom: 10%;
  background:
    linear-gradient(175deg, #ffffff 0%, #fbf9f4 100%);
  border: 1px solid #e8e2d4;
  box-shadow: inset 0 0 0 5px #ffffff, inset 0 0 0 6px rgba(185, 164, 108, 0.45);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}
.letter-small {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.6rem;
  color: var(--gray);
}
.letter-names {
  font-family: "Tapestry", cursive;
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  color: var(--ink);
  line-height: 1.2;
}
.letter-names .amp { font-family: "Tapestry", cursive; }
.letter-date {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  color: var(--gold-dark);
}

/* hai nếp gấp bên — nền là màu viền nét, lớp lót ::before là giấy */
.env-side {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #c3b492;
}
.env-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f8f4e8 0%, #efe8d4 55%, #e3d8bb 98%);
}
.env-side-l { clip-path: polygon(0 0, 50% 50%, 0 100%); }
.env-side-l::before { clip-path: polygon(0 1%, 49% 50%, 0 99%); }
.env-side-r {
  clip-path: polygon(100% 0, 100% 100%, 50% 50%);
}
.env-side-r::before {
  clip-path: polygon(100% 1%, 100% 99%, 51% 50%);
  background: linear-gradient(270deg, #f8f4e8 0%, #efe8d4 55%, #e3d8bb 98%);
}

/* nếp gấp đáy — có viền nét dọc hai mép chéo */
.env-bottom {
  position: absolute;
  inset: 0;
  z-index: 3;
  clip-path: polygon(0 100%, 50% 45%, 100% 100%);
  background: #c3b492;
  border-radius: 0 0 12px 12px;
  filter: drop-shadow(0 -2px 2px rgba(95, 85, 60, 0.25));
}
.env-bottom::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0.45% 99.2%, 50% 46.6%, 99.55% 99.2%);
  background: linear-gradient(180deg, #e3d8ba 0%, #f1ebd8 45%, #faf6ec 100%);
  border-radius: 0 0 12px 12px;
}

/* nắp trên — viền nét hai mép chéo, mở ra khi bấm */
.env-flap {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #bcac87;
  clip-path: polygon(0 0, 100% 0, 50% 54%);
  border-radius: 12px 12px 0 0;
  transform-origin: top center;
  backface-visibility: hidden;
  filter: drop-shadow(0 3px 2.5px rgba(95, 85, 60, 0.32));
}
.env-flap::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0.45% 0.8%, 99.55% 0.8%, 50% 52.4%);
  background: linear-gradient(180deg, #f6f0de 0%, #ece1c5 60%, #ded0aa 100%);
  border-radius: 12px 12px 0 0;
}

/* dấu sáp — ảnh PNG nền trong suốt */
.env-seal {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: 5;
  width: clamp(96px, 27vw, 130px);
  height: clamp(96px, 27vw, 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 6px rgba(80, 60, 20, 0.4));
}
.env-seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Nút mở thiệp cách điệu --- */
.btn-open {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.6rem 1rem;
  font-family: var(--serif);
  color: #8a7440;
}
.btn-open-text {
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  border-bottom: 1px solid var(--gold-dark);
  padding-bottom: 0.25rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.95), 0 0 20px rgba(255, 255, 255, 0.8);
  transition: letter-spacing 0.35s ease, color 0.3s ease;
}
.btn-open-line {
  position: relative;
  width: 52px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  transition: width 0.35s ease;
}
.btn-open-line::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  width: 6px;
  height: 6px;
  translate: 0 -50%;
  rotate: 45deg;
  background: var(--gold);
}
.btn-open-line.flip { scale: -1 1; }
.btn-open:hover .btn-open-text { letter-spacing: 0.5em; color: var(--ink); }
.btn-open:hover .btn-open-line { width: 70px; }

/* --- Chuỗi animation khi mở --- */
.cover.opening .env-seal { animation: sealPop 0.5s ease forwards; }
@keyframes sealPop {
  40% { translate: -50% -50%; scale: 1.15; opacity: 1; }
  100% { translate: -50% -50%; scale: 0; opacity: 0; }
}

.cover.opening .env-flap { animation: flapOpen 0.9s ease 0.4s forwards; }
@keyframes flapOpen {
  0%   { transform: rotateX(0); z-index: 4; }
  99%  { z-index: 4; }
  100% { transform: rotateX(180deg); z-index: 1; }
}

.cover.opening .env-letter { animation: letterOut 1s ease 1.15s forwards; }
@keyframes letterOut {
  to { top: -75%; bottom: 85%; min-height: 82%; scale: 1.08; box-shadow: 0 18px 40px rgba(0,0,0,0.15); }
}

.cover.opening .cover-greet,
.cover.opening .cover-msg,
.cover.opening #open-btn {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* ===== Nút nhạc ===== */
.music-btn {
  position: fixed;
  right: 1.1rem;
  bottom: 4.4rem;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--white);
  color: var(--gold-dark);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s;
}
.music-btn.playing { animation: spin 4s linear infinite; }
.music-btn.muted { opacity: 0.5; }
.scroll-btn { bottom: 1.1rem; }
.scroll-btn svg { display: block; width: 20px; height: 20px; margin: auto; }
.scroll-btn.playing svg { animation: scrollBob 1.4s ease-in-out infinite; }
@keyframes scrollBob { 50% { transform: translateY(3px); } }
.scroll-btn.playing { animation: none; border-color: var(--gold-dark); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 4rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), rgba(250,249,246,0.9)),
    radial-gradient(ellipse at bottom, #f0ece1 0%, var(--ivory) 65%);
}

.hero-photo {
  flex-shrink: 0;
  max-width: none;
  width: min(100%, 560px);
  height: auto;
  border: 1px solid var(--gold);
  padding: 0.5rem;
  background: var(--white);
  margin-bottom: 2rem;
}

.hero-top {
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.75rem;
  color: var(--gray);
}

.hero-names {
  font-family: "Tapestry", cursive;
  font-size: clamp(3rem, 11vw, 5rem);
  color: var(--ink);
  margin: 0.5rem 0;
  line-height: 1.25;
}
.hero-names .amp { font-family: "Tapestry", cursive; }

.hero-date {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.25em;
  color: var(--gold-dark);
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gold);
  margin: 2rem 0;
}
.divider::before,
.divider::after {
  content: "";
  width: 70px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
}

/* ===== Đếm ngược ===== */
.countdown { display: flex; gap: 0.8rem; }

.cd-box {
  width: 74px;
  padding: 0.9rem 0.3rem;
  background: var(--white);
  border: 1px solid #e8e2d4;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}
.cd-box span {
  display: block;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--gold-dark);
  line-height: 1.1;
}
.cd-box small {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray);
}

/* ===== Section chung ===== */
.section {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

.section-title {
  font-size: clamp(2.2rem, 7vw, 3rem);
  color: var(--gold-dark);
  margin-bottom: 2.2rem;
}

/* ===== Lời ngỏ ===== */
.section.invite { padding-top: 2rem; }
.invite-text {
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.02rem;
  color: var(--ink);
}
.guest-name { color: var(--gold-dark); font-weight: 500; }

/* ===== Cặp đôi ===== */
.couple-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-width: 560px;
  margin: 0 auto;
}

.couple-card {
  width: 50%;
  text-align: center;
}
.couple-card.bride {
  position: relative;
  z-index: 1;
}
.couple-card.groom {
  position: relative;
  z-index: 2;
  margin-top: 3.5rem;
  margin-left: -1%;
}

.photo-frame {
  position: relative;
  width: 100%;
  margin: 0 auto 1rem;
}
.couple-card.groom .photo-frame { transform: rotate(-4deg); }
.couple-card.bride .photo-frame { transform: rotate(5deg); }

.frame-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(60, 40, 20, 0.28));
}
.frame-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 83%;
  color: var(--ink);
  line-height: 1.15;
  pointer-events: none;
}
.frame-role {
  display: block;
  font-family: var(--script-main);
  font-size: clamp(1rem, 4.2vw, 1.9rem);
}
.frame-name {
  display: block;
  margin-top: 0.15em;
  font-family: var(--sans);
  font-size: clamp(0.55rem, 2vw, 0.9rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.couple-parents { font-size: 0.88rem; color: var(--gray); }
.couple-card.bride .couple-parents { transform: translateX(-24px); }
.couple-card.groom .couple-parents { transform: translateX(24px); }

/* ===== Sự kiện ===== */
.section.events {
  max-width: none;
  background: #e6dbc1;
}
.event-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.event-card {
  --r: 20px;
  flex: 1 1 280px;
  max-width: 360px;
  background: #fffcf7;
  padding: 2.4rem 2rem;
  -webkit-mask:
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--r)) calc(100% - 2 * var(--r)) no-repeat,
    radial-gradient(circle var(--r) at center, #000 98%, transparent 100%) left top / calc(2 * var(--r)) calc(2 * var(--r)) round no-repeat,
    radial-gradient(circle var(--r) at center, #000 98%, transparent 100%) left bottom / calc(2 * var(--r)) calc(2 * var(--r)) round no-repeat,
    radial-gradient(circle var(--r) at center, #000 98%, transparent 100%) left top / calc(2 * var(--r)) calc(2 * var(--r)) no-repeat round,
    radial-gradient(circle var(--r) at center, #000 98%, transparent 100%) right top / calc(2 * var(--r)) calc(2 * var(--r)) no-repeat round;
  mask:
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--r)) calc(100% - 2 * var(--r)) no-repeat,
    radial-gradient(circle var(--r) at center, #000 98%, transparent 100%) left top / calc(2 * var(--r)) calc(2 * var(--r)) round no-repeat,
    radial-gradient(circle var(--r) at center, #000 98%, transparent 100%) left bottom / calc(2 * var(--r)) calc(2 * var(--r)) round no-repeat,
    radial-gradient(circle var(--r) at center, #000 98%, transparent 100%) left top / calc(2 * var(--r)) calc(2 * var(--r)) no-repeat round,
    radial-gradient(circle var(--r) at center, #000 98%, transparent 100%) right top / calc(2 * var(--r)) calc(2 * var(--r)) no-repeat round;
}
.event-icon svg { width: 120px; height: auto; margin-bottom: 0.8rem; }
.event-card h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b4a1e;
  margin-bottom: 0.5rem;
}
.event-time { color: #6b4a1e; font-weight: 500; font-size: 1rem; }

/* ===== Lịch cưới ===== */
.section.calendar { padding-top: 4rem; padding-bottom: 0; }
.cal-wrap { max-width: 400px; margin: 0 auto; }
.cal-month {
  font-family: var(--script-main);
  font-size: 3.4rem;
  font-weight: 400;
  line-height: 1.1;
  color: #6b4a1e;
}
.cal-year {
  font-family: var(--serif);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--gold-dark);
  margin: 0.2rem 0 1.6rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 0.4rem;
}
.cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--gray);
}
.cal-day.heart {
  position: relative;
  isolation: isolate;
  color: #fff;
  font-weight: 700;
}
.cal-day.heart::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -23px 0 0 -20px;
  z-index: -1;
  background: url("../images/trai_tim_2.webp") center / 100% 100% no-repeat;
}
.event-venue {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b4a1e;
  margin-top: 0.6rem;
}
.event-place { color: var(--gray); font-size: 1rem; margin-top: 0.3rem; }
.event-map {
  display: inline-block;
  margin-top: 1rem;
  font-size: 1rem;
  color: #d49aa8;
  text-decoration: underline;
}

/* ===== Album ===== */
.section.album { padding-top: 3rem; padding-bottom: 0; }
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row dense;
  align-items: center;
  gap: 0.6rem;
}
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e8e2d4;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}
/* Hàng 1: ảnh 1 full width; hàng 2: ảnh 2-4 (auto); hàng 3-4: ảnh 5 lớn bên trái, ảnh 6-7 xếp cột phải */
.gallery img:nth-child(1) { grid-column: 1 / span 3; grid-row: 1; }
.gallery img:nth-child(5) { grid-column: 1 / span 2; grid-row: 3 / span 2; }
.gallery img:nth-child(6) { grid-column: 3; grid-row: 3; }
.gallery img:nth-child(7) { grid-column: 3; grid-row: 4; }
.gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
}

/* ===== Slider ảnh ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 14, 8, 0.92);
}
.lightbox[hidden] { display: none; }
.lb-img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border: 6px solid #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.lb-img.lb-in { animation: lbSlide 0.35s ease; }
@keyframes lbSlide {
  from { opacity: 0; transform: translateX(var(--dir, 40px)) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.lb-btn {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.6rem;
  line-height: 1;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  opacity: 0.85;
}
.lb-btn:hover { opacity: 1; }
.lb-close { top: 0.4rem; right: 0.4rem; font-size: 2.2rem; }
.lb-prev { left: 0.4rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.4rem; top: 50%; transform: translateY(-50%); }


/* ===== Mừng cưới ===== */
.section.gift { margin-top: 0.6rem; padding-left: 0; padding-right: 0; width: calc(100% - 3rem); max-width: calc(860px - 3rem); }
.gift {
  max-width: none;
  aspect-ratio: 1376 / 768;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: url("../images/nen/nen_laptop.png") center / contain no-repeat;
}
@media (min-width: 1921px) {
  .gift { aspect-ratio: 1376 / 768; background-image: url("../images/nen/nen_pc.png"); }
}
@media (min-width: 1025px) and (max-width: 1920px) {
  .gift { aspect-ratio: 1200 / 896; background-image: url("../images/nen/nen_ipad.png"); }
}
@media (max-width: 1024px) {
  .gift { aspect-ratio: 1200 / 896; background-image: url("../images/nen/nen_ipad.png"); }
}
@media (max-width: 480px) {
  .gift { aspect-ratio: 768 / 1376; background-image: url("../images/nen/nen_mobile.png"); }
}
.gift-panel {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
  background: none;
  padding: 2.4rem 2.4rem 2.2rem;
  color: #6b4a1e;
  line-height: 1.8;
}
.gift-panel p { margin-bottom: 1rem; }
@media (min-width: 1025px) {
  .section.gift { container-type: inline-size; }
  .gift-panel { max-width: min(860px, 71.5cqw); padding: 0.9rem 1.6rem 0.8rem; line-height: 1.5; font-size: 0.92rem; }
  .gift-panel p { margin-bottom: 0.4rem; }
  .gift-lead { font-size: 1.7rem; margin-bottom: 0.4rem; }
  .gift-btn { width: 170px; height: 60px; font-size: 1.05rem; margin-top: 0.2rem; }
}
@media (min-width: 481px) and (max-width: 1024px) {
  .section.gift { padding-bottom: 6.5rem; }
  .gift-panel { max-width: min(580px, 77%); }
}
@media (max-width: 1024px) {
  .section.gift { width: calc(100% - 4rem); max-width: calc(860px - 4rem); }
  .gift-panel { padding: 1.8rem 1rem 0.5rem; line-height: 1.5; font-size: 0.92rem; }
  .gift-panel p { margin-bottom: 0.5rem; }
  .gift-lead { font-size: 1.6rem; margin-bottom: 0.6rem; }
  .gift-btn { width: 170px; height: 68px; font-size: 1.1rem; margin-top: 0.3rem; }
}
@media (max-width: 480px) {
  .section.gift { width: calc(100% - 2.4rem); max-width: calc(860px - 2.4rem); }
  .gift-panel { max-width: 86%; padding: 0.6rem 0.8rem 0.5rem; line-height: 1.45; font-size: 0.86rem; }
  .gift-panel p { margin-bottom: 0.4rem; }
  .gift-lead { font-size: 1.45rem; margin-bottom: 0.4rem; }
  .gift-btn { width: 150px; height: 60px; font-size: 1.05rem; margin-top: 0.3rem; }
}
.gift-lead {
  font-family: var(--script-main);
  font-size: 1.9rem;
  line-height: 1.5;
  margin-bottom: 1.4rem;
}
.gift-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 80px;
  margin-top: 0.6rem;
  padding: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80' preserveAspectRatio='none'%3E%3Cpath d='M4 40 C10 22 26 14 44 16 Q60 10 78 15 Q100 8 122 15 Q140 10 156 16 C174 14 190 22 196 40 C190 58 174 66 156 64 Q140 70 122 65 Q100 72 78 65 Q60 70 44 64 C26 66 10 58 4 40 Z' fill='none' stroke='%23b8a77a' stroke-width='1.4'/%3E%3Cpath d='M14 40 Q18 33 25 35 Q28 39 24 42 Q20 43 19 40' fill='none' stroke='%23b8a77a' stroke-width='1'/%3E%3Cpath d='M186 40 Q182 33 175 35 Q172 39 176 42 Q180 43 181 40' fill='none' stroke='%23b8a77a' stroke-width='1'/%3E%3Cpath d='M86 12 Q100 4 114 12 M86 68 Q100 76 114 68' fill='none' stroke='%23b8a77a' stroke-width='1'/%3E%3Ccircle cx='100' cy='12' r='1.6' fill='%23b8a77a'/%3E%3Ccircle cx='100' cy='68' r='1.6' fill='%23b8a77a'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  border: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b4a1e;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.3s ease;
}
.gift-btn:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.gift-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1.2rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(241, 201, 210, 0.45) 0 90px, transparent 91px),
    radial-gradient(circle at 85% 75%, rgba(199, 214, 184, 0.45) 0 110px, transparent 111px),
    linear-gradient(135deg, #f7f1e3, #f2ebdc);
  color: #6b4a1e;
  text-align: center;
}
.gift-screen[hidden] { display: none; }
.gift-screen-box { width: min(360px, 100%); margin: auto 0; }
.gift-screen-box h3 {
  font-size: 2.8rem;
  font-weight: 400;
  margin-bottom: 1rem;
}
.gift-screen-box img {
  width: 260px;
  max-width: 100%;
  margin: 0 auto 1.2rem;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(90, 70, 40, 0.12);
}
.gift-screen-box p { font-size: 1rem; line-height: 1.8; color: var(--gray); }
.gift-back {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.6rem;
  background: none;
  border: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: underline;
  color: #6b4a1e;
  cursor: pointer;
}

/* ===== RSVP / LỜI CHÚC ===== */
.rsvp-panel {
  max-width: 480px;
  margin: 0 auto;
  padding: 2.6rem 2.2rem 2.2rem;
  background: #fffaf5;
  border: 1px solid rgba(201, 169, 106, 0.45);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(90, 70, 40, 0.1);
  color: #6b4a1e;
  text-align: left;
}
.rsvp-lead {
  font-family: var(--script-main);
  font-size: 1.5rem;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 1.8rem;
}
.rsvp-form { display: flex; flex-direction: column; gap: 1.1rem; }
.rsvp-field { display: flex; flex-direction: column; gap: 0.35rem; border: 0; min-width: 0; }
.rsvp-field > span,
.rsvp-field legend { font-size: 1rem; padding: 0; margin-bottom: 0.3rem; }
.rsvp-field input[type="text"],
.rsvp-field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--gold);
  border-radius: 8px;
  outline: none;
}
.rsvp-field textarea { resize: vertical; }
.rsvp-field input:focus,
.rsvp-field textarea:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(185, 164, 108, 0.2); }
.rsvp-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.4rem;
  background: #efe6d8;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}
.rsvp-option input { accent-color: var(--gold-dark); }
.rsvp-error { font-size: 0.85rem; color: #b8343b; margin-top: 0.2rem; }
.rsvp-submit {
  align-self: center;
  margin-top: 0.4rem;
  padding: 0.7rem 2.6rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #6b4a1e;
  background: #ecd7dc;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.rsvp-submit:hover { opacity: 0.85; }
.rsvp-note { font-size: 0.8rem; color: var(--gray); text-align: center; }
.rsvp-thanks { font-family: var(--script-main); font-size: 1.4rem; text-align: center; color: #6b4a1e; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  background:
    linear-gradient(180deg, var(--ivory), #f0ece1);
}
.footer-thanks {
  font-size: 3rem;
  color: var(--gold-dark);
  margin-bottom: 0.4rem;
}
.footer-names {
  font-family: var(--serif);
  letter-spacing: 0.15em;
  color: var(--gray);
}

main#invitation { overflow-x: clip; }

/* ===== Responsive: iPad (tablet) ===== */
@media (max-width: 1024px) {
  .hero { padding-top: 0; min-height: 0; justify-content: flex-start; }
  .hero-photo { width: 100vw; border: 0; padding: 0; margin-bottom: 2rem; }
  .section { padding: 3rem 2rem; }
  .hero-names { font-size: clamp(3rem, 9vw, 4.5rem); }
  .cover-content { max-width: 520px; }
  .cover-greet { font-size: 1.7rem; }
}

/* Màn hình thấp (điện thoại ngang, iPad ngang) */
@media (max-height: 700px) {
  .cover { padding: 1rem; }
  .cover-msg { margin-bottom: 1.4rem; }
  .envelope { width: min(400px, 70vw); margin-bottom: 1.6rem; }
  .btn-open { margin-top: 0.6rem; }
}

/* ===== Responsive: điện thoại ===== */
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .cover-greet { font-size: 1.3rem; }
  .cover-msg { font-size: 1rem; margin-bottom: 1.8rem; }
  .hero { padding: 0 1.2rem 3rem; min-height: 0; justify-content: flex-start; }
  .hero-photo { width: 100vw; margin-bottom: 1.5rem; }
  .hero-date { font-size: 1.05rem; letter-spacing: 0.15em; }
  .divider { margin: 1.5rem 0; }
  .countdown { gap: 0.5rem; }
  .cd-box { width: 64px; }
  .cd-box span { font-size: 1.5rem; }
  .section { padding: 3rem 1.2rem; }
  .section-title { margin-bottom: 1.6rem; }
  .event-card, .gift-card { padding: 1.4rem 1.1rem; }
  .event-card h3 { font-size: 1.3rem; }
  .gift-card img { width: 150px; }
  .footer-thanks { font-size: 2.4rem; }
  .btn { padding: 0.7rem 1.6rem; }
}
