/* ======================================================
   강범준 돌잔치 초대장 — 메인 스타일시트
   테마: 크림/베이지 · 한복 느낌의 따뜻한 톤
   ====================================================== */

/* ── CSS 변수 ─────────────────────────────────────── */
:root {
  --cream:       #FEFAF4;
  --bg:          #FBF5E8;
  --beige-100:   #F5ECD7;
  --beige-200:   #EDD9B8;
  --beige-300:   #DFCAA0;
  --gold:        #C9A050;
  --gold-dark:   #9C7535;
  --brown-light: #B8956A;
  --brown:       #8B6745;
  --brown-dark:  #5E4430;
  --text-dark:   #3D2B1A;
  --text-mid:    #6E5040;
  --text-light:  #9E826E;
  --white:       #FFFFFF;
  --shadow-sm:   0 2px 12px rgba(100,70,40,.10);
  --shadow-md:   0 6px 28px rgba(100,70,40,.14);
  --shadow-lg:   0 12px 48px rgba(100,70,40,.18);
  --font-serif:  'Noto Serif KR', Georgia, serif;
  --font-sans:   'Noto Sans KR', sans-serif;
  --mw:          480px;
  --r-sm:        8px;
  --r-md:        16px;
  --r-lg:        24px;
  --r-full:      9999px;
}

/* ── 리셋 ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: #EDE3D0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dark);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-sans); }
a { color: inherit; text-decoration: none; }

/* ── 가운데 정렬 래퍼 ──────────────────────────── */
header, main, .fab-share, .toast, .lightbox {
  max-width: var(--mw);
  margin-left: auto;
  margin-right: auto;
}

/* ── 공통 섹션 ──────────────────────────────────── */
.section {
  padding: 52px 22px;
  background: var(--cream);
  position: relative;
}
.section:nth-child(even) { background: var(--white); }

/* ── 섹션 헤더 (타이틀+선) ─────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.sh-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--beige-300), transparent);
}
.sh-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--brown);
  letter-spacing: .28em;
  white-space: nowrap;
}

/* ======================================================
   🎀 히어로 섹션
   ====================================================== */
.hero-section {
  position: relative;
  width: 100%;
  max-width: var(--mw);
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 60px;
}

/* 대표 사진 풀스크린 배경 */
.hero-photo-wrap {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #F2E4CC 0%, #E6D0A8 100%);
}
.hero-photo-wrap.no-img {
  background: linear-gradient(160deg, #F2E4CC 0%, #DDBE8A 100%);
}
.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.hero-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.02) 0%,
    rgba(0,0,0,.04) 50%,
    rgba(30,15,5,.55) 100%
  );
}

/* 떠다니는 꽃잎 */
.floating-petals {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.petal {
  position: absolute;
  animation: petalFall linear infinite;
  opacity: .65;
}
@keyframes petalFall {
  0%   { transform: translateY(-30px) rotate(0deg);   opacity: 0; }
  8%   { opacity: .65; }
  92%  { opacity: .4; }
  100% { transform: translateY(105vh) rotate(400deg); opacity: 0; }
}

/* 히어로 텍스트 */
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 24px;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--cream);
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px);
  padding: 5px 18px;
  border-radius: var(--r-full);
  letter-spacing: .12em;
  margin-bottom: 14px;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 600;
  color: #FFF8EE;
  letter-spacing: .32em;
  line-height: 1.15;
  margin-bottom: 10px;
  text-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.hero-sub {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,248,235,.85);
  letter-spacing: .08em;
  margin-bottom: 22px;
}
.hero-date-chip {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--brown-dark);
  background: rgba(255,248,220,.92);
  padding: 9px 28px;
  border-radius: var(--r-full);
  letter-spacing: .12em;
  box-shadow: 0 4px 18px rgba(0,0,0,.2);
}

/* 스크롤 힌트 */
.scroll-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  animation: bounce 2.2s ease-in-out infinite;
}
.scroll-text { font-size: 10px; color: rgba(255,248,235,.6); letter-spacing: .12em; }
.scroll-arrow { font-size: 18px; color: rgba(255,248,235,.7); }
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(5px); }
}

/* ======================================================
   🌸 인삿말
   ====================================================== */
.invite-section {
  text-align: center;
  padding: 56px 32px;
  background: var(--white);
}
.deco-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  justify-content: center;
}
.deco-line::before,
.deco-line::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--beige-300));
}
.deco-line::after {
  background: linear-gradient(90deg, var(--beige-300), transparent);
}
.deco-flower { font-size: 20px; }

.invite-text {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 2.1;
  margin: 22px 0;
}
.invite-text strong {
  color: var(--brown);
  font-weight: 500;
}

/* ======================================================
   👶 아이·부모 정보
   ====================================================== */
.child-section { background: var(--bg); }

.child-card {
  background: var(--white);
  border: 1px solid var(--beige-200);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.child-card-top {
  background: linear-gradient(135deg, var(--beige-100) 0%, var(--beige-200) 100%);
  padding: 28px 20px 22px;
  text-align: center;
}
.child-emoji { font-size: 28px; display: block; margin-bottom: 8px; }
.child-name {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--brown-dark);
  letter-spacing: .35em;
  margin-bottom: 6px;
}
.child-birth {
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: .06em;
}
.parent-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}
.parent-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.parent-role {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: .1em;
}
.parent-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--brown);
  letter-spacing: .2em;
}
.parent-divider {
  font-size: 22px;
  color: var(--beige-300);
  margin-top: 12px;
}

/* ======================================================
   📅 행사 안내
   ====================================================== */
.event-section { background: var(--cream); }

.event-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.ev-card {
  background: var(--white);
  border: 1px solid var(--beige-200);
  border-radius: var(--r-md);
  padding: 18px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.ev-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--beige-100);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.ev-label {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: .15em;
  margin-bottom: 4px;
}
.ev-value {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: 3px;
}
.ev-sub {
  font-size: 13px;
  color: var(--brown);
}
.ev-addr {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* 지도 버튼 */
.map-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--brown-light) 0%, var(--brown) 100%);
  color: var(--white);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  box-shadow: 0 4px 18px rgba(100,70,40,.28);
  transition: transform .15s, box-shadow .15s;
  text-align: center;
}
.map-btn:active { transform: scale(.97); }
.map-btn.secondary {
  background: var(--beige-100);
  color: var(--brown-dark);
  border: 1.5px solid var(--beige-300);
  box-shadow: none;
  margin-top: 14px;
}

/* ======================================================
   📸 갤러리
   ====================================================== */
.photo-hero-section { background: var(--bg); }

/* 대형 메인 사진 */
.photo-main-frame {
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-lg);
  position: relative;
  /* 세로형 비율 유지 */
  aspect-ratio: 3 / 4;
  background: var(--beige-100);
}
.photo-main-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.img-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--beige-300);
}

/* 갤러리 그리드 */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gallery-item {
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--beige-100);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  /* 세로형 기본 */
  aspect-ratio: 3 / 4;
}
.gallery-item:active { transform: scale(.97); }

/* 가로 와이드 아이템 */
.gallery-item.wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

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

/* ======================================================
   🗺️ 오시는 길
   ====================================================== */
.map-section { background: var(--cream); }

/* ── 약도 이미지 래퍼 ──────────────────────────────── */
.map-img-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
  background: var(--beige-100);
  /* 이미지 로딩 실패 시 폴백 최소 높이 */
  min-height: 200px;
}

/* 약도 실제 이미지 */
.map-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-lg);
  transition: transform .3s ease;
}
.map-img:hover { transform: scale(1.01); }

/* 이미지 위 은은한 테두리 오버레이 */
.map-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1.5px var(--beige-200);
  pointer-events: none;
}

/* 이미지 로드 실패 시 텍스트 약도 */
.map-img-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
}
.map-img-wrap.map-img-error .map-img         { display: none; }
.map-img-wrap.map-img-error .map-img-fallback { display: flex; }

.map-fallback-pin  { font-size: 40px; }
.map-fallback-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--brown-dark);
  letter-spacing: .1em;
}
.map-fallback-addr {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
}

.transport-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.tr-item {
  background: var(--white);
  border: 1px solid var(--beige-200);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.tr-icon { font-size: 22px; min-width: 28px; text-align: center; }
.tr-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--text-mid);
}
.tr-body b {
  font-size: 14px;
  color: var(--brown);
  font-weight: 500;
  letter-spacing: .05em;
}

/* ======================================================
   🌸 마무리
   ====================================================== */
.closing-section {
  background: linear-gradient(180deg, var(--beige-100) 0%, var(--beige-200) 60%, var(--beige-300) 100%);
  text-align: center;
  padding: 52px 32px 64px;
}
.closing-img-wrap {
  width: 220px;
  aspect-ratio: 3/4;
  margin: 0 auto 28px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--white);
}
.closing-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.closing-flower-anim {
  font-size: 30px;
  display: block;
  margin-bottom: 18px;
  animation: sway 3s ease-in-out infinite;
}
@keyframes sway {
  0%,100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}
.closing-msg {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 300;
  color: var(--brown-dark);
  line-height: 2;
  margin-bottom: 16px;
}
.closing-name {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--brown);
  font-weight: 500;
  letter-spacing: .15em;
  margin-bottom: 10px;
}
.closing-date {
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: .12em;
}

/* ======================================================
   🔘 플로팅 공유 버튼
   ====================================================== */
.fab-share {
  position: fixed;
  bottom: 28px;
  right: calc(50% - var(--mw)/2 + 18px);
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--brown-light) 0%, var(--brown) 100%);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: 0 4px 20px rgba(100,70,40,.38);
  z-index: 100;
  transition: transform .15s;
}
.fab-share:active { transform: scale(.92); }
.fab-icon { font-size: 16px; line-height: 1; }
.fab-label { font-size: 9px; font-weight: 600; letter-spacing: .04em; }

/* 화면이 max-width 보다 좁으면 right 고정 */
@media (max-width: 480px) {
  .fab-share { right: 18px; }
}

/* ======================================================
   🔔 토스트
   ====================================================== */
.toast {
  position: fixed;
  bottom: 94px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(50,30,15,.9);
  color: var(--white);
  padding: 9px 22px;
  border-radius: var(--r-full);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .28s, transform .28s;
  z-index: 200;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ======================================================
   🖼️ 라이트박스
   ====================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: 94vw;
  max-height: 90svh;
  border-radius: var(--r-md);
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  object-fit: contain;
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.15);
  color: var(--white);
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* ======================================================
   스크롤 등장 애니메이션 (JS에서 class 추가)
   ====================================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ======================================================
   📱 반응형 — 데스크탑에서도 모바일처럼
   ====================================================== */
@media (min-width: 481px) {
  body { background: #D9CEBC; }

  header, main {
    box-shadow: 0 0 60px rgba(80,55,30,.22);
  }
}

/* 초소형 화면 */
@media (max-width: 360px) {
  .hero-name { font-size: 44px; }
  .section   { padding: 40px 16px; }
  .child-name { font-size: 24px; }
}
