/* ============================================================
   sections.css — 섹션별 레이아웃 · 데이지 장식 · 컴포넌트
   ============================================================ */

/* ─────────────── 1. 메인 커버 ─────────────── */
.cover {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;   /* 위부터 채워 사진이 맨 위에 붙게 */
  text-align: center;
  padding: 0 0 44px;             /* 사진 위 여백 제거 */
  background:
    radial-gradient(120% 80% at 50% 0%, var(--lilac-100) 0%, var(--cream) 60%);
  position: relative;
  overflow: hidden;
}
.cover__daisy {
  position: absolute;
  width: 84px; opacity: 0.45;
  pointer-events: none;
  animation: floaty 6s ease-in-out infinite;
  z-index: 3;
}
.cover__daisy--1 { top: 20px; left: -24px; width: 126px; transform: rotate(-15deg); }
.cover__daisy--2 { bottom: 70px; right: -20px; width: 110px; animation-delay: -3s; }
@keyframes floaty {
  0%,100% { transform: translateY(0) rotate(-8deg); }
  50%     { transform: translateY(-14px) rotate(6deg); }
}

/* 사진 2장(위/아래, 간격 없이) + 캘리그래피 png 를 경계에 겹쳐 오버레이 */
.cover__stack {
  width: 100%;
  position: relative;
  line-height: 0;            /* 사진 사이 여백 제거 */
}
.cover__photo {
  width: 100%;
  aspect-ratio: 3 / 4;              /* JS가 config.coverPhotos 값으로 덮어씀 */
  overflow: hidden;                 /* zoom(확대) 시 넘치는 부분 잘라냄 */
  background-color: var(--lilac-100);
  display: block;
}
.cover__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;                /* 영역을 꽉 채우며 크롭 */
  object-position: center;          /* JS가 position 으로 덮어씀 */
  display: block;
}
.cover__lettering {
  position: absolute;
  left: 0; right: 0;
  top: 50%;                  /* 두 사진 경계 = 스택 세로 중앙 */
  transform: translateY(-50%);
  width: 100%;               /* 좌우 꽉 차게 */
  padding: 0 12px;
  z-index: 2;
  /* 이미지가 이미 흰 글씨(투명 배경) — 사방 그림자로 밝은 배경 위 가독성 확보 */
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55))
          drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}
/* 아래 사진 하단을 배경(크림색)으로 자연스럽게 페이드 */
.cover__photo--bottom { position: relative; }
.cover__photo--bottom::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30%;
  background: linear-gradient(to bottom, rgba(255, 253, 249, 0), var(--cream));
  pointer-events: none;
}

.cover__caption { padding: 26px 28px 0; }
.cover__names {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: var(--purple-deep);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.cover__names .amp { color: var(--lilac-300); margin: 0 10px; font-family: var(--font-script); }
.cover__date {
  color: var(--ink-soft);
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}
.cover__scroll {
  margin-top: 32px;                 /* 이름·날짜와 겹치지 않도록 아래로 */
  color: var(--lilac-400);
  font-size: 0.75rem; letter-spacing: 0.1em;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cover__scroll span { animation: bob 1.6s ease-in-out infinite; font-size: 1.1rem; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }

/* ─────────────── 2. 인사말 ─────────────── */
.greeting__body {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 2.1;
}
.greeting__body p { min-height: 0.6em; }

/* ─────────────── 3. 예식 정보 ─────────────── */
.info__parents {
  display: grid;
  gap: 6px;
  text-align: center;
  margin-bottom: 26px;
}
.info__parents .line {
  font-size: 1.02rem;
  color: var(--ink);
}
.info__parents .parents { color: var(--ink-soft); font-size: 0.92rem; }
.info__parents .child { font-family: var(--font-serif); color: var(--purple-deep); font-weight: 600; }
.info__parents .rel { color: var(--lilac-400); font-size: 0.85rem; margin-left: 4px; }
.info__meta {
  text-align: center;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--lilac-50);
  border: 1px solid var(--line);
}
.info__meta .when { font-family: var(--font-serif); font-size: 1.15rem; color: var(--purple-deep); }
.info__meta .where { color: var(--ink-soft); margin-top: 6px; font-size: 0.95rem; }

/* ─────────────── 4. 캘린더 + D-day ─────────────── */
.calendar {
  max-width: 320px;
  margin: 0 auto 26px;
  padding: 22px 18px 18px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.calendar__title {
  text-align: center;
  font-family: var(--font-serif);
  color: var(--purple-deep);
  margin-bottom: 14px;
  font-size: 1.05rem;
}
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.calendar__grid .dow {
  font-size: 0.72rem; color: var(--ink-soft); padding-bottom: 6px; font-weight: 600;
}
.calendar__grid .dow.sun { color: var(--warn); }
.calendar__grid .day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--ink); border-radius: 50%;
}
.calendar__grid .day.sun { color: var(--warn); }
.calendar__grid .day.muted { color: transparent; }
.calendar__grid .day.mark {
  background: var(--lilac-300);
  color: #fff; font-weight: 700;
  box-shadow: 0 4px 10px rgba(163,137,232,0.4);
  position: relative;
}
.calendar__grid .day.mark::after {
  content: '♥'; position: absolute; top: -9px; right: -2px; font-size: 0.6rem; color: var(--daisy);
}
.dday {
  text-align: center;
  font-family: var(--font-serif);
}
.dday__count {
  font-size: 1.3rem; color: var(--purple-deep); font-weight: 700;
}
.dday__count b { color: var(--daisy); font-size: 1.7rem; padding: 0 4px; }
.dday__timer {
  display: flex; justify-content: center; gap: 10px; margin-top: 16px;
}
.dday__timer .unit {
  min-width: 58px; padding: 10px 6px;
  background: var(--lilac-50); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.dday__timer .num { font-size: 1.3rem; font-weight: 700; color: var(--purple-deep); }
.dday__timer .lab { font-size: 0.68rem; color: var(--ink-soft); letter-spacing: 0.05em; }

/* ─────────────── 5. 갤러리 ─────────────── */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gallery__grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 12px; cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}
.gallery__grid img:active { transform: scale(0.96); }

/* 라이트박스 */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(52, 43, 68, 0.92);
  display: none; align-items: center; justify-content: center;
  touch-action: pan-y;
}
.lightbox.open { display: flex; }
.lightbox__img {
  max-width: 92vw; max-height: 82vh; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__btn--prev { left: 12px; }
.lightbox__btn--next { right: 12px; }
.lightbox__close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.15); color:#fff; font-size: 1.3rem; }
.lightbox__count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.85); font-size: 0.85rem; letter-spacing: 0.1em;
}

/* ─────────────── 6. 오시는 길 ─────────────── */
.venue__map {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.venue__addr {
  text-align: center; color: var(--ink); font-size: 0.96rem; margin: 14px 0 4px;
}
.venue__addr b { color: var(--purple-deep); font-family: var(--font-serif); }
.venue__mapbtns {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 6px;
}
.venue__mapbtns .btn { padding: 12px 4px; font-size: 0.86rem; }
.venue__transport { margin-top: 24px; display: grid; gap: 12px; }
.venue__transport li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; background: var(--lilac-50); border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.venue__transport .ico { font-size: 1.2rem; }
.venue__transport .lab { font-weight: 700; color: var(--purple-deep); font-size: 0.9rem; }
.venue__transport .desc { color: var(--ink-soft); font-size: 0.86rem; }

/* ─────────────── 7. 마음 전하실 곳(계좌) ─────────────── */
.accounts__group { margin-bottom: 12px; }
.accordion {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--paper);
}
.accordion__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; font-weight: 700; color: var(--purple-deep); background: var(--lilac-50);
}
.accordion__head .arrow { transition: transform 0.25s ease; color: var(--lilac-400); }
.accordion.open .accordion__head .arrow { transform: rotate(180deg); }
.accordion__body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion.open .accordion__body { max-height: 500px; }
.account-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line);
}
.account-row .who { font-size: 0.82rem; color: var(--ink-soft); }
.account-row .num { font-size: 0.92rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.account-row .num b { color: var(--purple-deep); font-weight: 600; }
.account-row .copy { padding: 8px 12px; font-size: 0.8rem; background: var(--lilac-100); border-radius: 10px; color: var(--purple-deep); white-space: nowrap; }

/* ─────────────── 8. RSVP ─────────────── */
.form { display: grid; gap: 14px; }
.form label { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; display: block; margin-bottom: 6px; }
.form .field input, .form .field textarea, .form .field select {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); transition: border-color 0.2s ease;
}
.form .field input:focus, .form .field textarea:focus, .form .field select:focus {
  outline: none; border-color: var(--lilac-300);
}
.form textarea { resize: vertical; min-height: 80px; }
.radio-group { display: flex; gap: 8px; }
.radio-group label {
  flex: 1; text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink-soft); font-weight: 600; cursor: pointer; margin: 0; transition: all 0.15s ease;
}
.radio-group input { position: absolute; opacity: 0; }
.radio-group input:checked + span { }
.radio-group label:has(input:checked) { background: var(--lilac-300); color: #fff; border-color: var(--lilac-300); }
.form__msg { text-align: center; font-size: 0.88rem; min-height: 1.2em; }
.form__msg.ok { color: var(--ok); }
.form__msg.err { color: var(--warn); }

/* ─────────────── 9. 방명록 ─────────────── */
.guestbook__list { display: grid; gap: 12px; margin-bottom: 22px; }
.guestbook__item {
  padding: 15px 16px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.guestbook__item .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.guestbook__item .name { font-weight: 700; color: var(--purple-deep); font-size: 0.92rem; }
.guestbook__item .date { font-size: 0.72rem; color: var(--ink-soft); }
.guestbook__item .msg { font-size: 0.92rem; color: var(--ink); white-space: pre-wrap; }
.guestbook__empty { text-align: center; color: var(--ink-soft); font-size: 0.9rem; padding: 20px 0; }
.guestbook__more { margin: 0 auto; display: block; }

/* ─────────────── 10. 연락처 ─────────────── */
.contacts { display: grid; gap: 12px; }
.contact-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.contact-row .who { }
.contact-row .who .role { font-size: 0.78rem; color: var(--lilac-400); }
.contact-row .who .name { font-family: var(--font-serif); color: var(--purple-deep); font-weight: 600; }
.contact-row .acts { display: flex; gap: 8px; }
.contact-row .acts a {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--lilac-50); font-size: 1.1rem; border: 1px solid var(--line);
}

/* ─────────────── 11. Footer / 공유 ─────────────── */
.footer {
  text-align: center; padding: 50px 28px 60px;
  background: radial-gradient(120% 90% at 50% 100%, var(--lilac-100) 0%, var(--cream) 60%);
}
.footer__daisy { width: 54px; margin: 0 auto 16px; opacity: 0.7; }
.footer__names { font-family: var(--font-script); font-size: 1.6rem; color: var(--lilac-400); margin-bottom: 6px; }
.footer__thanks { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 24px; }
.footer__share { display: flex; gap: 10px; justify-content: center; }
.footer__copy { margin-top: 28px; font-size: 0.72rem; color: var(--lilac-300); letter-spacing: 0.05em; }

/* ─────────────── 토스트 ─────────────── */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--purple-deep); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 0.86rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease; z-index: 200; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─────────────── 배경음악 토글 버튼 (음파 이퀄라이저) ─────────────── */
.music-toggle {
  position: fixed; top: 12px; z-index: 90;
  /* 모바일: 화면 우측 12px / 데스크탑: 가운데 카드(.app)의 우측 12px 에 정렬 */
  right: max(12px, calc((100vw - var(--maxw)) / 2 + 12px));
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  background: rgba(255, 255, 255, 0.35); backdrop-filter: blur(6px);
  border: 1px solid rgba(169, 139, 216, 0.3);
  cursor: pointer; padding: 0;
  opacity: 0.55;                       /* 꺼짐: 흐리게 */
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.music-toggle:active { transform: scale(0.9); }
.music-toggle.is-playing { opacity: 1; }
.music-toggle .bar {
  width: 2px; border-radius: 1px;
  background: var(--lilac-400);
  transition: height 0.25s ease;
}
/* 꺼짐: 정지된 파형 모양 */
.music-toggle .bar:nth-child(1) { height: 5px; }
.music-toggle .bar:nth-child(2) { height: 9px; }
.music-toggle .bar:nth-child(3) { height: 13px; }
.music-toggle .bar:nth-child(4) { height: 9px; }
.music-toggle .bar:nth-child(5) { height: 5px; }
/* 재생 중: 바마다 박자를 다르게 튀는 음파 */
.music-toggle.is-playing .bar { animation: eq-bounce 1.1s ease-in-out infinite; }
.music-toggle.is-playing .bar:nth-child(1) { animation-delay: -0.9s; }
.music-toggle.is-playing .bar:nth-child(2) { animation-delay: -0.55s; animation-duration: 0.9s; }
.music-toggle.is-playing .bar:nth-child(3) { animation-delay: -0.2s; }
.music-toggle.is-playing .bar:nth-child(4) { animation-delay: -0.7s; animation-duration: 1.3s; }
.music-toggle.is-playing .bar:nth-child(5) { animation-delay: -0.4s; animation-duration: 0.8s; }
@keyframes eq-bounce {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}
