/* ==========================================================================
   SỔ TAY CÓ MỤC LỤC — ĐẤT NUNG (theme chính của thiệp 25)
   Bìa sổ đất nung gáy lò xo, nhãn kem; ruột sổ là các trang kem có lề hồng,
   tab màu đánh dấu bên phải và số trang 01, 02… khớp với mục lục.
   Theo thiết kế "Khác biệt · Sổ tay có mục lục — đất nung". Cơ chế dùng chung ở theme-core.css;
   số trang, màu tab và mục lục do js/modules/notebook.js đánh theo các khối đang hiện.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. NỀN & BỐ CỤC CHUNG
   -------------------------------------------------------------------------- */
:root {
  --vn-card-max: 900px;
  --vn-content-max: 560px;
  /* Lề trang: tối thiểu 20px / 26px (phải rộng hơn để chừa chỗ cho tab nhô ra);
     màn rộng thì nội dung dừng ở 560px và căn giữa trong thiệp 900px */
  --st-gutter-left: 20px;
  --st-gutter-right: 26px;
  --st-page-left: max(var(--st-gutter-left), (100% - var(--vn-content-max)) / 2);
  --st-page-right: max(var(--st-gutter-right), (100% - var(--vn-content-max)) / 2);
  --st-page-gap: 30px;
  --st-radius: 10px;
}

body {
  background: var(--vn-outside);
  color: var(--st-ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

::selection { background: var(--st-mustard); color: var(--st-ink); }

:focus-visible {
  outline: 2px solid var(--st-terracotta) !important;
  outline-offset: 3px;
}

.app-container {
  position: relative;
  width: min(var(--vn-card-max), 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(34px, env(safe-area-inset-top)) 0 0;
  overflow: hidden;
  background: var(--st-kraft);
  color: var(--st-ink);
  display: flex;
  flex-direction: column;
}
.reveal-section { margin-bottom: 0; }

/* Trang sổ: lề hồng bên trái, tab màu nhô ra mép phải */
.st-page {
  position: relative;
  margin: var(--st-page-gap) var(--st-page-right) 0 var(--st-page-left);
  padding: 22px 20px 22px 34px;
  border-radius: 6px 14px 14px 6px;
  background: var(--st-page);
  box-shadow: var(--st-page-shadow);
  color: var(--st-ink);
  text-align: left;
}
.st-page::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 22px;
  width: 1px;
  background: var(--st-margin-line);
  pointer-events: none;
}
.st-page::after {
  content: "";
  position: absolute;
  /* Trang ngắn: kéo tab lên để không lòi xuống trang dưới */
  top: max(24px, min(var(--st-tab-top, 24px), calc(100% - 94px)));
  right: -14px;
  width: 14px;
  height: 70px;
  border-radius: 0 6px 6px 0;
  background: var(--st-tab, transparent);
  pointer-events: none;
}
.st-page[hidden] { display: none !important; }
/* Trang kẻ dòng (Save the date) */
.st-page--lined {
  background: var(--st-page) repeating-linear-gradient(180deg, transparent 0 31px, var(--st-page-line) 31px 32px);
}
.st-group { display: flex; flex-direction: column; }

/* Nhãn "01 · SAVE THE DATE" và tiêu đề trang */
.vn-kicker,
.st-kicker {
  margin: 0;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: left;
  color: var(--st-terracotta);
}
.st-num:empty { display: none; }
.st-num:not(:empty)::after { content: " · "; }
.st-kicker-text,
.st-kicker .rb-heading,
.st-kicker .card-heading,
.st-kicker .gift-heading,
.st-kicker .ceremony-type-title {
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}
.vn-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  color: var(--st-ink);
  overflow-wrap: anywhere;
}

/* Nút dùng chung: bo góc 10px */
.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--st-radius);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: filter .2s ease;
}
.st-btn:hover { filter: brightness(1.06); }
.st-btn[hidden] { display: none; }
.st-btn--terracotta { background: var(--st-terracotta); color: #FFFFFF; }
.st-btn--sage { background: var(--st-sage); color: #FFFFFF; }

/* --------------------------------------------------------------------------
   2. BÌA SỔ: GÁY LÒ XO, TAB MÀU, NHÃN KEM
   -------------------------------------------------------------------------- */
.envelope-screen { background: var(--st-kraft); }
.envelope-box { min-height: 100%; }

.st-cover {
  position: relative;
  flex: 1;
  box-sizing: border-box;
  min-height: calc(100dvh - 68px);
  /* Bìa rộng hết khổ thiệp (900px), chỉ chừa lề tối thiểu */
  margin: max(34px, env(safe-area-inset-top)) var(--st-gutter-right) max(34px, env(safe-area-inset-bottom)) var(--st-gutter-left);
  padding: 30px 22px 30px 42px;
  border-radius: 6px 18px 18px 6px;
  background: var(--st-terracotta);
  box-shadow: 0 14px 30px rgba(58, 42, 34, .25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--st-ink);
  cursor: pointer;
}
.st-spiral {
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 10px;
  width: 16px;
  border-radius: 8px;
  background: repeating-linear-gradient(180deg, transparent 0 14px, var(--st-kraft) 14px 26px);
  pointer-events: none;
}
.st-cover-tabs {
  position: absolute;
  top: 120px;
  right: -14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.st-cover-tabs span {
  width: 14px;
  height: 54px;
  border-radius: 0 6px 6px 0;
  background: var(--st-mustard);
}
.st-cover-tabs span:nth-child(2) { background: var(--st-sage); }
.st-cover-tabs span:nth-child(3) { background: #F3EBDD; }

.st-cover-label {
  width: 100%;
  max-width: 420px;
  padding: 36px 22px 40px;
  border-radius: var(--st-radius);
  background: var(--st-page);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .12);
}
.st-cover-book {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--st-terracotta);
}
.st-cover-rule {
  display: block;
  height: 1px;
  margin: 20px 30px 22px;
  background: #E0CDB3;
}
.cover-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--st-ink);
}
.envelope-invite-text {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--st-ink);
  overflow-wrap: anywhere;
}
.cover-line {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--st-muted);
}
.envelope-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 22px 0 0;
  font-family: var(--font-display);
  line-height: 1.2;
}
.envelope-name-line {
  font-size: 34px;
  font-weight: 400;
  color: var(--st-terracotta);
  overflow-wrap: anywhere;
}
.envelope-name-amp {
  margin: 6px 0;
  font-size: 20px;
  color: var(--st-ink);
}
.envelope-date {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.envelope-date:empty { display: none; }
.envelope-lunar { margin: 0; font-size: 12px; color: var(--st-muted); }
.envelope-lunar[hidden] { display: none; }

.btn-open {
  flex: none;
  width: 100%;
  max-width: 420px;
  min-height: 50px;
  margin-top: 20px;
  border: 0;
  border-radius: var(--st-radius);
  background: var(--st-ink);
  color: var(--st-page);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .2s ease, opacity .2s ease;
}
.btn-open:hover { filter: brightness(1.25); }
.btn-open:disabled { opacity: .55; cursor: progress; }

#envelope-screen .cover-loading-overlay { background: var(--st-kraft); }
.cover-loading-spinner { border-color: rgba(184, 96, 62, .25); border-top-color: var(--st-terracotta); }

@media (max-height: 700px) {
  .st-cover { padding-top: 22px; padding-bottom: 22px; }
  .st-cover-label { padding: 20px 16px; }
  .envelope-name-line { font-size: 30px; }
  .btn-open { min-height: 46px; margin-top: 16px; }
}

/* --------------------------------------------------------------------------
   3. MỤC LỤC
   -------------------------------------------------------------------------- */
.st-toc {
  margin: 0 var(--st-page-right) 0 var(--st-page-left);
  padding: 20px 22px;
  border-radius: 6px 14px 14px 6px;
  background: var(--st-page);
  box-shadow: var(--st-page-shadow);
}
.st-toc-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.4;
}
.st-toc-list { margin: 4px 0 0; padding: 0; list-style: none; }
.st-toc-list:empty { display: none; }
.st-toc:has(.st-toc-list:empty) { display: none; }
.st-toc-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--st-ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}
.st-toc-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.st-toc-title { min-width: 0; }
.st-toc-leader { flex: 1; min-width: 16px; border-bottom: 1px dotted var(--st-leader); }
.st-toc-page { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-toc-row:hover .st-toc-title { color: var(--st-terracotta); }

/* Bấm mục lục: cuộn tới trang, chừa khoảng thở phía trên */
.st-page { scroll-margin-top: 16px; }

/* --------------------------------------------------------------------------
   4. SAVE THE DATE
   -------------------------------------------------------------------------- */
.hero-section { margin-top: 40px; }
.envelope-stage { width: 100%; margin-top: 12px; }
.photo-frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 6px solid #FFFFFF;
  border-radius: 8px;
  background: var(--st-photo-mat);
  box-shadow: 0 4px 10px rgba(58, 42, 34, .12);
  rotate: -1.5deg;
  cursor: zoom-in;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}
.hero-title-box { margin-top: 16px; }
.hero-names {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--st-ink);
  overflow-wrap: anywhere;
}
.hero-names .amp { color: var(--st-ink); }
.hero-invite-guest {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--st-terracotta);
}
.hero-quote {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 2;
  color: var(--st-ink-soft);
}

/* --------------------------------------------------------------------------
   5. HAI GIA ĐÌNH
   -------------------------------------------------------------------------- */
.red-card { border: 0; }
.parents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.family-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}
.family-portrait {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 8px;
  overflow: hidden;
  border: 4px solid #FFFFFF;
  border-radius: 50%;
  background: var(--st-photo-mat);
}
.family-portrait[hidden] { display: none; }
.family-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.family-side small {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--st-sage);
}
.family-side[data-party="bride"] small { color: var(--st-terracotta); }
.family-side h4 {
  margin: 2px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
  /* Luôn giữ chỗ 2 dòng: thiếu bố hoặc mẹ thì địa chỉ hai bên vẫn thẳng hàng */
  display: grid;
  align-content: center;
  justify-items: center;
  width: 100%;
  min-height: calc(2 * 1.5em);
}
.family-side p { margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.family-side .groom-name,
.family-side .bride-name {
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.family-side .role-badge {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--st-muted);
}
.family-side .role-badge:empty { display: none; }

/* --------------------------------------------------------------------------
   6. LỄ THÀNH HÔN: TỜ LỊCH NHỎ + GIỜ LỄ
   -------------------------------------------------------------------------- */
.ceremony-time-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.st-datetile {
  flex: none;
  width: 84px;
  overflow: hidden;
  border-radius: var(--st-radius);
  background: #FFFFFF;
  text-align: center;
  box-shadow: 0 3px 8px rgba(58, 42, 34, .15);
}
.st-datetile > span { display: block; }
/* Hiệu ứng cuộn mặc định đẩy tháng / thứ ra ngang → bị overflow: hidden của tờ lịch cắt
   nên không bao giờ "lộ" ra. Cho trượt dọc trong khung. */
.st-datetile .ceremony-month { transform: translateY(-8px); }
.st-datetile .ceremony-day { transform: scale(.85); }
.st-datetile .ceremony-dow { transform: translateY(8px); }
.st-datetile .ceremony-month {
  padding: 4px 2px;
  background: var(--st-terracotta);
  color: var(--st-page);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
}
.st-datetile .ceremony-day {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.2;
}
.st-datetile .ceremony-dow {
  padding: 0 2px 4px;
  font-size: 11px;
  line-height: 1.4;
}
.st-datetile:has(.ceremony-day:empty) { display: none; }
.st-datetime { min-width: 0; }
.ceremony-clock {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
}
.ceremony-clock:empty { display: none; }
.ceremony-year,
.ceremony-time-badge .lunar {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--st-muted);
}
.ceremony-time-badge .lunar { margin-top: 0; }
.ceremony-year:empty,
.ceremony-time-badge .lunar:empty { display: none; }

.ceremony-note { margin: 14px 0 0; }
.ceremony-note:empty { display: none; }
/* Tên địa điểm (nơi làm lễ / nhà hàng / tiệc nhà gái): cùng kiểu chữ, đều có icon ghim */
.ceremony-note-place,
.reception-card .venue-name,
#reception-bride .rb-venue-name-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 10px 0 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--st-ink);
  overflow-wrap: anywhere;
}
#reception-bride .rb-venue-name-row { justify-content: flex-start; }
#reception-bride .rb-venue-name { margin: 0; font: inherit; color: inherit; text-align: left; }
.venue-location-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: var(--st-terracotta);
}
/* Thiết kế chỉ ghi tên nơi làm lễ — nhãn "được cử hành tại" vẫn đọc được cho trình đọc màn hình */
.ceremony-note-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ceremony-direction { margin-top: 12px; }

/* --------------------------------------------------------------------------
   7. TIỆC CƯỚI
   -------------------------------------------------------------------------- */
.reception-header { display: block; }
.reception-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.reception-time-col {
  min-width: 0;
  padding: 10px;
  border-radius: var(--st-radius);
  background: var(--st-chip-yellow);
}
.reception-time-col + .reception-time-col { background: var(--st-chip-green); }
.reception-time-col small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--st-chip-yellow-ink);
}
.reception-time-col + .reception-time-col small { color: var(--st-sage-deep); }
.reception-time-col strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.3;
}

.venue-address,
.reception-date-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--st-muted);
  overflow-wrap: anywhere;
}
.reception-date-text:empty { display: none; }
.reception-lunar { margin: 0; font-size: 12px; line-height: 1.5; color: var(--st-muted); }
.reception-lunar:empty { display: none; }

.calendar-paper {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.calendar-paper-title { display: none; }
.calendar-grid-header,
.calendar-grid-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  font-size: 12px;
  text-align: center;
}
.calendar-grid-header span,
.calendar-grid-days span {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-grid-header span { font-size: 10px; font-weight: 700; color: var(--st-terracotta); }
.calendar-grid-days .wedding-day {
  width: 28px;
  margin: 0 auto;
  border: 2px solid var(--st-terracotta);
  border-radius: 50%;
  color: var(--st-terracotta);
  font-weight: 700;
}

.reception-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.reception-actions button {
  min-height: 46px;
  padding: 0 8px;
  border: 1.5px solid var(--st-ink);
  border-radius: var(--st-radius);
  background: transparent;
  color: var(--st-ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  transition: background .2s ease;
}
.reception-actions button[style*="none"] + button,
.reception-actions button:only-child { grid-column: 1 / -1; }
.reception-actions .btn-gold-outline:hover { background: rgba(58, 42, 34, .06); }
.reception-actions .btn-cream-solid { border: 0; background: var(--st-ink); color: var(--st-page); }
.reception-actions .btn-cream-solid:hover { background: #4E3A30; }

/* Tiệc nhà gái: cùng kiểu trang tiệc cưới */
#reception-bride.st-page {
  /* reception-bride.css đặt width: 100% — cộng margin trang sẽ tràn mép phải */
  width: auto;
  max-width: none;
  margin: var(--st-page-gap) var(--st-page-right) 0 var(--st-page-left);
  padding: 22px 20px 22px 34px;
  font-family: var(--font-body);
  text-align: left;
  color: var(--st-ink);
}
#reception-bride .bride-reception-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
#reception-bride .st-kicker .rb-heading { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }
/* Khối tiệc nhà gái dùng đúng cấu trúc và kiểu chữ của tiệc nhà trai:
   nhãn dẫn và ngày số lớn chỉ để JS ghi dữ liệu, không hiển thị */
#reception-bride .rb-lead,
#reception-bride .rb-venue-label,
#reception-bride .rb-weekday,
#reception-bride .rb-date { display: none !important; }
#reception-bride .rb-title { margin-top: 4px; }
#reception-bride .rb-date-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--st-muted); overflow-wrap: anywhere; }
#reception-bride .rb-date-text:empty { display: none; }
#reception-bride .rb-lunar { margin: 0; font-size: 12px; line-height: 1.5; text-transform: none; color: var(--st-muted); }
#reception-bride .rb-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
#reception-bride .rb-time-col { gap: 0; padding: 10px; border-radius: var(--st-radius); background: var(--st-chip-yellow); }
#reception-bride .rb-time-col + .rb-time-col { background: var(--st-chip-green); }
#reception-bride .rb-time-col small { font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--st-chip-yellow-ink); }
#reception-bride .rb-time-col + .rb-time-col small { color: var(--st-sage-deep); }
#reception-bride .rb-time-col strong { font-family: var(--font-display); font-size: 26px; font-weight: 400; line-height: 1.3; color: var(--st-ink); }
#reception-bride .rb-venue { margin-top: 0; }
#reception-bride .rb-venue-address { margin: 0; font-size: 13px; line-height: 1.5; color: var(--st-muted); overflow-wrap: anywhere; }
#reception-bride .rb-direction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--st-radius);
  background: var(--st-terracotta);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
}
#reception-bride .rb-direction[hidden] { display: none; }

/* --------------------------------------------------------------------------
   8. ĐỊA ĐIỂM
   -------------------------------------------------------------------------- */
.venue-card { display: block; }
.map-embed-wrapper {
  width: 100%;
  height: 190px;
  margin-top: 10px;
  overflow: hidden;
  border: 6px solid #FFFFFF;
  border-radius: 8px;
  background: #E3E2D2;
}
.map-embed-wrapper iframe { display: block; width: 100%; height: 100%; }
.venue-direction-btn { display: flex; width: 100%; margin-top: 10px; min-height: 46px; }

/* --------------------------------------------------------------------------
   9. ALBUM: LƯỚI 3 CỘT ẢNH DÁN NGHIÊNG
   -------------------------------------------------------------------------- */
.artwork-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.artwork-wall:empty { display: none; }
.artwork-wall:has(> :nth-child(2):last-child),
.artwork-wall:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.artwork-wall.is-single { grid-template-columns: 1fr; }
.artwork-item {
  position: relative;
  display: block;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 4px solid #FFFFFF;
  border-radius: 0;
  background: var(--st-photo-mat);
  box-shadow: 0 2px 6px rgba(58, 42, 34, .1);
  cursor: zoom-in;
}
/* Nghiêng bằng thuộc tính rotate để không đè transform của hiệu ứng cuộn */
.artwork-item:nth-child(6n+1) { rotate: -2deg; }
.artwork-item:nth-child(6n+2) { rotate: 1.5deg; }
.artwork-item:nth-child(6n+3) { rotate: -1deg; }
.artwork-item:nth-child(6n+4) { rotate: 2deg; }
.artwork-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.artwork-item:hover img { transform: scale(1.04); }
.artwork-item.is-feature { grid-column: auto; grid-row: auto; aspect-ratio: 1; }
.artwork-wall.is-single .artwork-item { aspect-ratio: 4 / 5; }
.artwork-more {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(58, 42, 34, .86);
  color: var(--st-page);
  font-size: 11px;
}
.artwork-more b {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
}

/* --------------------------------------------------------------------------
   10. ĐẾM NGƯỢC & LỊCH TRÌNH
   -------------------------------------------------------------------------- */
.countdown-card,
.timeline-card { padding: 0; border: 0; background: none; box-shadow: none; text-align: left; }
.countdown-card:not([style*="none"]) + .timeline-card { margin-top: 20px; }
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  padding: 0;
}
.count-box {
  min-width: 0;
  padding: 8px 0;
  border: 0;
  border-radius: var(--st-radius);
  background: #FFFFFF;
  text-align: center;
  box-shadow: 0 2px 6px rgba(58, 42, 34, .08);
}
.count-box .num {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--st-ink);
  font-variant-numeric: tabular-nums;
}
.count-box .lbl {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--st-muted);
}

.timeline-list { margin-top: 2px; padding: 0; border: 0; background: none; }
.timeline-list:empty { display: none; }
.timeline-item {
  display: grid;
  grid-template-columns: 18px 50px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--st-rule);
}
/* Ô đánh dấu ✓ như danh sách việc trong sổ */
.timeline-line-col {
  grid-column: 1;
  grid-row: 1;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--st-terracotta);
  border-radius: 4px;
}
.timeline-line-col::before { content: "✓"; font-size: 11px; line-height: 1; color: var(--st-terracotta); }
.timeline-dot { display: none; }
.timeline-left { grid-column: 2; grid-row: 1; }
.timeline-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline-right { grid-column: 3; grid-row: 1; min-width: 0; }
.timeline-text { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   11. TRANG PHỤC
   -------------------------------------------------------------------------- */
.dresscode-card {
  display: block;
  border: 0;
  border-radius: 6px 14px 14px 6px;
  overflow: visible;
}
.dresscode-note {
  margin: 4px 0 0;
  max-width: none;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  color: var(--st-ink);
}
.dresscode-note:empty { display: none; }
.dresscode-palettes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 14px 12px;
  margin-top: 12px;
  width: 100%;
}
.dresscode-item {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 64px;
  max-width: none;
}
.dresscode-item:hover { transform: none; }
.dresscode-swatch {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--st-radius);
  box-shadow: inset 0 0 0 1px rgba(58, 42, 34, .12);
  transform: none !important;
}
.dresscode-item:hover .dresscode-swatch { transform: none !important; box-shadow: inset 0 0 0 1px rgba(58, 42, 34, .12); }
/* Tên màu dưới mỗi ô (cho phép xuống 2 dòng khi tên dài) */
.dresscode-name {
  width: 100%;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--st-ink-soft);
}

/* --------------------------------------------------------------------------
   12. SỔ LƯU BÚT: Ô GẠCH CHÂN, GIẤY KẺ DÒNG, GIẤY NHỚ
   -------------------------------------------------------------------------- */
#guestbook { display: flex; flex-direction: column; gap: 8px; }
.guestbook-card { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.guestbook-card .vn-title { font-size: 24px; }
.guestbook-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; }
.guestbook-form .form-input,
.guestbook-form .form-textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--st-ink);
  font-family: var(--font-body);
  font-size: 16px;
  box-shadow: none;
}
.guestbook-form .form-input {
  min-height: 46px;
  padding: 0 2px;
  border-bottom: 1.5px solid var(--st-ink);
}
.guestbook-form .form-textarea {
  min-height: 96px;
  padding: 0 2px;
  line-height: 32px;
  background: repeating-linear-gradient(180deg, transparent 0 31px, var(--st-rule) 31px 32px);
  background-attachment: local;
  resize: none;
}
.guestbook-form .form-input:focus { border-bottom-color: var(--st-terracotta); box-shadow: none; }
.guestbook-form .form-textarea:focus { box-shadow: none; }
.form-input::placeholder,
.form-textarea::placeholder,
.rsvp-input::placeholder,
.rsvp-textarea::placeholder { color: #8C7A6C; font-size: 16px; }

.guestbook-actions { display: flex; gap: 8px; }
.btn-wish-icon {
  flex: none;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--st-ink);
  border-radius: var(--st-radius);
  background: transparent;
  color: var(--st-ink);
  cursor: pointer;
}
.btn-wish-icon:hover { background: rgba(58, 42, 34, .06); }

.btn-submit-wish,
.rsvp-btn-submit,
.btn-modal-refresh {
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--st-radius);
  background: var(--st-terracotta);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  transition: background .2s ease, opacity .2s ease;
}
.btn-submit-wish:hover,
.rsvp-btn-submit:hover,
.btn-modal-refresh:hover { background: var(--st-terracotta-deep); }
.btn-submit-wish { flex: 1; }
.btn-submit-wish.is-submitting,
.rsvp-btn-submit.is-submitting { opacity: .6; cursor: progress; }

.wishes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  margin: 0 -4px;
  padding: 4px;
}
.wishes-list::-webkit-scrollbar-thumb { background: var(--st-rule); }
.wish-item {
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--st-note-yellow);
  box-shadow: 0 2px 6px rgba(58, 42, 34, .1);
  rotate: -1deg;
}
.wish-item:nth-child(even) { background: var(--st-note-green); rotate: 1deg; }
.wish-item-header { justify-content: flex-start; align-items: baseline; gap: 6px; margin: 0; }
.wish-author {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--st-ink);
  overflow-wrap: anywhere;
}
.wish-time { flex: none; font-size: 11px; color: var(--st-muted); }
.wish-message {
  margin: 2px 0 0;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 14px;
  line-height: 1.55;
  color: var(--st-ink);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   13. HỘP QUÀ MỪNG
   -------------------------------------------------------------------------- */
.gift-section { text-align: left; }
.gift-wrapper { display: block; max-width: none; }
.gift-note { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--st-ink); }
.gift-envelope-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 10px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--st-radius);
  background: var(--st-ink);
  color: var(--st-page);
  box-shadow: none;
  cursor: pointer;
  transition: background .2s ease;
}
.gift-envelope-trigger:hover { background: #4E3A30; }
.gift-hint-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
}
.gift-envelope-trigger:hover .gift-hint-text { color: inherit; transform: none; }

/* --------------------------------------------------------------------------
   14. BÌA SAU: CẢM ƠN
   -------------------------------------------------------------------------- */
.exit-room {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  margin: var(--st-page-gap) var(--st-page-right) max(30px, env(safe-area-inset-bottom)) var(--st-page-left);
  padding: 30px 22px;
  border-radius: 6px 18px 18px 6px;
  background: var(--st-terracotta);
  color: var(--st-page);
  text-align: center;
}
.exit-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.3;
}
.exit-lead { margin: 6px 0 0; font-size: 14px; line-height: 1.6; }
.exit-names {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.exit-names:empty { display: none; }
.exit-room .gift-brand-footer {
  margin-top: 12px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: inherit;
}
.gift-brand-footer.visible,
.visible .gift-brand-footer { opacity: .75 !important; }

/* --------------------------------------------------------------------------
   15. MÀN HÌNH LỖI, NÚT NỔI, MODAL, TOAST, LIGHTBOX
   -------------------------------------------------------------------------- */
.not-found-screen { background: var(--st-kraft); }
.not-found-card {
  padding: 32px 24px;
  border: 0;
  border-radius: 6px 14px 14px 6px;
  outline: 0;
  background: var(--st-page);
  box-shadow: var(--st-page-shadow);
}
.not-found-icon { color: var(--st-terracotta); }
.not-found-title { font-weight: 400; color: var(--st-ink); }
.not-found-desc { color: var(--st-muted); }

.floating-music {
  border: 1.5px solid var(--st-rule);
  border-radius: 12px;
  background: var(--st-page);
  color: var(--st-terracotta);
  box-shadow: 0 4px 12px rgba(58, 42, 34, .18);
}
.floating-music.playing {
  border-color: var(--st-terracotta);
  background: var(--st-terracotta);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(58, 42, 34, .22);
}
.lang-trigger-btn,
.lang-dropdown {
  border: 1.5px solid var(--st-rule);
  border-radius: var(--st-radius);
  background: var(--st-page);
}
.lang-trigger-btn { color: var(--st-ink); }
.lang-trigger-btn:hover,
.floating-lang.is-open .lang-trigger-btn { background: #F3EBDD; border-color: var(--st-rule); color: var(--st-ink); }
.lang-dropdown { overflow: hidden; top: calc(100% + 4px); }
.lang-btn { color: var(--st-ink); }
.lang-btn:hover { background: #F3EBDD; color: var(--st-ink); }
.lang-btn.active { background: var(--st-terracotta); color: #FFFFFF; }

.modal-box,
.wish-modal-card,
.gift-modal-box {
  border: 0;
  border-radius: 6px 16px 16px 6px;
  outline: 0;
  background: var(--st-page);
  box-shadow: 0 14px 30px rgba(58, 42, 34, .25);
  color: var(--st-ink);
}
.modal-close,
.wish-modal-close,
.gift-modal-close {
  border: 1.5px solid var(--st-ink);
  border-radius: var(--st-radius);
  background: transparent;
  color: var(--st-ink);
}
.modal-close:hover,
.wish-modal-close:hover,
.gift-modal-close:hover { background: var(--st-ink); color: var(--st-page); }
.modal-title,
.wish-modal-title h3,
.gift-modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--st-ink);
}
.modal-subtitle,
.wish-modal-subtitle { color: var(--st-muted); }

.rsvp-form-label { font-weight: 600; color: var(--st-ink); }
.rsvp-input,
.rsvp-textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--st-rule);
  border-radius: var(--st-radius);
  background: #FFFFFF;
  color: var(--st-ink);
  font-family: var(--font-body);
  font-size: 16px;
  box-shadow: none;
}
.rsvp-textarea { min-height: 90px; resize: none; }
.rsvp-input:focus,
.rsvp-textarea:focus { border-color: var(--st-terracotta); box-shadow: 0 0 0 3px var(--vn-red-tint); }
.rsvp-radio-label { border: 1.5px solid var(--st-rule); border-radius: var(--st-radius); background: #FFFFFF; }
.rsvp-radio-label:has(input:checked) { border-color: var(--st-terracotta); background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--st-terracotta); }
.rsvp-radio-label input { accent-color: var(--st-terracotta); }

.wish-suggestion-item { border-radius: var(--st-radius); background: var(--st-note-yellow); border-color: transparent; }
.wish-suggestion-item:nth-child(even) { background: var(--st-note-green); }
.wish-suggestion-item:hover { border-color: var(--st-terracotta); }
.btn-modal-cancel { border: 1.5px solid var(--st-ink); border-radius: var(--st-radius); color: var(--st-ink); font-size: 13px; font-weight: 600; }
.btn-modal-cancel:hover { background: rgba(58, 42, 34, .06); }

.gift-person-card { border: 0; border-radius: 12px; background: #F3EBDD; }
.gift-person-title { font-family: var(--font-display); font-weight: 400; color: var(--st-ink); }
.gift-qr-card { padding: 0; border: 6px solid #FFFFFF; border-radius: 8px; background: #FFFFFF; box-shadow: 0 2px 6px rgba(58, 42, 34, .12); }
.gift-qr-img { padding: 0; }
.gift-bank-name { color: var(--st-terracotta); }
.gift-bank-number { font-family: var(--font-display); font-weight: 400; color: var(--st-ink); }
.gift-bank-owner { color: var(--st-muted); }
.gift-person-card .btn-copy-acc,
.gift-person-card .btn-save-qr { border-radius: var(--st-radius); font-size: 13px; font-weight: 600; }
.gift-person-card .btn-copy-acc { border-color: var(--st-terracotta); background: var(--st-terracotta); color: #FFFFFF; }
.gift-person-card .btn-copy-acc:hover { border-color: var(--st-terracotta-deep); background: var(--st-terracotta-deep); color: #FFFFFF; }
.gift-person-card .btn-save-qr { border-color: var(--st-ink); color: var(--st-ink); }
.gift-person-card .btn-save-qr:hover { background: rgba(58, 42, 34, .06); color: var(--st-ink); }

.toast { border: 0; border-radius: var(--st-radius); background: var(--st-ink); color: var(--st-page); }

.lightbox-modal img { border: 6px solid #FFFFFF; border-radius: 4px; outline: 0; }
.lightbox-close,
.lightbox-nav { border: 1.5px solid rgba(248, 241, 229, .6); border-radius: 50%; color: var(--st-page); }
.lightbox-counter { color: var(--st-page); }

/* --------------------------------------------------------------------------
   16. MÀN HÌNH NHỎ / RỘNG
   -------------------------------------------------------------------------- */
@media (min-width: 900px) {
  .app-container { box-shadow: 0 0 0 1px rgba(58, 42, 34, .08), 0 10px 40px rgba(58, 42, 34, .12); }
}

@media (max-width: 360px) {
  :root { --st-gutter-left: 14px; --st-gutter-right: 22px; }
  .st-page { padding: 20px 16px 20px 30px; }
  .st-page::before { left: 18px; }
  .vn-title { font-size: 24px; }
  .envelope-name-line { font-size: 30px; }
  .count-box .num { font-size: 21px; }
  .reception-actions { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 18px 46px minmax(0, 1fr); gap: 8px; }
}

/* --------------------------------------------------------------------------
   17. TIỆC CƯỚI (nhà trai / nhà gái): giãn khoảng cách cho thoáng
   -------------------------------------------------------------------------- */
.reception-card .vn-title,
#reception-bride .rb-title { margin-top: 8px; }
.reception-card .reception-times,
#reception-bride .rb-times { gap: 12px; margin-top: 20px; }
.reception-card .venue-name,
#reception-bride .rb-venue-name-row { margin-top: 22px; }
.reception-card .venue-address,
#reception-bride .rb-venue-address { margin-top: 6px; }
.reception-card .reception-date-text,
#reception-bride .rb-date-text { margin-top: 10px; }
.reception-card .reception-lunar,
#reception-bride .rb-lunar { margin-top: 4px; }
.reception-card .calendar-paper { margin-top: 24px; }
.reception-card .reception-actions { margin-top: 22px; gap: 12px; }
#reception-bride .rb-direction { margin-top: 22px; }

/* Dòng ngày tiệc: đậm và đậm màu hơn chữ địa chỉ */
.reception-card .reception-date-text,
#reception-bride .rb-date-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--st-ink);
}
