/* 프로토타입 — 전시형 포트폴리오 (Pretendard UI + 로케일별 본문 서체) */
:root {
  --bg: #0f0f0e;
  --bg-elevated: #181816;
  --text: #e8e6e1;
  --text-muted: #9a9790;
  --accent: #c4a574;
  --line: #2a2926;
  --font-ui: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-ko: "Gowun Dodum", "Pretendard", serif;
  --font-en: "Lora", "Times New Roman", Georgia, serif;
  --font-zh: "Noto Sans SC", "Pretendard", sans-serif;
  --font-sans: var(--font-ui);
  --font-serif: var(--font-en);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.35s;
  /* 썸네일: 기본 어둡게, 호버 시 원래 밝기·색감 */
  --thumb-dim: brightness(0.68) saturate(0.92);
  --thumb-lit: brightness(1) saturate(1);
}

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

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.55;
  font-weight: 400;
}

/* 사진: 드래그·이미지 선택 복사 방해(우클릭·드래그는 protect-assets.js). [data-allow-save] 내부는 예외 */
.page img,
.overlay img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

[data-allow-save] img {
  -webkit-user-drag: auto;
  user-select: auto;
  -webkit-user-select: auto;
}

/* 워터마크: 가로·세로 모든 이미지 우하단에 배치. right/bottom % 앵커로 이미지 밖 이탈 방지.
   컨테이너 overflow:hidden으로 클립. 풀스크린은 컨테이너를 이미지 크기에 맞게 자동 축소.
   방향 클래스(.watermarked--portrait/landscape)는 watermark-orientation.js가 지정(현재 미사용). */
:root {
  --wm-image: url("../assets/logo/haylen_white_signature.png");
  --wm-opacity: 0.88;
  /* 세로 5등분 1칸의 절반 */
  --wm-height-pct: 10%;
}

.watermarked {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
}

.watermarked > img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.watermarked::after {
  content: "";
  position: absolute;
  right: 3%;
  bottom: 4%;
  z-index: 1;
  pointer-events: none;
  height: min(var(--wm-height-pct), 96px);
  min-height: 22px;
  max-height: 14vh;
  aspect-ratio: 1 / 2;
  width: auto;
  background-image: var(--wm-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: var(--wm-opacity);
  mix-blend-mode: normal;
}

/* 세로·가로 공통: 우하단 앵커 — 방향별 오프셋 불필요 */
.watermarked.watermarked--portrait::after {
  right: 3%;
  bottom: 4%;
}

/* Index: 인트로 스플래시 — 전면 타이포그래피 · 순차 등장 → 페이드 아웃 후 본문 */
body.index-intro-active {
  overflow: hidden;
}

.index-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  opacity: 1;
  cursor: pointer;
  transition: opacity 0.75s var(--ease-out);
}

.index-intro.index-intro--exit {
  opacity: 0;
  pointer-events: none;
}

/* 인트로 컨테이너 */
.intro-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  user-select: none;
  pointer-events: none;
}

/* 액센트 가로선 */
.intro-rule {
  display: block;
  width: 0;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 2.75rem;
  opacity: 0;
  transition:
    width 0.65s var(--ease-out),
    opacity 0.45s var(--ease-out);
}

.index-intro.is-line-visible .intro-rule {
  width: 64px;
  opacity: 0.55;
}

/* 아티스트 이름 */
.intro-name {
  display: block;
  font-family: var(--font-en);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.4rem, 9.5vw, 6.8rem);
  letter-spacing: 0.15em;
  color: var(--text);
  line-height: 1;
  margin: 0 0 1.25rem;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.95s var(--ease-out),
    transform 0.95s var(--ease-out);
}

.index-intro.is-name-visible .intro-name {
  opacity: 1;
  transform: translateY(0);
}

/* 태그라인 — 로케일별 서체 */
.intro-tagline {
  display: block;
  font-family: var(--font-ko);
  font-size: clamp(0.78rem, 2.2vw, 1rem);
  letter-spacing: 0.3em;
  color: var(--accent);
  margin: 0 0 1.8rem;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out);
}

body.locale-en .intro-tagline {
  font-family: var(--font-en);
  font-style: italic;
  letter-spacing: 0.08em;
  font-size: clamp(0.85rem, 2.4vw, 1.05rem);
}

body.locale-zh .intro-tagline {
  font-family: var(--font-zh);
  letter-spacing: 0.22em;
}

.index-intro.is-tagline-visible .intro-tagline {
  opacity: 0.8;
  transform: translateY(0);
}

/* 연도 */
.intro-year {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.75s var(--ease-out);
}

.index-intro.is-year-visible .intro-year {
  opacity: 0.38;
}

@media (prefers-reduced-motion: reduce) {
  .intro-rule,
  .intro-name,
  .intro-tagline,
  .intro-year {
    transition-duration: 0.01ms;
  }
  .index-intro {
    transition-duration: 0.2s;
  }
}

/* 로케일별 표제·수필 본문 */
body.locale-ko .index-title,
body.locale-ko .index-essay,
body.locale-ko .exhibit-lead,
body.locale-ko .search-lead,
body.locale-ko .prose-detail {
  font-family: var(--font-ko);
}

body.locale-en .index-title,
body.locale-en .index-essay,
body.locale-en .exhibit-lead,
body.locale-en .search-lead,
body.locale-en .prose-detail,
body.locale-en .exhibit-h1,
body.locale-en .search-h1 {
  font-family: var(--font-en);
}

body.locale-zh .index-title,
body.locale-zh .index-essay,
body.locale-zh .exhibit-lead,
body.locale-zh .search-lead,
body.locale-zh .prose-detail,
body.locale-zh .exhibit-h1,
body.locale-zh .search-h1 {
  font-family: var(--font-zh);
}

body.locale-ko .exhibit-h1,
body.locale-ko .search-h1 {
  font-family: var(--font-ko);
}

body.locale-en .result-item h3,
body.locale-en .exhibit-cell .cap-title {
  font-family: var(--font-en);
}

body.locale-ko .result-item h3,
body.locale-ko .exhibit-cell .cap-title {
  font-family: var(--font-ko);
}

body.locale-zh .result-item h3,
body.locale-zh .exhibit-cell .cap-title {
  font-family: var(--font-zh);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--dur) var(--ease-out);
}
a:hover {
  opacity: 0.85;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 4rem;
}

/* 전체화면 그리드 페이지 — 컨테이너 max-width 해제 */
.page-search .page,
.page-category .page {
  max-width: none;
  padding-left: clamp(0.65rem, 1.5vw, 1.5rem);
  padding-right: clamp(0.65rem, 1.5vw, 1.5rem);
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.brand {
  /* 두 줄 텍스트 높이 = 낙관 높이 (줄간·line-height와 동일 변수 사용) */
  --brand-name-lh: 1.2;
  --brand-sub-lh: 1.2;
  --brand-sub-gap: 0.2rem;
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

.brand-signature {
  flex: 0 0 auto;
  /* Haylen(1행) + 간격 + 부제(2행, 예: 사진) — 합산 높이와 동일 */
  height: calc(
    1em * var(--brand-name-lh) + var(--brand-sub-gap) + 0.7rem * var(--brand-sub-lh)
  );
  width: auto;
  aspect-ratio: 1 / 2;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.brand .brand-name {
  display: block;
  line-height: var(--brand-name-lh);
}

.brand .brand-subtitle {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  line-height: var(--brand-sub-lh);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--brand-sub-gap);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--text);
}

/* Typography */
h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.025em;
  font-family: var(--font-ui);
}

/* Hero label — 제목 위 작은 메타 텍스트 */
.hero-label {
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
  margin: 0 0 1.1rem;
  font-family: var(--font-ui);
}

/* 인덱스 제목 하단 영문 병기 */
.index-subtitle-en {
  display: none; /* 기본 숨김, KO/ZH에서만 표시 */
  margin: -0.55rem 0 1.1rem;
  font-family: var(--font-en);
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  font-style: italic;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  opacity: 0.7;
}

body.locale-ko .index-subtitle-en,
body.locale-zh .index-subtitle-en {
  display: block;
}

.index-essay {
  max-width: 38rem;
  margin: 0 0 1.5rem;
}

.index-essay p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0 0 1.1rem;
}

.index-essay p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 40rem;
  margin: 0 0 2rem;
  line-height: 1.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out);
}

.btn:hover {
  border-color: var(--accent);
  background: rgba(196, 165, 116, 0.06);
}

.btn-primary {
  border-color: var(--accent);
  color: var(--accent);
}

/* Index hero */
.hero-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
}

.hero-visual {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.hero-visual-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: 55% 45%;
}

/* 인덱스: 잔잔한 모션 (감도 설정 시 비활성) */
@media (prefers-reduced-motion: no-preference) {
  .page-index .hero-visual img {
    animation: heroDrift 22s ease-in-out infinite alternate;
  }

  @keyframes heroDrift {
    0% {
      transform: scale(1) translate(0, 0);
    }
    100% {
      transform: scale(1.09) translate(-1.2%, -0.8%);
    }
  }

  .page-index .hero-label {
    animation: indexFadeRise 0.85s var(--ease-out) both;
  }

  .page-index .index-title {
    animation: indexFadeRise 0.95s 0.06s var(--ease-out) both;
  }

  .page-index .index-essay p:nth-child(1) {
    animation: indexFadeRise 0.9s 0.12s var(--ease-out) both;
  }
  .page-index .index-essay p:nth-child(2) {
    animation: indexFadeRise 0.9s 0.22s var(--ease-out) both;
  }
  .page-index .index-essay p:nth-child(3) {
    animation: indexFadeRise 0.9s 0.32s var(--ease-out) both;
  }

  .page-index .hero-actions {
    animation: indexFadeRise 1s 0.45s var(--ease-out) both;
  }

  .page-index .card-grid {
    animation: indexFadeRise 1.1s 0.55s var(--ease-out) both;
  }

  @keyframes indexFadeRise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .page-index .hero-visual {
    animation: indexFadeRise 1.15s 0.08s var(--ease-out) both;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 3rem;
  align-items: stretch;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  overflow: hidden;
  transition:
    border-color var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}

.card:hover {
  border-color: #3d3c38;
  transform: translateY(-3px);
}

.card-link {
  display: block;
  color: inherit;
}

.card-img {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #222;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--thumb-dim);
  transition:
    transform 0.6s var(--ease-out),
    filter var(--dur) var(--ease-out);
}

.card:hover .card-img img {
  transform: scale(1.03);
  filter: var(--thumb-lit);
}

.card-link:focus-visible .card-img img {
  filter: var(--thumb-lit);
}

.card-body {
  padding: 1rem 1.1rem 1.25rem;
}

.card-body h2 {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 500;
    margin: 0 0 0.35rem;
  }

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Index: 로고만 — 카드형 UI 없이 페이지 배경과 동일(테두리·들림 없음, 여백 없이 채움) */
.card.card--logo-mark {
  background: var(--bg);
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.card.card--logo-mark:hover {
  transform: none;
  border-color: transparent;
}

.card--logo-mark {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.card-logo-mark-fill {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  box-sizing: border-box;
}

.card-logo-mark-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center center;
}

/* 한 열로 쌓일 때도 옆 카드(이미지+텍스트)와 비슷한 덩어리 높이 유지 */
@media (max-width: 767px) {
  .card-grid .card--logo-mark {
    min-height: clamp(17rem, 92vw, 26rem);
  }
}

/* Search */
.search-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.search-bar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out);
}

.tag:hover,
.tag.is-on {
  border-color: var(--accent);
  color: var(--accent);
}

.results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── 그리드 기본값: CSS columns 마소너리 (Pinterest 방식) ── */
.result-list {
  display: block;
  columns: 242px;
  column-gap: 0.5rem;
}

.result-list.view-mode-grid {
  display: block;
  columns: 242px;
  column-gap: 0.5rem;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  align-items: stretch;
  transition:
    border-color var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
  border-radius: 2px;
  /* masonry: 아이템이 두 열에 걸치지 않도록 */
  break-inside: avoid;
  margin-bottom: 0.5rem;
}

/* 고밀도 그리드(4열+)에서 카드 패딩 최소화 */
.result-list.view-mode-grid.grid-cols-4 .result-item,
.result-list.view-mode-grid.grid-cols-5 .result-item,
.result-list.view-mode-grid.grid-cols-6 .result-item {
  padding: 0.3rem;
  gap: 0.35rem;
}

.result-list.view-mode-grid.grid-cols-4 .result-item h3,
.result-list.view-mode-grid.grid-cols-5 .result-item h3,
.result-list.view-mode-grid.grid-cols-6 .result-item h3 {
  font-size: 0.78rem;
}

.result-list.view-mode-grid.grid-cols-4 .result-tags,
.result-list.view-mode-grid.grid-cols-5 .result-tags,
.result-list.view-mode-grid.grid-cols-6 .result-tags {
  font-size: 0.65rem;
}

.result-item:hover {
  border-color: #3d3c38;
  transform: translateY(-2px);
}

.result-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #141413;
}

.result-thumb img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
  filter: var(--thumb-dim);
  transition: filter var(--dur) var(--ease-out);
}

.result-item:hover .result-thumb img,
.result-item:focus-within .result-thumb img {
  filter: var(--thumb-lit);
}

.result-body {
  min-width: 0;
}

.result-item h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  margin: 0 0 0.35rem;
  font-weight: 500;
  line-height: 1.3;
}

.result-tags {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Exhibit grid */
.exhibit-intro {
  margin-bottom: 2rem;
}

.exhibit-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* 카테고리 상세 바둑판: CSS columns 마소너리 */
.works-root.view-mode-grid {
  display: block;
  columns: 242px;
  column-gap: 0.5rem;
}

.works-root.view-mode-grid.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.works-root.view-mode-grid.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.works-root.view-mode-grid.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.works-root.view-mode-grid.grid-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.works-root.view-mode-grid.grid-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
}

.exhibit-cell {
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  background: var(--bg-elevated);
  text-align: left;
  color: inherit;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: border-color var(--dur) var(--ease-out);
  /* masonry */
  break-inside: avoid;
  margin-bottom: 0.5rem;
  display: block;
}

.exhibit-cell:hover {
  border-color: #3d3c38;
}

.exhibit-cell .works-photo-wrap {
  width: 100%;
}

.exhibit-cell .works-photo-wrap img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
  filter: var(--thumb-dim);
  transition: filter var(--dur) var(--ease-out);
}

.exhibit-cell:hover .works-photo-wrap img,
.exhibit-cell:focus-visible .works-photo-wrap img {
  filter: var(--thumb-lit);
}

.exhibit-cell figcaption {
  padding: 0.85rem 1rem 1rem;
}

.exhibit-cell .cap-title {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  font-weight: 500;
}

.exhibit-cell .cap-year {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Category index & view icons */
.view-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1.5rem;
}

.view-toolbar .toggle-group button.view-btn {
  padding: 0.5rem 0.72rem;
  line-height: 0;
}

.view-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  vertical-align: middle;
}

.view-btn svg path,
.view-btn svg rect {
  stroke: currentColor;
  fill: none;
}

.category-root {
  display: block;
  columns: 242px;
  column-gap: 0.5rem;
}

.category-root.view-mode-grid.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.category-root.view-mode-grid.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.category-root.view-mode-grid.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.category-root.view-mode-grid.grid-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.category-root.view-mode-grid.grid-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
}

.category-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  overflow: hidden;
  text-align: left;
  transition: border-color var(--dur) var(--ease-out);
  /* masonry */
  break-inside: avoid;
  margin-bottom: 0.5rem;
}

.category-card:hover {
  border-color: #3d3c38;
}

.category-card-thumb img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
  filter: var(--thumb-dim);
  transition: filter var(--dur) var(--ease-out);
}

.category-card:hover .category-card-thumb img {
  filter: var(--thumb-lit);
}

.category-card-body {
  padding: 0.85rem 1rem 1rem;
}

.category-card-title {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  font-weight: 500;
}

.category-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
}

.category-root.view-mode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.6rem;
  max-width: none;
  columns: unset;
}

.category-root.view-mode-list .category-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: stretch;
  break-inside: unset;
  margin-bottom: 0;
}

.category-root.view-mode-list .category-card-thumb {
  min-height: 100px;
}

.category-root.view-mode-list .category-card-thumb img {
  width: 100%;
  height: 100%;
  min-height: 100px;
  max-height: 160px;
  aspect-ratio: unset;
  object-fit: cover;
}

.works-root.view-mode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.6rem;
  max-width: none;
  columns: unset;
}

.works-root.view-mode-list .works-cell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  break-inside: unset;
  margin-bottom: 0;
}

.works-root.view-mode-list .works-cell .works-photo-wrap {
  width: 180px;
  flex-shrink: 0;
  align-self: stretch;
}

.works-root.view-mode-list .works-cell .works-photo-wrap img {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  align-self: stretch;
}

.works-root.view-mode-list .works-cell figcaption {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0.75rem 1rem;
}

@media (max-width: 520px) {
  .works-root.view-mode-list .works-cell {
    flex-direction: column;
  }

  .works-root.view-mode-list .works-cell .works-photo-wrap {
    width: 100%;
  }

  .works-root.view-mode-list .works-cell .works-photo-wrap img {
    width: 100%;
    aspect-ratio: 3 / 2;
  }

  .category-root.view-mode-list .category-card {
    grid-template-columns: 1fr;
  }

  .category-root.view-mode-list .category-card-thumb img {
    max-height: 220px;
  }

  .result-list.view-mode-list .result-item {
    flex-direction: column;
  }

  .result-list.view-mode-list .result-thumb {
    width: 100%;
  }
}

.search-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.search-results-head .results-count {
  margin-bottom: 0;
}

.result-list.view-mode-grid.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.result-list.view-mode-grid.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.result-list.view-mode-grid.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.result-list.view-mode-grid.grid-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.result-list.view-mode-grid.grid-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
}

.result-list.view-mode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.6rem;
  max-width: none;
  columns: unset;
}

.result-list.view-mode-list .result-item {
  flex-direction: row;
  align-items: flex-start;
  break-inside: unset;
  margin-bottom: 0;
}

.result-list.view-mode-list .result-thumb {
  width: 160px;
  flex-shrink: 0;
  border-radius: 4px;
}

.result-list.view-mode-list .result-thumb img {
  height: 120px;
  object-fit: cover;
}

.result-list.view-mode-list .result-body {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0 0.25rem 0.75rem;
}

.category-back-wrap {
  margin: 0 0 1rem;
}

.category-back {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.category-back:hover {
  color: var(--accent);
}

/* Layout toggle (legacy) */
.layout-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.layout-tools label {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toggle-group {
  display: inline-flex;
  border: 1px solid var(--line);
}

.toggle-group button {
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  font-family: inherit;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out);
}

.toggle-group button.is-active {
  background: rgba(196, 165, 116, 0.12);
  color: var(--accent);
}

.toggle-group button + button {
  border-left: 1px solid var(--line);
}

/* Modal / lightbox */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 9, 0.92);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--dur) var(--ease-out),
    visibility var(--dur) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 1rem);
}

/* 모달·좌우 네비 한 덩어리 — 화살표는 모달 밖 8~10px */
.overlay-dialog-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: min(1240px, 100%);
  max-height: min(92vh, 960px);
  box-sizing: border-box;
  pointer-events: none; /* 클릭은 자식만 */
}

.overlay-dialog-row > * {
  pointer-events: auto;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.overlay.fs-img-active {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.overlay.fs-img-active .overlay-dialog-row {
  max-width: none;
  max-height: none;
  width: 100%;
  min-height: 100%;
  gap: 8px;
  padding: 0 10px;
  box-sizing: border-box;
  align-self: stretch;
}

.overlay-inner {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1080px;
  width: 100%;
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  gap: 0;
}

@media (min-width: 900px) {
  .overlay-inner.layout-split {
    grid-template-columns: 1.15fr 1fr;
  }
}

.overlay-inner.layout-stack .detail-text {
  border-top: 1px solid var(--line);
}

.overlay-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease-out);
}

.overlay-close:hover {
  border-color: var(--accent);
}

.detail-media {
  background: #0a0a09;
  align-self: start;
}

.detail-image-wrap {
  background: #0a0a09;
  min-height: 200px;
}

.detail-image-wrap img {
  width: 100%;
  height: auto;
  max-height: min(78vh, 900px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ── 낙관 위치 교정 ────────────────────────────────────────
   문제 1) grid stretch: 텍스트 컬럼이 길면 .detail-image-wrap 셀이
           grid row 전체 높이로 늘어나 낙관이 이미지 아래 검정 영역에 배치됨
           → align-self: start 로 컨테이너 높이 = 이미지 높이로 고정
   문제 2) letterbox: 세로 사진에서 max-height + object-fit:contain 조합이
           이미지 좌우에 투명 여백을 만들어 낙관이 여백 영역에 배치됨
           → 오버레이 컨텍스트에서는 max-height·object-fit 제거,
             오버레이 자체(max-height:92vh + overflow:auto)가 높이 제어 담당
   ─────────────────────────────────────────────────────────── */
.overlay-inner:not(.is-image-fullscreen) .detail-media,
.overlay-inner:not(.is-image-fullscreen) .detail-image-wrap {
  align-self: start;   /* grid row 높이에 맞춰 늘어나지 않음            */
  min-height: 0;       /* 200px 하한선 제거 — 이미지 높이가 그대로 컨테이너 높이 */
}

.overlay-inner:not(.is-image-fullscreen) .detail-image-wrap {
  cursor: zoom-in;
}

.overlay-inner:not(.is-image-fullscreen) .detail-image-wrap img {
  width: 100%;
  height: auto;
  max-height: none;    /* 오버레이 overflow:auto 가 처리 — letterbox 원인 제거  */
  object-fit: unset;   /* width:100% + height:auto 자연 비율 = 여백 없음       */
}

/* 이미지 전체화면: split 그리드 2열 때문에 왼쪽만 차지하던 문제 → flex 단일 면 + 중앙 정렬 */
.overlay-inner.is-image-fullscreen {
  display: flex !important;
  flex-direction: column;
  grid-template-columns: unset !important;
  max-width: none;
  width: 100%;
  min-height: 100vh;
  max-height: 100vh;
  height: 100vh;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #050504;
}

.overlay-inner.is-image-fullscreen .detail-text,
.overlay-inner.is-image-fullscreen .detail-exif {
  display: none !important;
}

.overlay-inner.is-image-fullscreen .detail-media,
.overlay-inner.is-image-fullscreen .detail-image-wrap {
  /* 전체화면: media는 뷰포트를 채우되, watermark 기준 wrap은 이미지 크기와 일치해야 함 */
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: auto;
  cursor: zoom-out;
}

.overlay-inner.is-image-fullscreen .detail-image-wrap img {
  width: auto;
  max-width: 100vw;
  height: auto;
  max-height: 100vh;
  object-fit: contain;
  margin: 0 auto;
}

.overlay-inner.is-image-fullscreen .detail-image-wrap {
  flex: 0 0 auto;
  width: fit-content;
  height: fit-content;
  max-width: 100vw;
  max-height: 100vh;
}

/* 전체화면: 닫기 버튼 대신 화면 아무 곳이나 클릭으로 복귀 */
.overlay-inner.is-image-fullscreen .overlay-close {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .overlay-inner {
    transition:
      max-height 0.35s var(--ease-out),
      background 0.35s var(--ease-out);
  }
}

.detail-text {
  padding: 1.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-text h2 {
  font-family: var(--font-ui);
  font-size: 1.75rem;
  font-weight: 500;
  margin: 0;
}

.detail-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-caption {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
}

.detail-note {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

#detail-note-block.is-empty {
  display: none;
}

.note-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.footer-mini {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========== 갤러리 셀 호버 오버레이 ========== */
.works-photo-wrap {
  position: relative;
  display: block;
  overflow: hidden;
}

.cell-hover-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem 0.85rem;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 55%);
  opacity: 0;
  transition: opacity 0.28s var(--ease-out);
  pointer-events: none;
}

.exhibit-cell:hover .cell-hover-overlay,
.exhibit-cell:focus-visible .cell-hover-overlay {
  opacity: 1;
}

.cell-hover-caption {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.88);
  font-family: var(--font-ko);
  letter-spacing: 0.01em;
}

/* ========== 오버레이 이전/다음: 플렉스 행으로 모달 옆 고정 간격(~10px) ========== */
.overlay-nav {
  position: relative;
  flex: 0 0 auto;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
  z-index: 130;
  width: 2.9rem;
  height: 2.9rem;
  align-self: center;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,15,14,0.72);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out),
    opacity var(--dur) var(--ease-out);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay-nav:hover {
  border-color: var(--accent);
  background: rgba(15,15,14,0.9);
}

.overlay-nav:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 639px) {
  .overlay-nav {
    width: 2.5rem;
    height: 2.5rem;
  }

  .overlay-dialog-row {
    gap: max(8px, env(safe-area-inset-left, 8px));
    padding: 0 max(8px, env(safe-area-inset-right, 8px));
  }
}

/* ========== 상세 뷰어: 이중 제목 ========== */
.detail-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-title-en {
  font-family: var(--font-en);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.detail-title-en[hidden] {
  display: none;
}


/* ========== 상세 뷰어: 이미지 하단 EXIF 정보 칩 ========== */
.detail-exif {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.detail-exif[hidden],
.detail-exif:empty {
  display: none;
}

.detail-exif-below {
  padding: 0.65rem 0.75rem 0.75rem;
  background: #0a0a09;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.exif-chip {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  white-space: nowrap;
}

/* ========== 상세 뷰어: 태그 pills ========== */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.detail-tags[hidden] {
  display: none;
}

.detail-tag {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  background: rgba(196,165,116,0.08);
  border: 1px solid rgba(196,165,116,0.22);
  color: var(--text-muted);
  border-radius: 1px;
}

/* ========== 상세 뷰어: 카운터 ========== */
.detail-counter {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(154,151,144,0.55);
  margin-top: auto;
  padding-top: 0.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ========== 이미지 로딩 페이드 ========== */
#detail-img {
  transition: opacity 0.22s var(--ease-out);
}

#detail-img.is-loading {
  opacity: 0.35;
}


/* ========== 모바일 네비 조정 ========== */
@media (max-width: 639px) {

  .detail-title-en {
    font-size: 0.85rem;
  }

  .detail-counter {
    font-size: 0.62rem;
  }
}

/* ========== Mobile & touch-friendly ========== */
@media (max-width: 639px) {
  .page {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .nav-links {
    gap: 0.65rem 1.1rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .nav-links a {
    font-size: 0.76rem;
    padding: 0.35rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .brand {
    font-size: 1.2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    justify-content: center;
    min-height: 44px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    margin-top: 2rem;
    gap: 1.15rem;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar input[type="search"] {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .search-results-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .search-results-head .view-toolbar {
    justify-content: flex-end;
  }

  .result-list.view-mode-grid.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
  }

  .result-list.view-mode-grid.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem 0.55rem;
  }

  .result-item {
    padding: 0.65rem;
  }

  .result-item h3 {
    font-size: 0.92rem;
  }

  .tag {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  .view-toolbar .toggle-group button.view-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
  }

  .exhibit-intro,
  .category-head {
    margin-bottom: 1.25rem;
  }

  .exhibit-h1,
  .search-h1 {
    font-size: clamp(1.4rem, 6.5vw, 1.85rem);
    margin-bottom: 0.65rem;
  }

  .lead {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
  }

  .works-root.view-mode-grid .works-cell .cap-title,
  .works-root.view-mode-grid .exhibit-cell .cap-title {
    font-size: 0.88rem;
    line-height: 1.25;
  }

  .works-root.view-mode-grid .works-cell .cap-year,
  .works-root.view-mode-grid .exhibit-cell .cap-year {
    font-size: 0.65rem;
  }

  .works-root.view-mode-grid .works-cell figcaption,
  .works-root.view-mode-grid .exhibit-cell figcaption {
    padding: 0.5rem 0.55rem 0.6rem;
  }

  .category-root.view-mode-grid .category-card-title {
    font-size: 0.88rem;
    line-height: 1.25;
  }

  .category-root.view-mode-grid .category-card-meta {
    font-size: 0.65rem;
  }

  .category-root.view-mode-grid .category-card-body {
    padding: 0.55rem 0.65rem 0.65rem;
  }

  .footer-mini {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    font-size: 0.68rem;
    line-height: 1.5;
    word-break: break-word;
  }

  .overlay {
    padding: max(0.35rem, env(safe-area-inset-top)) max(0.35rem, env(safe-area-inset-right))
      max(0.35rem, env(safe-area-inset-bottom)) max(0.35rem, env(safe-area-inset-left));
  }

  .overlay-inner {
    max-height: min(92vh, 100dvh);
  }

  .overlay-close {
    top: max(0.5rem, env(safe-area-inset-top));
    right: max(0.5rem, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .detail-text {
    padding: 1rem max(1rem, env(safe-area-inset-right)) 1.35rem max(1rem, env(safe-area-inset-left));
    gap: 0.75rem;
  }

  .detail-text h2 {
    font-size: 1.35rem;
    line-height: 1.2;
  }

  .detail-caption {
    font-size: 0.9rem;
  }

  .detail-note {
    font-size: 0.85rem;
  }

  .category-back {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }
}

@media (max-width: 639px) and (prefers-reduced-motion: reduce) {
  .card:hover {
    transform: none;
  }

  .result-item:hover {
    transform: none;
  }
}

/* ============================================================
   화면보호기 슬라이드쇼
   ============================================================ */

/* 전체 오버레이 */
#screensaver {
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s var(--ease-out);
  cursor: pointer;
}

#screensaver.ss--active {
  opacity: 1;
  pointer-events: auto;
}

body.ss-body-active {
  overflow: hidden;
}

/* 슬라이드 패널 (A/B 교차) */
.ss-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.75s var(--ease-out);
}

.ss-slide::after {
  content: "";
  position: absolute;
  right: 3%;
  bottom: 4%;
  z-index: 2;
  pointer-events: none;
  height: min(var(--wm-height-pct), 96px);
  min-height: 22px;
  max-height: 14vh;
  aspect-ratio: 1 / 2;
  width: auto;
  background-image: var(--wm-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: var(--wm-opacity);
  mix-blend-mode: normal;
}

.ss-slide--active {
  opacity: 1;
}

/* 하단 텍스트 */
.ss-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3.5rem 2.5rem 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  pointer-events: none;
}

.ss-title {
  font-family: var(--font-ko);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

body.locale-en .ss-title {
  font-family: var(--font-en);
  font-style: italic;
}

.ss-meta {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
}

/* 닫기 버튼 */
.ss-close {
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  border-radius: 50%;
  transition: background var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out);
}

.ss-close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* 카운터 */
.ss-counter {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  right: max(1.25rem, env(safe-area-inset-right));
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.28);
  pointer-events: none;
}

/* ── 트리거 버튼 (전 페이지 공통, 우하단 고정) ── */
.ss-trigger-btn {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  right: max(1.5rem, env(safe-area-inset-right));
  z-index: 9000;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,15,14,0.75);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  transition:
    background var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out);
}

.ss-trigger-btn:hover {
  background: rgba(196,165,116,0.12);
  border-color: rgba(196,165,116,0.35);
  color: var(--accent);
}

/* 슬라이드쇼 활성 중일 때 버튼 숨김 (닫기 버튼이 대체) */
body.ss-body-active .ss-trigger-btn {
  display: none;
}

@media (max-width: 639px) {
  .ss-info {
    padding: 2.5rem 1.25rem 1.5rem;
  }
  .ss-trigger-btn {
    width: 2.25rem;
    height: 2.25rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: max(1rem, env(safe-area-inset-right));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ss-slide,
  #screensaver {
    transition-duration: 0.01ms;
  }
}

/* 작가노트 문단(빈 줄) 그대로 보이기 — 2026-11-19 */
#detail-note { white-space: pre-line; }
