/* ============================================================
   雲谷 2D 폴백 전시 (alt.html) — three.js 구동 불가 환경용.
   콘텐츠 우선 반응형 문서. 3D 의 시각 정체성(먹빛·서예·크림 톤·존 구성)은
   유지하되, 미터 스케일링/가로 스와이프 없이 화면 폭에 맞게 흐른다.
   클릭 상세는 3D 와 동일(.pm 사진 · .am 유품), 영상은 Plyr.
   (alt 전용 파일 — 3D 메인에는 영향 없음)
   ============================================================ */
:root {
  --ink:        #1a1a1a;
  --ink-soft:   #3d3d3d;
  --gray:       #6f6f6f;
  --gray-light: #9a9a9a;
  --line:       #e4e2dd;
  --line-soft:  #efeee9;
  --paper:      #ffffff;
  --paper-warm: #faf9f6;
  --cream:      #e8dfcd;
  --tint:       #f5efe1;
  --frame:      #1d1a16;
  --accent:     #8a1f1f;
  --sans: 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --serif: 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
  --maxw: 1180px;
  word-break: keep-all;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper-warm);
  line-height: 1.78;
  font-size: 16px;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; background: none; border: 0; color: inherit; }

/* 배경 — covers.png(운곡 초상 + 수묵 산수) 고정 워시. 하단에 붙임, 살짝 작게 */
#wash {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('../img/covers.png') center bottom / auto 82% no-repeat;
  opacity: .5;
}
/* 모바일 — 좁은 화면에선 초상·산수 워시가 본문과 부딪혀 오히려 소음 → 표시하지 않음 */
@media (max-width: 860px) { #wash { display: none; } }

/* ============ HUD — 3D 그대로 ============ */
.alt-brand {
  position: fixed; top: 18px; left: clamp(16px, 3vw, 40px); z-index: 30;
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  /* alt 는 항상 밝은 한지 배경 — 3D 와 달리 blend(difference) 불필요, 먹색 그대로 */
}
.alt-brand img { height: 26px; width: auto; }
.alt-brand__sub { font-size: 11px; color: var(--ink-soft); letter-spacing: .04em; white-space: nowrap; }
@media (max-width: 720px) { .alt-brand__sub { display: none; } }

.alt-hud-right { position: fixed; top: 18px; right: clamp(16px, 3vw, 40px); z-index: 30; display: flex; align-items: center; gap: 12px; }
.bgm-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.8);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 4px 13px; font-size: 13px; line-height: 1.3; color: var(--gray);
}
.bgm-toggle__bars { position: relative; display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.bgm-toggle__bars i { width: 2px; background: currentColor; }
.bgm-toggle__bars i:nth-child(1) { height: 5px; }
.bgm-toggle__bars i:nth-child(2) { height: 9px; }
.bgm-toggle__bars i:nth-child(3) { height: 6px; }
.bgm-toggle__bars i:nth-child(4) { height: 10px; }
.bgm-toggle[aria-pressed="false"] .bgm-toggle__bars::after {
  content: ''; position: absolute; left: -3px; right: -3px; top: 50%;
  height: 1.5px; background: var(--accent); transform: rotate(-28deg);
}
.bgm-toggle[aria-pressed="false"] .bgm-toggle__bars { opacity: .55; }
.bgm-toggle[aria-pressed="true"] { color: var(--ink); }
.bgm-toggle[aria-pressed="true"] .bgm-toggle__bars i { animation: bgmEq .9s ease-in-out infinite alternate; }
.bgm-toggle[aria-pressed="true"] .bgm-toggle__bars i:nth-child(1) { animation-duration: .82s; animation-delay: -.35s; }
.bgm-toggle[aria-pressed="true"] .bgm-toggle__bars i:nth-child(2) { animation-duration: 1.04s; animation-delay: -.6s; }
.bgm-toggle[aria-pressed="true"] .bgm-toggle__bars i:nth-child(3) { animation-duration: .74s; animation-delay: -.15s; }
.bgm-toggle[aria-pressed="true"] .bgm-toggle__bars i:nth-child(4) { animation-duration: .96s; animation-delay: -.8s; }
@keyframes bgmEq { from { height: 3px; } to { height: 11px; } }
.lang-switch {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lang-switch__opt { border: 0; background: none; padding: 5px 13px; text-decoration: none; font-size: 11px; line-height: 1; letter-spacing: .08em; color: var(--gray); }
.lang-switch__opt + .lang-switch__opt { border-left: 1px solid var(--line); }
.lang-switch__opt[aria-current="true"] { background: rgba(26,26,26,.07); color: var(--ink); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .bgm-toggle[aria-pressed="true"] .bgm-toggle__bars i { animation: none; } }

/* ============ 커버(히어로) — 3D 로딩 스크린 ============ */
.cover {
  position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center;   /* vh 선행 = svh 미지원(iOS 15.3-) 폴백 */
  text-align: center; overflow: hidden; padding: 96px 24px;
  background: var(--paper); isolation: isolate;
}
.cover__bg {
  position: absolute; inset: 0; z-index: 0;
  background: url('../img/intro/bg-wide.webp') center bottom / cover no-repeat;
  opacity: .92; transform-origin: center 72%; animation: heroZoom 22s cubic-bezier(.12,.7,.2,1) forwards;
}
.cover__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,.4) 38%, rgba(255,255,255,0) 66%); }
@keyframes heroZoom { from { transform: scale(1.26); } to { transform: scale(1); } }
.cover__inner { position: relative; z-index: 2; transform: translateY(-2vh); }
.cover__eyebrow { font-size: clamp(15px, 2.4vw, 18px); letter-spacing: .05em; color: var(--ink-soft); margin-bottom: 28px; opacity: 0; animation: heroUp .8s ease .15s forwards; }
.cover__logo {
  width: min(400px, 74vw); height: auto; margin: 0 auto;
  -webkit-mask-image: linear-gradient(135deg, #000 34%, rgba(0,0,0,0) 60%); mask-image: linear-gradient(135deg, #000 34%, rgba(0,0,0,0) 60%);
  -webkit-mask-size: 260% 260%; mask-size: 260% 260%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 100%; mask-position: 100% 100%; filter: blur(9px); opacity: .2;
  animation: heroWrite 2.6s cubic-bezier(.4,0,.2,1) .35s forwards;
}
@keyframes heroWrite { to { -webkit-mask-position: 0% 0%; mask-position: 0% 0%; filter: blur(0); opacity: 1; } }
.cover__sign { height: 56px; width: auto; margin: 24px auto 0; opacity: 0; animation: heroUp .9s ease 2.1s forwards; }
@keyframes heroUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
/* 커버 스크롤 큐 — 아래로 내려 관람 */
.cover__scroll {
  position: absolute; left: 0; right: 0; bottom: 40px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--ink-soft); background: none; cursor: pointer;
  opacity: 0; animation: heroUp .8s ease 2.5s forwards;
}
.cover__scroll-txt { font-size: 14px; letter-spacing: .02em; }
.cover__scroll svg { width: 26px; height: 26px; animation: scrollBob 1.8s ease-in-out infinite; }
@keyframes scrollBob { 0%,100% { transform: translateY(-3px); opacity: .55; } 50% { transform: translateY(4px); opacity: 1; } }

/* ============ 본문 컨테이너·섹션 ============ */
main { position: relative; z-index: 1; }
.sec { max-width: var(--maxw); margin: 0 auto; padding: clamp(56px, 9vw, 104px) clamp(20px, 5vw, 48px) 0; }
.sec--last { padding-bottom: clamp(40px, 7vw, 80px); }
.sec__head { text-align: center; margin-bottom: clamp(28px, 5vw, 52px); }
.sec__ko { font-size: clamp(26px, 4.6vw, 40px); font-weight: 700; line-height: 1.28; text-wrap: balance; color: var(--ink); }
.sec__en { display: block; margin-top: 8px; font-size: clamp(12px, 1.6vw, 14px); letter-spacing: .06em; color: var(--gray-light); }
.sec__lead { margin-top: 14px; font-size: clamp(14px, 1.9vw, 16px); color: var(--ink-soft); }
.sec__rule { width: 40px; height: 1px; background: var(--ink); border: 0; margin: 22px auto 0; }

/* 원고(시) */
.verse { max-width: 640px; margin: 0 auto; text-align: center; font-size: clamp(15px, 2vw, 17px); line-height: 2; color: var(--ink-soft); }
.verse p { margin-top: 24px; text-wrap: balance; }
.verse p:first-child { margin-top: 0; }

/* 인용 카드 (배플·챕터 명언) */
.quote { max-width: 620px; margin: clamp(28px,5vw,44px) auto 0; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(40,34,26,.07); padding: clamp(26px,4vw,40px) clamp(22px,4vw,34px); text-align: center; }
.quote__name { font-size: 15px; font-weight: 700; letter-spacing: .1em; color: var(--gray); }
.quote__body { margin-top: 14px; font-size: clamp(15px,2vw,16.5px); line-height: 1.95; }
.quote__body p { margin-top: 14px; text-wrap: balance; }
.quote__body p:first-child { margin-top: 0; }
.quote__src { margin-top: 16px; font-size: 13.5px; color: var(--gray); }

/* 서예 이미지 */
.calli { max-width: 560px; margin: clamp(24px,4vw,44px) auto 0; }
.calli img { width: 100%; height: auto; }
.calli--sm { max-width: 430px; }

/* ============ 서문 스텔레 — 3D 자립 비석(흰 카드) + 안쪽 이중 테두리 장식 ============ */
.stele {
  position: relative;
  max-width: 620px; margin: 0 auto; background: #fdfdfc;
  border: 1px solid var(--line); box-shadow: 0 20px 46px rgba(40,34,26,.1);
  padding: clamp(44px,6.5vw,68px) clamp(34px,5.5vw,60px); text-align: center;
}
/* 안쪽 헤어라인 프레임 + 네 모서리 짧은 장식선(추모 상장 결) */
.stele::before {
  content: ''; position: absolute; inset: clamp(10px, 1.6vw, 16px);
  border: 1px solid rgba(60,55,48,.16); pointer-events: none;
}
.stele::after {
  content: ''; position: absolute; inset: clamp(10px, 1.6vw, 16px); pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left top / 2px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 2px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 2px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 14px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 2px 14px no-repeat;
  opacity: .5;
}
.stele > * { position: relative; z-index: 1; }
.stele__header { font-size: clamp(13px,1.7vw,15px); color: var(--ink-soft); letter-spacing: .02em; }
.stele__logo { width: min(300px, 78%); height: auto; margin: clamp(20px,3vw,30px) auto clamp(24px,4vw,36px); }
.stele__body { font-size: clamp(15px,2vw,16.5px); line-height: 1.95; color: var(--ink-soft); }
.stele__stanza { margin-top: 22px; text-wrap: balance; }
.stele__stanza:first-child { margin-top: 0; }
.stele__stanza--name { font-weight: 700; color: var(--ink); }

/* ============ 배플 — 雲谷 + 운곡 + 자서전 인용 + 영정 ============ */
.baffle { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: clamp(28px,4vw,56px); align-items: center; max-width: 920px; margin: clamp(36px,6vw,60px) auto 0; }
.baffle__portrait { border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(40,34,26,.14); background: #f4f1ec; }
.baffle__portrait img { width: 100%; height: auto; }
.baffle__text { text-align: left; }
.baffle__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.baffle__logo { height: 40px; width: auto; }
.baffle__name { font-size: 15px; color: var(--gray); }
.baffle__quote { font-size: clamp(15px,2vw,16px); line-height: 1.9; color: var(--ink-soft); }
.baffle__quote p { margin-top: 12px; text-wrap: balance; }
.baffle__quote p:first-child { margin-top: 0; }
.baffle__src { margin-top: 16px; font-size: 13px; color: var(--gray); }
@media (max-width: 720px) { .baffle { grid-template-columns: 1fr; } .baffle__portrait { max-width: 320px; margin: 0 auto; } .baffle__text { text-align: center; } .baffle__head { justify-content: center; } }

/* ============ 유품 — desktop.png 탑뷰 + 낱개 이미지 ============ */
.desk-wrap { max-width: 800px; margin: 0 auto; }
.desk { position: relative; width: 100%; aspect-ratio: 1463 / 742; }
/* aspect-ratio 미지원(iOS 15 미만) — padding 트릭으로 높이 확보 (absolute 자식 붕괴 방지) */
@supports not (aspect-ratio: 1 / 1) { .desk { height: 0; padding-top: 50.717%; } }
.desk__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.desk-item { position: absolute; background: none; border: 0; padding: 0; cursor: pointer; transition: transform .28s var(--ease); }
.desk-item img { width: 100%; height: 100%; object-fit: contain; }
.desk-item:hover { transform: translateY(-6%); }
.desk-item:hover img { filter: drop-shadow(0 5px 7px rgba(20,14,8,.4)); }
.desk-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.desk-hint { text-align: center; margin-top: 18px; font-size: 14px; color: var(--gray); }

/* 학여역수행주 — 서예 + 풀이를 한 묶음(카드)으로 */
.hakyeo { max-width: 640px; margin: clamp(26px,4vw,46px) auto 0; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(40,34,26,.07); padding: clamp(30px,4vw,46px) clamp(24px,4vw,42px); text-align: center; }
.hakyeo__calli { width: min(430px, 84%); height: auto; margin: 0 auto clamp(20px,3vw,30px); }
.hakyeo__title { font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--gray); }
.hakyeo__quote { margin-top: 12px; font-size: clamp(15px,2vw,16.5px); line-height: 1.9; color: var(--ink); text-wrap: balance; }

/* ============ 사진 갤러리 (챕터) ============ */
/* 앞선 요소와 겹치지 않게 위 여백. 액자 하단을 한 기준선에 맞추고(캡션은 그 아래) — subgrid */
.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(200px, 26vw, 280px), 1fr));
  column-gap: clamp(20px, 3vw, 34px);
  row-gap: clamp(40px, 6vw, 64px);
  align-items: end;
  margin-top: clamp(40px, 6vw, 68px);
}
.photo { display: flex; flex-direction: column; }
@supports (grid-template-rows: subgrid) {
  .photo { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
  .photo__frame { align-self: end; }   /* 액자 하단 기준 정렬 */
}
.photo__frame { display: block; width: 100%; background: var(--frame); padding: clamp(6px, .8vw, 9px); box-shadow: 0 14px 30px rgba(40,34,26,.16); }
.photo__mat { display: block; background: #fdfdfc; padding: clamp(8px, 1.4vw, 16px); }
.photo__mat img { width: 100%; height: auto; background: #f1efe9; }
.photo__plate { margin-top: 12px; }
.photo__date { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.photo__title { margin-top: 2px; font-size: 14px; font-weight: 500; line-height: 1.55; color: var(--ink); }
.photo__cap { margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--gray); }

/* ============ 연보 — 3단 (세로 구분선으로 명확히 분리) ============ */
.yeon { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px,3.5vw,52px); }
.yeon__col + .yeon__col { border-left: 1px solid var(--line); padding-left: clamp(28px,3.5vw,52px); }
@media (max-width: 760px) {
  .yeon { grid-template-columns: 1fr; gap: 0; }
  .yeon__col + .yeon__col { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 10px; }
}
.yeon__row { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.yeon__col > .yeon__row:first-child { border-top: 0; }
.yeon__y { flex: none; width: 84px; font-weight: 700; font-size: 14px; color: #26231f; }
.yeon__t { font-size: 14px; color: #38332c; line-height: 1.6; }
.yeon__t p { margin-top: 3px; }
.yeon__t p:first-child { margin-top: 0; }
.yeon__h { font-weight: 700; font-size: 14px; color: var(--ink); padding: 14px 0 4px; }

/* ============ 언론보도 ============ */
.press { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(160px,22vw,220px), 1fr)); gap: clamp(18px,2.6vw,30px); margin-top: clamp(24px,4vw,44px); }
.press__item { background: #3a352e; padding: clamp(10px,1.6vw,18px); box-shadow: 0 14px 30px rgba(0,0,0,.22); }
.press__mount { display: block; width: 100%; background: var(--frame); padding: clamp(5px,.7vw,7px); }
.press__mount .m { display: block; background: #fdfdfc; padding: clamp(4px,.6vw,6px); }
.press__mount img { width: 100%; height: auto; background: #f1efe9; }
.press__plate { margin-top: 10px; color: #e7ddc9; }
.press__date { font-size: 12px; font-weight: 700; }
.press__title { font-size: 12.5px; line-height: 1.5; opacity: .86; }

/* ============ 영상 ============ */
.film { max-width: 900px; margin: 0 auto; }
.film__frame { background: #2a2723; padding: clamp(8px,1.2vw,14px); box-shadow: 0 22px 50px rgba(30,24,16,.3); }
.film__frame video { width: 100%; aspect-ratio: 16/9; display: block; background: #000; }
.film .plyr { --plyr-color-main: #8a1f1f; }

/* ============ 내비 — 우측 위치 인디케이터(도트) ============ */
.dots { position: fixed; right: clamp(14px, 2vw, 26px); top: 50%; transform: translateY(-50%); z-index: 25; display: flex; flex-direction: column; align-items: flex-end; gap: 13px; }
.dots button { position: relative; width: 9px; height: 9px; padding: 0; border: 1px solid var(--gray-light); border-radius: 50%; background: transparent; display: flex; align-items: center; }
.dots button[aria-current="true"] { background: var(--accent); border-color: var(--accent); }
.dots__lbl { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12.5px; color: var(--ink); background: rgba(253,253,252,.9); border: 1px solid var(--line-soft); padding: 3px 10px; opacity: 0; pointer-events: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dots__lbl em { font-style: normal; color: var(--gray-light); margin-left: 5px; }
.dots button[aria-current="true"] .dots__lbl { opacity: 1; }
@media (max-width: 860px) { .dots { display: none; } }

/* 목록 FAB + 드로어 (모바일 메뉴 겸용) */
.nav-fab {
  position: fixed; right: clamp(16px, 3vw, 28px); bottom: clamp(18px, 3vw, 28px); z-index: 26;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px 9px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(253,253,252,.9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(40,34,26,.14); font-size: 13.5px; color: var(--ink);
}
.nav-fab svg { width: 17px; height: 17px; color: var(--ink-soft); }
.drawer { position: fixed; inset: 0; z-index: 40; display: none; }
.drawer.is-on { display: block; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(24,20,14,.28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: pmFade .3s var(--ease); }
.drawer__panel {
  position: absolute; top: 0; right: 0; z-index: 1; height: 100%; width: min(360px, 86vw);
  background: var(--paper-warm); border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(40,34,26,.18); padding: 22px 20px; overflow-y: auto;
  display: flex; flex-direction: column; animation: drawerIn .34s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(20px); opacity: 0; } }
.drawer__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer__title { font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--ink); }
.drawer__close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-soft); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.drawer__list { display: flex; flex-direction: column; }
.drawer__item { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; padding: 12px 10px; border-top: 1px solid var(--line-soft); }
.drawer__item:first-child { border-top: 0; }
.drawer__item[aria-current="true"] { position: relative; }
.drawer__item[aria-current="true"]::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.drawer__ko { font-size: 16px; font-weight: 700; color: var(--ink); }
.drawer__item[aria-current="true"] .drawer__ko { color: var(--accent); }
.drawer__en { font-size: 12px; color: var(--gray-light); }
.drawer__3d { margin-top: auto; padding-top: 20px; font-size: 14px; color: var(--ink-soft); text-decoration: none; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .cover__scroll svg { animation: none; } }

/* ============ 사진 상세 모달 (.pm) — style.css 이식 ============ */
.pm { position: fixed; inset: 0; z-index: 300; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pm.is-open { display: block; }
.pm__backdrop { position: fixed; inset: 0; background: rgba(18,16,14,.82); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: pmFade .3s var(--ease); }
.pm__dialog { position: relative; width: min(1240px, 96vw); margin: 28px auto; background: var(--paper); border: 0; box-shadow: 0 40px 110px rgba(0,0,0,.5); animation: pmRise .42s var(--ease); }
@keyframes pmFade { from { opacity: 0; } }
@keyframes pmRise { from { opacity: 0; transform: translateY(18px); } }
.pm__close { position: fixed; top: 12px; right: 14px; z-index: 305; background: none; border: 0; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; mix-blend-mode: difference; }
.pm__body { display: grid; grid-template-columns: 2.1fr 1fr; }
.pm__figure { margin: 0; background: #1b1916; display: grid; place-items: center; padding: 30px; }
.pm__figure img { max-width: 100%; max-height: 680px; width: auto; object-fit: contain; cursor: zoom-in; }
.pm__zoom { position: fixed; inset: 0; z-index: 320; display: none; place-items: center; padding: 12px; background: rgba(12,11,10,.95); cursor: zoom-out; touch-action: none; overflow: hidden; }
.pm__zoomimg { cursor: zoom-in; max-width: calc(100vw - 24px); max-height: 92vh; max-height: calc(100dvh - 40px); object-fit: contain; }   /* 92vh 선행 = dvh 폴백 */
/* 줌 닫기 — 모달 닫기(.pm__close)와 동일 스타일. 줌 뷰만 닫는다 (모달 유지) */
.pm__zoomclose {
  position: fixed; top: 12px; right: 14px; z-index: 5;
  background: none; border: 0; width: 40px; height: 40px; border-radius: 50%;
  color: #fff; font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  mix-blend-mode: difference; cursor: pointer; padding: 0;
}

.pm__zoom.is-open { display: grid; animation: pmFade .25s var(--ease); }
.pm__info { padding: 46px 40px 38px; display: flex; flex-direction: column; min-width: 0; }
.pm__theme { font-size: 14px; font-weight: 700; color: var(--accent); margin: 0 0 18px; }
.pm__theme-sub { font-size: 12px; font-weight: 500; color: var(--gray-light); letter-spacing: .04em; margin-left: 5px; }
.pm__date { font-family: var(--serif); font-size: 18px; color: var(--ink-soft); margin: 0 0 10px; }
.pm__title { font-family: var(--serif); font-weight: 700; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.35; margin: 0 0 16px; text-wrap: balance; }
.pm__caption { color: var(--gray); font-size: 15px; line-height: 1.7; margin: 0 0 30px; }
.pm__nav { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 24px; }
.pm__navbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; background: none; border: 1px solid var(--line-soft); padding: 8px; text-align: left; cursor: pointer; }
.pm__navthumb { width: 72px; height: 54px; flex: 0 0 auto; object-fit: cover; object-position: top; border: 1px solid var(--line); background: var(--paper-warm); }
.pm__navtext { min-width: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pm__navtext em { display: block; font-style: normal; font-size: 11px; letter-spacing: .08em; color: var(--gray); margin-bottom: 3px; }
@media (max-width: 820px) { .pm__dialog { width: 94vw; margin: 62px auto 26px; } .pm__body { grid-template-columns: 1fr; } .pm__figure { padding: 16px; } .pm__figure img { max-height: 54vh; } .pm__info { padding: 28px 22px 30px; } .pm__title { font-size: 20px; } .pm__navthumb { width: 58px; height: 44px; } }

/* ============ 유품 상세 모달 (.am) — style.css 이식 ============ */
.am { position: fixed; inset: 0; z-index: 330; display: none; align-items: center; justify-content: center; padding: 18px; }
.am.is-on { display: flex; }
.am__backdrop { position: absolute; inset: 0; }
.am__panel { position: relative; display: flex; flex-direction: column; width: min(580px, 92vw); max-height: 86vh; background: #fdfdfc; border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(26,24,20,.16); padding: 14px; animation: pmRise .38s var(--ease); }
.am__close { position: absolute; top: 0; right: 0; z-index: 2; width: 42px; height: 42px; border: 0; border-radius: 0; background: #fff; color: var(--ink); font-size: 17px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.am__close::after { content: ''; position: absolute; inset: -12px; }
.am__stage { margin: 0; min-height: 0; position: relative; aspect-ratio: 1600 / 1067; max-height: calc(86vh - 122px); display: flex; align-items: center; justify-content: center; background: #f4f1ec; }
.am__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.am__stage::after { content: ''; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2px solid var(--line); border-top-color: var(--ink-soft); border-radius: 50%; opacity: 0; pointer-events: none; }
.am__stage.is-loading::after { opacity: 1; animation: am-spin .8s linear infinite; }
.am__stage.is-loading .am__img { opacity: 0; }
@keyframes am-spin { to { transform: rotate(360deg); } }
.am__foot { display: flex; align-items: center; gap: 12px; padding: 12px 2px 2px; }
.am__nav { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(253,253,252,.9); color: var(--ink-soft); }
.am__nav svg { width: 17px; height: 17px; }
.am__cap { flex: 1; min-width: 0; text-align: center; }
.am__name { display: block; font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }   /* pre-line: 원고의 \\n 줄바꿈 렌더 · anywhere: 『』 연속 표기도 필요 시 분리(영문은 공백 우선) */
@media (max-width: 720px) { .am__panel { width: calc(100vw - 28px); padding: 10px; } .am__stage { max-height: calc(76vh - 110px); } }
