/* ============================================================
   호이 포토 블로그 — 공개 화면 스타일 (화이트 미니멀 갤러리)
   토큰 SSOT: 색·간격·폭·아이콘 크기는 전부 :root 변수로만 사용
   ============================================================ */

@font-face {
  font-family: "Pretendard";
  src: url("fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* 색 */
  --bg: #fff;
  --text: #111;
  --muted: #767676;
  --border: #efefef;
  --heart: #ed4956;
  --ph: #f4f4f4;               /* 이미지 로드 전 플레이스홀더 */
  --overlay: rgba(0, 0, 0, .25);
  --lb-bg: rgba(255, 255, 255, .98);

  /* 타이포 */
  --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans KR", sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-h2: 22px;       /* 본문 소제목 */
  --fs-2xl: 28px;
  /* 글 본문 문단 전용 — 관리자 설정에서 이 값만 바꾼다.
     다른 요소(제목·소제목·태그·목록 등)는 영향을 받지 않는다. */
  --fs-body: 16px;

  /* 간격 (8pt 그리드) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* 레이아웃 폭 */
  --container: 860px;
  --post-width: 1024px;
  --text-width: 640px;
  /* 본문 블록 박스 폭 = 콘텐츠 폭 + 좌우 여백 (border-box 기준) */
  --side-w: 190px;     /* 좌측 사이드바 폭 */
  --text-box: 672px;   /* 640 + 32 */
  --post-box: 1056px;  /* 1024 + 32 — 가로 사진 기준 폭 */
  --port-box: 912px;   /* 880 + 32 — 세로 사진은 한 화면에 더 들어오도록 좁게 */
  --wide-box: 1312px;

  /* 아이콘 · 모서리 · 터치 타깃 */
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-full: 999px;
  --tap: 44px;
}

/* ---------- 다크 모드 ----------
   미디어쿼리가 아니라 html[data-theme]로만 전환한다.
   시스템 설정 판단은 <head>의 인라인 스크립트가 맡으므로,
   이 파일을 함께 쓰는 관리자 화면은 영향을 받지 않는다. */

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f0f10;               /* 완전한 검정 대신 살짝 눌러 눈부심을 줄인다 */
  --text: #ededed;
  --muted: #9b9b9b;
  --border: #262629;
  --heart: #ff5c69;            /* 어두운 배경에서 붉은색이 죽지 않도록 밝게 */
  --ph: #1b1b1e;
  --overlay: rgba(0, 0, 0, .45);
  --lb-bg: rgba(12, 12, 13, .98);
}

/* ---------- 테마 전환 버튼 (우측 하단 고정) ---------- */

.theme-toggle {
  position: fixed;
  right: max(var(--sp-4), env(safe-area-inset-right));
  bottom: max(var(--sp-4), env(safe-area-inset-bottom));
  z-index: 900;                /* 라이트박스(1000)보다 아래 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
:root[data-theme="dark"] .theme-toggle { box-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.theme-toggle:hover { background: var(--ph); }
.theme-toggle:active { transform: scale(.94); }
/* 현재 테마에 따라 해/달 아이콘 하나만 보여준다 */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- 베이스 ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

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

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; }

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

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.icon {
  width: var(--icon-md);
  height: var(--icon-md);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); }

/* 다운로드 억제 (best effort) — 사진 요소는 선택·드래그·롱프레스 콜아웃 차단 */
.tile img, .photo-frame img, .lb-img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none; /* 우클릭 대상이 이미지가 아닌 부모가 되도록 */
}

/* 사이트 헤더 없음 — 사진이 화면 맨 위부터 시작하는 무크롬 갤러리 구성 */

/* draft 미리보기 배너 (관리자 전용 노출) */
.draft-banner {
  background: var(--text);
  color: var(--bg);
  text-align: center;
  font-size: var(--fs-sm);
  padding: var(--sp-2) var(--sp-4);
}

/* ---------- 2단 레이아웃 (좌측 사이드바 + 그리드) ---------- */

.layout {
  max-width: calc(var(--container) + var(--side-w) + var(--sp-8));
  margin-inline: auto;
  padding: var(--sp-6) var(--sp-4) 0;
  display: grid;
  gap: var(--sp-8);
  grid-template-columns: 1fr;   /* 모바일: 세로로 쌓임 */
}
@media (min-width: 900px) {
  .layout {
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    align-items: start;
  }
  .sidebar { position: sticky; top: var(--sp-6); }
}
.content { min-width: 0; }

/* ---------- 사이드바 ---------- */

.sidebar { min-width: 0; }

/* 모바일 전용 접기 버튼 */
.side-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.side-toggle .icon { transition: transform .15s ease; }
.side-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }

.side-panel { display: none; padding-top: var(--sp-4); }
.side-panel.is-open { display: block; }

@media (min-width: 900px) {
  .side-toggle { display: none; }
  .side-panel { display: block; padding-top: 0; }
}

/* 검색 */
.search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: var(--sp-6);
}
.search .search-icon {
  position: absolute;
  left: var(--sp-3);
  color: var(--muted);
  pointer-events: none;
}
.search input[type="search"] {
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--sp-8) 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  -webkit-appearance: none;
  appearance: none;
}
.search input[type="search"]::-webkit-search-cancel-button { display: none; }
.search input[type="search"]:focus { outline: none; border-color: var(--text); }
.search input[type="search"]::placeholder { color: var(--muted); }
.search-clear {
  position: absolute;
  right: var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  color: var(--muted);
}
.search-clear:hover { background: var(--ph); color: var(--text); }

/* 카테고리 목록 */
.cats { display: flex; flex-direction: column; }
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  min-height: 38px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text);
  transition: background-color .15s ease, color .15s ease;
}
.cat-item:hover { background: var(--ph); }
.cat-item.is-active { font-weight: 600; }
.cat-item.is-active .cat-name { text-decoration: underline; text-underline-offset: 4px; }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count { font-size: var(--fs-xs); color: var(--muted); flex-shrink: 0; }
.cat-item.is-child {
  padding-left: var(--sp-6);
  font-size: var(--fs-xs);
  color: var(--muted);
  min-height: 32px;
}
.cat-item.is-child:hover, .cat-item.is-child.is-active { color: var(--text); }
/* 하위 목록은 상위(또는 자신)가 선택됐을 때만 펼친다 */
.cat-children { display: none; }
.cat-children.is-open { display: block; }

/* 사이드바 태그 */
.side-tags { margin-top: var(--sp-8); }
.side-title {
  margin: 0 0 var(--sp-3);
  padding-inline: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--muted);
}
.side-tags .pills { padding: 0 var(--sp-3); flex-wrap: wrap; overflow: visible; }

/* 사이드바 맨 아래 — 사진 전체보기 */
.side-foot {
  margin-top: var(--sp-8);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.side-allphotos {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text);
  transition: background-color .15s ease;
}
.side-allphotos:hover { background: var(--ph); }
.side-allphotos .icon { color: var(--muted); }
.side-allphotos-count { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }

/* ---------- 사진 전체보기 페이지 ---------- */

.photos-page {
  max-width: calc(var(--container) + var(--side-w) + var(--sp-8));
  margin-inline: auto;
  padding: var(--sp-6) var(--sp-4) 0;
}
.photos-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  position: relative;
  margin-bottom: var(--sp-6);
  text-align: center;
}
.photos-head h1 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: .02em;
}
.photos-count { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.photos-back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  align-self: flex-start;
  min-height: var(--tap);
  font-size: var(--fs-sm);
  color: var(--muted);
  transition: color .15s ease;
}
.photos-back:hover { color: var(--text); }
@media (min-width: 640px) {
  .photos-back { position: absolute; left: 0; top: 0; }
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
@media (min-width: 640px)  { .photo-grid { grid-template-columns: repeat(4, 1fr); gap: var(--sp-1); } }
@media (min-width: 1100px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }

.photo-cell { margin: 0; }
.photo-cell .photo-frame { aspect-ratio: 1; overflow: hidden; background: var(--ph); }
.photo-cell .photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .15s ease;
}
@media (hover: hover) {
  .photo-cell:hover .photo-frame img { opacity: .85; }
}

/* 라이트박스에서 원본 글로 가는 링크 */
.lb-link {
  position: absolute;
  bottom: var(--sp-12);
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: var(--sp-2) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg);
  font-size: var(--fs-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color .15s ease;
}
.lb-link[hidden] { display: none; }
.lb-link:hover { background: var(--ph); }

/* 결과 안내 줄 */
.result-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  padding-inline: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.result-note strong { color: var(--text); font-weight: 600; }
.result-reset {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.result-reset:hover { color: var(--text); }

/* ---------- 태그 pill ---------- */

.pills {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-4);
  overflow-x: auto;               /* 본문 가로 스크롤 방지: 자체 스크롤 */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: var(--sp-1) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  color: var(--muted);
  background: var(--bg);
  transition: background-color .15s ease, color .15s ease;
}
.pill:hover { background: var(--ph); color: var(--text); }
.pill.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.pill .pill-count { margin-left: var(--sp-1); font-size: var(--fs-xs); opacity: .7; }

/* ---------- 그리드 (모바일 우선: 풀블리드 · gap 2px → 640px+ gap 4px) ---------- */

.grid-wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
@media (min-width: 640px) {
  .grid { gap: var(--sp-1); }
}
/* 2단 레이아웃 안에서는 .layout이 이미 폭·여백을 잡으므로 중복 제한을 푼다 */
.content .grid-wrap { max-width: none; padding-inline: 0; }
.content .pagination { padding-inline: 0; }

.tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--ph);
}
.tile img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
/* 사진 없는 글(글 전용) 타일 — 흰 카드 + 제목 */
.tile.is-text {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);   /* gap을 밀지 않도록 안쪽 선으로 */
  transition: background-color .15s ease;
}
.tile.is-text:hover { background: var(--ph); }

.tile-noimg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 100%;
  padding: var(--sp-4);
  text-align: center;
}
.noimg-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  /* 제목이 길어도 카드를 넘치지 않게 3줄까지만 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.noimg-date { font-size: var(--fs-xs); color: var(--muted); }

/* 제목이 이미 보이므로 어두운 오버레이 대신 하트만 아래에 얹는다 */
.tile.is-text .tile-overlay {
  background: transparent;
  color: var(--muted);
  justify-content: flex-end;
}
.tile.is-text .tile-overlay .tile-title { display: none; }

.tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--overlay);
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
/* hover 가능한 기기에서만 오버레이 노출 — 모바일은 탭 즉시 이동 */
@media (hover: hover) {
  .tile:hover .tile-overlay,
  .tile:focus-visible .tile-overlay { opacity: 1; }
}
.tile-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-likes {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
}

/* ---------- 페이지네이션 ---------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-8) var(--sp-4);
}
.page-link, .page-cur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding-inline: var(--sp-2);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.page-link { color: var(--muted); transition: background-color .15s ease, color .15s ease; }
.page-link:hover { background: var(--ph); color: var(--text); }
.page-cur { background: var(--text); color: var(--bg); font-weight: 600; }
.page-gap { min-width: var(--sp-6); text-align: center; color: var(--muted); }

/* ---------- 빈 상태 · 404 ---------- */

.empty {
  max-width: var(--container);
  margin-inline: auto;
  padding: 96px var(--sp-4);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-base);
}
.empty .empty-title {
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin: 0 0 var(--sp-2);
}
.empty p { margin: 0 0 var(--sp-5); }
.empty a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-6);
  border: 1px solid var(--text);
  border-radius: var(--r-full);
  color: var(--text);
  font-size: var(--fs-sm);
  transition: background-color .15s ease, color .15s ease;
}
.empty a:hover { background: var(--text); color: var(--bg); }

/* ---------- 포스트 ---------- */

/* .post는 폭을 제한하지 않는다 — 블록마다 자기 폭을 갖고,
   '전체 폭' 사진은 .post의 폭(공개 화면=뷰포트, 에디터=캔버스)을 그대로 채운다.
   덕분에 100vw 트릭 없이 에디터·미리보기·발행 화면이 같은 규칙으로 동작한다. */
.post { padding-top: var(--sp-8); }

.post-head {
  max-width: var(--text-box);
  margin-inline: auto;
  padding-inline: var(--sp-4);
  text-align: center;
}
.post-title {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-2xl);
  font-weight: 600;
  line-height: 1.35;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1) var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.post-meta a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s ease;
  padding-block: var(--sp-2); /* 터치 타깃 보강 */
}
.post-meta a:hover { color: var(--text); }

/* ---------- 본문 블록 ----------
   ⚠️ 클래스·구조는 lib.php render_blocks()와 assets/editor.js renderBlock()이
      동일하게 생성한다. 한쪽을 바꾸면 세 곳을 함께 맞출 것. */

.post-blocks { margin-block: var(--sp-8); }

.pb { margin-inline: auto; }

.pb-p, .pb-h, .pb-q, .pb-hr {
  max-width: var(--text-box);
  padding-inline: var(--sp-4);
}

.pb-p {
  margin-block: 0 var(--sp-5);
  font-size: var(--fs-body);
  line-height: 1.8;
}
.pb-h {
  margin-block: var(--sp-12) var(--sp-4);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -.01em;
}
.pb-q {
  margin-block: var(--sp-8);
  border-left: 2px solid var(--text);
  padding-block: var(--sp-1);
  padding-left: var(--sp-5);
  font-size: var(--fs-lg);
  line-height: 1.7;
}
.pb-hr {
  margin-block: var(--sp-12);
  border: 0;
  border-top: 1px solid var(--border);
}
.pb-p a, .pb-q a, .pb-h a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* 사진 블록 — 네 가지 폭 */
.pb-img { margin-block: var(--sp-12); }
.pb-img.is-inset  { max-width: var(--text-box); padding-inline: var(--sp-4); }
.pb-img.is-normal { max-width: var(--post-box); padding-inline: var(--sp-4); }
/* 기본 크기일 때만 세로 사진을 좁게 — '넓게/전체'는 직접 고른 값이므로 건드리지 않는다 */
.pb-img.is-normal.is-port { max-width: var(--port-box); }
.pb-img.is-wide   { max-width: var(--wide-box); padding-inline: var(--sp-4); }
.pb-img.is-full   { max-width: none; padding-inline: 0; }  /* .post 폭을 가득 */

/* 갤러리 — flex-grow를 종횡비에 비례시켜 높이를 자동으로 맞춘다(크롭 없음) */
.pb-grid {
  display: flex;
  gap: var(--sp-1);
  max-width: var(--post-box);
  padding-inline: var(--sp-4);
  margin-block: var(--sp-12);
}
.pb-grid-item { margin: 0; flex: 1 1 0; min-width: 0; }
.pb-grid .photo-cap { display: none; }  /* 갤러리는 캡션 없이 이미지 리듬 유지 */

.photo-frame { position: relative; }
.photo-frame img {
  width: 100%;
  height: auto;
  background: var(--ph);   /* 로드 전 플레이스홀더 (스켈레톤) */
}
/* 투명 가드 — 롱프레스 저장 방지 + 클릭 시 라이트박스 */
.photo-guard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.photo-cap {
  margin-top: var(--sp-2);
  text-align: center;
}
.cap-alt {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text);
}
.cap-exif {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: .02em;
}

/* ---------- 좋아요 ---------- */

.like-row {
  display: flex;
  justify-content: center;
  margin-block: var(--sp-8);
}
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.like-btn:hover { background: var(--ph); }
.like-btn .icon-heart { transition: transform .15s ease; }
.like-btn:active .icon-heart { transform: scale(1.2); }
.like-btn.liked { border-color: var(--heart); color: var(--heart); }
.like-btn.liked .icon-heart { fill: var(--heart); stroke: var(--heart); }

/* ---------- 이전/다음 글 ---------- */

.post-nav {
  max-width: var(--post-width);
  margin: var(--sp-8) auto 0;
  padding: var(--sp-6) var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
}
.post-nav a, .post-nav .nav-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-1);
  max-width: 46%;
  min-height: var(--tap);
}
.post-nav .nav-next { text-align: right; align-items: flex-end; margin-left: auto; }
.nav-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.nav-title {
  font-size: var(--fs-sm);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  transition: color .15s ease;
}
.post-nav a:hover .nav-title { color: var(--muted); }

/* ---------- 라이트박스 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--lb-bg);
}
.lightbox[hidden] { display: none; }
.lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.lb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lb-btn {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background-color .15s ease;
}
.lb-btn:hover { background: var(--ph); }
.lb-close { top: var(--sp-3); right: var(--sp-3); }
.lb-prev { left: var(--sp-2); top: 50%; transform: translateY(-50%); }
.lb-next { right: var(--sp-2); top: 50%; transform: translateY(-50%); }
.lb-count {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}
@media (min-width: 640px) {
  .lb-stage { padding: var(--sp-16); }
}

/* ---------- 모션 최소화 존중 ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
