/* 볼드(700)로 요청됐을 때, 라틴 문자만 Inter의 실제 600(세미볼드) 파일을 쓰게 해서
   진짜 700(볼드)보다 살짝 가볍게 보이도록 함 - 한글은 이 규칙의 유니코드 범위에
   안 걸려서 Noto Serif KR의 진짜 700을 그대로 씀(더 두껍게 유지) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://cdnjs.cloudflare.com/ajax/libs/fontsource-inter/5.0.3/files/inter-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   토큰
   ============================================================ */
:root {
  --bg: #FFFFFF;
  --paper: #F1EEE7;
  --ink: #1C1B19;
  --graphite: #6E6A62;
  --line: #C9C4B8;
  --sanguine: #93432B;
  --link-orange: #C4732B;
  --lb-text: #FFFFFF;

  --font-display: "Fraunces", "Noto Serif KR", Georgia, serif;
  --font-body: "Inter", "Noto Serif KR", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Serif KR", ui-monospace, monospace;
  --font-caption: "Gowun Batang", "Noto Serif KR", "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  /* 글자 강조(각주 이동, CV 안내문구 등)가 서서히 사라지는 건 '움직임'이 아니라 색이 옅어지는
     것뿐이라, 위의 일괄 규칙에서 예외로 둠 - 안 그러면 OS에서 '동작 줄이기'를 켠 컴퓨터에서
     페이드 없이 뚝 사라짐 */
  .flash-highlight.flash-highlight-fade { transition-duration: 1s !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 1px solid var(--sanguine);
  outline-offset: 2px;
}

/* 방향키로 이동한 텍스트형 링크 - 사각형 대신 밑줄+색상 변화(호버와 동일) */
.cv-link:focus,
.cv-link:focus-visible,
.cat-item a:focus,
.cat-item a:focus-visible,
.text-item a:focus,
.text-item a:focus-visible,
.ref-item a:focus,
.ref-item a:focus-visible,
.search-item a:focus,
.search-item a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cv-link:focus .cv-line,
.cv-link:focus-visible .cv-line { color: var(--sanguine); }
.text-item a:focus .text-item-title,
.text-item a:focus-visible .text-item-title { color: var(--sanguine); }
.ref-item a:focus .ref-title,
.ref-item a:focus-visible .ref-title { color: var(--sanguine); }
.search-item a:focus .search-leaf,
.search-item a:focus-visible .search-leaf { color: var(--sanguine); }

/* 작품/전경 썸네일 카드 - 테두리 없이, 호버와 똑같이 캡션만 드러남 */
.card:focus,
.card:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.card:focus .frame,
.card:focus-visible .frame {
  outline: none !important;
  box-shadow: none !important;
}
.card:focus .cap,
.card:focus-visible .cap {
  opacity: 1;
  transform: translateY(0);
}

.wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
}

.wrap.narrow { max-width: 720px; }

@media (max-width: 650px) {
  .wrap { padding: 0 16px; }
  .wrap.narrow { padding: 0 16px; }
}

/* ============================================================
   헤더
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
  position: relative;
}

.site-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--graphite);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover { color: var(--ink); border-color: var(--sanguine); }
.site-nav a:focus-visible { outline: none; color: var(--ink); border-color: var(--sanguine); }

.nav-icon {
  display: flex;
  align-items: center;
  color: var(--graphite);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.nav-icon:hover { color: var(--sanguine); }
.nav-icon svg { display: block; width: 16px; height: 16px; }
.nav-icon:focus-visible { outline: none; color: var(--sanguine); }

/* .nav-icon의 display:flex보다 반드시 나중에 와야 삼선이 기본적으로 숨겨짐 (+ !important로 이중 안전장치) */
.menu-trigger { display: none !important; }

.lang-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  width: 62px;
  padding: 5px 0;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--graphite);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-short { display: none; }

.lang-toggle:hover { color: var(--ink); border-color: var(--graphite); }
.lang-toggle:focus-visible { outline: none; color: var(--ink); border-color: var(--sanguine); }

/* ============================================================
   650px 미만 - 삼선(햄버거) 메뉴로 전환
   (Ctrl 확대/축소든 창 크기 드래그든, 유효 뷰포트 너비 기준으로 동일하게 반응)
   ============================================================ */
@media (max-width: 650px) {
  .menu-trigger {
    display: flex !important;
    width: 18px;
    height: 18px;
  }
  .menu-trigger svg { width: 18px; height: 18px; }

  .header-right { gap: 18px; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 28px rgba(20, 19, 17, 0.12);
    padding: 6px 32px 14px;
  }

  .site-nav.open { display: flex; }

  .site-nav li { width: 100%; }

  .site-nav a {
    display: block;
    width: 100%;
    padding: 11px 0;
    border-bottom: none;
    font-size: 13px;
  }

  .lang-toggle {
    width: auto;
    min-width: 34px;
    padding: 5px 6px;
    font-size: 11px;
  }

  .lang-full { display: none; }
  .lang-short { display: inline; }

  .pager { width: 100%; justify-content: center; }
}

/* ============================================================
   미리보기(홈) - 헤더 메뉴를 숨기고 큰 버튼 네 개가 메뉴를 대신함
   ============================================================ */
body.landing-page .site-nav,
body.landing-page .menu-trigger { display: none !important; }

.landing-page-section {
  min-height: calc(100vh - 200px);
  min-height: calc(100svh - 200px);
  display: flex;
  align-items: center;
  padding: 24px 0 72px;
}
.landing-page-section .wrap { width: 100%; }

.landing-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.landing-btn {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  min-height: 220px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.landing-btn:hover,
.landing-btn:focus-visible {
  outline: none;
  border-color: var(--sanguine);
  background: rgba(0, 0, 0, 0.02);
}
.landing-btn-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.landing-btn-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--graphite);
}
.landing-btn:hover .landing-btn-sub,
.landing-btn:focus-visible .landing-btn-sub { color: var(--sanguine); }

@media (max-width: 900px) {
  .landing-menu { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
  .landing-menu { grid-template-columns: 1fr; gap: 12px; }
  .landing-btn { min-height: 0; padding: 22px 20px; gap: 8px; }
  .landing-btn-title { font-size: 26px; }
  .landing-page-section { min-height: calc(100svh - 160px); }
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sanguine);
  margin: 0 0 28px;
}

/* ============================================================
   CV (홈)
   ============================================================ */
.cv-page { padding: 28px 0 96px; }

.cv-profile { margin-bottom: 4px; }

.cv-profile-line {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--graphite);
  margin: 0 0 4px;
}

.cv-intro {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--sanguine);
  max-width: 100%;
  margin: 24px 0 36px;
}

.cv-group-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sanguine);
  margin: 40px 0 8px;
}

.cv-group-label:first-of-type { margin-top: 0; }

.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

.cv-item.cv-year-break { margin-top: 8px; }


.cv-link {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  text-decoration: none;
  color: var(--ink);
  max-width: 100%;
}

.cv-line {
  font-family: var(--font-display);
  font-size: 16px;
  transition: color 0.15s ease;
  display: table;
  border-collapse: collapse;
  min-width: 0;
  max-width: 100%;
}

.cv-year-col {
  display: table-cell;
  white-space: nowrap;
  padding-right: 0.45em;
}

.cv-rest-col {
  display: table-cell;
}

.cv-link.js-hover .cv-line { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   카테고리 / 목록 페이지 (Works, Text 인덱스)
   ============================================================ */
.list-page, .detail-page { padding: 40px 0 96px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--graphite);
  margin-bottom: 24px;
}

.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

.breadcrumb-root {
  color: var(--sanguine);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.breadcrumb a:focus-visible { outline: none; color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }
.crumb-sep { margin: 0 8px; color: var(--line); }

.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 640px;
}

.cat-item a {
  display: inline-flex;
  padding: 18px 8px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--ink);
  transition: color 0.15s ease;
  max-width: 100%;
}

.cat-item a.js-hover { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

.cat-item .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
}

/* Works 카테고리 목록 - 대표 이미지 미리보기 */
.cat-list-preview { max-width: 900px; }

.cat-item-link {
  display: inline-flex !important;
  align-items: center;
  gap: 28px;
  padding: 20px 8px !important;
  max-width: 100%;
}

.cat-preview {
  position: relative;
  flex: none;
  height: 180px;
  width: auto;
  max-width: 260px;
  overflow: hidden;
  background: var(--paper);
  border-radius: 2px;
  display: block;
}

.cat-preview img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

.cat-item-title {
  font-family: var(--font-display);
  font-size: 19px;
  color: inherit;
}

.detail-year { margin: 0 0 6px; }

.detail-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 27px;
  margin: 0 0 28px;
}

/* 전시 상세 페이지: 연도-제목-장소를 서로 가깝게 붙임(다른 페이지의 detail-title엔 영향 없음) */
.detail-year + .detail-title { margin-bottom: 6px; }

.detail-venue {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--graphite);
  margin: 0 0 32px;
}

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  text-decoration: none;
  margin-bottom: 24px;
}

.back-link:hover { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }
.back-link:focus-visible { outline: none; color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

.subhead {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sanguine);
  margin: 48px 0 10px;
}

.search-list + .search-list,
.search-summary + .subhead,
.search-more + .subhead {
  margin-top: 8px;
}

.list-page .search-summary ~ .subhead { margin: 28px 0 10px; }

.statement {
  max-width: 62ch;
  margin-bottom: 8px;
}

.statement p { margin: 0 0 16px; color: var(--ink); text-align: justify; text-justify: inter-word; }
.statement p.align-center { text-align: center; }
.statement p.align-left { text-align: left; }
.statement p.align-right { text-align: right; }

.footnote-ref { line-height: 0; }
.footnote-ref .footnote-jump {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--link-orange);
  text-decoration: none;
  cursor: pointer;
}
.footnote-ref .footnote-jump:hover { text-decoration: underline; text-underline-offset: 2px; }
.footnote-ref .footnote-jump:focus-visible { outline: none; text-decoration: underline; }

.post-explore-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 20px;
}

.post-explore-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-explore-links a:hover { color: var(--sanguine); }
.post-explore-links a:focus-visible { outline: none; color: var(--sanguine); }

.footnote-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--graphite);
}

.footnote-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.footnote-num {
  flex: none;
  color: var(--sanguine);
  cursor: pointer;
  text-decoration: none;
}
.footnote-num:hover { text-decoration: underline; text-underline-offset: 2px; }
.footnote-num:focus-visible { outline: none; text-decoration: underline; }
.footnote-text { flex: 1; }

/* ============================================================
   작품/전경 그리드 (매이슨리)
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  align-items: center;
}

/* Works 작품 그리드 전용 - .wrap의 1600px 상한을 벗어나 화면 끝까지 채움
   (화면이 1600px보다 좁아지면 자연히 .wrap과 같은 폭이 되어 동일하게 동작) */
body.gallery-page { touch-action: pan-y; }

.gallery-swipe-unit { display: block; }

.grid-fullbleed {
  padding-left: max(32px, calc((100vw - 1600px) / 2 + 32px));
  padding-right: max(32px, calc((100vw - 1600px) / 2 + 32px));
  box-sizing: border-box;
  touch-action: pan-y;
}

.bleed-pager {
  padding-top: 4px;
  display: flex;
  justify-content: center;
}

/* auto-fill 대신 뷰포트 폭 구간별로 열 개수를 딱 고정 - 확대/축소 경계에서
   열 개수가 불안정하게 튀는 현상 방지 (항상 같은 방향으로만 바뀜) */
@media (max-width: 1500px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 650px)  { .grid { grid-template-columns: 1fr; } }

.card { margin: 0; cursor: pointer; }

.frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
}

.frame img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.card.js-hover .frame img { transform: scale(1.02); }

.placeholder-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--graphite);
}

.cap {
  display: table;
  width: 100%;
  margin: 10px 2px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--graphite);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cap > span:first-child {
  display: table-cell;
  width: 100%;
}

.cap-year {
  display: table-cell;
  white-space: nowrap;
  padding-left: 8px;
  vertical-align: top;
}

.card.js-hover .cap { opacity: 1; transform: translateY(0); }

.grid-compact .cap { display: none; }

/* ============================================================
   Text 목록 / 글 상세
   ============================================================ */
.text-list { list-style: none; margin: 0; padding: 0; }

.text-item a {
  display: inline-flex;
  flex-direction: column;
  padding: 20px 8px;
  text-decoration: none;
  color: var(--ink);
  max-width: 100%;
}

.text-item-title {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 0;
}

.text-item a.js-hover .text-item-title { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

.text-item-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--graphite);
}

.text-item-excerpt {
  font-size: 14px;
  color: var(--graphite);
  margin-bottom: 4px;
}

.empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--graphite);
  padding: 16px 0;
}

.post-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  margin: 0 0 10px;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  margin: 0 0 32px;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 15px;
}

.contact-list a {
  display: inline-block;
  padding: 16px 4px;
  text-decoration: none;
  max-width: 100%;
}

.contact-list a:hover { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }
.contact-list a:focus-visible { outline: none; color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

.contact-copy {
  display: inline-block;
  max-width: 100%;
  padding: 16px 4px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.contact-copy:hover { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }
.contact-copy:focus-visible { outline: none; color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 20px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.toast.open {
  opacity: 1;
}

/* ============================================================
   푸터 / 관리자 토글
   ============================================================ */
.site-footer {
  padding: 24px 0 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--graphite);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================================
   본문 안 인라인 링크 ( [텍스트](URL) 문법으로 생성됨 )
   ============================================================ */
.inline-link {
  color: var(--link-orange);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.inline-link:hover { color: var(--sanguine); }
.inline-link:focus-visible { outline: none; color: var(--sanguine); }

/* 키보드로 방향키 이동하는 동안, 마우스가 가만히 올려둔 요소의 :hover 표시가 같이 남아있지
   않도록 - pointer-events를 꺼서 그 요소가 더는 "호버 중"으로 취급되지 않게 함
   (마우스가 실제로 움직이면 JS가 이 클래스를 바로 제거해서 정상으로 돌아옴) */
body.keyboard-nav-active .card,
body.keyboard-nav-active .cv-link,
body.keyboard-nav-active .cat-item a,
body.keyboard-nav-active .text-item a,
body.keyboard-nav-active .ref-item a,
body.keyboard-nav-active .search-item a {
  pointer-events: none;
}

/* 본문 중 자동으로 걸리는 작품 언급 링크 - 일반 인라인 링크와 살짝 구분되게 점선 밑줄 */
.work-mention {
  color: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  text-decoration-color: var(--sanguine);
}
.work-mention:hover { color: var(--sanguine); }
.work-mention:focus-visible { outline: none; color: var(--sanguine); }

.search-match-highlight { background: none; color: inherit; }

.flash-highlight {
  background: var(--sanguine);
  color: var(--bg) !important;
  border-radius: 2px;
}

.flash-highlight.flash-highlight-fade {
  transition: background 1s ease, color 1s ease;
  background: transparent;
  color: inherit !important;
}

/* 카드(작품 썸네일)를 강조할 때는 카드 전체에 테두리로 표시 */
.frame.flash-highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sanguine);
  opacity: 1;
  pointer-events: none;
}
.frame.flash-highlight.flash-highlight-fade::after {
  transition: opacity 1s ease;
  opacity: 0;
}

.work-preview {
  position: fixed;
  width: auto;
  max-width: 220px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(20, 19, 17, 0.18);
  padding: 6px;
  z-index: 90;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.work-preview.open { opacity: 1; transform: translateY(0); }

.work-preview img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
}

/* ============================================================
   서문/평문 참조 카드 (전시 상세 페이지)
   ============================================================ */
.ref-list { list-style: none; margin: 0 0 8px; padding: 0; max-width: 480px; }

.ref-item a {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 2px;
  text-decoration: none;
  color: var(--ink);
  max-width: 100%;
}

/* 소제목(서문/글) 바로 다음 첫 항목은 위쪽 패딩을 줄여서, 그리드(작업/전시전경)와
   비슷한 간격이 되도록 함 (다른 항목들의 터치 영역은 그대로 유지) */
.ref-list .ref-item:first-child a { padding-top: 0; }

.ref-item a.js-hover .ref-title { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

.ref-title { font-family: var(--font-display); font-size: 16px; }

.ref-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--graphite);
}

/* ============================================================
   검색
   ============================================================ */
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.search-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  border-radius: 2px;
}

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

.search-submit {
  padding: 0 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity 0.15s ease;
}

.search-submit:hover { opacity: 0.85; }
.search-submit:focus-visible { outline: none; opacity: 0.85; }

.search-summary {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  margin: 0 0 8px;
}

.search-list { list-style: none; margin: 0 0 6px; padding: 0; }

.search-item a {
  display: block;
  padding: 5px 2px;
  text-decoration: none;
  color: var(--graphite);
}

.search-item-work a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 2px;
}

.search-thumb {
  flex: none;
  height: 56px;
  width: auto;
  max-width: 90px;
  overflow: hidden;
  background: var(--paper);
  border-radius: 2px;
}

.search-thumb img { display: block; height: 100%; width: auto; max-width: 90px; object-fit: contain; }

.search-thumb-empty { width: 56px; }

.search-path {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.search-leaf {
  font-weight: 600;
  color: var(--ink);
}

.search-item a.js-hover .search-leaf { color: var(--sanguine); text-decoration: underline; text-underline-offset: 3px; }

.search-sep { color: var(--line); }

.search-more {
  display: inline-block;
  margin: 4px 0 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.search-more:hover { color: var(--sanguine); }

.gallery-more {
  display: inline-block;
  margin: 14px 0 40px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gallery-more:hover { color: var(--sanguine); }
.gallery-more:focus-visible { outline: none; color: var(--sanguine); }

mark.hl {
  background: none;
  color: var(--link-orange);
  font-weight: 600;
}

.pager {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.pager a,
.pager-current,
.pager-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border-radius: 2px;
  text-decoration: none;
}

.pager a:hover { color: var(--sanguine); background: var(--paper); }
.pager a:focus-visible { outline: none; color: var(--sanguine); background: var(--paper); }

.pager-current {
  color: var(--bg);
  background: var(--ink);
}

.pager-disabled { color: var(--line); }

.pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  color: var(--line);
}

.pager-arrow { font-size: 15px; }

/* ============================================================
   라이트박스
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(20, 19, 17, 0.94);
  overflow: hidden;
  cursor: default;
  user-select: none;
}

.lightbox.open { display: block; }
body.lightbox-active #app { user-select: none; }
.lightbox.dragging { cursor: grabbing; }
.lightbox.dragging #lb-image,
.lightbox.dragging .lb-info { cursor: grabbing !important; }

/* lb-image-wrap이 라이트박스 전체를 덮어야 이미지 주변 여백에서도 스와이프가 됨
   (캡션 영역은 z-index가 더 높은 .lb-info가 위에 있어서 자연히 보호됨) */
.lb-image-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* 이미지 자체가 프레임 - 실제 width/height/left/top을 JS가 직접 제어(transform 아님) */
#lb-image {
  position: fixed;
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 5;
  cursor: zoom-in;
}

#lb-image.lb-image-placeholder,
#lb-image-peek-next.lb-image-placeholder,
#lb-image-peek-next2.lb-image-placeholder,
#lb-image-peek-prev.lb-image-placeholder,
#lb-image-peek-prev2.lb-image-placeholder {
  background: #1c1c1c;
  border: 1px dashed rgba(255, 255, 255, 0.25);
}

#lb-image-peek-prev,
#lb-image-peek-prev2,
#lb-image-peek-next,
#lb-image-peek-next2 {
  position: fixed;
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  z-index: 4;
}

.lightbox.zoomed #lb-image { cursor: zoom-out; }

.lb-info {
  position: fixed;
  left: 40px;
  bottom: 10px;
  width: fit-content;
  max-width: calc(100vw - 80px);
  color: var(--lb-text);
  z-index: 10;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 1px 12px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transition: opacity 0.25s ease;
}

.lb-info-hidden {
  opacity: 0;
  pointer-events: none;
}

.lb-caption-line { cursor: text; user-select: text; }
.lb-info a { cursor: pointer; }

@media (max-width: 650px) {
  .lb-info { left: 16px; max-width: calc(100vw - 32px); }
}

.lb-caption-line {
  font-family: var(--font-caption);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 1px 8px;
  margin-left: -8px;
  word-break: keep-all;
  max-width: min(420px, calc(100vw - 80px));
}

/* 애매한 길이라서 좁은 폭(420px)엔 못 들어가지만 조금만 더 넓히면 한 줄에 들어가는
   캡션일 때만 JS가 이 클래스를 붙여서 더 넓은 폭을 씀 - 긴 캡션은 원래 폭 그대로 유지 */
.lb-info-wide .lb-caption-line { max-width: min(700px, calc(100vw - 80px)); }

.lb-caption-line strong {
  font-weight: 700;
  font-size: 16px;
}

.lb-note { margin: 1px 0 0; font-size: 14px; font-family: var(--font-caption); color: var(--lb-text); pointer-events: none; word-break: keep-all; max-width: min(420px, calc(100vw - 80px)); }

.lb-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 6px;
  max-width: min(420px, calc(100vw - 80px));
  pointer-events: none; /* 컨테이너 자체는 터치를 통과시킴(아래 이미지가 반응하도록) */
}

/* 좁은 화면(삼선 기준)에서, 작품이 참여한 전시가 많아 목록이 너무 길어지면(3개 초과)
   바닥에서 위로 다 쌓이는 대신, 오래된 전시들은 천장에서 아래로 내려오게 나눠서 보여줌.
   순서는 그대로(꼭대기=오래된 전시, 아래=최근 전시) 유지됨 - 데스크톱에선 항상 숨김.
   display:block(flex 아님)이어야 아래 float 기법(닫기 버튼 영역만 피해서 줄바꿈)이 작동함 */
.lb-links-top {
  display: none;
  position: fixed;
  left: 40px;
  top: 24px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 80px));
  color: var(--lb-text);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 1px 12px rgba(0, 0, 0, 0.5);
}
.lb-links-top:empty { display: none !important; }
@media (max-width: 650px) {
  .lb-links-top:not(:empty) { display: block; left: 16px; max-width: calc(100vw - 32px); }
}
.lb-links-top .lb-explore-link { display: block; }
/* 닫기 버튼이 있는 딱 그 자리만큼만 투명하게 띄워서(float), 글자가 그 옆에서만
   좁게 줄바꿈되고 그 아래(버튼보다 낮은 위치)부터는 다시 원래 너비로 꽉 채워짐 -
   크기(width/height)는 JS가 닫기 버튼의 실제 위치를 재서 그때그때 넣어줌 */
.lb-top-avoid-spacer { float: right; }

.lb-explore-link { pointer-events: auto; } /* 실제 글자 링크만 클릭/터치 가능 */

.lb-explore-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--lb-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.lb-explore-link:hover { color: var(--sanguine); }
.lb-explore-link:focus-visible { outline: none; color: var(--sanguine); }

/* 왼쪽 여백(16px)과 대칭이 되도록, 너비 계산도 32px(16px*2) 기준으로 맞춤 - 그대로
   두면 데스크톱 여백(80px=40px*2) 기준이 남아있어서 오른쪽 여백만 넓어 보임.
   (앞의 규칙들보다 나중에 나와야 우선 적용되므로 이 위치에 둠) */
@media (max-width: 650px) {
  .lb-caption-line,
  .lb-info-wide .lb-caption-line,
  .lb-note,
  .lb-links {
    max-width: calc(100vw - 32px);
  }
}

.lb-close {
  position: absolute;
  top: 24px;
  right: 32px;
  z-index: 60;
  background: none;
  border: none;
  color: var(--lb-text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
}

.lb-close:hover { color: var(--sanguine); }
.lb-close:focus-visible { outline: none; color: var(--sanguine); }

/* ============================================================
   검색 오버레이
   ============================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(20, 19, 17, 0.35);
}

.search-overlay.open { display: block; }

.search-panel {
  position: absolute;
  top: 76px;
  right: 32px;
  width: 380px;
  max-width: calc(100vw - 48px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(20, 19, 17, 0.18);
  padding: 18px;
}

.search-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 24px;
  width: 11px;
  height: 11px;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}

@media (max-width: 650px) {
  .search-panel {
    left: 16px !important;
    right: 16px !important;
    width: auto;
    max-width: none;
  }
  .search-panel::before { display: none; }
}

.overlay-search-form { display: flex; }

.overlay-search-input {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  border-radius: 2px;
}

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

.recent-searches { margin-top: 14px; }

.recent-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.recent-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--graphite);
}

.recent-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--line);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.recent-clear:hover { color: var(--sanguine); }
.recent-clear:focus-visible { outline: none; color: var(--sanguine); }

.recent-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  margin: 10px 0 0;
}

.recent-list { list-style: none; margin: 0; padding: 0; }

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.recent-item:hover { opacity: 1; }

.recent-item.recent-cursor { opacity: 1; }

.search-page-form { position: relative; }

.recent-searches-inline {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(20, 19, 17, 0.14);
  padding: 16px 18px;
  max-width: none;
  margin-top: 0;
}

.recent-searches-inline.open { display: block; }

.recent-more {
  display: block;
  margin-top: 6px;
  padding: 6px 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--graphite);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.recent-more:hover { color: var(--sanguine); }
.recent-more:focus-visible { outline: none; color: var(--sanguine); }

.recent-page-actions {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0 8px;
}

#recent-clear-all {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#recent-clear-all:hover { color: var(--sanguine); }
#recent-clear-all:focus-visible { outline: none; color: var(--sanguine); }

.recent-item-full {
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 2px;
  border-top: 1px solid var(--line);
}
.recent-item-full:last-child { border-bottom: 1px solid var(--line); }
.recent-item-full .recent-item-link { font-size: 15px; }

.recent-item-link {
  flex: 1;
  padding: 7px 2px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
}

.recent-item-link:hover { color: var(--sanguine); }
.recent-item-link:focus-visible { outline: none; color: var(--sanguine); }

.recent-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--graphite);
  font-size: 11px;
  padding: 4px;
}

.recent-item-remove:hover { color: var(--sanguine); }
.recent-item-remove:focus-visible { outline: none; color: var(--sanguine); }

/* ============================================================
   단축키 안내 패널
   ============================================================ */
.shortcuts-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 19, 17, 0.5);
  padding: 24px;
}

.shortcuts-panel.open { display: flex; }

.shortcuts-inner {
  position: relative;
  width: 380px;
  max-width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 4px;
  padding: 28px 24px;
  box-shadow: 0 16px 40px rgba(20, 19, 17, 0.25);
}

.shortcuts-inner h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 18px;
}

.shortcuts-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: var(--graphite);
  cursor: pointer;
  font-size: 14px;
}

.shortcuts-close:hover { color: var(--sanguine); }
.shortcuts-close:focus-visible { outline: none; color: var(--sanguine); }

#shortcuts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#shortcuts-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--graphite);
}

.shortcut-keys { display: flex; gap: 4px; flex: none; }

kbd {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
}

/* ============================================================
   다크모드 (OS 설정 자동 감지)
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171613;
    --paper: #211F1B;
    --ink: #EDEAE2;
    --graphite: #9C978C;
    --line: #3A3733;
    --sanguine: #D98363;
    --link-orange: #E0975A;
    --header-wash: rgba(23, 22, 19, 0.88);
  }

  .site-header { background: var(--header-wash); }

  .placeholder-mark { color: var(--graphite); }

  .search-panel, .shortcuts-inner {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

/* 갤러리/카드형 썸네일 이미지(loading="lazy" 쓰는 것들) - 로딩 중간 상태(덜 그려진
   모습)가 그대로 보이면 지저분해 보이므로, 완전히 다 불러와진 뒤에만 서서히 나타나게 함 */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.25s ease;
}
img[loading="lazy"].img-ready {
  opacity: 1;
}

/* 글 상세 페이지 맨 아래 - 같은 카테고리 안 이전/다음 글로 이동하는 칸 */
.post-sibling-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.post-sibling-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.post-sibling-link:not(.post-sibling-empty):hover { border-color: var(--sanguine); background: rgba(0, 0, 0, 0.02); }
.post-sibling-next { text-align: right; align-items: flex-end; }
.post-sibling-empty { border-color: transparent; pointer-events: none; }
.post-sibling-dir {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--graphite);
}
.post-sibling-title {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.4;
}

@media (max-width: 650px) {
  .post-sibling-nav { grid-template-columns: 1fr; gap: 10px; }
  .post-sibling-next { text-align: left; align-items: flex-start; }
}

/* 글 본문에 삽입된 이미지(-[@썸네일|원본|캡션]-) - 글 폭 안에서 가운데에 놓이고, 폭을 꽉
   채우지 않게 84%까지만 커짐. 세로로 긴 그림도 화면 높이의 55%까지만 */
.post-inline-figure {
  display: block;
  width: fit-content;
  max-width: 84%;
  margin: 1.6em auto;
}
.post-inline-image {
  display: block;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.post-inline-image img {
  display: block;
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 55vh;
  -webkit-user-drag: none;
}
.post-inline-image:focus-visible { outline: 1px solid var(--sanguine); outline-offset: 4px; }

/* 이미지 밑 캡션 - 한 칸 띄우고 작게, 가운데 정렬. width:0 + min-width:100%는 캡션이 길어도
   이미지 폭보다 넓어지지 않고 이미지 폭에 맞춰 줄바꿈되게 하는 방법 */
.post-inline-cap {
  display: block;
  width: 0;
  min-width: 100%;
  margin-top: 6px;
  font-family: var(--font-caption);
  font-size: 13px;
  line-height: 1.5;
  color: var(--graphite);
  text-align: center;
}
