/* 상견례 초대장 — 따뜻한 베이지 종이 위에 기와지붕을 얹은 단일 페이지 */

:root {
  --paper: #F3EADF;       /* 베이지 종이 */
  --card: #FAF5EE;        /* 한 톤 밝은 종이 — 장소 카드 */
  --surround: #E6D8C6;    /* 넓은 화면에서 종이 바깥 */
  --ink: #3B322B;         /* 갈색 먹 */
  --muted: #6E5F52;
  --roof: #5A5048;        /* 기와 */
  --accent: #7E533C;      /* 밤색 — 버튼·링크 */
  --wash: #EBDDCB;
  --hair: #D9C8B3;
  --seal: #A0453A;        /* 낙관 — 하트·지도 표시 */
  --gold: #A57B47;        /* 맨 위 '초대합니다' */
  --gold-ink: #7A5E45;    /* 맨 위 부제 */

  --display: 'Song Myung', 'Hahmlet', 'Noto Serif KR', 'AppleMyungjo', 'Batang', serif;
  --text: 'Hahmlet', 'Noto Serif KR', 'AppleMyungjo', 'Batang', serif;
  --gutter: clamp(22px, 7.6vw, 32px);

  color-scheme: only light;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surround);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

h1, h2, p, figure, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.is-missing { display: none !important; }

/* 종이 한 장 */
.sheet {
  max-width: 440px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
}

@media (min-width: 480px) {
  .sheet { box-shadow: 0 0 0 1px var(--hair); }
}

/* ---------- 표지 ---------- */

.cover {
  padding: 40px 0 72px;
  text-align: center;
}

/* 맨 위 초대 문구와 그림 */
.intro { padding: 4px var(--gutter) 0; margin-bottom: 34px; }

.intro-title {
  padding-left: .08em;    /* 자간 끝 여백 보정 */
  font-family: var(--display);
  font-size: clamp(38px, 11vw, 46px);
  line-height: 1.25;
  letter-spacing: .08em;
  color: var(--gold);
}

.intro-sub {
  margin-top: 16px;
  font-family: var(--display);
  font-size: clamp(18px, 5.2vw, 21px);
  line-height: 1.7;
  letter-spacing: .02em;
  color: var(--gold-ink);
}

.couple {
  display: block;
  width: min(86%, 300px);
  height: auto;
  margin: 26px auto 0;
}

.roof {
  display: block;
  width: calc(100% - 14px);
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.cover-photo { margin: 2px var(--gutter) 0; }

.cover-photo img { width: 100%; }

.names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .48em;
  margin-top: 38px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(29px, 8.8vw, 37px);
  line-height: 1.25;
  letter-spacing: .14em;
}

/* 자간 끝 여백 보정 */
.names > span:not(.sr-only) { margin-right: -.14em; }

.names .heart {
  flex: none;
  width: .52em;
  height: .52em;
  margin-top: .04em;
  color: var(--seal);
}

.when {
  margin-top: 24px;
  font-size: 17px;
  letter-spacing: .02em;
  text-wrap: balance;
}

.where {
  margin-top: 2px;
  color: var(--muted);
}

/* ---------- 사진 ---------- */

.picture { margin: 0 var(--gutter) 60px; }

.picture img { width: 100%; }

/* ---------- 섹션 공통 ---------- */

h2 {
  margin-bottom: 26px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 23px;
  line-height: 1.4;
  letter-spacing: .06em;
  text-align: center;
}

h2 [aria-hidden] {
  margin: 0 .35em;
  font-size: .82em;
  letter-spacing: 0;
}

/* ---------- 인사말 ---------- */

.greeting {
  padding: 0 var(--gutter) 64px;
  text-align: center;
}

.greeting p {
  font-size: clamp(15.5px, 4.3vw, 17px);
  line-height: 2.05;
}

.greeting span {
  display: block;
  text-wrap: balance;
}

/* ---------- 참석자: 두 집안을 나란히 ---------- */

.guests { padding: 0 var(--gutter) 64px; }

.families {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 300px;
  margin: 0 auto;
  text-align: center;
}

.family + .family { border-left: 1px solid var(--hair); }

.family dt {
  margin-bottom: 12px;
  font-size: 14.5px;
  color: var(--muted);
}

.family dd {
  font-size: 17px;
  line-height: 2.05;
}

/* ---------- 식사 메뉴: 차림표 ---------- */

.menu { padding: 0 var(--gutter) 72px; }

.menu-card {
  padding: 34px 16px 32px;
  border: 1px solid var(--roof);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--roof);
  text-align: center;
}

.menu-card h2 { margin-bottom: 20px; }

.courses {
  font-family: var(--display);
  font-size: clamp(16px, 4.6vw, 18.5px);
  line-height: 2.2;
  letter-spacing: .02em;
}

/* ---------- 사진첩 ---------- */

.gallery { padding: 0 var(--gutter) 72px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.gallery-grid li[hidden] { display: none; }

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--wash);
  overflow: hidden;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  opacity: 0;
  transition: opacity .35s ease;
}

.thumb img.is-loaded { opacity: 1; }

.gallery .more-btn {
  display: flex;
  width: fit-content;
  margin: 20px auto 0;
}

.gallery .more-btn[hidden] { display: none; }

/* ---------- 연락하기 ---------- */

.contact {
  margin: 0 var(--gutter) 64px;
  border-top: 1px solid var(--hair);
}

.person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
}

.who { font-size: 18px; }

.role {
  margin-right: .6em;
  font-size: 14.5px;
  color: var(--muted);
}

.actions { display: flex; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 clamp(11px, 3.8vw, 17px);
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pill svg { width: 17px; height: 17px; flex: none; }

.pill:active { background: var(--wash); }

@media (hover: hover) {
  .pill:hover { background: var(--wash); }
}

/* ---------- 오시는 길 ---------- */

.location {
  padding: 0 var(--gutter) 72px;
  text-align: center;
}

.location h2.venue {
  margin-bottom: 0;
  font-size: 25px;
  letter-spacing: .08em;
}

.address { margin-top: 6px; }

.venue-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 20px;
  margin-top: 4px;
  font-size: 15px;
}

.text-btn {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  white-space: nowrap;
  cursor: pointer;
}

.map-wrap {
  position: relative;
  isolation: isolate;
  height: 250px;
  margin: 26px calc(var(--gutter) * -1) 0;
  border-top: 1px solid var(--hair);
  background: var(--wash);
}

.map { position: absolute; inset: 0; background: var(--wash); }

.map-link { position: absolute; inset: 0; z-index: 900; }

.map .leaflet-tile-pane { filter: grayscale(.55) sepia(.32) contrast(.92) brightness(1.03); }

.map .leaflet-control-attribution {
  font-family: system-ui, sans-serif;
  font-size: 10px;
  background: rgba(243, 234, 223, .85);
}

.seal-pin { background: none; border: 0; }

.seal-pin span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 36px;
  border-radius: 3px;
  background: var(--seal);
  color: #FBF6EF;
  font-family: var(--display);
  font-size: 13px;
  line-height: 1.05;
  text-align: center;
  box-shadow: 0 2px 6px rgba(59, 50, 43, .3);
}

.seal-pin span::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom: 0;
  border-top-color: var(--seal);
}

.nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 calc(var(--gutter) * -1);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 6px;
  border: 0;
  background: var(--paper);
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn + .nav-btn { border-left: 1px solid var(--hair); }

.nav-btn:active { background: var(--wash); }

@media (hover: hover) {
  .nav-btn:hover { background: var(--wash); }
}

/* ---------- 이후 일정: 시간 순서대로 ---------- */

.after { padding: 0 var(--gutter) 72px; }

.tl-item {
  position: relative;
  padding: 0 0 36px 30px;
}

.tl-item:last-child { padding-bottom: 0; }

/* 기와 막새 모양의 시간 표시 */
.tl-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--roof);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--roof);
}

.tl-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 26px;
  bottom: 6px;
  width: 1px;
  background: var(--hair);
}

.tl-time {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.45;
  letter-spacing: .04em;
}

.tl-what { margin-top: 2px; }

.tl-who {
  margin-top: 2px;
  font-size: 15px;
  color: var(--muted);
}

.tl-label {
  display: inline-block;
  margin-right: .6em;
  padding: 0 .55em;
  border: 1px solid var(--hair);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.7;
}

.places { margin-top: 14px; }

.places li + li::before {
  content: '또는';
  display: block;
  margin: 8px 0;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: center;
  color: var(--muted);
}

.place {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  padding: 12px 12px 12px 15px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--card);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.place:active { background: var(--wash); }

@media (hover: hover) {
  .place:hover { border-color: var(--accent); }
}

.place-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.place-detail {
  grid-column: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.place-go {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 5px 11px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13.5px;
  line-height: 1.3;
  white-space: nowrap;
}

/* ---------- 마무리 ---------- */

.closing {
  padding: 0 var(--gutter) 60px;
  text-align: center;
}

.closing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.closing-actions [hidden] { display: none; }

.roof-mark {
  display: block;
  width: 104px;
  height: auto;
  margin: 52px auto 0;
}

/* ---------- 일정 등록 창 ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(43, 34, 28, .45);
}

.sheet-backdrop[hidden] { display: none; }

.calendar-sheet {
  width: 100%;
  max-width: 440px;
  padding: 24px 22px calc(18px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: var(--paper);
  text-align: center;
}

.sheet-title {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.4;
}

.sheet-sub {
  margin: 2px 0 16px;
  font-size: 14.5px;
  color: var(--muted);
}

.sheet-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 10px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 16px;
  text-decoration: none;
}

.sheet-option:active { background: var(--wash); }

.sheet-close {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

/* ---------- 사진 크게 보기 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: #1E1814;
  color: #F3EADF;
  overscroll-behavior: contain;
}

.lightbox[hidden] { display: none; }

.lightbox :focus-visible { outline-color: #F3EADF; }

.lb-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 4px 0 20px;
}

.lb-count {
  font-size: 15px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.lb-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.lb-close svg { width: 26px; height: 26px; }

.lb-stage {
  position: absolute;
  top: calc(56px + env(safe-area-inset-top));
  bottom: calc(44px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity .18s ease;
}

.lb-img.is-ready { opacity: 1; }

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 76px;
  margin-top: -38px;
  border: 0;
  background: none;
  color: #F3EADF;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lb-prev { left: 0; }
.lb-next { right: 0; }

.lb-nav svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}

.lb-nav[hidden] { display: none; }

/* ---------- 알림 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 3000;
  max-width: calc(100% - 40px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 첫 화면 한 번의 움직임: 지붕이 내려앉고 이름이 드러남 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .intro-title { animation: fade-in .8s ease-out both; }
  .intro-sub { animation: fade-in .8s ease-out .25s both; }
  .couple { animation: rise-in 1s cubic-bezier(.2, .7, .2, 1) .45s both; }
  .cover .roof { animation: roof-settle 1.1s cubic-bezier(.2, .7, .2, 1) .8s both; }
  .cover-photo { animation: fade-in .9s ease-out .75s both; }
  .names > span:first-child { animation: fade-in .9s ease-out 1.1s both; }
  .names .heart { animation: heart-in .7s cubic-bezier(.3, 1.4, .5, 1) 1.55s both; }
  .names > span:last-child { animation: fade-in .9s ease-out 1.3s both; }
  .calendar-sheet { animation: rise .22s ease-out; }
}

@media (prefers-reduced-motion: reduce) {
  .thumb img, .lb-img { transition: none; }
}

@keyframes roof-settle {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes heart-in {
  from { opacity: 0; transform: scale(.4); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
