:root {
  --wall: #223028;
  --wall-deep: #1a2721;
  --panel: #2f4238;
  --mat: #f3ecdc;
  --mat-shadow: #d8cdb0;
  --brass: #c6a15b;
  --brass-dim: #8f7645;
  --ink: #211c15;
  --ink-soft: #574f40;
  --sage: #9ab596;
  --radius: 3px;
  /* 애플 기기에서는 San Francisco, 그 외에는 각 OS의 기본 시스템 폰트로 자동 대체됩니다 */
  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background-color: var(--wall);
  /* 배경 사진을 넣으려면 public/img/museum-bg.jpg 파일을 두면 아래가 자동 적용됩니다.
     사진이 없으면 기본 짙은 초록색 배경으로 표시돼요. */
  background-image:
    linear-gradient(180deg, rgba(26,39,33,0.45) 0, rgba(34,48,40,0.55) 320px, var(--wall) 320px),
    url('/img/museum-bg.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: top center;
  color: var(--mat);
  font-family: var(--sans);
  min-height: 100vh;
}

a { color: inherit; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 6vw 20px;
  border-bottom: 1px solid rgba(198,161,91,0.25);
}

.site-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
  color: var(--mat);
  text-decoration: none;
}
.site-title span { color: var(--brass); font-style: italic; }

.nav-actions { display: flex; align-items: center; gap: 14px; font-size: 0.92rem; }

.btn {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--brass);
  background: transparent;
  color: var(--mat);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: rgba(198,161,91,0.12); }
.btn-solid { background: var(--brass); color: var(--wall-deep); font-weight: 600; }
.btn-solid:hover { background: #d4b06d; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.88rem; color: var(--sage);
}
.user-chip .avatar-mini { width: 30px; height: 30px; }

.hero {
  padding: 56px 6vw 40px;
  max-width: 640px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.25;
  margin: 0 0 14px;
}
.hero p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--sage);
  margin: 0;
}

.plinth {
  height: 1px;
  margin: 0 6vw 40px;
  background: linear-gradient(90deg, transparent, var(--brass-dim), transparent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 34px 26px;
  padding: 0 6vw 80px;
}

.frame {
  background: var(--mat);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 14px 26px rgba(0,0,0,0.28), inset 0 0 0 1px var(--mat-shadow);
  cursor: pointer;
  transition: transform 0.18s ease;
}
.frame:hover { transform: translateY(-4px); }
.frame:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.frame-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 1px;
  display: block;
  background: #d8cdb0;
}

.plaque {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--mat-shadow);
  color: var(--ink);
}
.plaque .title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  margin: 0 0 4px;
}
.plaque .artist {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.empty-state {
  padding: 60px 6vw;
  text-align: center;
  color: var(--sage);
  font-size: 1.05rem;
}
.empty-state a { color: var(--brass); text-decoration: underline; }

/* modal placard */
.overlay {
  position: fixed; inset: 0;
  background: rgba(10,14,11,0.78);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 50;
}
.hidden { display: none; }

.placard {
  background: var(--mat);
  color: var(--ink);
  max-width: 760px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.placard-img {
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  background: var(--wall-deep);
  display: block;
}
.placard-body { padding: 26px 28px 30px; }
.placard-body h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 10px;
}
.placard-artist {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.placard-desc { line-height: 1.75; font-size: 0.98rem; white-space: pre-wrap; }

.comments-section {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--mat-shadow);
}
.comments-section h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.08rem;
  margin: 0 0 14px;
}
.comments-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.comments-empty { color: var(--ink-soft); font-size: 0.9rem; }

.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.comment-name { font-weight: 600; font-size: 0.88rem; }
.comment-time { font-size: 0.76rem; color: var(--ink-soft); }
.comment-text { margin: 0; font-size: 0.92rem; line-height: 1.55; }

.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--mat-shadow);
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.92rem;
  resize: vertical;
}
.comment-form button { align-self: flex-end; }
.placard-close {
  float: right;
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer;
  color: var(--ink-soft);
  padding: 20px 20px 0 0;
}

/* forms */
.form-page {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 6vw;
}
.form-page h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 26px;
}
.form-page.wide { max-width: 560px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.86rem;
  color: var(--sage);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid rgba(198,161,91,0.4);
  background: var(--panel);
  color: var(--mat);
  font-family: var(--sans);
  font-size: 0.95rem;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 1px solid var(--brass); }

.char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.char-option {
  background: var(--panel);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 10px 6px 8px;
  text-align: center;
  cursor: pointer;
}
.char-option.selected { border-color: var(--brass); }
.char-option .avatar-mini { margin: 0 auto 6px; }
.char-option span { font-size: 0.78rem; color: var(--sage); }

.form-error {
  color: #e2a5a5;
  font-size: 0.88rem;
  margin-bottom: 14px;
  min-height: 1.2em;
}
.form-note {
  margin-top: 18px;
  font-size: 0.86rem;
  color: var(--ink-soft) ;
  color: var(--sage);
}

.avatar-mini { border-radius: 50%; overflow: hidden; flex-shrink: 0; object-fit: cover; background: var(--panel); }

footer.site-footer {
  text-align: center;
  padding: 30px;
  font-size: 0.8rem;
  color: var(--brass-dim);
}
