/* Các phần dùng chung. Màu, font và bo góc lấy từ biến của từng mẫu. */
.wedding-extras { background: var(--bg); color: var(--ink); }

.x-section {
  padding: 88px 28px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.x-head { margin-bottom: 40px; }
.x-kicker {
  margin: 0;
  color: var(--accent);
  font: 600 11px/1.5 var(--f-body);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.x-head h2 {
  margin: 14px 0 0;
  font: 400 36px/1.15 var(--f-display);
  letter-spacing: -0.01em;
}
.x-head::after {
  content: var(--ornament, "");
  display: block;
  margin-top: 18px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.6em;
}

.x-label {
  margin: 0 0 12px;
  color: var(--accent);
  font: 600 11px/1.4 var(--f-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.x-lead { max-width: 340px; margin: -16px auto 32px; color: var(--muted); font-size: 14px; }

/* Gia đình */
.x-family-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.x-family-grid article { display: grid; gap: 8px; }
.x-parent { margin: 0; font: 400 19px/1.3 var(--f-display); text-wrap: balance; }
.x-family-grid small { margin-top: 8px; color: var(--muted); font-size: 11px; }
.x-family-amp { color: var(--gold); font: italic 400 34px/1 var(--f-display); }

/* Chuyện tình */
.x-story-list { display: grid; gap: 28px; margin: 0; padding: 0; list-style: none; text-align: left; }
.x-story-list li { display: grid; grid-template-columns: 104px 1fr; gap: 20px; align-items: center; }
.x-story-list li:nth-child(even) { grid-template-columns: 1fr 104px; text-align: right; }
.x-story-list li:nth-child(even) .ph { order: 2; }
.x-story-list .ph { border-radius: var(--radius); }
.x-story-when { color: var(--accent); font: 600 11px/1.4 var(--f-body); letter-spacing: 0.16em; text-transform: uppercase; }
.x-story-list h3 { margin: 6px 0 4px; font: 400 23px/1.2 var(--f-display); }
.x-story-list p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* Album */
.x-album-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.x-album-grid .ph { border-radius: var(--radius); }
.x-album-a, .x-album-d { grid-column: 1 / -1; }

/* Lịch trình */
.x-schedule-list { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.x-schedule-list li { position: relative; padding: 26px 8px; }
.x-schedule-list li + li { border-top: 1px solid var(--line); }
.x-schedule-list time { display: block; color: var(--accent); font: 600 12px/1.4 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; }
.x-schedule-list h3 { margin: 8px 0 6px; font: 400 30px/1.15 var(--f-display); }
.x-schedule-list p { max-width: 320px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.6; }
.x-schedule-list .is-pending time { color: var(--muted); font-weight: 500; }
.x-schedule-list .is-pending h3 { opacity: 0.72; }
.x-schedule-list .is-main {
  margin: 6px 0;
  padding: 32px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
}
.x-schedule-list .is-main + li { border-top: 0; }
.x-schedule-list .is-main time, .x-schedule-list .is-main p { color: inherit; }
.x-schedule-list .is-main p { opacity: 0.94; }
.x-dress { margin: 30px 0 0; color: var(--muted); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.x-dress span { color: var(--ink); }

/* Đếm ngược */
.x-countdown .x-head { margin-bottom: 26px; }
.x-countdown .x-head::after { display: none; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.countdown > span {
  display: grid;
  gap: 4px;
  padding: 18px 4px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.countdown strong { font: 400 38px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.countdown small { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.wedding-day-message { grid-column: 1 / -1; margin: 0; font: 400 36px/1.2 var(--f-display); }

/* Địa điểm */
.x-location .x-head { margin-bottom: 12px; }
.x-location .x-head::after { display: none; }
.x-address { max-width: 300px; margin: 0 auto 30px; color: var(--muted); font-size: 14px; }
.map-frame { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.map-frame iframe { display: block; width: 100%; height: 340px; border: 0; filter: saturate(0.7); }
.map-frame iframe[hidden] { display: none; }
.map-frame.is-open .map-placeholder { display: none; }
.map-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 44px 24px 36px;
  background:
    repeating-linear-gradient(32deg, transparent 0 34px, color-mix(in srgb, var(--accent) 7%, transparent) 34px 35px),
    repeating-linear-gradient(-58deg, transparent 0 52px, color-mix(in srgb, var(--accent) 6%, transparent) 52px 53px);
}
.map-placeholder p { margin: 0; color: var(--muted); font-size: 13px; }
.map-placeholder button {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: var(--btn-radius);
  background: var(--paper);
  color: var(--accent);
  cursor: pointer;
  font: 600 11px/1 var(--f-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.map-pin {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  box-shadow: inset 0 0 0 10px var(--accent), inset 0 0 0 20px var(--paper);
  transform: rotate(-45deg);
  animation: mapPinFloat 2.6s ease-in-out infinite;
}
.x-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.x-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: var(--btn-radius);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: 600 12px/1 var(--f-body);
  letter-spacing: 0.1em;
  white-space: nowrap;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.2s ease, background 0.2s ease;
}
.x-btn.is-solid { background: var(--accent); color: var(--on-accent); }
.x-btn:active { transform: scale(0.98); }
.x-btn:focus-visible, .map-placeholder button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Biểu mẫu */
.x-form { display: grid; gap: 22px; text-align: left; }
.x-field { display: grid; gap: 8px; }
.x-field > span, .x-choice legend {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.x-field input, .x-field textarea, .x-field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--f-body);
}
.x-field input::placeholder, .x-field textarea::placeholder { color: var(--muted); }
.x-field input:disabled { opacity: 0.55; }
.x-field textarea { resize: vertical; }
.x-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
/* Ô bẫy spam: người thật không thấy, bot hay điền vào. */
.x-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.x-field input:focus, .x-field textarea:focus, .x-field select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.x-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.x-choice legend { margin-bottom: 8px; padding: 0; }
.x-choice label { position: relative; }
.x-choice input { position: absolute; opacity: 0; }
.x-choice span {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}
.x-choice input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.x-choice input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.x-check { display: flex; gap: 10px; align-items: center; min-height: 44px; margin-top: -8px; font-size: 14px; }
.x-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-status { margin: -6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }

/* Lời chúc */
.x-wishes { background: var(--paper); }
.x-wishes .x-field input, .x-wishes .x-field textarea { background: var(--bg); }
.wish-preview { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.wish-empty { margin: 0; color: var(--muted); font-size: 13px; }
.wish-preview-list { display: grid; gap: 12px; max-height: 520px; overflow-y: auto; text-align: left; overscroll-behavior: contain; }
.wish-preview-list article { padding: 18px 20px; border-left: 2px solid var(--accent); border-radius: var(--radius); background: var(--bg); }
.wish-preview-list strong { font: 400 21px/1.2 var(--f-display); }
.wish-preview-list p { margin: 6px 0 0; font-size: 14px; line-height: 1.6; }
.wish-bubble {
  position: fixed;
  z-index: 900;
  left: 50%;
  bottom: 80px;
  display: flex;
  gap: 12px;
  align-items: center;
  width: min(360px, calc(100vw - 32px));
  padding: 14px 20px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 18px 55px rgba(36, 20, 18, 0.25);
  color: var(--on-accent);
  transform: translateX(-50%);
  animation: wishBubble 3.6s ease both;
}
.wish-bubble span { font-size: 20px; }
.wish-bubble strong { font-size: 13px; font-weight: 500; }

/* Mừng cưới */
.x-gift-pick { margin-bottom: 12px; }
.x-gift-grid { display: grid; }
/* Chỉ hiện một mã mỗi lúc để camera không bắt nhầm mã bên cạnh. */
.x-gift:has([value="groom"]:checked) [data-gift="bride"],
.x-gift:has([value="bride"]:checked) [data-gift="groom"] { display: none; }
.x-gift-grid article {
  display: grid;
  justify-items: center;
  padding: 24px 12px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
.x-gift-grid .x-label { margin-bottom: 6px; }
.x-gift-grid h3 { min-height: 2.4em; margin: 0; font: 400 18px/1.2 var(--f-display); }
.qr-code {
  display: block;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  margin: 16px 0 14px;
  border-radius: calc(var(--radius) / 2);
  outline: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 6px;
}
.x-gift-grid small { color: var(--muted); font-size: 11px; }

@keyframes mapPinFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes wishBubble {
  0% { opacity: 0; transform: translate(-50%, 28px) scale(0.95); }
  14%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(0.96); }
}

@media (max-width: 360px) {
  .x-section { padding-inline: 20px; }
  .x-head h2 { font-size: 34px; }
  .countdown strong { font-size: 30px; }
  .x-parent { font-size: 16px; }
}
