/*
 * Thiệp cưới: phong cách lãng mạn pastel.
 * Giao diện luôn sáng (mô phỏng thiệp giấy), không đổi theo chế độ tối của máy.
 *
 * Quy tắc bo góc: nút bấm bo tròn hẳn (pill), ảnh chân dung khung vòm,
 * thẻ và ảnh còn lại bo 20px, ô nhập liệu bo 14px.
 */

:root {
  --bg: #fcf6f5;
  --bg-tint: #f8eaea;
  --surface: #fffbfa;
  --line: #ecd6d6;
  --ink: #4a3a40;
  --ink-soft: #78636a;
  --rose: #9c4d5a;
  --rose-deep: #843d4a;
  --rose-soft: #e8c3c5;
  --rose-wash: #f3dcdc;
  --on-rose: #fffbfa;
  --rose-night: #6a2f3b;

  --shadow: 0 24px 60px -28px rgba(156, 77, 90, 0.38);
  --shadow-sm: 0 10px 30px -18px rgba(156, 77, 90, 0.4);
  --radius: 20px;
  --radius-input: 14px;

  --font-script: "Great Vibes", "Segoe Script", cursive;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1120px;
  --gutter: 20px;

  color-scheme: only light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.js.is-locked body {
  overflow: hidden;
}

/* Cormorant mặc định dùng chữ số kiểu cổ (lệch hàng), ép về chữ số thẳng hàng cho ngày giờ dễ đọc */
.cover__date,
.hero__date,
.calendar__head {
  font-variant-numeric: lining-nums;
}

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

h1, h2, h3, p, figure, ol, ul {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--rose);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Chỉ trình đọc màn hình đọc được, không hiện trên trang */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Bố cục chung ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(4.5rem, 10vw, 7.5rem);
}

.section--tint {
  background: var(--bg-tint);
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1.25;
}

.amp {
  color: var(--rose);
}

/* Trái tim nằm riêng một dòng giữa tên chú rể và cô dâu (bìa thiệp, đầu thiệp) */
.name-heart {
  display: block;
  margin-block: 0.06em 0.1em;
  font-size: 0.55em;
  line-height: 1;
  text-align: center;
  color: var(--rose);
}

.name-heart i,
.couple__amp i {
  display: inline-block;
}

/* Trái tim giữa tên chú rể và cô dâu đập nhịp đôi như tim thật, kèm lắc nhẹ */
@media (prefers-reduced-motion: no-preference) {
  .name-heart i,
  .couple__amp i {
    animation: heartbeat 1.6s ease-in-out infinite;
  }

  .couple__amp i {
    animation-delay: 0.4s;
  }

  @keyframes heartbeat {
    0%, 40%, 100% {
      transform: scale(1) rotate(0deg);
    }
    10% {
      transform: scale(1.22) rotate(-8deg);
    }
    20% {
      transform: scale(1.02) rotate(5deg);
    }
    30% {
      transform: scale(1.16) rotate(-4deg);
    }
  }
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rose);
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-title--center {
  text-align: center;
}

.section-lead {
  margin-top: 0.75rem;
  max-width: 52ch;
  color: var(--ink-soft);
}

/* Khung ảnh hình vòm: nửa trên là nửa hình tròn khi ảnh có tỉ lệ 4:5 */
.arch {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 50% 50% var(--radius) var(--radius) / 40% 40% var(--radius) var(--radius);
  background: var(--rose-wash);
}

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

/* ---------- Nút bấm ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.75rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn i {
  font-size: 1.2em;
}

.btn--primary {
  background: var(--rose);
  color: var(--on-rose);
}

.btn--primary:hover {
  background: var(--rose-deep);
}

.btn--ghost {
  background: transparent;
  border-color: var(--rose-soft);
  color: var(--rose);
}

.btn--ghost:hover {
  border-color: var(--rose);
  background: var(--surface);
}

.btn--sm {
  min-height: 40px;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- Bìa thiệp ---------- */

.cover {
  display: none;
}

.js .cover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 3.5rem var(--gutter) 2rem;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(90% 60% at 15% 0%, rgba(255, 251, 250, 0.16) 0%, transparent 60%),
    linear-gradient(160deg, var(--rose) 0%, var(--rose-deep) 55%, var(--rose-night) 100%);
  transition: opacity 0.8s ease 0.25s;
}

.cover.is-open {
  opacity: 0;
  pointer-events: none;
}

/* Tim rơi lơ lửng phía sau tấm thiệp (do main.js tạo) */
.cover__petals {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cover__petal {
  position: absolute;
  top: 0;
  opacity: 0;
  color: var(--rose-soft);
}

/* Tấm thiệp giữa bìa */
.cover__card {
  position: relative;
  width: 100%;
  max-width: 34rem;
  padding: 3.4rem clamp(1.25rem, 5vw, 2.75rem) 2.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 30px 70px -20px rgba(46, 33, 38, 0.55), 0 10px 26px rgba(46, 33, 38, 0.18);
}

.cover__card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--rose-soft);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

/* Con dấu tim trên mép thiệp */
.cover__seal {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--rose), var(--rose-deep));
  color: var(--on-rose);
  font-size: 1.6rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 22px rgba(132, 61, 74, 0.45), inset 0 2px 4px rgba(255, 251, 250, 0.3);
}

.cover__seal::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 3px solid var(--rose);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

/* Tim bung ra khi mở thiệp (do main.js tạo), main.js đặt vị trí trùng con dấu */
.cover__burst {
  position: fixed;
  top: 0;
  left: 50%;
  pointer-events: none;
}

.cover__spark {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

#open-invite {
  position: relative;
  overflow: hidden;
}

/* Vệt sáng lướt qua nút "Mở thiệp" */
#open-invite::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 251, 250, 0.45), transparent);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .cover__petal {
    animation: heart-fall var(--dur, 20s) ease-in-out var(--delay, 0s) infinite;
  }

  .cover__card {
    animation: cover-card-in 1s var(--ease) both;
  }

  .cover__seal {
    animation: seal-pulse 2.2s ease-in-out infinite;
  }

  #open-invite::after {
    animation: btn-shine 3.2s ease-in-out 1.2s infinite;
  }

  .cover.is-opening .cover__seal {
    animation: seal-break 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  .cover.is-opening .cover__seal::after {
    animation: seal-ring 0.65s ease-out forwards;
  }

  .cover__spark {
    animation: spark 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--delay, 0s) forwards;
  }

  .cover.is-open .cover__card {
    animation: cover-card-away 0.85s ease-in forwards;
  }

  @keyframes cover-fall {
    0% {
      transform: translate3d(0, -8vh, 0) rotate(0deg);
      opacity: 0;
    }
    10% {
      opacity: var(--alpha, 0.5);
    }
    50% {
      transform: translate3d(var(--sway, 20px), 48vh, 0) rotate(180deg);
    }
    90% {
      opacity: var(--alpha, 0.5);
    }
    100% {
      transform: translate3d(0, 108vh, 0) rotate(360deg);
      opacity: 0;
    }
  }

  /* Tim rơi chỉ nghiêng qua lại, không xoay tròn để luôn đứng thẳng */
  @keyframes heart-fall {
    0% {
      transform: translate3d(0, -8vh, 0) rotate(-14deg);
      opacity: 0;
    }
    10% {
      opacity: var(--alpha, 0.5);
    }
    30% {
      transform: translate3d(calc(var(--sway, 20px) * 0.6), 28vh, 0) rotate(14deg);
    }
    55% {
      transform: translate3d(var(--sway, 20px), 55vh, 0) rotate(-12deg);
    }
    80% {
      transform: translate3d(calc(var(--sway, 20px) * 0.4), 82vh, 0) rotate(12deg);
    }
    90% {
      opacity: var(--alpha, 0.5);
    }
    100% {
      transform: translate3d(0, 108vh, 0) rotate(-10deg);
      opacity: 0;
    }
  }

  @keyframes cover-card-in {
    from {
      opacity: 0;
      transform: translateY(36px) scale(0.97);
    }
  }

  @keyframes seal-pulse {
    0%, 100% {
      transform: translate(-50%, -50%) scale(1);
    }
    50% {
      transform: translate(-50%, -50%) scale(1.07);
      box-shadow: 0 8px 34px rgba(132, 61, 74, 0.55), inset 0 2px 4px rgba(255, 251, 250, 0.3);
    }
  }

  @keyframes btn-shine {
    0% {
      left: -60%;
      opacity: 1;
    }
    45%, 100% {
      left: 120%;
      opacity: 1;
    }
  }

  @keyframes seal-break {
    30% {
      transform: translate(-50%, -50%) scale(1.18) rotate(6deg);
      filter: brightness(1.25);
    }
    60% {
      transform: translate(-50%, -50%) scale(1.05) rotate(-4deg);
      opacity: 0.6;
      filter: brightness(1.45);
    }
    100% {
      transform: translate(-50%, -50%) scale(0) rotate(15deg);
      opacity: 0;
      filter: brightness(1.8);
    }
  }

  @keyframes seal-ring {
    from {
      transform: scale(0.85);
      opacity: 0.8;
    }
    to {
      transform: scale(2.6);
      opacity: 0;
    }
  }

  @keyframes spark {
    0% {
      transform: translate(-50%, -50%) scale(0) rotate(0deg);
      opacity: 0;
    }
    15% {
      transform: translate(-50%, -50%) scale(1.25) rotate(calc(var(--rot) * 0.2));
      opacity: 1;
    }
    65% {
      opacity: 0.9;
    }
    100% {
      transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.5) rotate(var(--rot));
      opacity: 0;
    }
  }

  @keyframes cover-card-away {
    15% {
      transform: translateY(10px) rotate(0.5deg);
    }
    100% {
      transform: translateY(-110vh) rotate(-5deg) scale(0.94);
      opacity: 0.6;
    }
  }
}

.cover__inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.4rem;
  max-width: 34rem;
  text-align: center;
}

.cover__names {
  font-size: clamp(2.8rem, 11.5vw, 5rem);
  color: var(--rose);
  padding-block: 0.1em;
}

.cover__date {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}

.cover__guest {
  display: grid;
  gap: 0.25rem;
  margin-block: 0.5rem 0.75rem;
  padding: 1.1rem 2rem 0.3rem;
  border-block: 1px solid var(--rose-soft);
}

.cover__invite {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.cover__guest-name {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.3;
  padding-bottom: 0.1em;
  color: var(--rose);
}

/* ---------- Đầu thiệp ---------- */

.hero {
  display: grid;
  align-items: center;
  min-height: 100dvh;
  padding-block: clamp(3rem, 8vw, 4.5rem);
  background:
    radial-gradient(50% 50% at 92% 18%, #f6d7d9 0%, transparent 72%),
    radial-gradient(45% 40% at 0% 100%, #f9e3d9 0%, transparent 70%),
    var(--bg);
}

.hero__inner {
  display: grid;
  gap: 2.5rem;
  justify-items: center;
  text-align: center;
}

.hero__photo {
  width: min(64vw, 320px);
  box-shadow: var(--shadow);
}

.hero__text {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
}

.hero__kicker {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.3;
  padding-bottom: 0.1em;
  color: var(--ink-soft);
}

/* Hai tên và trái tim là một khối, căn giữa với nhau */
.hero__names {
  display: grid;
  justify-items: center;
  font-size: clamp(3.4rem, 12vw, 6rem);
  color: var(--rose);
  outline: none;
}

.hero__date {
  display: grid;
  gap: 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.4;
}

.hero__lunar {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ink-soft);
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: 1.15fr 1fr;
    justify-items: start;
    text-align: left;
    gap: 4rem;
  }

  .hero__text {
    justify-items: start;
    order: 0;
  }

  .hero__photo {
    order: 1;
    width: 100%;
    max-width: 440px;
    justify-self: end;
  }
}

@media (max-width: 899px) {
  .hero__photo {
    order: -1;
  }
}

/* Chưa có ảnh đầu thiệp: chữ căn giữa cả trang */
.hero--text-only .hero__inner {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.hero--text-only .hero__text {
  justify-items: center;
}

/* ---------- Hai gia đình ---------- */

.families__parents {
  display: grid;
  gap: 2rem;
  justify-items: center;
  text-align: center;
}

.family {
  display: grid;
  gap: 0.15rem;
}

.family__title {
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--rose);
}

.family p {
  font-weight: 400;
}

.family .family__address {
  margin-top: 0.35rem;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.families__amp {
  font-size: 3.2rem;
  line-height: 1;
  color: var(--rose);
}

.families__announce {
  max-width: 30ch;
  margin: clamp(3rem, 7vw, 4.5rem) auto clamp(2.5rem, 6vw, 4rem);
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-style: italic;
  line-height: 1.35;
  padding-bottom: 0.1em;
  text-align: center;
  text-wrap: balance;
}

.couple {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
}

.person {
  display: grid;
  justify-items: center;
  max-width: 340px;
  text-align: center;
}

.person__photo {
  width: min(70vw, 300px);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.person__role {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--rose);
}

/* Họ tên đầy đủ dài nhất ("Nguyễn Ngọc Huyền") rộng khoảng 7.9em ở Great Vibes:
   cỡ chữ co theo màn hình để luôn nằm trên một dòng */
.person__name {
  font-size: min(2.5rem, calc((100vw - 2 * var(--gutter)) / 8.5));
  white-space: nowrap;
  color: var(--rose);
}

.person__intro {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.couple__amp {
  display: flex;
  justify-content: center;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--rose);
}

@media (min-width: 768px) {
  .families__parents {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 760px;
    margin-inline: auto;
  }

  .couple {
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    max-width: 880px;
    margin-inline: auto;
  }

  .couple__amp {
    align-self: center;
    font-size: 3.5rem;
  }

  /* Hai cột chia nhau phần còn lại sau lề, tim (3.5rem) và hai khoảng cách (1.5rem) */
  .person__name {
    font-size: min(2.5rem, calc((100vw - 2 * var(--gutter) - 6.5rem) / 17));
  }

  .person--offset {
    margin-top: 5rem;
  }
}

/* ---------- Lịch cưới ---------- */

.schedule__grid {
  display: grid;
  gap: 3.5rem;
}

.calendar {
  margin-top: 2rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.calendar__head {
  margin-bottom: 1rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
}

.calendar__dow {
  padding-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.calendar__day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-size: 0.95rem;
}

.calendar__day--sun {
  color: var(--rose);
}

.calendar__day--wedding {
  color: var(--on-rose);
  font-weight: 600;
}

.calendar__day--wedding i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  color: var(--rose);
  z-index: 0;
}

.calendar__day--wedding span {
  position: relative;
  z-index: 1;
  margin-top: -0.15rem;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.countdown__cell {
  display: grid;
  justify-items: center;
  padding: 0.8rem 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.countdown__num {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}

.countdown__label {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.countdown__done {
  margin-top: 1.25rem;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-style: italic;
  line-height: 1.4;
  padding-bottom: 0.1em;
  color: var(--rose);
  text-align: center;
}

.events {
  display: grid;
}

.event {
  display: grid;
  gap: 1.25rem;
  padding-block: 2rem;
}

.event + .event {
  border-top: 1px solid var(--rose-soft);
}

.event:first-child {
  padding-top: 0;
}

.event__time {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}

.event__clock {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 500;
  line-height: 1;
  color: var(--rose);
  font-variant-numeric: lining-nums;
}

.event__date {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.event__side {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rose);
}

.event__title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
}

.event__venue {
  margin-top: 0.4rem;
  font-weight: 500;
}

.event__address {
  color: var(--ink-soft);
}

.event__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

@media (min-width: 960px) {
  .schedule__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 5rem;
    align-items: start;
  }

  .schedule__aside {
    position: sticky;
    top: 2rem;
  }

  .events {
    padding-top: 0.5rem;
  }

  .event {
    grid-template-columns: 9.5rem 1fr;
    gap: 2rem;
  }

  .event__time {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ---------- Album ---------- */

/*
 * Lưới đều, mỗi ảnh chiếm 2 rãnh để hàng cuối thiếu ảnh có thể đặt vào giữa.
 * Điện thoại 2 cột: số ảnh lẻ thì ảnh đầu tiên trải hết bề ngang.
 * Máy tính 3 hoặc 4 cột (main.js chọn theo số ảnh), hàng cuối thiếu thì căn giữa.
 */
.album__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.album__item {
  display: block;
  grid-column: span 2;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--rose-wash);
  cursor: zoom-in;
}

.album__grid--odd .album__item:first-child {
  grid-column: 1 / -1;
}

.album__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.album__item:hover img {
  transform: scale(1.04);
}

@media (min-width: 768px) {
  .album__grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
  }

  .album__grid--4 {
    grid-template-columns: repeat(8, 1fr);
  }

  .album__grid--odd .album__item:first-child {
    grid-column: span 2;
  }

  .album__grid .album__item--row-start {
    grid-column: var(--start) / span 2;
  }
}

.album__empty {
  margin-top: 2rem;
  text-align: center;
  color: var(--ink-soft);
}

/* Xem ảnh phóng to */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(46, 33, 38, 0.94);
  color: var(--on-rose);
}

.lightbox::backdrop {
  background: rgba(46, 33, 38, 0.6);
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox__img {
  max-width: min(92vw, 1100px);
  max-height: 84dvh;
  border-radius: var(--radius);
  object-fit: contain;
  user-select: none;
  touch-action: pan-y;
}

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 251, 250, 0.3);
  border-radius: 999px;
  background: rgba(255, 251, 250, 0.1);
  color: var(--on-rose);
  font-size: 1.4rem;
  cursor: pointer;
  transition: background-color 0.3s var(--ease);
}

.lightbox__btn:hover {
  background: rgba(255, 251, 250, 0.22);
}

.lightbox__close {
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  translate: 0 -50%;
}

.lightbox__prev {
  left: 16px;
}

.lightbox__next {
  right: 16px;
}

@media (max-width: 640px) {
  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: max(20px, env(safe-area-inset-bottom));
    translate: none;
  }

  .lightbox__prev {
    left: calc(50% - 60px);
  }

  .lightbox__next {
    right: calc(50% - 60px);
  }
}

/* ---------- Sổ lưu bút ---------- */

.guestbook__grid {
  display: grid;
  gap: 3rem;
}

.wish-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field label {
  font-size: 0.95rem;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #ae8089;
  border-radius: var(--radius-input);
  background: var(--surface);
  font-weight: 400;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 7.5rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(156, 77, 90, 0.18);
}

.field [aria-invalid="true"] {
  border-color: #a8323f;
}

.field__hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.field__error {
  font-size: 0.88rem;
  font-weight: 500;
  color: #a8323f;
}

.field__error:empty {
  display: none;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wish-form .btn {
  justify-self: start;
}

.form-status {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--rose);
}

.form-status:empty {
  display: none;
}

.form-status--error {
  color: #a8323f;
}

.wishes__list {
  display: grid;
  gap: 0.9rem;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 0.25rem;
  overscroll-behavior: contain;
}

.wish {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.wish__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.wish__name {
  font-weight: 500;
}

.wish__time {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.wish__message {
  margin-top: 0.35rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.wish--new {
  box-shadow: inset 0 0 0 1px var(--rose-soft);
}

.wishes__empty {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--rose-soft);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-soft);
}

.wishes__empty i {
  font-size: 2rem;
  color: var(--rose-soft);
}

.wish--skeleton {
  display: grid;
  gap: 0.6rem;
}

.wish--skeleton span {
  display: block;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--rose-wash);
}

.wish--skeleton span:first-child {
  width: 35%;
}

.wish--skeleton span:last-child {
  width: 80%;
}

@media (min-width: 900px) {
  .guestbook__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 5rem;
    align-items: start;
  }

  .wishes {
    padding-top: 0.5rem;
  }
}

/* ---------- Lời cảm ơn ---------- */

.thanks__photo {
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow);
}

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

@media (min-width: 640px) {
  .thanks__photo {
    aspect-ratio: 7 / 4;
  }
}

.thanks__content {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  text-align: center;
}

.thanks__title {
  font-size: clamp(3.6rem, 10vw, 5rem);
  color: var(--rose);
}

.thanks__message {
  max-width: 40ch;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  line-height: 1.45;
}

.thanks__sign {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.75rem;
  font-weight: 500;
}

.thanks__names {
  color: var(--rose);
}

.thanks__date {
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

.thanks__credit {
  max-width: 48ch;
  margin-top: 2.5rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.thanks__credit a {
  color: inherit;
  text-underline-offset: 2px;
}

/* ---------- Trang trí hai bên lề ---------- */

/* Chỉ hiện khi hai bên lề đủ rộng; nằm trên nền nhưng không nhận thao tác chuột */
.side-decor {
  display: none;
}

@media (min-width: 1360px) {
  .js .side-decor {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
  }
}

.side-decor__col {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc((100vw - var(--container)) / 2);
  overflow: hidden;
}

.side-decor__col--left {
  left: 0;
}

.side-decor__col--right {
  right: 0;
}

.side-decor__petal {
  position: absolute;
  top: 0;
  opacity: 0;
  color: var(--rose-soft);
}

/* Cánh hoa: hình giọt bo lệch hai góc */
.side-decor__petal--leaf {
  width: 1em;
  height: 0.65em;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, var(--rose-soft), var(--rose-wash));
}

@media (prefers-reduced-motion: no-preference) {
  .side-decor__petal {
    animation: heart-fall var(--dur, 20s) ease-in-out var(--delay, 0s) infinite;
  }

  .side-decor__petal--leaf {
    animation-name: cover-fall;
  }
}

/* ---------- Nút nhạc ---------- */

.music {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--rose);
  font-size: 1.6rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.3s var(--ease);
}

.music:active {
  transform: scale(0.95);
}

.music.is-playing {
  background: var(--rose);
  border-color: var(--rose);
  color: var(--on-rose);
}

/* ---------- Thông báo nhỏ ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(84px, calc(env(safe-area-inset-bottom) + 68px));
  z-index: 50;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.92rem;
  font-weight: 400;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Ghi chú khi xem thử trên máy ---------- */

.dev-note {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 60;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  width: min(560px, calc(100vw - 24px));
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.85rem;
  line-height: 1.5;
  transform: translateX(-50%);
  box-shadow: 0 12px 30px -12px rgba(46, 33, 38, 0.5);
}

.dev-note ul {
  margin-top: 0.3rem;
  padding-left: 1.1rem;
  list-style: disc;
}

.dev-note__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 251, 250, 0.12);
  color: inherit;
  cursor: pointer;
}

/* ---------- Thông báo lỗi cấu hình ---------- */

.config-error {
  max-width: 640px;
  margin: 4rem auto;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* ---------- Chuyển động ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
    transition-delay: var(--delay, 0s);
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .music.is-playing i {
    animation: spin 4s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
}

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

  .js .cover {
    transition: opacity 0.2s linear;
  }

  .js .cover.is-open {
    transition-delay: 0s;
  }

  .album__item img,
  .album__item:hover img {
    transition: none;
    transform: none;
  }
}
