/* 청첩장 공통 색상과 글꼴 */
:root {
  color-scheme: light;
  --paper: #fffcf9;
  --ink: #473c35;
  --muted: #71665c;
  --rose: #975d68;
  --rose-light: #f8e9e7;
  --cream: #f6f1e9;
  --line: #e6dbd1;
  --gold: #b89976;
  --serif: Georgia, "Times New Roman", serif;
  --serif-ko: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --sans: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
}
button, a { color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; font: inherit; }
a { text-decoration: none; }
button:disabled { cursor: default; opacity: .55; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 4px; }
::selection { background: #f5d5d9; }
h1, h2, p, dl, dd, figure { margin: 0; }
svg { display: inline-block; flex-shrink: 0; }
a svg, button svg { width: 17px; height: 17px; }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.frame { width: min(1080px, calc(100% - clamp(48px, 11vw, 144px))); margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 5px; padding: 9px 15px; background: white; color: var(--rose); z-index: 5; }
.skip-link:focus { top: 5px; }

/* 상단과 표지 */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { min-height: 68px; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font: 26px/1.1 var(--serif); letter-spacing: -.06em; }
.brand svg { width: 30px; height: 30px; color: var(--rose); }
.header-nav { display: flex; gap: 26px; margin-left: auto; }
.header-nav a, .share-top { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
.header-nav a:hover { color: var(--rose); text-decoration: underline; text-underline-offset: 5px; }
.share-top { gap: 6px; background: transparent; border: 0; padding: 0 2px 0 18px; position: relative; }
.share-top::before { content: ""; width: 1px; height: 14px; background: var(--line); position: absolute; left: 0; }
.share-top:hover { color: var(--rose); }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "copy photo" "actions photo";
  gap: 0 clamp(26px, 5vw, 80px);
  padding-block: clamp(42px, 4.6vw, 66px);
  align-items: center;
}
.cover-copy { grid-area: copy; align-self: end; text-align: center; }
.flower-sprig { width: 104px; height: auto; margin-bottom: 15px; }
.cover-kicker, .section-kicker {
  color: var(--rose);
  font: 500 11px/1.5 var(--sans);
  text-transform: uppercase;
  letter-spacing: .22em;
}
.cover-kicker { display: flex; align-items: center; justify-content: center; gap: 11px; }
.cover-kicker::before, .cover-kicker::after { content: ""; width: 24px; height: 1px; background: #d7b7ad; }
h1 {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(8px, 1.1vw, 17px);
  margin-top: 12px;
  font: 500 clamp(32px, 3.6vw, 53px)/1.45 var(--serif-ko);
  letter-spacing: -.055em;
}
h1 em { color: var(--rose); font: italic .78em/1 var(--serif); }
.signature { margin-top: 4px; font: italic clamp(23px, 2.5vw, 36px)/1.2 var(--serif); color: var(--rose); letter-spacing: -.045em; }
.cover-info { margin-top: 26px; color: var(--ink); font-size: 16px; }
.cover-info::before { content: ""; display: block; width: 27px; height: 1px; margin: 0 auto 20px; background: #cdb598; }
.mid-dot { margin: 0 7px; color: #b59d88; }
.cover-info a { color: var(--muted); font-size: 14px; align-items: center; gap: 3px; display: inline-flex; padding: 3px 6px; }
.cover-info a svg { width: 15px; height: 15px; color: var(--rose); margin-right: 2px; }
.cover-info a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cover-art { grid-area: photo; width: min(100%, 438px); justify-self: center; }
.portrait-mat { border: 1px solid #cbb99e; border-radius: 50% 50% 5px 5px / 30% 30% 5px 5px; padding: 7px; background: #fffdf9; }
.cover-img {
  display: block;
  width: 100%;
  aspect-ratio: 4/4.85;
  border-radius: 50% 50% 2px 2px / 30% 30% 2px 2px;
  object-fit: cover;
  object-position: center 40%;
  background: var(--cream);
}
.hero-actions, .map-actions, .footer-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero-actions { grid-area: actions; align-self: start; justify-content: center; margin-top: 23px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 45px;
  padding: 10px 18px;
  font: 500 14px/1.5 var(--sans);
  border-radius: 5px;
  border: 1px solid transparent;
}
.primary { background: var(--rose); color: white; }
.primary:hover { background: #81505a; }
.secondary { color: var(--ink); background: transparent; border-color: #d1c3b6; }
.secondary:hover { background: var(--cream); }

/* 초대글과 사진첩 */
.spread { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1fr); gap: clamp(38px, 8vw, 100px); padding-block: clamp(55px, 6.2vw, 87px); }
.note-section, .location-section { border-top: 1px solid var(--line); }
h2 { margin-top: 10px; font: 500 clamp(30px, 2.8vw, 42px)/1.4 var(--serif-ko); letter-spacing: -.06em; }
.letter-body { white-space: pre-line; font: 400 clamp(17px, 1.35vw, 20px)/1.9 var(--serif-ko); letter-spacing: -.035em; }
.families { margin-top: 22px; font-size: 14px; color: var(--muted); }
.families p + p { margin-top: 3px; }
.families strong { margin-left: 3px; color: var(--ink); font-weight: 600; }
.gallery-section { background: var(--cream); padding-block: clamp(42px, 5.5vw, 73px); }
.gallery-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.gallery-tip { color: var(--muted); font-size: 13px; }
.gallery-tip > span[aria-hidden] { margin: 0 3px; }
#gallery-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 23px; }
#gallery-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4,minmax(0,1fr)); }
.gallery-item { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 4px; background: #e5dcd2; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 1.18; object-fit: cover; border-radius: inherit; }
.gallery-item:hover img { filter: brightness(.96); }
.gallery-index { position: absolute; bottom: 8px; left: 8px; background: #fffaf1ed; color: #594d42; padding: 2px 6px; border-radius: 2px; font: 11px/1.3 var(--serif); }
#gallery-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
#gallery-pagination button { border: 1px solid #d3c6b8; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); font-size: 19px; }
#gallery-pagination button[aria-disabled="true"] { opacity: .38; cursor: default; }
.gallery-page-count { min-width: 3rem; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }

/* 예식 달력과 오시는 길 */
.event-time { margin: 21px 0 17px; font: 17px/1.8 var(--sans); }
.calendar-card { padding: 23px clamp(20px,3vw,36px) 18px; border: 1px solid var(--line); border-radius: 9px; background: #fffefd; }
.calendar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.calendar-top > :first-child { font: 500 21px/1.5 var(--serif-ko); }
.countdown { font: 500 12px/1.4 var(--sans); font-variant-numeric: tabular-nums; color: #804752; background: var(--rose-light); padding: 3px 10px; border-radius: 20px; }
.weekdays, #calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); justify-items: center; }
.weekdays { padding-block: 7px; font-size: 12px; color: var(--muted); border-block: 1px solid var(--line); }
#calendar-grid { margin: 7px 0; gap: 2px 0; font: 15px/1 var(--serif); }
.day { width: 31px; height: 31px; display: grid; place-items: center; }
.is-sun, .weekdays span:first-child, .heart { color: var(--rose); }
.day.is-wedding { border-radius: 50%; background: var(--rose); color: white; }
.calendar-note { display: flex; align-items: center; justify-content: center; gap: 7px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 13px; }
.venue-name { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font: 20px/1.6 var(--serif-ko); }
.venue-name svg { width: 21px; height: 21px; color: var(--rose); }
.address-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
address { font-size: 14px; font-style: normal; }
.copy-address, .detail-action { border: 0; background: transparent; color: var(--rose); font-size: 13px; display: inline-flex; gap: 5px; align-items: center; justify-content: center; min-height: 44px; padding: 4px 7px; }
.copy-address svg { width: 15px; height: 15px; }
.map-actions { margin-top: 12px; }
.map-actions a { flex: 1; }
.transport { margin-top: 18px; }
.transport div { display: flex; align-items: baseline; gap: 15px; border-top: 1px solid var(--line); padding-block: 12px; font-size: 14px; }
.transport dt { min-width: max-content; font-weight: 600; }
.transport dd { white-space: pre-line; color: var(--muted); }
.optional-section { margin-bottom: 18px; }
.optional-section summary { cursor: pointer; border-block: 1px solid var(--line); padding: 14px 0; }
.detail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 15px; font-size: 14px; border-bottom: 1px solid var(--line); }
.detail-action { margin-left: auto; }

/* 마음 전하실 곳 */
.gift-section { background: #f8f3ed; border-top: 1px solid var(--line); }
.gift-note { margin-top: 13px; font: 15px/1.8 var(--serif-ko); color: var(--muted); }
#account-list { display: grid; gap: 10px; align-content: start; min-width: 0; }
.account-group { background: #fffdf9; border: 1px solid var(--line); border-radius: 7px; }
.account-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 500;
}
.account-summary::-webkit-details-marker { display: none; }
.account-summary::before { content: ""; width: 8px; height: 8px; background: #bc9f7f; border-radius: 50%; }
.account-group[data-side="bride"] .account-summary::before { background: #c9919d; }
.account-summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.account-group[open] .account-summary::after { transform: translateY(2px) rotate(225deg); }
.account-group-body { margin: 0 17px; border-top: 1px solid var(--line); }
.account-empty { margin-block: 14px; color: var(--muted); font-size: 14px; }
.account-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding-block: 14px; }
.account-row + .account-row { border-top: 1px solid var(--line); }
.account-info { display: grid; gap: 2px; min-width: 0; }
.account-label { color: var(--rose); font-size: 12px; font-weight: 600; }
.account-owner { font-size: 14px; }
.account-number { font-size: 16px; font-variant-numeric: tabular-nums; }
.account-copy { border: 1px solid #dfc8c4; border-radius: 5px; background: #fff7f4; color: #814952; min-height: 44px; padding: 6px 12px; font-size: 13px; }
.account-copy:hover { background: var(--rose-light); }

/* 맺음말과 사진 확대 화면 */
footer { text-align: center; background: var(--rose-light); }
.footer-inner { padding-block: 40px; }
.footer-flower { width: 30px; height: 30px; color: var(--rose); }
footer .section-kicker { margin-top: 7px; }
.footer-names { margin: 8px 0 6px; font: italic clamp(34px, 4vw, 54px)/1.25 var(--serif); letter-spacing: -.045em; }
.footer-msg { font-size: 14px; }
.footer-actions { justify-content: center; margin-top: 19px; }
.footer-actions .button { border-color: #d7bbba; background: transparent; }
.footer-actions .button:hover { background: #fff8f4; }
.modal-open { overflow: hidden; }
#photo-dialog { padding: 0; max-width: 100vw; max-height: 100dvh; border: 0; background: transparent; color: white; overflow: visible; }
#photo-dialog::backdrop { background: rgb(40 33 31 / 94%); }
.lightbox-inner { position: relative; max-width: 100vw; padding: 50px 56px 40px; }
.lightbox-image { display: block; max-width: min(78vw, 940px); max-height: 75vh; max-height: 75dvh; object-fit: contain; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #fff7; border-radius: 50%; color: white; background: #332a29b3; font: 30px/1 var(--serif); }
.lightbox-close { top: 0; right: 4px; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 4px; }
.lightbox-next { right: 4px; }
.lightbox-count { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); font-size: 13px; letter-spacing: 2px; }
#toast { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 10px 17px; max-width: calc(100% - 32px); width: max-content; border-radius: 5px; background: #483c36; color: white; opacity: 0; pointer-events: none; font-size: 14px; z-index: 15; }
#toast.is-visible { opacity: 1; }
.noscript { position: fixed; bottom: 0; width: 100%; background: white; padding: 12px; text-align: center; }

@media (min-width: 721px) and (max-width: 900px) {
  .header-row { gap: 14px; }
  .header-nav { gap: 13px; }
  .share-top { padding-left: 10px; }
}

/* 휴대폰에서는 예식 정보를 사진 위에, 바로가기 버튼을 사진 아래에 배치합니다. */
@media (max-width: 720px) {
  .frame { width: min(540px, calc(100% - 40px)); }
  .header-row { min-height: 54px; gap: 10px; }
  .brand { font-size: 22px; gap: 6px; }
  .brand svg { width: 25px; height: 25px; }
  .header-nav { gap: 0; }
  .header-nav a:not(.gift-link) { display: none; }
  .header-nav .gift-link { font-size: 12px; white-space: nowrap; }
  .share-top { min-width: 38px; justify-content: center; padding: 0; }
  .share-top span { display: none; }
  .share-top::before { display: none; }
  .hero { grid-template-columns: minmax(0,1fr); grid-template-areas: "copy" "photo" "actions"; gap: 0; padding-block: 27px; }
  .flower-sprig { display: none; }
  .cover-kicker { font-size: 9px; letter-spacing: .19em; }
  .cover-kicker::before, .cover-kicker::after { width: 19px; }
  h1 { margin-top: 8px; gap: 10px; font-size: clamp(31px, 8.6vw, 43px); line-height: 1.4; }
  .signature { margin-top: 1px; font-size: 22px; }
  .cover-info { margin-top: 12px; font-size: 14px; }
  .cover-info::before { display: none; }
  .cover-info a { padding-block: 2px; font-size: 13px; }
  .cover-art { width: min(100%, 380px); margin-top: 19px; }
  .portrait-mat { padding: 5px; }
  .cover-img { aspect-ratio: 4/4.35; }
  .hero-actions { margin-top: 17px; gap: 8px; width: min(100%,380px); justify-self: center; }
  .hero-actions a { flex: 1; }
  .button { min-height: 45px; padding: 9px 12px; font-size: 13px; }
  .spread { grid-template-columns: minmax(0,1fr); gap: 21px; padding-block: 43px; }
  .section-kicker { font-size: 10px; }
  h2 { font-size: 29px; margin-top: 4px; }
  .note-section { text-align: center; }
  .letter-body { font-size: 16px; }
  .families { margin-top: 17px; }
  .gallery-section { padding-block: 37px; }
  .gallery-heading { display: block; }
  .gallery-tip { margin-top: 6px; font-size: 13px; }
  #gallery-grid { gap: 5px; margin-top: 16px; }
  #gallery-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gallery-item img { aspect-ratio: 1; }
  .gallery-index { bottom: 5px; left: 5px; font-size: 10px; }
  .event-time { margin: 13px 0 11px; font-size: 16px; }
  .calendar-card { padding: 16px; }
  .map-actions, .footer-actions { gap: 8px; }
  .transport div { gap: 10px; }
  .footer-inner { padding-block: 31px; }
  .lightbox-inner { padding: 49px 0 40px; }
  .lightbox-image { max-width: 100vw; max-height: 72dvh; }
}
@media (max-width: 350px) {
  .frame { width: calc(100% - 30px); }
  .cover-info { font-size: 13px; }
  .mid-dot { margin-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* 모바일 커버 사진 크기 */
@media (max-width: 720px) {
  .cover-art {
    width: min(calc(100% + 16px), 420px);
  }

  .cover-img {
    aspect-ratio: 4 / 4.8;
  }
}
/* PC와 모바일 모두 사진 윗부분을 기준으로 표시 */
.cover-img {
  object-position: center top;
}