/* fit.css — Responsive kiểu "thu/phóng cả tấm thiệp".
 * Tấm thiệp (#[data-showcase-root]) luôn được dựng ở KÍCH THƯỚC THIẾT KẾ GỐC
 * (điện thoại: 480px, máy tính bảng/máy tính: 900px) rồi scale đồng đều theo màn hình bằng
 * transform: scale(). Nhờ vậy bố cục, font, khoảng cách, họa tiết giữ nguyên, không bị xuống dòng
 * ngoài ý muốn. js/fit.js đặt các biến --card-w / --card-scale và chiều cao khung bao ngoài. */

html { overflow-x: hidden; overflow-x: clip; }
body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }

:root { --card-w: 480px; --card-scale: 1; }

/* Khung bao ngoài: giữ vị trí giữa, cắt phần tràn của lớp scale (không sinh thanh cuộn ngang). */
body > div[data-testid="minimalism-darkred-template"] {
  position: relative;
  width: 100% !important;
  max-width: 100%;
  overflow: hidden !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

/* Tấm thiệp: khóa chiều rộng thiết kế, scale từ mép trên – giữa. */
html body [data-showcase-root] {
  flex: none !important;
  width: var(--card-w) !important;
  min-width: var(--card-w) !important;
  max-width: var(--card-w) !important;
  margin: 0 !important;
  transform: scale(var(--card-scale));
  transform-origin: 50% 0;
  will-change: transform;
}

/* Chữ từng dùng đơn vị vw (co giãn theo màn hình) đã được đổi sang px cố định trong typography.css /
 * theme-minimalism-brown.css; riêng class Tailwind cũ dưới đây cũng khóa về giá trị tại khung 480px. */
@media (max-width: 767px) {
  [data-showcase-root] .text-\[clamp\(38px\,11vw\,46px\)\] { font-size: 46px; }
}

/* Chống xuống dòng ngoài ý muốn cho hàng tên cô dâu – chú rể ở đầu thiệp (thiết kế 1 dòng). */
[data-section="hero"] > div.relative.z-10:has(> p[data-f^="couple."]) { flex-wrap: nowrap !important; }
[data-section="hero"] p[data-f^="couple."] { white-space: nowrap !important; }

/* Tên cô dâu / chú rể ở thẻ "Thông tin lễ cưới": giữ trên MỘT dòng (không bẻ dòng), cỡ chữ vừa khít khung thẻ. */
:root:root:root:root:root:root [data-section="family"] h3[data-f^="couple."] {
  white-space: nowrap !important;
  text-wrap: nowrap !important;
  width: 100% !important;
  overflow-wrap: normal !important;
}

/* Đường kẻ dọc giữa hai bên gia đình: màu be nhạt trùng nền thẻ nên bị mất -> dùng màu nâu của theme. */
[data-section="family"] .row-span-4.w-\[1px\] { background-color: rgba(124, 106, 96, .4) !important; }

/* Font chữ theo đúng thiệp gốc: dùng font-family inline (Baskerville / Times New Roman / Viaoda Libre / The Nautigal / Lora...).
 * css/typography.css (bộ font "Elegant") không còn được nạp. Phần chữ không có font inline dùng font Baskerville của thiệp. */
html body { font-family: Baskerville, "Times New Roman", ChungDoiIndic, serif !important; }
body input, body textarea, body button, body select { font-family: inherit; }

/* Lightbox xem ảnh phóng to: nền tối, đặt trên cùng (không bị scale cùng tấm thiệp vì nằm ở top layer). */
dialog.modal[open] { background: rgba(8, 8, 8, .94) !important; }
dialog.modal .modal-box { cursor: default; }
dialog.modal img[data-a^="album-"] { user-select: none; -webkit-user-drag: none; }

/* Chữ phần dưới thiệp (địa điểm, chỉ đường, hộp quà, lời cảm ơn): đậm, to và rõ hơn. */
[data-section="map"] [data-f="view.venue.display"] { font-size: 15px !important; font-weight: 500 !important; color: #5f4d43 !important; line-height: 1.5 !important; }
[data-section="map"] [data-f="texts.venueLead"] { font-size: 17px !important; font-weight: 700 !important; }
[data-section="map"] [data-f="texts.directionsButton"] { font-size: 16px !important; font-weight: 700 !important; color: #6b5442 !important; }
[data-section="gift"] [data-f="texts.giftTitle"] { font-size: 22px !important; font-weight: 700 !important; }
[data-section="gift"] [data-f="texts.giftHint"] { font-size: 15px !important; font-weight: 600 !important; color: #5f4d43 !important; opacity: 1 !important; }
[data-showcase-root] [data-f="texts.giftHint"] { opacity: 1 !important; }
[data-f="texts.footerMessage"] { font-size: 16px !important; font-weight: 500 !important; color: #5f4d43 !important; line-height: 1.55 !important; }
[data-showcase-root] .ienv-hint { animation: none !important; opacity: 1 !important; }
[data-f="texts.footerMessage"] { text-wrap: balance; }
