/* 디지털 웨딩앨범 — 화면 스타일
   색/간격 토큰을 :root에 모아두면, 나중에 색감만 바꾸기 쉽다. */

@font-face {
  font-family: 'Album Script';
  src: url('../vendor/fonts/dancing-script-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #2b2927;
  --ink-soft: #5c5752;
  --paper: #faf8f4;
  --line: #e7e2d9;
  --accent: #a9875a;
  --overlay-text: #ffffff;
  --gap: 3px;
  --radius-sm: 6px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', Pretendard, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

html { opacity: 0; }
html.ready { opacity: 1; transition: opacity .35s ease; }

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

/* ---------- 커버 ---------- */

.cover {
  position: relative;
  height: 100svh;
  min-height: 420px;
  width: 100%;
  overflow: hidden;
  background: #1c1b1a;
}

.cover__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%; /* manifest의 focus 값으로 JS가 덮어씀 */
}

.cover__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.42) 0%, rgba(0,0,0,.18) 32%, rgba(0,0,0,0) 56%);
  pointer-events: none;
}

.cover__text {
  position: relative;
  z-index: 1;
  padding-top: calc(13vh + var(--safe-top));
  text-align: center;
  color: var(--overlay-text);
  text-shadow: 0 1px 10px rgba(0,0,0,.22);
}

.cover__script {
  font-family: 'Album Script', cursive;
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  line-height: 1;
  margin: 0;
}

.cover__names {
  margin: .9rem 0 0;
  font-size: clamp(1.05rem, 4vw, 1.4rem);
  font-weight: 500;
  letter-spacing: .02em;
}

.cover__hint {
  position: absolute;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  transform: translateX(-50%);
  color: var(--overlay-text);
  opacity: .85;
  transition: opacity .3s ease;
  animation: hint-bob 1.8s ease-in-out infinite;
}
.cover__hint.is-hidden { opacity: 0; }
.cover__hint svg { width: 26px; height: 26px; display: block; filter: drop-shadow(0 1px 6px rgba(0,0,0,.3)); }

@keyframes hint-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(7px); }
}

@media (prefers-reduced-motion: reduce) {
  .cover__hint { animation: none; }
}

/* ---------- 그룹 그리드 ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  padding: var(--gap);
  background: var(--paper);
}

.grid__tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--line);
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.grid__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.grid__tile:active img { transform: scale(1.03); }

.grid__end {
  text-align: center;
  color: var(--ink-soft);
  font-size: .85rem;
  padding: 2.6rem 1rem calc(3rem + var(--safe-bottom));
}

/* ---------- 안내 화면 (링크/접속 만료 등) ---------- */

.screen {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.4rem;
  background: var(--ink);
  color: #f3f1ec;
  text-align: center;
}

.screen__inner { max-width: 360px; }

.screen__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 .7rem;
}

.screen__body {
  font-size: .98rem;
  line-height: 1.7;
  color: #cfccc4;
  margin: 0;
}

/* 보는 도중 접속이 끊겼을 때: 화면 위에 덮는 모달형 안내 (닫기 버튼 없음) */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem;
  background: rgba(20, 18, 16, .82);
  backdrop-filter: saturate(120%) blur(2px);
  text-align: center;
}

.overlay__card {
  max-width: 320px;
  color: #fff;
}

.overlay__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 .5rem;
}

.overlay__body {
  font-size: .92rem;
  line-height: 1.65;
  color: #ddd9d1;
  margin: 0;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- PhotoSwipe 보정: 장수 표시를 더 또렷하게 ---------- */

.pswp__counter { font-size: 14px; }
