.hidden {
  display: none !important;
}

/* =========================================================
   TRANG BÌA CÁ NHÂN HOÁ (TRƯỚC KHI MỞ THIỆP)
   ========================================================= */
.guest-cover {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(168, 22, 44, 0.45), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(56, 4, 12, 0.7), transparent 60%),
    var(--wine-deep);
}

.guest-envelope {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  padding: 38px 26px 32px;
  text-align: center;
  box-shadow:
    0 28px 70px rgba(24, 2, 6, 0.52),
    0 0 0 1px rgba(255, 252, 248, 0.25);
  overflow: hidden;
  animation: envCardIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.env-inner-frame {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(200, 157, 84, 0.42);
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
}

@keyframes envCardIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.env-floral {
  position: absolute;
  top: 14px;
  width: 74px;
  opacity: 0.75;
  pointer-events: none;
  filter: saturate(0.95);
}

.env-floral.left {
  left: -14px;
  transform: rotate(12deg);
}

.env-floral.right {
  right: -14px;
  transform: scaleX(-1) rotate(12deg);
}

.env-seal {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--wine-deep);
  color: var(--paper);
  display: grid;
  place-items: center;
  box-shadow:
    0 6px 16px rgba(92, 8, 20, 0.32),
    inset 0 0 0 2px rgba(243, 215, 155, 0.45);
}

.env-kicker {
  position: relative;
  z-index: 2;
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--wine);
  margin: 0 0 8px;
}

.env-guest-name {
  position: relative;
  z-index: 2;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 6.8vw, 2.15rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 12px;
  padding: 6px 12px;
  border-bottom: 1px dashed rgba(200, 157, 84, 0.6);
  display: inline-block;
}

.env-sub {
  position: relative;
  z-index: 2;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 8px;
}

.env-couple-stack {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0 8px;
}

.env-couple-stack .couple-line {
  font-family: var(--script);
  font-size: clamp(2.5rem, 9.8vw, 3.2rem);
  font-weight: 400;
  line-height: 1.16;
  padding: 0 8px;
}

.env-couple-stack .couple-amp {
  font-family: var(--script);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gold);
  margin: 0;
}

.env-divider {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px auto 10px;
  max-width: 180px;
}

.env-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.env-divider i {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--wine);
}

.env-date {
  position: relative;
  z-index: 2;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink);
  margin: 0 0 22px;
}

.env-open-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 176px;
  min-height: 46px;
  padding: 10px 32px;
  border: 1px solid rgba(243, 215, 155, 0.45);
  border-radius: 999px;
  background: var(--wine-deep);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  box-shadow: 0 10px 24px rgba(92, 8, 20, 0.3);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.env-open-btn:hover {
  background: var(--wine);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(92, 8, 20, 0.38);
}

/* =========================================================
   NỘI DUNG THIỆP CHÍNH
   ========================================================= */
.invite-shell {
  max-width: 480px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 18px 50px rgba(92, 8, 20, 0.12);
  overflow: hidden;
}

.invite-page {
  padding: 16px 12px 40px;
}

@media (min-width: 640px) {
  .invite-page {
    padding: 32px 16px 64px;
  }
}

.section {
  position: relative;
  text-align: center;
  padding: 28px 18px;
}

.section.tight {
  padding: 18px;
}

.section.wine {
  background: var(--wine);
  color: var(--paper);
}

.section-label {
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wine);
  font-weight: 700;
  margin: 0 0 8px;
}

.section.wine .section-label {
  color: rgba(255, 252, 248, 0.88);
}

.section-title {
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 2.6rem);
  color: var(--wine);
  margin: 0 0 8px;
  font-weight: 500;
  line-height: 1.15;
}

.section.wine .section-title {
  color: var(--paper);
}

.section-body {
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.75;
  margin: 0 auto;
  max-width: 36em;
}

.section.wine .section-body {
  color: rgba(255, 252, 248, 0.92);
}

/* Hero */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--wine);
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  background: linear-gradient(180deg, transparent, rgba(255, 252, 248, 0.94) 68%, var(--paper));
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 24px 16px 30px;
  text-align: center;
}

.hero-date {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin: 0 0 6px;
  color: var(--wine);
}

.hero-names {
  font-family: var(--script);
  font-size: clamp(2.35rem, 9.6vw, 3.15rem);
  line-height: 1.2;
  margin: 0;
  font-weight: 400;
  padding: 2px 6px;
}

.hero-amp {
  font-size: 0.8em;
  margin: 0 3px;
}

/* Photo card */
.photo-card {
  position: relative;
  margin: 8px 18px 0;
  padding: 8px;
}

.photo-card img.main {
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.5s ease;
}

.photo-card img.main.is-landscape {
  aspect-ratio: 4 / 3;
}

.photo-card img.main.is-portrait {
  aspect-ratio: 3 / 4;
}

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 360px;
  margin: 16px auto 0;
}

.countdown-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 4px;
}

.countdown-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--wine);
  line-height: 1;
}

.countdown-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

/* Families */
.families {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 8px;
}

.family h3 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wine);
}

.family p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--ink);
}

.couple-big {
  font-family: var(--script);
  font-size: clamp(2.6rem, 10vw, 3.35rem);
  line-height: 1.15;
  margin: 20px 0 8px;
  font-weight: 400;
}

.couple-big span {
  display: block;
}

.couple-amp {
  font-size: 1.65rem;
  margin: 2px 0;
}

/* Event block */
.event-block {
  padding: 8px 0 4px;
}

.event-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wine);
  margin: 0 0 6px;
}

.event-time {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  color: var(--ink);
}

.event-date-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 12px;
}

.event-date-row .side-label {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-top: 1px solid var(--wine);
  border-bottom: 1px solid var(--wine);
  padding: 6px 0;
  min-width: 88px;
  color: var(--wine);
}

.event-day {
  font-family: var(--serif);
  font-size: 3.8rem;
  line-height: 0.95;
  color: var(--wine);
  font-weight: 700;
}

.event-lunar {
  font-style: italic;
  font-size: 0.96rem;
  color: var(--ink);
  margin: 0 0 8px;
}

.event-venue {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
  color: var(--wine);
}

.event-address {
  font-size: 1rem;
  margin: 0 0 14px;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 28px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--wine);
  color: var(--paper);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.map-btn:hover {
  background: var(--wine-deep);
  transform: translateY(-1px);
}

/* Calendar */
.calendar {
  max-width: 360px;
  margin: 12px auto 0;
  color: var(--paper);
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.8rem;
  opacity: 0.85;
  margin-bottom: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.96rem;
}

.calendar-grid span {
  position: relative;
  display: grid;
  place-items: center;
  height: 32px;
}

.calendar-grid span.mark img {
  position: absolute;
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.calendar-grid span.mark em {
  position: relative;
  font-style: normal;
  font-weight: 700;
}

/* =========================================================
   ALBUM ẢNH 3D COVERFLOW CAROUSEL
   ========================================================= */
.gallery-section {
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: hidden;
}

.coverflow {
  position: relative;
  width: 100%;
  height: 370px;
  margin: 8px auto 0;
  perspective: 1100px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.coverflow-track {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.cf-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(224px, 60vw);
  height: min(336px, 88vw);
  border-radius: 14px;
  overflow: hidden;
  background: var(--wine-deep);
  box-shadow: 0 18px 40px rgba(24, 2, 6, 0.45);
  border: 2px solid rgba(255, 252, 248, 0.28);
  cursor: pointer;
  transition:
    transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.48s ease,
    filter 0.48s ease,
    box-shadow 0.48s ease;
  will-change: transform, opacity;
}

.cf-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  pointer-events: none;
}

.cf-slide.is-center {
  border-color: rgba(255, 252, 248, 0.85);
  box-shadow: 0 24px 54px rgba(20, 2, 5, 0.62);
}

.coverflow-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 252, 248, 0.45);
  background: rgba(255, 252, 248, 0.88);
  color: var(--wine-deep);
  font-size: 1.35rem;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(24, 2, 6, 0.32);
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease;
}

.coverflow-nav.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.coverflow-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.coverflow-nav.prev { left: 10px; }
.coverflow-nav.next { right: 10px; }

.coverflow-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 0 16px;
  flex-wrap: wrap;
}

.cf-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.36);
  transition: width 0.28s ease, background 0.28s ease;
}

.cf-dot.active {
  width: 22px;
  background: var(--paper);
}

/* =========================================================
   LIGHTBOX PHÓNG TO ẢNH + THANH THUMBNAIL PHÍA DƯỚI
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(16, 4, 7, 0.96);
  backdrop-filter: blur(8px);
  padding: 12px 10px 14px;
  color: var(--paper);
  user-select: none;
  -webkit-user-select: none;
}

.lightbox.open {
  display: flex;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 3;
}

.lightbox-counter {
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  color: rgba(255, 252, 248, 0.88);
  padding-left: 6px;
}

.lightbox-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 252, 248, 0.35);
  background: rgba(255, 252, 248, 0.12);
  color: var(--paper);
  font-size: 1.45rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.lightbox-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
  margin: 6px 0;
}

.lightbox-img {
  max-width: 94vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  transition: opacity 0.22s ease;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 252, 248, 0.35);
  background: rgba(92, 8, 20, 0.76);
  color: var(--paper);
  font-size: 1.45rem;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease;
}

.lightbox-nav.prev { left: 8px; }
.lightbox-nav.next { right: 8px; }

.lightbox-nav.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    background: rgba(92, 8, 20, 0.68);
  }
}

.screen-swipe-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 14px);
  z-index: 95;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(42, 4, 10, 0.88);
  color: var(--paper);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 252, 248, 0.22);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
}

.screen-swipe-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.lightbox-thumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 8px 2px;
  max-width: 100%;
}

.lb-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(255, 252, 248, 0.1);
  opacity: 0.48;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-thumb.active {
  opacity: 1;
  border-color: var(--wine);
  box-shadow: 0 0 0 1px rgba(255, 252, 248, 0.75);
  transform: scale(1.06);
}

/* Thanks */
.thanks {
  position: relative;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--paper);
  overflow: hidden;
}

.thanks img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.thanks .fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(92, 8, 20, 0.75) 70%, rgba(92, 8, 20, 0.9));
}

.thanks-content {
  position: relative;
  z-index: 2;
  padding: 28px 20px 36px;
  text-align: center;
}

.thanks-content h2 {
  font-family: var(--script);
  font-size: 2.8rem;
  margin: 0 0 8px;
  font-weight: 400;
}

.thanks-content p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.65;
  opacity: 0.95;
}

.invite-footer {
  text-align: center;
  padding: 18px 16px 8px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}