/* 이미지 페이지 v7 (2026-10-29) — 첫 화면(css/imgdb.css)과 같은 다크 톤. Bootstrap 없음.
   배너 · 이미지 · 배너 · 정보 순서. 이미지 확대는 imageviewer.css 가 맡는다. */

:root {
  --bg: #0d0d0f;
  --surface: #18181b;
  --surface-hover: #1f1f23;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --subtle: #71717a;
  --accent: #8b5cf6;
  --accent-hover: #9d74f7;
  --danger: #f87171;
  --ease: 160ms ease;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Pretendard Variable", Pretendard, Inter, system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
a { color: inherit; }
h2, p { margin: 0; }

.wrap { max-width: 880px; margin: 0 auto; padding: 16px 16px 48px; }

/* 배너 */
.ad { margin: 0 0 16px; text-align: center; overflow: hidden; }
.ad-mid { margin: 16px 0; }
/* 다음 배너는 모바일에서 화면 너비 꽉 (v5 와 같음) */
@media (max-width: 768px) {
  .ads { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); }
}

/* 이미지 */
.photo {
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.photo img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: zoom-in;
  opacity: .4;
  transition: opacity .6s ease;
}
.photo img.loaded { opacity: 1; }

/* 정보 */
.info { padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: .9375rem; }
.meta dt { color: var(--subtle); }
.meta dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.actions .spacer { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.btn:hover { border-color: var(--border-hover); background: var(--surface-hover); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: rgba(248, 113, 113, .5); }
.btn-danger-fill, .btn-danger-fill:hover { border-color: #dc2626; background: #dc2626; color: #fff; }

.home { margin-top: 28px; text-align: center; }
.home .btn { color: var(--muted); }
.home .btn:hover { color: var(--text); }

/* 대화 상자 */
dialog {
  width: min(460px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin-bottom: 8px; font-size: 1.0625rem; font-weight: 600; }
dialog p { color: var(--muted); font-size: .9375rem; }
dialog .actions { justify-content: flex-end; margin-top: 20px; padding-top: 0; border-top: 0; }
.field { display: flex; gap: 8px; margin-top: 12px; }
.field label { flex: none; width: 64px; align-self: center; color: var(--subtle); font-size: .8125rem; }
.field input, .field select {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: .875rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.field select { font-family: inherit; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }

/* 짧은 알림 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .9375rem;
  transform: translateX(-50%);
}

/* 확대 보기 닫기 단추가 밝은 그림 위에서도 보이게 (v5 와 같음) */
.iv-close { filter: drop-shadow(1px 0 0 #000) drop-shadow(-1px 0 0 #000) drop-shadow(0 1px 0 #000) drop-shadow(0 -1px 0 #000); }

@media (max-width: 480px) {
  .photo { padding: 8px; }
  .info { padding: 16px; }
  .actions .btn span { display: none; }
}
