* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  background: #404040;
  color: #eee;
}
a { color: #6cf; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 24px;
  background: #202020;
  border-bottom: 1px solid #222;
}
.site-header .logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 1px;
}
.site-header .logo-kr {
  font-size: 16px;
  font-weight: 700;
  color: #ccc;
  letter-spacing: 1px;
}
.site-header .author-link {
  color: #6cf;
  text-decoration: none;
}
.site-header .author-link:hover {
  text-decoration: underline;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}
.container.narrow {
  max-width: 480px;
}

.empty-msg {
  text-align: center;
  color: #888;
  padding: 80px 0;
}

.top-section {
  width: 100%;
}

.bottom-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  margin: 32px auto 0;
}
.bottom-section .group-nav,
.bottom-section .comments {
  width: 100%;
}

.gallery-layout {
  display: flex;
  align-items: stretch;
  gap: 24px;
}

.func-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}
.func-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
  text-decoration: none;
  font-size: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.func-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.photo-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.main-photo {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.side-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.side-info {
  color: #ddd;
  font-size: 14px;
  line-height: 1.6;
}

.side-date {
  margin-top: 20px;
  font-size: 12px;
  color: #999;
}

.side-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 20px;
}
.side-thumbs .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.85;
}
.side-thumbs .thumb:hover {
  opacity: 1;
  border-color: #fff;
}

@media (max-width: 700px) {
  .photo-col {
    flex: 2 1 0;
    min-width: 50%;
  }
  .side-col {
    flex: 1 1 160px;
    padding-left: 16px;
  }
  .func-col {
    flex: 0 1 40px;
  }
  .func-btn {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .gallery-layout {
    flex-wrap: wrap;
  }
  .func-col {
    order: -1;
    flex: 0 0 100%;
    flex-direction: row;
    margin-bottom: 12px;
  }
  .photo-col {
    min-width: 100%;
  }
  .side-col {
    flex: 1 1 100%;
    min-width: 100%;
    padding-left: 0;
    padding-top: 20px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 20px;
  }
  .comment-form {
    flex-wrap: wrap;
  }
  .comment-form .comment-name-input {
    flex: 1 1 100%;
  }
  .comment-form .comment-content-input {
    flex: 1 1 auto;
  }
}

.group-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  font-size: 14px;
  color: #999;
}
.group-nav a { text-decoration: none; }
.group-nav .disabled { color: #444; }

.comments { margin-top: 24px; }
.comments h2 { font-size: 16px; color: #ccc; }

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment-list li {
  padding: 10px 0;
  border-bottom: 1px solid #222;
}
.comment-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #999;
  margin-bottom: 4px;
}
.comment-name { color: #ddd; font-weight: 600; }
.comment-body { font-size: 14px; line-height: 1.5; }

.comment-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.comment-form .comment-name-input {
  flex: 0 0 60px;
}
.comment-form .comment-content-input {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.comment-form input[type=text],
.admin-form input,
.admin-form textarea,
input[type=file],
textarea {
  background: #1b1b1b;
  border: 1px solid #333;
  color: #eee;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.comment-form button, .admin-form button, form button {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}
.comment-form button:hover, .admin-form button:hover { background: #2563eb; }
.comment-form button:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
}
.comment-form button:disabled:hover { background: #555; }

.hp-field { position: absolute; left: -9999px; }

.error { color: #f66; }

.preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}
.preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #ccc;
  cursor: pointer;
}
.preview-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #333;
}
.preview-caption { font-size: 11px; }

label { font-size: 13px; color: #aaa; margin-top: 8px; }
