/* ========================================================
   5. HAI GIA ĐÌNH, LỄ THÀNH HÔN, ĐỊA ĐIỂM, LỊCH TRÌNH & FOOTER
   ======================================================== */

/* ---------- Hai gia đình ---------- */
#wedding-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Tên chú rể & cô dâu trên tờ note */
.couple-highlight-names {
  width: 100%;
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.couple-person { min-width: 0; }

.groom-name,
.bride-name {
  font-family: var(--font-hand);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.couple-highlight-names .amp {
  padding-top: 6px;
  font-family: var(--font-hand);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent-red);
}

.role-badge {
  display: block;
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.role-badge:empty { display: none; }

/* Hai gia đình: 2 cột, địa chỉ hai bên luôn cùng hàng */
.parents-grid {
  width: 100%;
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  text-align: center;
}

.family-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.family-side + .family-side {
  padding-left: 6px;
  border-left: 1px solid rgba(47, 42, 38, 0.25);
}

.family-side small {
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-dark);
}

.family-side h4 {
  width: 100%;
  min-height: calc(1.5em * 2); /* giữ chỗ 2 dòng: thiếu bố/mẹ thì tên còn lại dóng giữa */
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: var(--font-body);
  font-size: clamp(10px, 2.9vw, 15px); /* thu nhỏ theo bề rộng để tên không phải xuống dòng */
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap; /* tên phụ huynh không xuống dòng */
}

.family-side:not(.has-parent-names) h4 { visibility: hidden; }

.family-side p {
  margin: 0;
  font-size: clamp(10px, 2.7vw, 12px);
  line-height: 1.5;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.family-side h4:empty,
.family-side p:empty { display: none; }

/* ---------- Tờ note dán: Lễ thành hôn ---------- */
.red-card {
  position: relative;
  margin: 48px 8px 0;
  padding: 36px 14px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--note-yellow);
  box-shadow: var(--shadow-note);
  text-align: center;
  rotate: -1.5deg;
}

.red-card::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 110px;
  height: 26px;
  background: var(--tape-pink);
  transform: translateX(-50%) rotate(-3deg);
}

.ceremony-title {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.7;
}

.ceremony-time-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.ceremony-time-badge .time {
  margin-top: 6px;
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.7;
}

.ceremony-time-badge .date-big {
  margin-top: 6px;
  font-family: var(--font-hand);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.ceremony-time-badge .date-big .slash { color: var(--accent-red); }

.ceremony-yearline {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.ceremony-yearline b { font-weight: 400; }

.ceremony-yearline .lunar:not(:empty)::before { content: " · "; }

.ceremony-time-badge .time:empty,
.ceremony-time-badge .lunar:empty { display: none; }

.ceremony-note {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.ceremony-note:empty { display: none; }

.ceremony-direction-btn,
.venue-direction-btn {
  min-height: 44px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 14px;
  line-height: 1.2;
}

.ceremony-direction-btn { margin-top: 14px; }
.ceremony-direction-btn[hidden] { display: none; }

.ceremony-direction-btn:hover,
.venue-direction-btn:hover { background: rgba(255, 255, 255, 0.55); }

/* ---------- Gặp nhau ở đây nhé ---------- */
.venue-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.venue-name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.venue-address {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

/* Bản đồ dán như một tấm ảnh */
.map-embed-wrapper {
  position: relative;
  margin-top: 10px;
  padding: 10px;
  background: var(--polaroid);
  box-shadow: var(--shadow-md);
  rotate: 1deg;
}

.map-embed-wrapper::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 24px;
  z-index: 1;
  width: 70px;
  height: 22px;
  background: var(--tape-blue);
  transform: rotate(6deg);
}

.map-embed-wrapper iframe {
  display: block;
  width: 100%;
  height: 200px;
  border: 0;
  background: var(--photo-1);
}

.venue-direction-btn {
  align-self: center;
  margin-top: 8px;
}

/* ---------- Lịch trình ---------- */
#timeline .card-heading { margin: 0 0 6px; }

.timeline-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-list {
  padding: 16px 20px;
  background: var(--polaroid);
  box-shadow: var(--shadow-paper);
}

.timeline-list:empty { display: none; }

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--paper-dot);
}

.timeline-item::before {
  content: "✓";
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink-dark);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
}

.timeline-left { flex: 0 0 64px; }

.timeline-line-col { display: none; }

.timeline-time {
  font-family: var(--font-hand);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.7;
  font-variant-numeric: lining-nums;
}

.timeline-right { min-width: 0; }

.timeline-text {
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* ---------- Hành trình tình yêu (không có trong bố cục này) ---------- */
#love-story { display: none !important; }

/* ---------- Cảm ơn ---------- */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: var(--content-width, 560px);
  margin: 0 auto;
  padding: 40px 24px 64px;
  text-align: center;
  color: var(--ink-dark);
}

.footer-label {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.1;
}

.footer-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.footer-names:not(:empty) + .footer-date:not(:empty)::before { content: " · "; }

.footer-line:has(.footer-names:empty):has(.footer-date:empty) { display: none; }
