/*
 * ============================================================
 * Vấn đề 1 — Font chữ tiêu đề:
 * Bổ sung biến --ci-display-cg (Cormorant Garamond cổ kính)
 * dùng cho H1, H2, tên người nhận chức — hỗ trợ Vietnamese đầy đủ.
 *
 * Cinzel (--ci-display) giữ nguyên cho kicker / year / label nhỏ
 * vì Cinzel không có subset Vietnamese.
 * ============================================================
 */
.ci-invite {
  --ci-ivory: #f4ede0;
  --ci-cream: #fff9f0;
  --ci-navy: #0e1b33;
  --ci-navy-deep: #08101e;
  --ci-gold: #c4a35a;
  --ci-gold-light: #e8d5a3;
  --ci-gold-deep: #8a6b2a;
  --ci-ink: #1a140c;
  --ci-muted: #6b5e4a;

  /* Display nhỏ (kicker, year, label): Cinzel — Latin only, không dấu tiếng Việt */
  --ci-display: "Cinzel", "Times New Roman", serif;

  /* Display lớn (H1, H2, tên người): Cormorant Garamond — có Vietnamese + weight đầy đủ */
  --ci-display-cg: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  /* Body text: Cormorant Garamond */
  --ci-serif: "Cormorant Garamond", Georgia, serif;

  /* Thư pháp: Great Vibes */
  --ci-script: "Great Vibes", cursive;

  color: var(--ci-ink);
  background: var(--ci-ivory);
  font-family: var(--ci-serif);

  /* Vấn đề 2 — Font size cơ sở (Mobile): tăng 2px so với baseline ~16px */
  font-size: 1.125rem; /* 18px */
  line-height: 1.65;
}

.ci-invite *,
.ci-invite *::before,
.ci-invite *::after {
  box-sizing: border-box;
}

.ci-invite img {
  max-width: 100%;
  display: block;
}

.ci-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  color: var(--ci-cream);
  overflow: hidden;
}

.ci-hero img.ci-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ci-hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 16, 30, 0.7), rgba(8, 16, 30, 0.92));
}

.ci-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  padding: 6rem 1.25rem 4rem;
}

.ci-kicker {
  font-family: var(--ci-display);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ci-gold-light);
}

/*
 * Vấn đề 1 — H1: dùng Cormorant Garamond thay Cinzel.
 * Cormorant Garamond có subset Vietnamese → không bị lỗi dấu tiếng Việt.
 * Giữ clamp() để responsive.
 */
.ci-hero h1 {
  font-family: var(--ci-display-cg);
  font-size: clamp(2.4rem, 6vw, 3.8rem); /* tăng nhẹ cùng lúc cải thiện khả năng đọc */
  font-weight: 600;
  line-height: 1.1;
  margin: 1rem 0 0.5rem;
}

.ci-subtitle {
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ci-gold-light);
}

.ci-portrait {
  width: 9rem;
  height: 9rem;
  margin: 1.75rem auto;
  border-radius: 999px;
  object-fit: cover;
  object-position: center 18%;
  box-shadow: 0 0 0 2px var(--ci-gold-light), 0 0 0 8px var(--ci-gold);
}

/*
 * Vấn đề 1 — .ci-honoree: tên người nhận chức/khấn —
 * dùng Cormorant Garamond để hỗ trợ Vietnamese và trang trọng hơn.
 */
.ci-honoree {
  font-family: var(--ci-display-cg);
  font-weight: 600;
  font-size: 1.35rem;
}

.ci-motto {
  font-family: var(--ci-script);
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  color: var(--ci-gold-light);
  margin: 0.75rem 0 0.25rem;
}

.ci-section {
  max-width: 64rem;
  margin: 0 auto;
  padding: 4.5rem 1.25rem;
}

/*
 * Vấn đề 1 — H2: dùng Cormorant Garamond.
 * Giữ màu Navy và clamp().
 */
.ci-section h2 {
  font-family: var(--ci-display-cg);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  color: var(--ci-navy);
  text-align: center;
  margin: 0.4rem 0 0.6rem;
}

.ci-center {
  text-align: center;
}

/*
 * Vấn đề 2 — .ci-lead (mô tả, thư mời, RSVP intro):
 * Mobile: 1.3rem (~21px, +2px từ 1.15rem=18.4px).
 * Desktop xem @media bên dưới.
 */
.ci-lead {
  max-width: 40rem;
  margin: 1rem auto 0;
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--ci-muted);
}

.ci-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

@media (min-width: 720px) {
  .ci-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .ci-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

.ci-card {
  background: var(--ci-cream);
  border-radius: 1.1rem;
  padding: 1.2rem 1.25rem;
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.28);
}

.ci-year {
  font-family: var(--ci-display);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ci-gold-deep);
}

.ci-dark {
  background: var(--ci-navy);
  color: var(--ci-cream);
}

.ci-dark h2 {
  color: var(--ci-cream);
}

.ci-schedule {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .ci-schedule { grid-template-columns: 1.05fr 0.95fr; }
}

.ci-item time {
  font-family: var(--ci-display);
  color: var(--ci-gold);
  display: inline-block;
  min-width: 4rem;
}

.ci-map iframe {
  width: 100%;
  height: 14rem;
  border: 0;
  border-radius: 0.7rem;
}

.ci-form,
.ci-wish-form {
  max-width: 36rem;
  margin: 2rem auto 0;
  display: grid;
  gap: 0.9rem;
}

.ci-form label,
.ci-wish-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: var(--ci-navy);
}

.ci-form input,
.ci-form textarea,
.ci-form select,
.ci-wish-form input,
.ci-wish-form textarea {
  width: 100%;
  border: 1px solid rgba(196, 163, 90, 0.4);
  background: var(--ci-cream);
  border-radius: 0.55rem;
  padding: 0.7rem 0.85rem;
  font-family: var(--ci-serif);
  font-size: 1rem;
  color: var(--ci-ink);
}

.ci-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.5rem;
  background: var(--ci-gold);
  color: var(--ci-navy-deep);
  border: 0;
  border-radius: 0.5rem;
  font-family: var(--ci-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.ci-btn:hover {
  background: var(--ci-gold-light);
}

.ci-thanks {
  text-align: center;
  padding: 2rem 1rem;
}

.ci-bank {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 800px) {
  .ci-bank { grid-template-columns: 1fr 1fr; }
}

.ci-bank-card {
  background: var(--ci-navy);
  color: var(--ci-cream);
  border-radius: 1.1rem;
  padding: 1.5rem;
}

.ci-bank-card img {
  width: 10rem;
  background: var(--ci-cream);
  padding: 0.5rem;
  border-radius: 0.6rem;
}

.ci-footer {
  background: var(--ci-navy-deep);
  color: var(--ci-gold-light);
  text-align: center;
  padding: 3rem 1rem;
}

.ci-radio {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(196, 163, 90, 0.3);
  border-radius: 0.7rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.ci-hidden { display: none; }

.ci-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  background: color-mix(in srgb, var(--ci-navy) 94%, #000);
  padding: 0.85rem 1rem;
}

.ci-nav a {
  color: var(--ci-gold-light);
  text-decoration: none;
  font-size: 0.92rem;
}

/* Nút nhạc nền nổi — góc phải dưới, không che nội dung */
.ci-audio-btn {
  position: fixed;
  z-index: 60;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 163, 90, 0.45);
  background: var(--ci-navy);
  color: var(--ci-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(8, 16, 30, 0.55);
}

.ci-audio-btn:hover {
  background: var(--ci-navy-deep);
}

.ci-audio-icon {
  display: flex;
}

.ci-audio-mute {
  position: absolute;
  transform: translate(10px, 10px);
}

.ci-audio-btn.is-playing .ci-audio-icon {
  animation: ci-disc-spin 8s linear infinite;
}

.ci-audio-btn.is-playing .ci-audio-mute {
  display: none;
}

@keyframes ci-disc-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 640px) {
  .ci-audio-btn {
    width: 3.5rem;
    height: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ci-audio-btn.is-playing .ci-audio-icon {
    animation: none;
  }
}

/* —— Bốn tone mẫu: navy (mặc định), marigold, burgundy, earth —— */
.ci-invite[data-theme="marigold"] {
  --ci-navy: #6b4a12;
  --ci-navy-deep: #3d2a08;
  --ci-gold: #e3a31a;
  --ci-gold-light: #f3d48a;
  --ci-gold-deep: #c47a12;
  --ci-ivory: #fbf4e4;
}

.ci-invite[data-theme="burgundy"] {
  --ci-navy: #4a1520;
  --ci-navy-deep: #2a0c14;
  --ci-gold: #c4a35a;
  --ci-gold-light: #e8d5a3;
  --ci-gold-deep: #8a6b2a;
  --ci-ivory: #f7efe6;
}

.ci-invite[data-theme="earth"] {
  --ci-ivory: #f5f5dc;
  --ci-cream: #faf6ee;
  --ci-navy: #5d4037;
  --ci-navy-deep: #3e2723;
  --ci-gold: #d87040;
  --ci-gold-light: #e8b48a;
  --ci-gold-deep: #a84b28;
  --ci-ink: #3e2723;
  --ci-muted: #8d6e63;
}

.ci-invite[data-theme="marigold"] .ci-portrait:not(.ci-portrait-wide) {
  object-position: center 34%;
}

.ci-portrait-wide {
  width: min(18rem, 78vw);
  height: 12rem;
  border-radius: 0.85rem;
  object-fit: cover;
  object-position: center 18%;
}

/* Hero hoa (khấn / truyền chức / lễ chung): thiệp kem trên nền ảnh */
.ci-hero-floral {
  align-items: center;
}
.ci-hero-floral .ci-hero-veil {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ci-ivory) 22%, transparent) 0%,
    color-mix(in srgb, var(--ci-gold) 28%, transparent) 40%,
    color-mix(in srgb, var(--ci-navy-deep) 58%, transparent) 100%
  );
}
.ci-hero-floral .ci-hero-inner {
  max-width: 42rem;
  margin: 5.5rem 1.25rem 3rem;
  padding: 2.2rem 1.4rem 2.5rem;
  background: color-mix(in srgb, var(--ci-cream) 94%, transparent);
  border-radius: 1.1rem;
  color: var(--ci-navy);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ci-gold) 35%, transparent);
}
.ci-hero-floral .ci-kicker,
.ci-hero-floral .ci-subtitle,
.ci-hero-floral .ci-motto {
  color: var(--ci-gold-deep);
}
.ci-hero-floral h1,
.ci-hero-floral .ci-honoree {
  color: var(--ci-navy);
}

/* Hero nhiều người: nới rộng khung kem */
.ci-hero-group .ci-hero-inner,
.ci-hero-floral.ci-hero-group .ci-hero-inner {
  max-width: 64rem;
}

/* Lưới chân dung 2–10 người — tự co theo data-count */
.ci-people {
  list-style: none;
  margin: 1.6rem 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .ci-people[data-count="2"],
  .ci-people[data-count="4"],
  .ci-people[data-count="5"],
  .ci-people[data-count="6"],
  .ci-people[data-count="7"],
  .ci-people[data-count="8"],
  .ci-people[data-count="9"],
  .ci-people[data-count="10"] {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 800px) {
  .ci-people[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
  .ci-people[data-count="4"] { grid-template-columns: repeat(4, 1fr); }
  .ci-people[data-count="5"],
  .ci-people[data-count="6"] { grid-template-columns: repeat(3, 1fr); }
  .ci-people[data-count="7"],
  .ci-people[data-count="8"],
  .ci-people[data-count="9"],
  .ci-people[data-count="10"] { grid-template-columns: repeat(4, 1fr); }
}
.ci-people li {
  background: var(--ci-ivory);
  border-radius: 1rem;
  padding: 1rem 0.85rem 1.15rem;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ci-gold) 28%, transparent);
}
.ci-people img {
  width: 6.25rem;
  height: 6.25rem;
  margin: 0 auto 0.55rem;
  border-radius: 999px;
  object-fit: cover;
  object-position: center 28%;
  box-shadow:
    0 0 0 2px var(--ci-gold-light),
    0 0 0 6px var(--ci-gold);
}
.ci-people h3 {
  font-family: var(--ci-display);
  font-size: 1rem;
  color: var(--ci-navy);
  margin: 0.15rem 0 0;
}
.ci-people .ci-motto {
  font-size: 1.2rem;
  color: var(--ci-gold-deep);
  margin: 0.35rem 0 0;
}
.ci-people-bio {
  margin-top: 2rem;
}

.ci-preview-bar,
.ci-owner-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  background: var(--ci-navy, #0e1b33);
  color: var(--ci-gold-light, #e8d5a3);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
}

.ci-owner-bar a,
.ci-preview-bar a {
  color: inherit;
}

body.ci-single-invite {
  margin: 0;
  background: #f4ede0;
}

.ci-section h3 {
  /*
   * Vấn đề 1 — H3 bên trong section (tên người trong card hành trình):
   * dùng Cormorant Garamond thay Cinzel để hỗ trợ Vietnamese.
   */
  font-family: var(--ci-display-cg);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.2rem 0;
}

/* ============================================================
 * Vấn đề 2 — Responsive Typography: Desktop (+4px so với mobile).
 * Breakpoint 768px (md) trở lên.
 * ============================================================ */
@media (min-width: 768px) {
  .ci-invite {
    /* Font size cơ sở desktop: tăng thêm 2px nữa so với mobile (tổng +4px từ baseline) */
    font-size: 1.25rem; /* 20px */
    line-height: 1.7;
  }

  /* H1 hero: điều chỉnh clamp bound lớn hơn cho màn hình rộng */
  .ci-hero h1 {
    font-size: clamp(2.6rem, 5vw, 4.2rem);
  }

  /* H2 section: bound lớn hơn */
  .ci-section h2 {
    font-size: clamp(2.2rem, 4vw, 3.1rem);
  }

  /* Lead text desktop: 1.45rem (~23px, +4px từ baseline ~19px) */
  .ci-lead {
    font-size: 1.45rem;
    line-height: 1.72;
  }

  /* .ci-honoree tên người */
  .ci-honoree {
    font-size: 1.5rem;
  }

  /* Subtitle italic trong hero */
  .ci-subtitle {
    font-size: 1.35rem;
  }

  /* Schedule items */
  .ci-item {
    font-size: 1.2rem;
  }

  /* Form labels */
  .ci-form label,
  .ci-wish-form label {
    font-size: 1.1rem;
  }

  /* Form inputs */
  .ci-form input,
  .ci-form textarea,
  .ci-form select,
  .ci-wish-form input,
  .ci-wish-form textarea {
    font-size: 1.15rem;
  }
}


