/* ═══════════════════════════════════════════════════════════════
   [시안 A] 활판 인쇄 종이 청첩장 — Classic Serif / Letterpress
   Paper: warm ivory · Ink: warm dark brown · Accent: antique gold
   Type: Gowun Batang (KR) + Libre Caslon Display (Latin)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --paper: #f7f3ea;
  --paper-deep: #eee8d9;
  --card: #fbf8f1;
  --ink: #37312a;
  --ink-soft: #6d6457;
  --ink-faint: #998e7e;
  --gold: #a5824c;
  --gold-line: rgba(165, 130, 76, 0.38);
  --gold-faint: rgba(165, 130, 76, 0.16);
  --error: #a3543f;

  --font-kr: "Gowun Batang", "Nanum Myeongjo", "Apple SD Gothic Neo", serif;
  --font-latin: "Libre Caslon Display", Georgia, serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--paper); /* 인앱 브라우저 오버스크롤 시 검은 띠 방지 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  /* 종이 질감 — 아주 미세한 노이즈 (고정 오버레이 대신 배경 레이어: 스크롤 끊김 방지) */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-kr);
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  color: inherit;
}

:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 3px;
}

::selection {
  background: rgba(165, 130, 76, 0.25);
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ═══════════════ Hero ═══════════════ */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: clamp(40px, 8svh, 72px) 24px calc(clamp(40px, 8svh, 72px) + env(safe-area-inset-bottom));
  text-align: center;
}

.hero__eyebrow {
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  color: var(--gold);
  margin-bottom: clamp(28px, 5svh, 44px);
}

.hero__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vw, 44px);
}

.hero__vertical {
  writing-mode: vertical-rl;
  font-size: 12.5px;
  letter-spacing: 0.55em;
  color: var(--ink-faint);
  display: none;
}

.hero__frame {
  padding: clamp(10px, 2vw, 14px);
  border: 1px solid var(--gold-line);
  position: relative;
  background: var(--card);
  box-shadow: 0 18px 44px -18px rgba(55, 49, 42, 0.28);
}

.hero__frame::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--gold-faint);
  pointer-events: none;
}

.hero__frame img {
  width: min(80vw, 46svh, 420px);
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
}

.hero__names {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(16px, 4vw, 28px);
  margin-top: clamp(30px, 5svh, 48px);
}

.hero__name-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hero__name-label {
  font-family: var(--font-latin);
  font-size: 10px;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: var(--ink-faint);
}

.hero__name {
  font-size: clamp(26px, 6.5vw, 36px);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
}

.hero__names .orn__diamond {
  align-self: center;
  margin-top: 14px;
}

.hero__announce {
  margin-top: clamp(18px, 3svh, 26px);
  text-wrap: balance;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.hero__date {
  margin-top: 10px;
  font-family: var(--font-latin);
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--gold);
}

.hero__date:empty,
.hero__announce:empty {
  display: none;
}

/* ═══════════════ 섹션 공통 ═══════════════ */

.section {
  padding: clamp(88px, 14vw, 136px) 24px;
  max-width: 760px;
  margin: 0 auto;
}

.section--deep {
  max-width: none;
  background: var(--paper-deep);
  border-top: 1px solid var(--gold-faint);
  border-bottom: 1px solid var(--gold-faint);
}

.section--deep > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.section__head {
  text-align: center;
  margin-bottom: clamp(44px, 7vw, 64px);
}

.section__eyebrow {
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--gold);
  margin-bottom: 14px;
}

.section__title {
  font-size: clamp(22px, 4.5vw, 29px);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.section__note {
  margin-top: 22px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.orn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.orn__line {
  width: 52px;
  height: 1px;
  background: var(--gold-line);
}

.orn__diamond {
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ═══════════════ 인사말 ═══════════════ */

.greeting__body {
  text-align: center;
  font-size: 15.5px;
  line-height: 2.2;
  letter-spacing: 0.02em;
}

.greeting__body p + p {
  margin-top: 30px;
}

/* ═══════════════ 신랑 · 신부 ═══════════════ */

.family {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  text-align: center;
}

.family__side {
  padding: 8px 0;
}

.family__label {
  font-family: var(--font-latin);
  font-size: 10.5px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--gold);
  margin-bottom: 14px;
}

.family__name {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.family__parents {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

.family__parents .rel {
  color: var(--ink-faint);
  font-size: 13px;
}

/* ═══════════════ 갤러리 ═══════════════ */

#gallery {
  max-width: 960px;
}

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

.gallery__item {
  border: 0;
  padding: 0;
  background: none;
  position: relative;
}

.gallery__item .ph {
  position: relative;
  display: block;
  width: 100%;
  padding-bottom: 133%;
  overflow: hidden;
  background: var(--paper-deep);
}

.gallery__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
  transition: transform 0.7s var(--ease-out);
}

@media (hover: hover) {
  .gallery__item:hover img {
    transform: scale(1.04);
  }
}

/* ═══════════════ Footer ═══════════════ */

.footer {
  text-align: center;
  padding: clamp(70px, 10vw, 100px) 24px calc(70px + env(safe-area-inset-bottom));
}

.footer__names {
  margin-top: 30px;
  font-size: 15px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  font-weight: 700;
}

.footer__thanks {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.footer__eng {
  display: none; /* 클래식 시안은 영문 락업을 쓰지 않는다 */
}

/* ═══════════════ 라이트박스 ═══════════════ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(22, 19, 14, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.lightbox.open {
  opacity: 1;
}

.lightbox__figure {
  max-width: 92vw;
  max-height: 84svh;
}

.lightbox__img {
  max-width: 92vw;
  max-height: 84svh;
  object-fit: contain;
  outline: 1px solid rgba(255, 255, 255, 0.12);
  outline-offset: -1px;
  transition: opacity 0.22s ease;
}

.lightbox__img.swap {
  opacity: 0;
}

.lightbox__close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  width: 46px;
  height: 46px;
  background: none;
  border: 0;
  color: rgba(247, 243, 234, 0.85);
  font-size: 30px;
  line-height: 1;
  z-index: 2;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 72px;
  background: none;
  border: 0;
  color: rgba(247, 243, 234, 0.6);
  font-size: 44px;
  font-family: var(--font-latin);
  line-height: 1;
  display: none;
  transition: color 0.2s ease;
}

@media (hover: hover) {
  .lightbox__nav:hover {
    color: rgba(247, 243, 234, 1);
  }
}

.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }

.lightbox__counter {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.25em;
  color: rgba(247, 243, 234, 0.65);
}

body.lb-open {
  overflow: hidden;
}

/* ═══════════════ 반응형 — PC ═══════════════ */

@media (min-width: 720px) {
  .hero__vertical {
    display: block;
  }

  /* PC·태블릿 가로: 이름·날짜까지 첫 화면에 들어오도록 사진 높이 상한을 조금 낮춘다 */
  .hero__frame img {
    width: min(80vw, 41svh, 420px);
  }

  .family {
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    align-items: center;
  }

  .family__divider {
    width: 1px;
    height: 84px;
    background: var(--gold-line);
    margin: 0 clamp(28px, 5vw, 56px);
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .lightbox__nav {
    display: block;
  }
}

@media (max-width: 719px) {
  /* 모바일 갤러리는 좌우 여백을 줄여 사진을 조금 더 크게 */
  #gallery {
    padding-left: 16px;
    padding-right: 16px;
  }

  .gallery {
    gap: 6px;
  }

  .family__divider {
    width: 56px;
    height: 1px;
    background: var(--gold-line);
    margin: 0 auto;
  }
}

/* ═══════════════ 모션 최소화 ═══════════════ */

@media (prefers-reduced-motion: reduce) {
  .gallery__item img,
  .lightbox,
  .lightbox__img {
    transition: none;
  }
}
