:root {
  --bg: #fbfaf4;
  --soft: #f0f2e8;
  --text: #39402f;
  --muted: #838b78;
  --accent: #6f8a5c;      /* 세이지 그린 */
  --accent-2: #a9b98f;    /* 연한 잎색 */
  --sun: #c07a68;
  --line: #e1e6d6;
  --sprig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 20'%3E%3Cpath d='M4 10h72' stroke='%23000' stroke-width='.8' fill='none'/%3E%3Cpath d='M18 10c3-6 10-7 13-6-2 4-7 6-13 6zM18 10c3 6 10 7 13 6-2-4-7-6-13-6zM34 10c3-6 10-7 13-6-2 4-7 6-13 6zM34 10c3 6 10 7 13 6-2-4-7-6-13-6zM50 10c3-5 8-6 11-5-2 3-6 5-11 5zM50 10c3 5 8 6 11 5-2-3-6-5-11-5zM64 10c2-3 6-4 9-3-2 2-5 3-9 3z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #e6eadc;
  color: var(--text);
  font-family: "Gowun Batang", serif;
  line-height: 1.8;
  word-break: keep-all;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  overflow: hidden;
}

/* PC 등 넓은 화면: 카드처럼 띄우고 그림자 (폰에서는 화면 꽉 채움) */
@media (min-width: 560px) {
  .wrap {
    margin: 48px auto;
    min-height: auto;
    border-radius: 28px;
    box-shadow:
      0 2px 6px rgba(57, 64, 47, .06),
      0 12px 28px rgba(57, 64, 47, .10),
      0 32px 64px rgba(57, 64, 47, .12);
  }
}

/* cover — 사진을 꽉 채우고 아래를 배경색으로 부드럽게 녹임 */
.cover { position: relative; text-align: center; padding-bottom: 56px; }
.cover-photo {
  width: 100%; aspect-ratio: 1200 / 1859; object-fit: cover; display: block;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
.cover { display: flex; flex-direction: column; }
.cover-photo { order: 0; }
.cover-date { order: 1; letter-spacing: .35em; color: var(--accent); font-size: 13px; margin-top: -8px; }
.cover-names { order: 2; }
.cover-venue { order: 3; }
.cover::after { order: 4; }
.cover-names { font-size: 26px; font-weight: 400; margin-top: 4px; letter-spacing: .1em; }
.cover-names i { font-style: normal; color: var(--accent); margin: 0 14px; font-size: 20px; }
.cover-venue { color: var(--muted); font-size: 14px; margin-top: 8px; }
.cover::after { content: ""; display: block; width: 80px; height: 20px; margin: 28px auto 0; background: var(--accent-2); -webkit-mask: var(--sprig) center/contain no-repeat; mask: var(--sprig) center/contain no-repeat; }

/* 떨어지는 잎 */
.leaves { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.leaf {
  position: absolute; top: -30px; width: 14px; height: 14px;
  background: var(--accent-2); opacity: .85;
  border-radius: 0 100% 0 100%;
  animation: fall linear infinite;
}
@keyframes fall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: .85; }
  100% { transform: translate(var(--dx, 60px), 110vh) rotate(540deg); opacity: 0; }
}

/* sections */
.section { padding: 72px 28px; text-align: center; }
.bg-soft { background: var(--soft); }
.label { font-size: 12px; letter-spacing: .4em; color: var(--accent); font-weight: 400; margin-bottom: 16px; }
.label::after { content: ""; display: block; width: 64px; height: 16px; margin: 6px auto 0; background: var(--accent-2); -webkit-mask: var(--sprig) center/contain no-repeat; mask: var(--sprig) center/contain no-repeat; }
.title { font-size: 19px; font-weight: 700; margin-bottom: 20px; }
#date-text { font-size: 16px; white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; }
.greeting { font-size: 15px; line-height: 2.1; margin-bottom: 40px; }
.parents { font-size: 15px; line-height: 2.2; margin-bottom: 28px; }
.parents b { font-size: 17px; margin-left: 6px; }
.parents small { color: var(--muted); font-size: 13px; margin: 0 4px; }

.btn {
  display: inline-block; padding: 12px 28px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; border-radius: 999px; font-size: 14px;
}
.btn.ghost { background: transparent; color: var(--accent); }

/* calendar */
.calendar { max-width: 300px; margin: 0 auto 28px; padding: 20px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; font-size: 14px; }
.calendar .dow { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.calendar .sun { color: var(--sun); }
.calendar .day { height: 36px; line-height: 36px; }
.calendar .today { background: var(--accent); color: #fff; border-radius: 50%; width: 36px; margin: 0 auto; }
.dday { font-size: 15px; }
.dday b { color: var(--accent); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: pointer; border-radius: 4px; background: var(--line); }
/* 접힌 갤러리: 마지막 줄을 배경색 그라데이션으로 가림 */
.gallery-wrap { position: relative; overflow: hidden; transition: max-height .6s ease; }
.gallery-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32%;
  background: linear-gradient(to bottom, rgba(251,250,244,0), var(--bg) 80%);
  pointer-events: none; transition: opacity .4s;
}
.gallery-wrap:not(.collapsed)::after { opacity: 0; }
.gallery-more {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: -8px; position: relative; z-index: 1;
  background: none; border: 0; padding: 8px 20px;
  color: var(--accent); font-size: 13px; letter-spacing: .2em;
}
.gallery-more::after {
  content: ""; width: 8px; height: 8px; margin-top: 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .3s;
  animation: nudge 1.6s ease-in-out infinite;
}
.gallery-more.open::after { transform: rotate(225deg); animation: none; }
@keyframes nudge { 0%, 100% { transform: rotate(45deg) translate(0, 0); } 50% { transform: rotate(45deg) translate(3px, 3px); } }
@media (prefers-reduced-motion: reduce) { .gallery-more::after { animation: none; } }
.lb-count { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,.75); font-size: 13px; letter-spacing: .1em; }

/* map */
.map { margin: 24px 0 0; height: 240px; background: var(--line); border-radius: 12px; overflow: hidden; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-pin { background: var(--accent); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.15); font-family: "Gowun Batang", serif; }
.map-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 32px; }
.map-links a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 4px; font-size: 13px; text-decoration: none; white-space: nowrap;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  transition: background .2s;
}
.map-links a:active { background: var(--soft); }
.map-links svg { width: 18px; height: 18px; flex: none; }
.transport { text-align: left; }
.transport div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.transport h4 { font-size: 14px; color: var(--accent); margin-bottom: 4px; }
.transport p { font-size: 14px; }

/* accounts */
.accounts details { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; text-align: left; overflow: hidden; }
.accounts summary { padding: 14px 18px; list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--soft); font-size: 15px; }
.accounts summary::-webkit-details-marker { display: none; }
.accounts summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.accounts details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.acc { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); gap: 12px; }
.acc p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.acc p b { color: var(--text); font-size: 14px; font-weight: 400; }
.acc button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; font-size: 12px; }

.share { display: flex; flex-direction: column; gap: 12px; align-items: center; padding-top: 24px; }
.share .btn { width: 220px; }
.footer { text-align: center; padding: 40px 0 56px; color: var(--muted); letter-spacing: .3em; font-size: 12px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(20,24,16,.98); display: flex; align-items: center; justify-content: center; z-index: 50; }
.lightbox[hidden] { display: none; }
.lightbox { padding: max(64px, calc(env(safe-area-inset-top) + 56px)) 0 max(56px, calc(env(safe-area-inset-bottom) + 48px)); }
/* 사진은 위(닫기 버튼)·아래(장수 표시) 공간을 비워두고 그 사이에만 */
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 40px; padding: 12px 16px; }
.lb-close {
  top: max(10px, env(safe-area-inset-top)); right: 10px;
  width: 44px; height: 44px; padding: 0 !important; font-size: 30px !important; line-height: 44px;
  border-radius: 50%; background: rgba(255,255,255,.12) !important;
}
.lb-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0; top: 50%; transform: translateY(-50%); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(30,36,24,.4); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 24px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--bg); border-radius: 14px; padding: 24px; width: 100%; max-width: 340px; text-align: center; }
.contact { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.contact span { font-size: 13px; color: var(--muted); }
.contact a { text-decoration: none; margin-left: 12px; font-size: 18px; }
.modal-box .btn { margin-top: 20px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px); background: rgba(45,56,36,.92); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 13px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* scroll fade-in */
.fade { opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s; }
.fade.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .fade { opacity: 1; transform: none; transition: none; }
  .leaves { display: none; }
}
