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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent !important;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  color: var(--ink);
  background-color: var(--paper-bg);
  background-image: none;
  background-position: center top;
  background-repeat: repeat-y;
  background-size: 100% auto;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
}

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

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

/* Safari / Zalo / Messenger WebView: font-size < 16px → auto-zoom khi focus → scroll ngang */
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;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  outline: none !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  outline: none !important;
}

input, textarea {
  -webkit-user-select: auto !important;
  user-select: auto !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Khi đang focus input: khóa cứng không cho kéo ngang (WebView Zalo/Messenger) */
html.input-focused,
html.input-focused body {
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

/* App Container */
.app-container {
  width: min(var(--app-width), 100%);
  margin: 0 auto;
  padding: 0 14px 60px;
  position: relative;
}

.reveal-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin-bottom: 40px;
}

.reveal-section.visible {
  opacity: 1;
  transform: none;
}

/* ========================================================
   MẪU DÙNG CHUNG — SCRAPBOOK (đặt sớm để file từng khối ghi đè)
   ======================================================== */
/* Tiêu đề viết tay "Save the date!", "Hai gia đình"... */
.section-title {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
  color: var(--ink-dark);
}

/* Khung ảnh: nền be khi chưa có ảnh, ảnh phủ kín khung */
.photo-frame,
.cover-photo,
.hero-photo-small,
.couple-photo,
.gallery-photo {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--photo-1);
}

.photo-frame img,
.cover-photo img,
.hero-photo-small img,
.couple-photo img,
.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-frame img:not([src]),
.cover-photo img:not([src]),
.hero-photo-small img:not([src]),
.couple-photo img:not([src]),
.gallery-photo img:not([src]) { visibility: hidden; }

/* Ẩn chữ chỉ dành cho trình đọc màn hình */
.hero-names,
.announcement-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Nút viên thuốc viền mực (dùng chung) */
.pill-btn,
.btn-open,
.btn-gold-outline,
.btn-cream-solid,
.venue-direction-btn,
.ceremony-direction-btn,
.gift-envelope-trigger,
.btn-submit-wish {
  border: 2px solid var(--ink-dark);
  border-radius: 999px;
  color: var(--ink-dark);
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}

.btn-open:focus-visible,
.btn-gold-outline:focus-visible,
.btn-cream-solid:focus-visible,
.venue-direction-btn:focus-visible,
.ceremony-direction-btn:focus-visible,
.gift-envelope-trigger:focus-visible,
.btn-submit-wish:focus-visible,
.btn-wish-icon:focus-visible,
.gallery-more:focus-visible,
.gallery-item:focus-visible,
.photo-frame:focus-visible {
  outline: 2px solid var(--accent-red) !important;
  outline-offset: 3px;
}

/* Ẩn khỏi mắt nhưng giữ cho trình đọc màn hình */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Icon ghim vị trí đứng trước tên địa điểm (nhà trai, nhà gái, lễ thành hôn) */
.venue-name::before,
#reception-bride .rb-venue-name::before,
.ceremony-note:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.35em;
  vertical-align: -0.2em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Mũi tên vẽ bằng SVG: ký tự ↗ trên điện thoại bị đổi thành emoji */
.arrow-icon {
  flex: none;
  width: 1em;
  height: 1em;
}
