:root {
  --rose: #FADADD;
  --cream: #FFF7F3;
  --ink: #3f2a2a;
  --gold: #E5C8A8;
  --muted: #8f6f6f;
  --shadow: 0 10px 30px rgba(63, 42, 42, .08);
  --radius: 18px;
}

html {
  scroll-behavior: smooth
}

body {
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--cream), #fff);
  margin: 0;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto
}

a {
  text-decoration: none;
  color: inherit
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(10px);
  background: rgba(255, 247, 243, .6);
  border-bottom: 1px solid rgba(229, 200, 168, .35)
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 0
}

.brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: .5px
}

.brand .amp {
  color: var(--gold)
}

.nav ul {
  display: flex;
  gap: 1.2rem;
  list-style: none;
  padding: 0;
  margin: 0
}

.nav a {
  padding: .5rem .8rem;
  border-radius: 999px
}

.nav a:hover {
  background: rgba(234, 204, 188, .35)
}

/* Nav Toggle (Hamburger) */
.nav-toggle {
  display: none; /* Ẩn trên desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle .bar {
  display: block;
  width: 25px; height: 3px; margin: 5px auto;
  background-color: var(--ink); transition: all 0.3s ease-in-out;
}
.hero {
  position: relative;
  min-height: 88dvh;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(250, 218, 221, .55), rgba(255, 247, 243, .6)), url('../images/002A8342.JPG');
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 247, 243, 0.4);
}

.hero-card {
  position: relative;
  z-index: 2;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(229, 200, 168, .5);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  width: min(680px, 92%)
}

.names {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 6vw, 54px);
  line-height: 1.1;
  margin: 0;
}

.names .amp {
  color: var(--gold)
}

.tagline {
  margin: .6rem 0 1rem;
  font-weight: 500;
  font-family: 'Playfair Display', serif;
  font-size: clamp(12px, 4vw, 30px);
  color: var(--muted)
}

.date {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  letter-spacing: .5px;
  font-size: clamp(12px, 4vw, 30px);
}

.cta-row {
  display: flex;
  gap: .8rem;
  justify-content: center;
  margin-top: 1.2rem;
  flex-wrap: wrap
}

.btn {
  border: none;
  background: var(--ink);
  color: #fff;
  padding: .85rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-weight: 600
}

.btn.alt {
  background: var(--gold);
  color: #2b1c1c
}

section {
  padding: 80px 20px
}

.sec-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 4vw, 36px);
  text-align: center;
  margin: 0 0 28px
}

.sec-desc {
  text-align: center;
  font-family: 'Playfair Display', serif;
  color: var(--muted);
  margin: -10px auto 32px;
  max-width: 720px;
  font-size: clamp(16px, 4vw, 28px)
}

.card {
  background: #fff;
  border: 1px solid rgba(229, 200, 168, .35);
  border-radius: var(--radius);
  box-shadow: var(--shadow)
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(20px, 1fr));
  gap: 14px
}

.unit {
  padding: 22px;
  text-align: center
}

.num {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700
}

.label {
  color: var(--muted);
  font-size: .95rem
}

.couple {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px
}

.couple .photo {
  border-radius: var(--radius);
  overflow: hidden
}

.couple .bio {
  display: grid;
  place-content: center;
  padding: 18px
}

.bio h3 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  margin: 0 0 8px
}

.bio p {
  color: var(--muted);
  margin: .2rem 0
}

@media(max-width:900px) {
  .couple {
    grid-template-columns: 1fr
  }

  /* Responsive Nav */
  .nav-toggle { display: block; z-index: 100; }
  .nav-links {
    position: absolute;
    top: 100%; right: 0;
    background: rgba(255, 247, 243, .95);
    backdrop-filter: blur(10px);
    width: 100%;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease-out;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(229, 200, 168, .35);
  }
  .nav-links.open { transform: scaleY(1); }
  .nav-links ul { flex-direction: column; align-items: center; gap: .5rem; }
  .nav-links a { display: block; width: 100%; text-align: center; }

  /* Hamburger animation */
  .nav-toggle.open .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.open .bar:nth-child(2) { opacity: 0; }
  .nav-toggle.open .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px
}

@media(max-width:900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

.grid a {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(229, 200, 168, .35)
}

.grid img {
  transition: transform .6s ease
}

.grid a:hover img {
  transform: scale(1.06)
}

.timeline {
  position: relative;
  padding-left: 30px; /* Tăng padding để có không gian cho đường kẻ và dấu chấm */
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px; /* Căn đường kẻ timeline về bên trái */
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--gold), rgba(229, 200, 168, .35));
}

.step {
  position: relative;
  margin: 28px 0;
  padding-left: 25px; /* Tạo khoảng cách giữa dấu chấm và hộp nội dung */
}

/* Không cần căn phải nữa */
.step:nth-child(odd) .box {
  text-align: left;
}

.step .dot {
  position: absolute;
  left: 0; /* Đặt dấu chấm vào đầu mỗi step */
  top: 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(229, 200, 168, .25)
}

.step .box {
  padding: 18px
}

.step h4 {
  margin: 0 0 8px;
  font-size: 20px
}

.step p {
  margin: 0;
  color: var(--muted)
}

@media(max-width:900px) {
  .step {
    padding-left: 20px; /* Điều chỉnh lại padding cho mobile */
  }

  .timeline {
    padding-left: 20px;
  }
}

.message-box {
  display: grid;
  gap: 12px
}

input,
textarea {
  padding: .9rem 1rem;
  border: 1px solid rgba(229, 200, 168, .6);
  border-radius: 12px;
  font: inherit;
  background: #fff
}

textarea {
  min-height: 100px;
  resize: vertical
}

.messages-list {
  margin-top: 24px;
  display: grid;
  gap: 10px;
  max-height: 500px; /* Giới hạn chiều cao, tương đương khoảng 5-7 tin nhắn */
  overflow-y: auto; /* Tự động thêm thanh cuộn khi nội dung vượt quá */
}

.msg-item {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid rgba(229, 200, 168, .35);
  box-shadow: var(--shadow)
}

.msg-item p {
  margin: 0;
  color: var(--muted)
}

.footer {
  padding: 26px 0 60px;
  text-align: center;
  color: var(--muted)
}

.audio-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease
}

.reveal.show {
  opacity: 1;
  transform: none
}

/* Lightbox Styles */
.lightbox {
  border: none;
  padding: 0;
  background: rgba(30, 20, 20, .8);
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
}

.lightbox::backdrop {
  background: rgba(30, 20, 20, .8);
  backdrop-filter: blur(4px);
}

.lightbox .lightbox-inner {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 1rem;
}

.lightbox img {
  max-width: 100%;
  max-height: 95vh; /* Giới hạn chiều cao ảnh để không bị tràn màn hình */
  border-radius: 8px;
}

.lightbox .close-x {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
}

/* Location Grid */
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.location-card {
  padding: 22px;
  text-align: center;
}

.location-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  margin: 0 0 10px;
}

.location-card .map-container {
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}

#giftbox {
    /* background: var(--rose); */
    padding: 80px 0;
  }
  #giftbox .sec-title {
    color: var(--ink);
  }
  .gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
  }
  .gift-card {
    background: #fff;
    border: 2px solid rgba(229, 200, 168, .5);
    border-radius: 18px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
  }
  .gift-card h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 16px;
    color: var(--ink);
  }
  .gift-card img {
    width: 200px;
    margin: 10px auto 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  }
  .gift-card p {
    margin: 4px 0;
    color: var(--muted);
    font-size: 15px;
  }

@media (max-width: 900px) {
  .location-grid {
    grid-template-columns: 1fr;
  }
}