﻿/* ==========================================================================
   Template m28: Duyên định (Classic Scarlet Editorial)
   ========================================================================== */

:root, [data-palette="classic"] {
  --bg-primary: #ffffff;
  --bg-secondary: #fbfbfb;
  --bg-card: #ffffff;
  --bg-frame: #ebefe8;
  --text-main: #333333;
  --text-muted: #666666;
  --text-light: #888888;
  --accent: #c71717;
  --accent-dark: #990f0f;
  --accent-soft: rgba(199, 23, 23, 0.08);
  --border-color: #e5e5e5;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-script: 'Alex Brush', cursive;
  --font-sans: 'Montserrat', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
}

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

body {
  background-color: #ececec;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.site-container {
  max-width: 500px;
  margin: 0 auto;
  background-color: var(--bg-primary);
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow-x: hidden;  /* máy cũ (iOS 15 trở xuống) chưa hiểu clip, dùng tạm hidden */
  overflow-x: clip;    /* hidden ép overflow-y thành auto, biến khối này thành vùng cuộn riêng và nuốt mất cú vuốt của khách; clip thì không */
}

/* Audio Control */
.audio-control-wrapper {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999;
}

.audio-toggle {
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  padding: 4px;
}

.vinyl-disk {
  width: 44px;
  height: 44px;
  background: #111;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 6s linear infinite;
  animation-play-state: paused;
}

.audio-toggle.playing .vinyl-disk {
  animation-play-state: running;
}

.vinyl-center {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-note-icon {
  width: 10px;
  height: 10px;
  color: #fff;
}

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

/* Hero Section */
.section-hero {
  position: relative;
  width: 100%;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  text-align: center;
  padding-bottom: 45px;
}

.hero-photo-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.75) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
}

.hero-subscript {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 6px;
}

.hero-handwrite {
  font-family: var(--font-script);
  font-size: 38px;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.couple-names {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  text-wrap: balance;
}

.couple-names .amp {
  font-family: var(--font-script);
  color: #ffd8d8;
  font-weight: normal;
  font-size: 36px;
  margin: 0 4px;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 18px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 12px;
  letter-spacing: 1px;
}

.hero-divider {
  opacity: 0.5;
}

/* Guest section */
.section-guest {
  padding: 24px 20px 0;
}

.guest-card {
  background: var(--bg-frame);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  border: 1px dashed rgba(199, 23, 23, 0.25);
}

.guest-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
}

.guest-tag {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.guest-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.guest-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* Section Title Common */
.section-title-wrap {
  text-align: center;
  margin-bottom: 24px;
}

.sub-title {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.main-title {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--text-main);
  font-weight: 700;
  text-wrap: balance;
}

/* Story Section */
.section-story {
  padding: 40px 24px;
  text-align: center;
}

.story-badge {
  margin-bottom: 20px;
}

.badge-en {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.badge-title {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--accent);
  font-weight: 700;
}

.quote-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.quote-text {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.8;
}

.story-photo-grid {
  margin-bottom: 24px;
}

.story-photo-item img {
  width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  display: block;
}

.romantic-message {
  padding: 0 10px;
}

.romantic-script {
  font-family: var(--font-script);
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 8px;
}

.romantic-body {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.romantic-strong {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--text-main);
}

/* Countdown */
.section-countdown {
  padding: 0 20px 40px;
}

.countdown-card {
  background: var(--bg-frame);
  border-radius: 16px;
  padding: 28px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.cd-ornament {
  width: 80px;
  margin-bottom: 12px;
}

.cd-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

.cd-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.countdown-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.cd-box {
  background: #fff;
  border-radius: 10px;
  padding: 12px 10px;
  min-width: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
}

.cd-val {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums lining-nums;
}

.cd-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 1px;
}

.cd-footer-lunar {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Couple */
.section-couple {
  padding: 20px 20px 40px;
}

.couple-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.person-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.person-img-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.person-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.person-role-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(199, 23, 23, 0.9);
  color: #fff;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.person-info {
  padding: 20px;
  text-align: center;
}

.person-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.person-parents {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.person-addr {
  font-size: 12px;
  color: var(--text-light);
}

.couple-heart-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
}

.love-seal-img {
  width: 60px;
  height: auto;
  opacity: 0.9;
}

/* Events */
.section-events {
  padding: 20px 20px 40px;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.event-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.event-card.is-main-event {
  border-color: rgba(199, 23, 23, 0.3);
  box-shadow: 0 8px 24px rgba(199, 23, 23, 0.08);
}

.event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.event-badge {
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
}

.event-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.event-time-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.event-clock {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}

.event-date-details {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.event-weekday {
  font-weight: 600;
  color: var(--text-main);
}

.event-date {
  color: var(--text-muted);
}

.event-lunar {
  font-size: 12px;
  color: var(--accent);
  font-style: italic;
}

.event-place-block {
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 16px;
}

.event-address {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-map {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-frame);
  color: var(--text-main);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.btn-map:hover {
  background: #e2e8df;
}

/* Gallery */
.section-gallery {
  padding: 20px 20px 40px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item:nth-child(5n+1) {
  grid-column: span 2;
  aspect-ratio: 16/10;
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-thumb {
  transform: scale(1.05);
}

.gallery-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-hover-overlay {
  opacity: 1;
}

.view-btn {
  font-size: 20px;
}

/* Gifts / Money Box */
.section-gifts {
  padding: 20px 20px 40px;
  background: var(--bg-frame);
  text-align: center;
}

.gifts-intro {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding: 0 10px;
}

.bank-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bank-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  text-align: center;
}

.bank-owner-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--accent);
  color: #fff;
  padding: 3px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 12px;
}

.qr-wrap {
  width: 150px;
  height: 150px;
  margin: 0 auto 14px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bank-meta {
  margin-bottom: 14px;
}

.bank-name {
  font-size: 15px;
  color: var(--text-main);
}

.bank-acc-num {
  font-size: 16px;
  font-family: monospace;
  font-weight: 700;
  color: var(--accent);
  margin: 4px 0;
}

.bank-holder {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.btn-copy-acc {
  background: var(--bg-frame);
  color: var(--text-main);
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-acc:hover {
  background: #e2e8df;
}

/* RSVP */
.section-rsvp {
  padding: 20px 20px 40px;
}

.rsvp-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.rsvp-intro {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: #fff;
}

.radio-options {
  display: flex;
  gap: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.btn-submit-rsvp {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 8px;
}

.btn-submit-rsvp:hover {
  background: var(--accent-dark);
}

.form-result-msg {
  margin-top: 14px;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.form-result-msg.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.form-result-msg.error {
  background: #ffebee;
  color: #c62828;
}

/* Wishes */
.section-wishes {
  padding: 20px 20px 40px;
}

.wishes-scroller {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.wish-item {
  background: var(--bg-frame);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
}

.wish-author {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.wish-body {
  color: var(--text-main);
  line-height: 1.5;
}

/* Thank you footer */
.section-thanks {
  padding: 30px 20px 20px;
  text-align: center;
  background: var(--bg-frame);
}

.thanks-photo-wrap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-sm);
  border: 4px solid #fff;
}

.thanks-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thanks-seal-box {
  margin-bottom: 12px;
}

.thanks-seal {
  width: 48px;
  height: auto;
}

.thanks-heading {
  font-family: var(--font-script);
  font-size: 42px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.thanks-msg {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 12px;
}

.thanks-sign {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 28px;
}

.shop-credit-box {
  font-size: 12px;
}

.shop-credit-box a.credit {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.shop-credit-box a.credit:hover {
  color: var(--accent);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lb-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* Toast */
.toast-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  z-index: 10000;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast-box.show {
  transform: translateX(-50%) translateY(0);
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
