/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Gowun Batang', 'Noto Serif KR', serif;
  color: #3a3a3a;
  background: #faf9f7;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: hidden;
  line-height: 1.8;
  letter-spacing: -0.02em;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}

img {
  max-width: 100%;
  display: block;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 이미지 위 투명 레이어 (길게 누르기 저장 완전 차단) */
.photo-wrapper {
  position: relative;
}

.photo-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
}

.gallery-item img,
.gallery-item .photo-wrapper,
.gallery-hero-slider img,
.lightbox-content img {
  pointer-events: auto;
  -webkit-touch-callout: none;
}

button, input, textarea {
  -webkit-user-select: auto;
  user-select: auto;
}

button {
  cursor: pointer;
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 30%,
    rgba(0,0,0,0.5) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding-bottom: 80px;
}

.hero-date {
  font-size: 13px;
  letter-spacing: 3px;
  margin-bottom: 16px;
  font-weight: 300;
  opacity: 0.9;
}

.hero-names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.hero-names .amp {
  font-size: 20px;
  font-weight: 200;
  opacity: 0.8;
}

.hero-venue {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.8;
  font-weight: 300;
}

.scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 1.5px solid rgba(255,255,255,0.6);
  border-bottom: 1.5px solid rgba(255,255,255,0.6);
  transform: rotate(45deg);
  animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0) rotate(45deg); opacity: 0.6; }
  50% { transform: translateY(8px) rotate(45deg); opacity: 1; }
}

/* ===== Section Common ===== */
.section {
  padding: 72px 28px;
}

.section-inner {
  text-align: center;
}

.section-title {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 4px;
  color: #5a5a5a;
  margin-bottom: 16px;
}

.divider {
  width: 1px;
  height: 40px;
  background: #c9b99a;
  margin: 0 auto 32px;
}

/* ===== Greeting ===== */
.greeting {
  background: #fff;
}

.greeting-text {
  font-size: 14.5px;
  color: #555;
  line-height: 2;
  margin-bottom: 36px;
}

.parents-info {
  font-size: 14px;
  color: #666;
  line-height: 2.2;
}

.parents-info .parent-name {
  color: #444;
}

.parents-info .child-name {
  font-weight: 600;
  color: #3a3a3a;
}

/* ===== Gallery ===== */
.gallery {
  background: #faf9f7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  padding: 0 4px;
}

.gallery-item {
  background: #fff;
  padding: 10px 10px 32px;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.2s ease;
  position: relative;
}

.gallery-item:nth-child(even) {
  margin-top: 16px;
}

.gallery-item:active {
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.gallery-item .photo-wrapper {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item .photo-label {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: #bbb;
  letter-spacing: 1.5px;
  font-family: 'Gowun Batang', serif;
}

/* 순차 등장 */
.gallery-item {
  opacity: 0;
}

.gallery-item.revealed {
  opacity: 1;
}

/* ===== Lightbox ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.lightbox.active {
  display: flex;
}

.lightbox.opening {
  animation: lbFadeIn 350ms ease-out forwards;
}

.lightbox.active:not(.opening):not(.closing) {
  opacity: 1;
}

.lightbox.closing {
  animation: lbFadeOut 300ms ease-in forwards;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lbFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 트랙 래퍼 */
.lightbox-track-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.lightbox-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: center;
  will-change: transform;
}

.lightbox-track.dragging {
  transition: none;
}

/* 슬라이드 */
.lightbox-slide {
  min-width: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 80px;
}

.lightbox-slide .slide-polaroid {
  background: #fff;
  padding: 12px 12px 40px;
  border-radius: 2px;
  max-width: 85vw;
  max-height: 70vh;
  opacity: 0.35;
  transform: scale(1) rotate(0deg) translateY(0);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
  will-change: transform, opacity;
  /* 나가는 모션: 크기 유지, 투명도만 서서히 */
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}

/* 들어오기 전 초기 상태 */
.lightbox-slide.entering .slide-polaroid {
  opacity: 0;
  transform: scale(0.88) rotate(2deg) translateY(12px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: none;
}

.lightbox-slide:nth-child(even).entering .slide-polaroid {
  transform: scale(0.88) rotate(-2deg) translateY(12px);
}

.lightbox-slide.active .slide-polaroid {
  opacity: 1;
  transform: scale(1) rotate(0deg) translateY(0);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
  /* 들어오는 모션: 살짝 작은 상태에서 커지며 등장 */
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
              transform 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
              box-shadow 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
  animation: lbFloat 3s ease-in-out 1s infinite;
}

@keyframes lbFloat {
  0%, 100% { transform: scale(1) rotate(0deg) translateY(0); }
  50% { transform: scale(1) rotate(0deg) translateY(-6px); }
}

.lightbox-slide .slide-img-wrapper {
  position: relative;
  overflow: hidden;
}

.lightbox-slide .slide-img-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
}

.lightbox-slide img {
  display: block;
  max-width: 100%;
  max-height: calc(70vh - 60px);
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.lightbox-slide .slide-label {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: #bbb;
  letter-spacing: 1.5px;
  font-family: 'Gowun Batang', serif;
}

/* 닫기 버튼 */
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  z-index: 1001;
  padding: 8px;
}

/* 카운터 */
.lightbox-counter {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  letter-spacing: 2px;
  transition: opacity 0.25s, transform 0.25s;
}

.lightbox-counter.changing {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}

.lightbox-counter.entering {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

/* 프로그레스 도트 */
.lightbox-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 1001;
}

.lightbox-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: background 0.3s;
}

.lightbox-dot.active {
  background: #c9b99a;
}

/* ===== Calendar ===== */
.calendar-section {
  background: #fff;
}

.wedding-datetime {
  font-size: 16px;
  color: #555;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.venue-link {
  display: inline-block;
  font-size: 13px;
  color: #c9b99a;
  letter-spacing: 0.5px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(201,185,154,0.3);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.venue-link:hover {
  border-color: #c9b99a;
}

.calendar {
  max-width: 320px;
  margin: 0 auto 24px;
}

.calendar table {
  width: 100%;
  border-collapse: collapse;
}

.calendar th {
  font-size: 12px;
  font-weight: 400;
  color: #999;
  padding: 8px 0;
}

.calendar th:first-child { color: #e07070; }
.calendar th:last-child { color: #7099c9; }

.calendar td {
  text-align: center;
  padding: 7px 0;
  font-size: 14px;
  color: #666;
}

.calendar td:first-child { color: #e07070; }
.calendar td:last-child { color: #7099c9; }

.calendar td.empty { color: transparent; }

.calendar td.today {
  background: #c9b99a;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  line-height: 36px;
  padding: 0;
}

.calendar .cal-month {
  font-size: 15px;
  color: #5a5a5a;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.dday-counter {
  font-size: 14px;
  color: #888;
  letter-spacing: 1px;
}

.dday-counter strong {
  color: #c9b99a;
  font-weight: 600;
  font-size: 16px;
}

/* ===== Location ===== */
.location {
  background: #faf9f7;
}

.venue-info {
  margin-bottom: 24px;
}

.venue-name {
  font-size: 20px;
  font-weight: 500;
  color: #3a3a3a;
  margin-bottom: 4px;
}

.venue-floor {
  font-size: 14px;
  color: #888;
  margin-bottom: 8px;
}

.venue-address {
  font-size: 14px;
  color: #666;
}

.venue-tel {
  font-size: 13px;
  color: #999;
  margin-top: 4px;
}

.map-container {
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.map-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

.map-btn:hover { opacity: 0.8; }

.map-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.map-btn.naver {
  background: #03c75a;
  color: #fff;
}

.map-btn.kakao {
  background: #fee500;
  color: #3a1d1d;
}

/* ===== Shuttle Bus ===== */
.shuttle {
  background: #fff;
}

.shuttle-desc {
  font-size: 14px;
  color: #888;
  margin-bottom: 24px;
  line-height: 1.8;
}

.shuttle-card {
  background: #f9f8f5;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
  text-align: left;
}

.shuttle-label {
  font-size: 15px;
  font-weight: 500;
  color: #444;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shuttle-tag {
  font-size: 11px;
  font-weight: 400;
  color: #c9b99a;
  background: rgba(201, 185, 154, 0.12);
  padding: 2px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.shuttle-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 13.5px;
}

.shuttle-info dt {
  color: #999;
  white-space: nowrap;
}

.shuttle-info dd {
  color: #555;
}

.shuttle-map {
  margin-top: 20px;
  margin-bottom: 4px;
}

.shuttle-map-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.shuttle-map-address {
  font-size: 12.5px;
  color: #999;
  margin-top: 10px;
  margin-bottom: 12px;
}

.shuttle-notice {
  list-style: none;
  margin-top: 16px;
  text-align: left;
}

.shuttle-notice li {
  font-size: 12.5px;
  color: #999;
  line-height: 1.8;
  padding-left: 12px;
  position: relative;
}

.shuttle-notice li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: #c9b99a;
  font-weight: 700;
}

/* ===== Account ===== */
.account {
  background: transparent;
}

.account-desc {
  font-size: 14px;
  color: #888;
  margin-bottom: 28px;
}

.account-group {
  margin-bottom: 12px;
}

.account-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #f5f3f0;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  color: #555;
  letter-spacing: 0.5px;
}

.account-toggle .toggle-arrow {
  transition: transform 0.3s;
  font-size: 12px;
}

.account-toggle.open .toggle-arrow {
  transform: rotate(180deg);
}

.account-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.account-list.open {
  max-height: 500px;
}

.account-item {
  padding: 16px 20px;
  border-bottom: 1px solid #f0eeeb;
}

.account-item:last-child {
  border-bottom: none;
}

.account-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
}

.account-holder {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}

.account-number {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-number span {
  font-size: 14px;
  color: #444;
}

.copy-btn {
  background: #c9b99a;
  color: #fff;
  border: none;
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.copy-btn:active {
  background: #b5a588;
}

/* ===== Guestbook ===== */
.guestbook {
  background: #faf9f7;
}

.guestbook-form {
  max-width: 360px;
  margin: 0 auto 32px;
}

.guestbook-form input,
.guestbook-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0ddd8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 8px;
  background: #fff;
  color: #3a3a3a;
  outline: none;
  transition: border-color 0.2s;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
  border-color: #c9b99a;
}

.guestbook-form textarea {
  height: 80px;
  resize: none;
}

.gb-submit {
  width: 100%;
  padding: 12px;
  background: #c9b99a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 1px;
  transition: background 0.2s;
}

.gb-submit:hover {
  background: #b5a588;
}

.guestbook-list {
  max-width: 360px;
  margin: 0 auto;
}

.gb-item {
  background: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 8px;
  text-align: left;
  position: relative;
}

.gb-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-right: 24px;
}

.gb-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #444;
}

.gb-item-date {
  font-size: 11px;
  color: #bbb;
}

.gb-item-msg {
  font-size: 13.5px;
  color: #666;
  line-height: 1.7;
  word-break: break-word;
}

.gb-hidden {
  display: none;
}

.gb-more-btn {
  width: 100%;
  padding: 12px;
  background: #f5f3f0;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  color: #888;
  letter-spacing: 0.5px;
  font-family: inherit;
  margin-top: 4px;
  transition: background 0.2s;
}

.gb-more-btn:hover {
  background: #eae7e2;
}

.gb-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #ccc;
  font-size: 16px;
  padding: 4px;
}

.gb-delete:hover {
  color: #999;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 40px 20px 60px;
  background: #fff;
  border-top: 1px solid #f0eeeb;
}

.footer-names {
  font-size: 16px;
  color: #c9b99a;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.footer-date {
  font-size: 12px;
  color: #bbb;
  letter-spacing: 2px;
}

/* ===== BGM Button ===== */
.bgm-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 900;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.bgm-btn:active {
  background: rgba(255,255,255,1);
}

.bgm-icon {
  width: 18px;
  height: 18px;
  color: #c9b99a;
}

.bgm-btn.playing .bgm-icon {
  animation: bgmPulse 1.5s ease-in-out infinite;
}

.bgm-btn.paused .bgm-icon {
  opacity: 0.4;
}

@keyframes bgmPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(50,50,50,0.9);
  color: #fff;
  padding: 12px 28px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 2000;
  transition: top 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  top: 24px;
}

/* ===== Delete Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  width: 280px;
  text-align: center;
}

.modal-box p {
  font-size: 14px;
  color: #555;
  margin-bottom: 16px;
}

.modal-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e0ddd8;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  font-family: inherit;
}

.modal-buttons {
  display: flex;
  gap: 8px;
}

.modal-buttons button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.modal-cancel {
  background: #f0eeeb;
  color: #888;
}

.modal-confirm {
  background: #e07070;
  color: #fff;
}
