/* 사진 뷰어(팝업). 블로그 photos 페이지와 admin 대시보드가 함께 쓴다. 색은 :root 변수(--bg, --text, --muted, --border)를 따른다. */

.photo-viewer {
  max-width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* 열 때 포커스는 대화상자 자체로 간다(photos.md에서 showModal 뒤 dlg.focus()). 그래야 iOS Safari가 × 버튼에 파란 테두리를 그리지 않는다. */
.photo-viewer:focus {
  outline: none;
}

.photo-viewer::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.photo-viewer[open] {
  display: flex;
  flex-direction: column;
}

.photo-viewer img {
  display: block;
  min-height: 0;
  max-width: 100%;
  max-height: calc(100vh - 8.5rem);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 6px;
}

/* 위 줄: 날짜와 닫기. 사진을 가리지 않도록 사진 바깥 여백에 둔다. */
.photo-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.photo-bar .photo-date {
  margin: 0;
}

/* 아래 줄: 하트만 오른쪽 끝에 둔다. */
.photo-meta {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* 보이는 아이콘은 하트와 같은 선 스타일의 SVG(14px)로 두고, 눌리는 범위만 투명 패딩으로 넓힌다(약 44px). */
.photo-close {
  display: flex;
  padding: 1rem;
  margin: -1rem -1rem -1rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.photo-close:hover {
  color: var(--text);
}
