/* ========================================================
   2. BASE RESETS & GLOBAL LAYOUT — LAVENDER WATERCOLOR THEME
   ======================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent !important;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent !important;
  overflow-x: hidden;
}

body {
  color: var(--ink);
  background-color: #ffffff;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body:not(.invite-open) {
  overflow: hidden;
}

body.invite-open {
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

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

/* Safari iOS: font-size < 16px trên input/textarea/select sẽ auto-zoom khi focus */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="password"],
input:not([type]),
textarea,
select {
  font-size: 16px !important;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  user-select: none;
  outline: none;
}

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

a {
  color: inherit;
  text-decoration: none;
  outline: none;
}

input, textarea, select {
  user-select: auto;
}

/* Main Container */
.app-container {
  width: min(900px, 100vw);
  margin: 0 auto;
  padding: 20px 18px 30px;
  position: relative;
  isolation: isolate;
  background-color: #f7f3fb;
  box-shadow: 0 0 40px rgba(45, 80, 115, 0.07);
}

/*
 * Ghép các tile nền theo kiểu xuôi/ngược để cạnh dưới của tile trước trùng
 * tuyệt đối với cạnh trên của tile sau. Không dùng filter trên toàn trang vì
 * lớp compositing quá dài sẽ làm Safari/Chrome mobile bị khựng khi cuộn.
 */
.app-background-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: #f7f3fb;
}

.app-background-tile {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 943 / 1675;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
    url("../assets/background.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.app-background-tile + .app-background-tile {
  margin-top: -1px;
}

.app-background-tile:nth-child(even) {
  transform: scaleY(-1);
}

/* Reveal Scroll Animation */
.reveal-section {
  /* Đã chuyển animation sang scroll-animations.css */
  margin-bottom: 36px;
}

.reveal-section.visible {
  /* Class này được thêm bởi IntersectionObserver trong script.js */
}

/* Elegant Card Standard Base */
.card-elegant {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(185, 210, 235, 0.7);
  border-radius: 20px;
  padding: 36px 22px 32px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(45, 80, 115, 0.09), 0 2px 8px rgba(0, 0, 0, 0.03);
  overflow: visible;
}

.card-title-main {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--primary-navy);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.card-subtitle-small {
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #4a6c8e;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.card-title-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 140px;
  margin: 4px auto 20px;
}

.card-title-divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(60, 95, 130, 0.45));
}

.card-title-divider .line:last-child {
  background: linear-gradient(to left, transparent, rgba(60, 95, 130, 0.45));
}

.card-title-divider .dot {
  font-size: 0.65rem;
  color: var(--primary-blue);
  line-height: 1;
}

/* Date 3-Column Box (Date Triptych) */
.date-triptych {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(175, 205, 230, 0.65);
  border-bottom: 1px solid rgba(175, 205, 230, 0.65);
  padding: 12px 10px;
  margin: 16px auto 12px;
  max-width: 380px;
}

.date-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.date-col .lbl {
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--primary-navy);
}

.date-col-center {
  border-left: 1px solid rgba(175, 205, 230, 0.7);
  border-right: 1px solid rgba(175, 205, 230, 0.7);
}

.date-col-center .day-num {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary-navy);
}

.date-col-center .year-num {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #4a6c8e;
  margin-top: 2px;
}

.lunar-date-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.82rem;
  color: #55799c;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
