/* ── 디자인 토큰 ─────────────────────────── */
:root {
  --bg: #f1ece4;          /* 바깥 배경 (데스크톱에서 보일 때) */
  --paper: #fbf7f1;       /* 청첩장 본체 배경 */
  --text: #2f2a25;
  --text-soft: #8a8078;
  --accent: #c4633f;      /* 포인트 색 (10월 가을, 감·테라코타) */
  --accent-soft: #f7e8de;
  --line: #e9e0d6;
  --sun: #c96b5d;         /* 일요일 */
  --sat: #6b8cae;         /* 토요일 */
  --serif: 'Noto Serif KR', serif;
  --sans: 'Noto Sans KR', sans-serif;
  --display: 'Cormorant Garamond', 'Noto Serif KR', serif; /* 대형 숫자·영문 */
}

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

body {
  background: var(--bg);
  font-family: var(--sans);
  font-weight: 300;
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 모바일 화면 폭 기준, 데스크톱에서는 가운데 카드 형태 */
#invitation {
  max-width: 430px;
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

section {
  padding: 72px 28px;
  text-align: center;
}
section + section { border-top: 1px solid var(--line); }

/* ── 섹션 공통 타이틀 ────────────────────── */
.section-label {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  margin-bottom: 32px;
}

/* ── 스크롤 등장 애니메이션 ───────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── 1. 커버 ────────────────────────────── */
#cover {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  border-top: none;
}
.cover-label {
  font-size: 11px;
  letter-spacing: 0.45em;
  color: var(--text-soft);
}

/* 10·10 타이포 마크 */
.mark-1010 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 4px 0;
}
.mark-1010 .num {
  font-family: var(--display);
  font-weight: 500;
  font-size: 96px;
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--text);
}
.mark-1010 .num:last-of-type { color: var(--accent); }
.mark-mid {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
}
.mark-mid .rule { width: 42px; height: 1px; background: var(--text); opacity: 0.35; }
.mark-mid .mid-text {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--text-soft);
}

#cover-names {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.08em;
}
.cover-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: var(--accent-soft);
  margin: 10px 0;
}
.cover-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 사진 파일이 없을 때 자리 표시 */
.photo-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent);
  font-size: 15px;
}
.photo-placeholder small { font-size: 12px; color: var(--text-soft); }
.cover-photo.no-img img { display: none; }
.cover-photo.no-img .photo-placeholder { display: flex; }

.cover-info { font-size: 15px; color: var(--text); }

/* ── 2. 인사말 ──────────────────────────── */
.greeting-message {
  white-space: pre-line;
  font-size: 15px;
  line-height: 2.1;
  margin-bottom: 40px;
}
/* 10 × 10 = 100 컨셉 문구 */
.formula { margin-bottom: 40px; }
.formula-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.formula-line .num {
  font-family: var(--display);
  font-weight: 500;
  font-size: 34px;
  color: var(--accent);
}
.formula-line .op {
  font-family: var(--display);
  font-size: 20px;
  color: var(--text-soft);
}
.formula-caption {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.9;
}

.family-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}
.family-lines .parents { color: var(--text-soft); }
.family-lines .who {
  color: var(--text);
  font-weight: 400;
  margin-left: 6px;
}

/* ── 3. 예식 안내 (달력 + 카운트다운) ──────── */
.schedule-datetime {
  font-size: 16px;
  margin-bottom: 32px;
  white-space: pre-line;
}

#calendar {
  max-width: 300px;
  margin: 0 auto 36px;
}
.cal-month {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 14px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 8px;
  font-size: 14px;
}
.cal-grid .dow { color: var(--text-soft); font-size: 12px; }
.cal-grid .sun { color: var(--sun); }
.cal-grid .sat { color: var(--sat); }
.cal-grid .day {
  width: 34px;
  height: 34px;
  line-height: 34px;
  margin: 0 auto;
  border-radius: 50%;
}
/* 예식일: 이중 링 (두 개의 0 — 반지 모티프) */
.cal-grid .day.wedding-day {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--accent);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.count-box {
  width: 64px;
  padding: 12px 0 10px;
  background: var(--accent-soft);
  border-radius: 8px;
}
.count-box span {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
}
.count-box small { font-size: 11px; color: var(--text-soft); }

.dday-message { font-size: 14px; color: var(--text-soft); }
.dday-message b { color: var(--accent); font-weight: 500; }

/* ── 4. 갤러리 ──────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--accent-soft);
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--accent);
  cursor: default;
}

/* 라이트박스 */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 13, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#lightbox[hidden] { display: none; }
#lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 4px;
}
#lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  padding: 12px;
  line-height: 1;
}
#lightbox-close { top: 14px; right: 14px; }
#lightbox-prev { left: 6px; top: 50%; transform: translateY(-50%); }
#lightbox-next { right: 6px; top: 50%; transform: translateY(-50%); }

/* ── 5. 오시는 길 ───────────────────────── */
.venue-name { font-size: 17px; font-weight: 400; margin-bottom: 6px; }
.venue-address { font-size: 14px; color: var(--text-soft); margin-bottom: 24px; }

.transport-info {
  margin-top: 32px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.transport-row { display: flex; gap: 14px; font-size: 14px; }
.transport-row .label {
  flex-shrink: 0;
  width: 52px;
  color: var(--accent);
  font-weight: 400;
}
.transport-row .detail { color: var(--text); }

/* ── 버튼 공통 ──────────────────────────── */
.btn-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:active { background: var(--accent-soft); }
.btn-kakao { background: #fee500; border-color: #fee500; }

/* ── 6. 연락하기 ────────────────────────── */
#contact-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.contact-group .group-title {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 12px;
}
.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.contact-row .role { color: var(--text-soft); font-size: 13px; margin-right: 10px; }
.contact-row .actions { display: flex; gap: 6px; }
.contact-row .actions a {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
}

/* ── 7. 마음 전하실 곳 ───────────────────── */
.accounts-note {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 28px;
}
.accordion { margin-bottom: 12px; text-align: left; }
.accordion-toggle {
  width: 100%;
  padding: 14px 18px;
  background: var(--accent-soft);
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion-toggle::after {
  content: '▾';
  color: var(--accent);
  transition: transform 0.3s;
}
.accordion.open .accordion-toggle::after { transform: rotate(180deg); }
.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.accordion.open .accordion-panel { grid-template-rows: 1fr; }
.accordion-panel > div { overflow: hidden; }
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.account-row .info { text-align: left; line-height: 1.5; }
.account-row .holder { color: var(--text-soft); font-size: 13px; }
.account-row .btn { padding: 7px 14px; font-size: 12px; flex-shrink: 0; }

/* ── 8. 공유 + 푸터 ─────────────────────── */
#share { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
footer { margin-top: 48px; }
.footer-1010 {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 14px;
}
#footer-names {
  font-family: var(--serif);
  font-size: 16px;
  margin-bottom: 10px;
}
.footer-thanks { font-size: 13px; color: var(--text-soft); }

/* ── 토스트 ─────────────────────────────── */
#toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(61, 56, 51, 0.92);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 200;
  transition: opacity 0.3s;
}
#toast[hidden] { display: none; }
