/* =========================================================
   1. 변수 / 리셋 / 레이아웃
   ========================================================= */
:root {
  /* 🐻 리락쿠마 실물 사진 추출 색상 */
  --primary-color: #8a6552;       /* 인형 지퍼 브라운 포인트 */
  --bg-color: #faf7f2;            /* 따뜻한 크림 아이보리 배경 */
  --card-bg: #ffffff;
  --text-main: #3d312a;           /* 딥 브라운 텍스트 */
  --text-sub: #8c7b70;            /* 서브 텍스트 */
  --border-color: #e8e1d7;        /* 베이지 테두리 */
  --sun-color: #e56b6b;
  --sat-color: #4a7bb0;
  --font-title: 'Maru Buri', serif;
  /* static 버전 CDN 의 font-family 는 'Pretendard' 입니다. */
  --font-body: 'Maru Buri', serif;
  --font-guestbook: 'Cafe24Dongdong', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 기본 브라우저 스크롤바 숨기기 (지퍼 스크롤바로 대체) */
html {
  scrollbar-width: none;
  -ms-overflow-style: none;
  background-color: #e9ecef;
}

::-webkit-scrollbar {
  display: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* 📱 모바일 뷰 고정 컨테이너 */
.invitation-container {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   2. 공통 컴포넌트
   ========================================================= */
.section {
  padding: 50px 24px;
  text-align: center;
}

.section-header {
  margin-bottom: 28px;
}

.section-header .sub-title {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--primary-color);
}

.section-header .main-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 500;
  color: var(--primary-color);
}

/* ✍️ 사진 하단 오버랩 필기체 타이틀 스타일 */
.overlapping-title {
  font-family: 'Alex Brush', cursive; /* 구글 필기체 폰트 */
  font-size: 52px;                   /* 바른손 스타일 크기 */
  color: var(--primary-color);
  text-align: center;
  margin-top: -42px;                 /* 사진 하단 위로 겹쳐 끌어올리기 */
  margin-bottom: 24px;               /* 날짜(2027.01.30)와의 여백 */
  position: relative;
  z-index: 10;                        /* 사진 위로 겹쳐지도록 레이어 올림 */
  line-height: 1;
  pointer-events: none;
}

.section-desc {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-sub);
}

.card-box {
  padding: 32px 20px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.divider {
  width: 40px;
  height: 1px;
  margin: 28px auto;
  background-color: var(--border-color);
}

.btn-primary,
.btn-primary-outline {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  font-size: 14px;
}

.btn-primary {
  border: none;
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary-outline {
  display: inline-block;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
}

/* ✨ 스크롤 등장 애니메이션 */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.reveal-on-scroll.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   3. 오프닝 인트로
   ========================================================= */
#intro-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #000000;
  z-index: 9999;
  cursor: pointer;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#intro-overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-touch-hint {
  position: absolute;
  bottom: 50px;
  color: #ffffff;
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  animation: pulse 1.8s infinite;
}

.intro-touch-hint .touch-icon {
  margin-top: 6px;
  font-size: 18px;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* =========================================================
   4. 메인 대표 사진
   ========================================================= */
.hero-section {
  padding: 40px 24px 30px;
  text-align: center;
}

.square-photo-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-date {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-sub);
}

.hero-names {
  margin-bottom: 8px;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 500;
}

.hero-names .heart {
  font-size: 18px;
  color: var(--sun-color);
}

.hero-venue {
  font-size: 14px;
  color: var(--text-sub);
}

/* =========================================================
   5. 초대 인사말
   ========================================================= */
.greeting-body {
  font-size: 13.5px;
  line-height: 2.1;
  letter-spacing: -0.3px;
  color: #444;
}

.parents-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}

.parent-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #666;
}

.parent-row .name {
  font-weight: 600;
  color: var(--text-main);
}

/* =========================================================
   6. 달력 + 카운트다운
   ========================================================= */
.calendar-card {
  padding: 24px 20px;
  background-color: rgba(138, 101, 82, 0.06);
  border-radius: 12px;
}

.calendar-month {
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--primary-color);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  text-align: center;
}

.day-head {
  padding-bottom: 8px;
  font-weight: 600;
  color: #777;
}

.day {
  padding: 6px 0;
  color: #444;
}

.day-head.sun, .day.sun { color: var(--sun-color); }
.day-head.sat, .day.sat { color: var(--sat-color); }

/* 예식일 강조 (위의 .sun/.sat 보다 뒤에 있어서 색이 덮어써진다) */
.day.target-day {
  background-color: var(--primary-color);
  color: #ffffff;
  border-radius: 50%;
  font-weight: 600;
}

.calendar-divider {
  width: 100%;
  height: 1px;
  margin: 16px 0;
  background-color: rgba(138, 101, 82, 0.15);
}

.countdown-wrap {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.countdown-item .label {
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--primary-color);
}

.countdown-item .number {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.countdown-wrap .colon {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

.dday-count {
  padding-top: 14px;
  font-size: 13.5px;
  color: #555;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.dday-count .highlight {
  font-weight: 700;
  color: var(--primary-color);
}

/* =========================================================
   7. 갤러리
   ========================================================= */
.photo-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
}

.photo-item.arch-left { border-radius: 80px 80px 8px 8px; }
.photo-item.arch-right { border-radius: 8px 8px 80px 80px; }

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

/* =========================================================
   8. 오시는 길
   ========================================================= */
.venue-info {
  margin-bottom: 20px;
}

.venue-name {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--primary-color);
}

.venue-address {
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--text-main);
}

.venue-tel {
  font-size: 13px;
  color: var(--text-sub);
}

.map-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  margin-bottom: 16px;
  border: 1px solid #e5e6ea;
  border-radius: 12px;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

.map-fallback {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-sub);
  background-color: #f4f1ec;
}

.map-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-zoom button {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #ffffff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.map-zoom button:active {
  background-color: #f0f0f0;
}

.map-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.map-btn {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.map-btn:hover {
  background-color: #f7f3ed;
}

.transport-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.transport-desc {
  padding: 14px 16px 16px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-main);
  text-align: left;
  white-space: pre-line;
}

/* =========================================================
   9. 아코디언 (교통편 / 연락처 / 계좌 공통)
   ========================================================= */
.accordion {
  margin-bottom: 12px;
  padding: 0;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background-color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.accordion-header .arrow-icon {
  font-size: 12px;
  color: var(--primary-color);
  transition: transform 0.3s ease;
}

.accordion.active .arrow-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  background-color: var(--bg-color);
  border-top: 1px solid var(--border-color);
  transition: max-height 0.35s ease-out;
}

/* 교통편 변형 */
.accordion--location {
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.accordion--location .accordion-header {
  padding: 14px 16px;
  background-color: var(--bg-color);
  font-size: 14px;
}

.accordion--location .accordion-content {
  background-color: #ffffff;
}

/* =========================================================
   10. 안내사항
   ========================================================= */
.notice-card {
  padding: 28px 22px;
  text-align: left;
}

.notice-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-color);
}

.notice-item-desc {
  padding-left: 2px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-main);
  word-break: keep-all;
}

.notice-divider {
  width: 100%;
  height: 1px;
  margin: 20px 0;
  background-color: var(--border-color);
  opacity: 0.6;
}

/* =========================================================
   11. 연락처 / 계좌 목록
   ========================================================= */
.contact-row,
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-color);
}

.contact-row { padding: 14px 20px; }
.account-row { padding: 16px 20px; }

.contact-row:last-child,
.account-row:last-child {
  border-bottom: none;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-role {
  min-width: 42px;
  font-size: 12.5px;
  color: var(--text-sub);
  text-align: left;
}

.contact-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

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

.btn-contact-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background-color: #ffffff;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.btn-contact-action:active {
  transform: scale(0.92);
  background-color: var(--bg-color);
}

.account-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.account-bank {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.account-number {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
}

.account-holder {
  font-size: 12.5px;
  color: #666;
}

/* 복사 버튼 + "복사됨" 말풍선 */
.btn-copy {
  position: relative; /* 말풍선 기준점 */
  padding: 6px 12px;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  background-color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:active {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-copy::after,
.btn-copy::before {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-copy::after {
  content: '복사됨';
  bottom: calc(100% + 8px);
  padding: 4px 8px;
  border-radius: 4px;
  background-color: #333333;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 11px;
  font-weight: 400;
  color: #ffffff;
  white-space: nowrap;
}

.btn-copy::before {
  content: '';
  bottom: calc(100% + 3px);
  border-style: solid;
  border-width: 5px 5px 0 5px;
  border-color: #333333 transparent transparent transparent;
}

.btn-copy.copied::after,
.btn-copy.copied::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   12. 방명록
   ========================================================= */
.modern-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.modern-form input,
.modern-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  background-color: #ffffff;
  font-family: inherit;
  font-size: 14px;
}

.modern-form input:focus,
.modern-form textarea:focus {
  border-color: var(--primary-color);
}

/* =========================================================
   13. 🐻 리락쿠마 지퍼 스크롤바
   ========================================================= */

/* 우측 지퍼 틀 전체 */
#custom-scrollbar-track {
  position: fixed;
  top: 0;
  left: calc(50% + 215px - 22px); /* 컨테이너(430px) 오른쪽 끝 */
  width: 22px;
  height: 100vh;
  z-index: 8000;
  overflow: visible;
  cursor: pointer;
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.12), 2px 0 6px rgba(0, 0, 0, 0.12);
  transition: opacity 0.3s ease;
}

#custom-scrollbar-track.hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 430px) {
  #custom-scrollbar-track {
    left: auto;
    right: 2px;
  }
}

/* 지퍼 열린 레이어 (하늘색 도트 안감 + 갈색 테두리) */
#zipper-opened-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  background-image:
    radial-gradient(#3b9ee3 22%, transparent 22%),
    radial-gradient(#3b9ee3 22%, transparent 22%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
  border-left: 5px solid var(--primary-color);
  border-right: 5px solid var(--primary-color);
  z-index: 1;
}

/* 지퍼 닫힌 레이어 (맞물린 플라스틱 톱니) */
#zipper-closed-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  background-image:
    radial-gradient(circle at 35% 50%, #b38b73 28%, transparent 29%),
    radial-gradient(circle at 65% 50%, #b38b73 28%, transparent 29%),
    linear-gradient(90deg, transparent 40%, #b38b73 40%, #b38b73 60%, transparent 60%),
    repeating-linear-gradient(to bottom, transparent 0, transparent 6px, #8c6a5a 6px, #8c6a5a 8px);
  background-size: 100% 12px, 100% 12px, 100% 100%, 100% 8px;
  /* 아래쪽 기준 정렬 → 지퍼가 위로 올라올수록 톱니가 자연스럽게 이어진다 */
  background-position: left bottom 0, left bottom 6px, left bottom 0, left bottom 0;
  border-left: 2px solid #8c6a5a;
  border-right: 2px solid #8c6a5a;
  z-index: 2;
}

/* 지퍼 손잡이 (리락쿠마 슬라이더) */
#rilakkuma-zipper-handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  z-index: 10;
  cursor: grab;
  user-select: none;
}

#rilakkuma-zipper-handle:active {
  cursor: grabbing;
}

#rilakkuma-zipper-handle img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(2px 3px 5px rgba(0, 0, 0, 0.35));
}

/* 가로 슬라이더 */
.gallery-slider {
  --gallery-h: 280px;            /* 세로 3:4 사진이 화면 너비의 약 절반(210px)이 되는 높이 */
  position: relative;            /* 카운터 계산용 offsetLeft 기준 */
  display: flex;
  gap: 10px;
  margin: 0 -24px;               /* 섹션 좌우 여백을 뚫고 화면 끝까지 */
  padding: 0 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
}

.gallery-slider.dragging {
  cursor: grabbing;
  user-select: none;
}

.gallery-slider .photo-item {
  flex: 0 0 auto;                /* 줄어들거나 늘어나지 않고 사진 크기 그대로 */
  height: var(--gallery-h);
  min-width: 150px;              /* 로딩 전 자리 (이게 없으면 전부 너비 0이라 한꺼번에 로드됨) */
  aspect-ratio: auto;            /* 기본 규칙의 정사각형(1) 해제 */
  border-radius: 6px;
  background-color: #efe9e1;
}

.gallery-slider .photo-item img {
  display: block;
  width: auto;                   /* 너비는 비율대로 자동 */
  height: 100%;
}

.gallery-counter {
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-sub);
}
