/* =========================================================
   MOBILE WEDDING INVITATION
   - 외부 라이브러리/외부 폰트 없이 동작
   - Tomcat 정적 배포 가능
========================================================= */

:root {
  --paper: #f7f2ee;
  --paper-2: #fbf8f5;
  --ink: #292421;
  --muted: #8e8179;
  --rose: #b7685f;
  --rose-light: #e8cac4;
  --line: rgba(63, 51, 45, 0.13);
  --max-width: 430px;
  --serif: "Times New Roman", "Iowan Old Style", "Baskerville", "Noto Serif KR", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #e8e3df;
  /* 스크롤(상하·좌우)만 허용: 핀치 확대·두 번 탭 확대 막기 */
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #e8e3df;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

button,
summary {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.wedding-shell {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.75), transparent 30%),
    linear-gradient(180deg, #fbf8f5 0%, var(--paper) 100%);
  box-shadow: 0 0 60px rgba(64, 51, 42, 0.08);
}

.section {
  position: relative;
  padding: 92px 28px;
}

.section-kicker,
.eyebrow {
  margin-bottom: 18px;
  color: var(--rose);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .24em;
  text-align: center;
}

.section-title {
  margin: 0 0 38px;
  font-family: var(--serif);
  font-size: clamp(30px, 8vw, 38px);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -.02em;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 900ms ease, transform 900ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* HERO */
.hero {
  min-height: 100svh;
  padding-top: max(56px, env(safe-area-inset-top));
  padding-bottom: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  margin-top: 16px;
  margin-bottom: 28px;
}

.hero-title {
  width: 100%;
  margin: 0 0 36px;
  color: #ba675d;
  font-family: var(--serif);
  font-size: clamp(48px, 14vw, 68px);
  font-weight: 400;
  line-height: .86;
  letter-spacing: -.06em;
  text-align: center;
}

.hero-title span {
  display: block;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  background: #efe7e1;
}

.photo-frame--main {
  width: min(86vw, 370px);
  aspect-ratio: 2 / 3;
  margin: 0 auto;
}

.photo-frame img,
.gallery-item img,
.map-placeholder img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 100px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(100, 82, 72, .14);
  color: #a29085;
  background:
    linear-gradient(145deg, rgba(255,255,255,.72), rgba(224,211,203,.45)),
    repeating-linear-gradient(45deg, rgba(167,142,130,.025) 0 10px, transparent 10px 20px);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .18em;
  text-align: center;
}

.photo-placeholder small {
  color: #ad9f96;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .02em;
}

.hero-meta {
  margin-top: 26px;
  text-align: center;
}

.hero-meta p {
  margin: 5px 0;
}

.couple-name {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .02em;
}

.couple-name span {
  display: inline-block;
  margin: 0 7px;
  color: var(--rose);
  font-size: 15px;
}

.date-line {
  margin-top: 10px !important;
  color: #70655f;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .12em;
}

.venue-line {
  color: #8f837b;
  font-size: 11px;
}

.scroll-cue {
  margin-top: auto;
  padding-top: 34px;
  border: 0;
  background: transparent;
  color: #a28d83;
  cursor: pointer;
}

.scroll-cue span {
  display: block;
  margin-bottom: 7px;
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: .2em;
}

.scroll-cue i {
  width: 1px;
  height: 32px;
  display: block;
  margin: 0 auto;
  background: linear-gradient(var(--rose), transparent);
}

/* INVITATION */
.invitation {
  text-align: center;
}

.invitation-copy {
  color: #514943;
  font-family: "Noto Serif KR", var(--serif);
  font-size: 14px;
  line-height: 2.05;
}

.invitation-copy p + p {
  margin-top: 28px;
}

.family-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 46px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.family-grid > div {
  min-width: 0;
}

.family-label {
  color: var(--rose);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .18em;
}

.family-grid p {
  margin: 8px 0 0;
}

.family-grid b {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.family-sub {
  color: #8f8179;
  font-size: 10px;
  line-height: 1.6;
}

/* EDITORIAL */
.editorial {
  padding-left: 20px;
  padding-right: 20px;
}

.editorial-grid {
  position: relative;
  min-height: 1000px;
}

.e-photo {
  position: absolute;
}

.e-photo--1 {
  top: 20px;
  left: 0;
  width: 57%;
  aspect-ratio: 2 / 3;
}

.e-photo--2 {
  top: 355px;
  right: 0;
  width: 47%;
  aspect-ratio: 2 / 3;
}

.e-photo--3 {
  top: 560px;
  left: 7%;
  width: 40%;
  aspect-ratio: 2 / 3;
}

.e-photo--4 {
  top: 750px;
  right: 7%;
  width: 40%;
  aspect-ratio: 2 / 3;
}

.editorial-word {
  position: absolute;
  margin: 0;
  color: #c37a70;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .16em;
  writing-mode: vertical-rl;
}

.editorial-word--1 {
  top: 70px;
  right: 14%;
}

.editorial-note {
  position: absolute;
  top: 660px;
  right: 0;
  width: 42%;
  margin: 0;
  color: #796b64;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
}

/* CALENDAR */
.calendar-section {
  text-align: center;
}

.month-title {
  margin: 0;
  color: #514841;
  font-family: var(--serif);
  font-size: 37px;
  font-weight: 400;
  letter-spacing: .08em;
}

.month-sub {
  margin: 4px 0 32px;
  color: var(--rose);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .28em;
}

.calendar-card {
  padding: 24px 16px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays span {
  padding: 8px 0 15px;
  color: #998b82;
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: .08em;
}

.calendar-weekdays .sun {
  color: var(--rose);
}

.calendar-days span {
  position: relative;
  min-height: 40px;
  display: grid;
  place-items: center;
  color: #5d544e;
  font-family: var(--serif);
  font-size: 12px;
}

.calendar-days .blank {
  color: transparent;
}

.calendar-days .wedding-day {
  color: white;
  z-index: 1;
}

.calendar-days .wedding-day::before {
  content: "";
  position: absolute;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--rose);
  z-index: -1;
}

.ceremony-summary {
  margin-top: 28px;
  display: grid;
  gap: 7px;
  color: #756861;
}

.ceremony-summary strong {
  color: #463e39;
  font-family: "Noto Serif KR", var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.ceremony-summary span {
  font-size: 11px;
}

/* LOCATION */
.location-card {
  text-align: center;
}

.location-name {
  margin: 0;
  font-family: "Noto Serif KR", var(--serif);
  font-size: 17px;
}

.location-hall {
  margin: 6px 0 24px;
  color: var(--rose);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .12em;
}

.map-placeholder {
  width: 100%;
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 20px;
  background: #ede6e0;
  color: #9e8e84;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .12em;
}

.map-placeholder small {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0;
}

.map-frame {
  width: 100%;
  height: 220px;
  background: #ede6e0;
  overflow: hidden;
}

.map-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.map-link-btn {
  padding: 11px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
}

.map-link-btn:active {
  background: var(--rose-light);
  border-color: var(--rose-light);
}

.transport-list {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.transport-list article {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.transport-list article > span {
  padding-top: 1px;
  color: var(--rose);
  font-family: var(--serif);
  font-size: 11px;
}

.transport-list b {
  font-size: 12px;
  font-weight: 600;
}

.transport-list p {
  margin: 5px 0 0;
  color: #8b7f78;
  font-size: 11px;
  line-height: 1.6;
}

.transport-detail {
  margin: 8px 0 0;
  color: #8b7f78;
  font-size: 11px;
  line-height: 1.6;
}

.transport-detail dt {
  margin-top: 12px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 600;
}

.transport-detail dt:first-child {
  margin-top: 0;
}

.transport-detail dd {
  position: relative;
  margin: 3px 0 0;
  padding-left: 10px;
}

.transport-detail dd::before {
  content: "·";
  position: absolute;
  left: 0;
}

.transport-detail em {
  margin-right: 4px;
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}

/* GALLERY */
.gallery {
  padding-left: 18px;
  padding-right: 18px;
}

/* 3열 바둑판: 섹션 좌우 끝까지 꽉 채움 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin: 0 -18px;
}

.gallery-item {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: #efe7e1;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  transition: transform 400ms ease;
}

.gallery-item:active img {
  transform: scale(1.04);
}

.gallery-item .photo-placeholder {
  min-height: 100%;
  padding: 6px;
  font-size: 10px;
  letter-spacing: .12em;
}

.gallery-caption {
  margin: 24px 0 0;
  color: #9b8b82;
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
  text-align: center;
}

/* 사진 크게 보기 (라이트박스) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(20, 17, 16, .96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms ease, visibility 280ms ease;
}

/* 열릴 때는 visibility를 즉시 바꿔서 닫기 버튼에 바로 포커스가 가도록 */
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 280ms ease, visibility 0s;
}

.lightbox-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 1;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  color: #f3ece7;
  background: transparent;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

/* 양 끝 사진도 가운데까지 올 수 있게 좌우 여백 50% */
.lightbox-track {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 50%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.lightbox-track::-webkit-scrollbar {
  display: none;
}

.lightbox-track.is-dragging,
.lightbox-track.is-animating {
  scroll-snap-type: none;
}

.lightbox-track.is-dragging {
  cursor: grabbing;
}

.lightbox-slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
  transform-origin: center;
  will-change: transform, opacity;
}

/* 크기는 JS가 원본 비율로 계산해서 지정 (불러오기 전에는 배경색) */
.lightbox-slide img {
  display: block;
  background: #2b2624;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 22px;
}

.lightbox-arrow {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  color: #f3ece7;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-arrow:disabled {
  opacity: .3;
  cursor: default;
}

.lightbox-counter {
  min-width: 64px;
  margin: 0;
  color: #cbbfb8;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .24em;
  text-align: center;
}

/* 화면 밖 섹션은 가까워질 때 그려서 스크롤 부담 줄이기 */
.gallery,
.details {
  content-visibility: auto;
}

.gallery {
  contain-intrinsic-size: auto 1400px;
}

.details {
  contain-intrinsic-size: auto 700px;
}

/* DETAILS */
.accordion {
  border-top: 1px solid var(--line);
}

.accordion details {
  border-bottom: 1px solid var(--line);
}

.accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 2px;
  cursor: pointer;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary span {
  font-family: "Noto Serif KR", var(--serif);
  font-size: 14px;
}

.accordion summary i {
  color: var(--rose);
  font-size: 18px;
  font-style: normal;
  font-weight: 300;
  transition: transform 250ms ease;
}

.accordion details[open] summary i {
  transform: rotate(45deg);
}

.detail-body {
  padding: 0 2px 18px;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: #746760;
  font-size: 11px;
}

.detail-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.detail-name {
  color: var(--ink);
  font-size: 13px;
}

.detail-name em {
  display: inline-block;
  min-width: 42px;
  margin-right: 6px;
  color: #a2908a;
  font-size: 11px;
  font-style: normal;
}

.detail-account {
  color: #8e8179;
  font-size: 12px;
  letter-spacing: .01em;
}

.copy-btn {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #8e7c72;
  background: transparent;
  font-size: 10px;
}

/* ENDING */
.ending {
  min-height: 92svh;
  padding-bottom: max(60px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ending-photo {
  width: 68%;
  aspect-ratio: 2188 / 2707;
  margin-bottom: 36px;
}

.ending-script {
  margin: 0 0 12px;
  color: var(--rose);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
}

.ending h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  line-height: .94;
}

.ending-date {
  margin: 20px 0 30px;
  color: #8e8078;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .18em;
}

.share-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-actions button {
  padding: 13px 10px;
  border: 1px solid rgba(147, 121, 107, .22);
  border-radius: 0;
  color: #665a53;
  background: rgba(255,255,255,.32);
  font-size: 11px;
  cursor: pointer;
}

footer {
  margin-top: auto;
  padding-top: 54px;
  display: flex;
  gap: 13px;
  color: #aa968b;
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: .18em;
}

.footer-dot {
  color: var(--rose);
}

/* TOAST */
.toast {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: min(82vw, 330px);
  padding: 10px 14px;
  border-radius: 999px;
  color: white;
  background: rgba(45, 39, 36, .86);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 431px) {
  body {
    padding: 26px 0;
  }

  .wedding-shell {
    border-radius: 2px;
  }
}

/* INTRO */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper);
  overflow: hidden;
  transition: opacity 700ms ease, transform 700ms ease;
}

.intro-overlay.intro-hide {
  opacity: 0;
  transform: translateY(-24px);
  pointer-events: none;
}

.intro-text {
  margin: 0;
  max-width: 100%;
  color: var(--rose);
  font-family: "Yellowtail", "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
  font-size: clamp(34px, 10vw, 56px);
  text-align: center;
  line-height: 1.5;
}

.intro-line-wrap {
  position: relative;
  display: inline-block;
}

/*
  "Oops!" 하고 깜짝 놀라는 느낌
  1) Oops, : 작게 있다가 크게 튀어나오며 흔들리다 자리 잡음
  2) just got married : 아래에서 가볍게 올라옴
  3) !     : 마지막에 한 번 통 튀어 오름
*/
/*
  필기체 꼬리(j의 왼쪽, d·!의 오른쪽 등)가 글자 칸 밖으로 나가는데,
  iOS Safari·카카오톡 브라우저는 애니메이션 중인 요소를 칸 크기대로 잘라서 그림.
  padding으로 칸을 넓혀 꼬리까지 포함시키고, 같은 크기의 음수 margin으로
  글자 위치·레이아웃은 그대로 유지.
*/
.intro-line-text,
.intro-bang {
  --pad-x: .5em;
  --pad-y: .3em;
  padding: var(--pad-y) var(--pad-x);
  margin: calc(var(--pad-y) * -1) calc(var(--pad-x) * -1);
}

.intro-line-text {
  display: inline-block;
  white-space: nowrap;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, .55),
    0 1.5px 1px rgba(90, 40, 35, .3);
  opacity: 0;
}

.intro-line-1 .intro-line-text {
  transform-origin: 50% 80%;
  animation: introOops 820ms cubic-bezier(.3, .7, .4, 1) 250ms forwards;
}

.intro-line-2 .intro-line-text {
  animation: introRise 650ms cubic-bezier(.2, .8, .3, 1) 1000ms forwards;
}

.intro-bang {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: introBang 560ms ease-out 1550ms both;
}

@keyframes introOops {
  0% {
    opacity: 0;
    transform: scale(.2) rotate(-14deg);
  }
  35% {
    opacity: 1;
    transform: scale(1.28) rotate(7deg);
  }
  52% {
    transform: scale(.9) rotate(-6deg);
  }
  68% {
    transform: scale(1.07) rotate(4deg);
  }
  84% {
    transform: scale(.98) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes introRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes introBang {
  0% {
    transform: translateY(0) scale(1) rotate(0);
  }
  35% {
    transform: translateY(-.32em) scale(1.25, .9) rotate(12deg);
  }
  60% {
    transform: translateY(0) scale(.9, 1.12) rotate(-4deg);
  }
  80% {
    transform: translateY(-.06em) scale(1.04) rotate(2deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .intro-line-text,
  .intro-bang {
    animation-duration: 10ms !important;
    animation-delay: 0ms !important;
  }

}
