
/* 관리자 로그인 상태가 아니면 글쓰기/수정/삭제 등 관리자 전용 컨트롤을 숨긴다. */
body:not(.is-admin) [data-admin-only] {
	display: none;
}

/* ================ header 영역 css ================ */
.user-menu {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

/* 로그인 페이지에서는 헤더의 로그인 버튼을 숨긴다. */
body.page-login .user-menu {
    display: none;
}

/* ================ nav 영역 css ================ */
.category-nav {
	width: 100%;
	padding: 2rem;
}

/* 트리 노드 제목이 nav 영역 너비를 벗어나면 말줄임(...) 처리 */
#category-jstree .jstree-anchor {
	max-width: 90%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.category-tree {
	margin-left: 1.2rem;	
}

.category-children {
	margin-left: 1.2rem;
}

.post-children {
	margin-left: 1.2rem;
}

.post-item, .post-children{
	color: blue;
	text-decoration: underline;
}


/* ================ main 영역 css ================ */
.post-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

.post-empty {
  display: none;
  padding: 64px 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 15px;
}

.post-panel[data-mode="initial"] .post-empty {
  display: block;
}

.post-panel[data-mode="initial"] .post-meta,
.post-panel[data-mode="initial"] .post-box {
  display: none;
}

.post-title {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.post-panel[data-mode="edit"] .post-title {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
}

.post-meta-line {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.post-box {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 460px;
  margin-top: 24px;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-sizing: border-box;
}

#post-vditor,
#post-preview {
  flex: 1;
  min-height: 320px;
}

#post-preview {
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: auto;
}

.post-toolbar {
  flex-shrink: 0;
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.post-toolbar [data-action="save"],
.post-toolbar [data-action="cancel"] {
  display: none;
}

.post-panel[data-mode="edit"] .post-toolbar [data-action="edit"],
.post-panel[data-mode="edit"] .post-toolbar [data-action="delete"] {
  display: none;
}

.post-panel[data-mode="edit"] .post-toolbar [data-action="save"],
.post-panel[data-mode="edit"] .post-toolbar [data-action="cancel"] {
  display: inline-block;
}

.post-panel[data-mode="view"] #post-vditor {
  display: none;
}

.post-panel[data-mode="edit"] #post-preview {
  display: none;
}


/* ================ list 영역 css ================ */
.list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.list__header h2 {
  font-size: 18px;
  font-weight: 600;
}

/* Tabulator 기본 테마를 걷어내고 jsTree 아이콘(fa-folder/fa-file-alt)과
   어울리는 플랫한 라인 스타일로 다시 그린다 */
.post-list.tabulator {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
}

.post-list .tabulator-header {
  background: transparent;
  border-bottom: 1px solid var(--color-border);
}

.post-list .tabulator-header .tabulator-col {
  background: transparent;
  border-right: 0;
}

.post-list .tabulator-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.post-list .tabulator-header-filter input {
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  padding: 4px 2px;
  font-size: 13px;
  font-family: inherit;
}

.post-list .tabulator-header-filter input:focus {
  outline: none;
  border-bottom-color: var(--color-primary);
}

.post-list .tabulator-row {
  background: transparent;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}

.post-list .tabulator-row:last-child {
  border-bottom: 0;
}

.post-list .tabulator-row:hover {
  background: var(--color-active);
}

.post-list .tabulator-cell {
  border-right: 0;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-text);
}

/* ================ 로그인 화면 css ================ */
.login-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

/* .post-box와 동일한 카드 톤(테두리/radius/padding)을 재사용해 통일감을 맞춘다 */
.login-card {
  width: 100%;
  max-width: 360px;
  padding: 32px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.login-title {
  margin: 0 0 var(--space-6);
  font-size: 24px;
  font-weight: 700;
}

.login-form .form-field {
  margin-bottom: var(--space-4);
}

.login-form label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: 13px;
  color: var(--color-muted);
}

.login-form input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 14px;
}

.login-form input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.login-error {
  min-height: 18px;
  margin: 0 0 var(--space-4);
  color: var(--color-danger);
  font-size: 13px;
}

.login-submit {
  width: 100%;
}

.post-list .tabulator-placeholder {
  color: var(--color-muted);
  font-size: 14px;
}


/* ================ comment 영역 ================ */
.comments {
  margin-top: 24px;
}

.comments h3 {
  font-size: 16px;
}

.comment-card {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.comment-card.reply {
  margin-left: 48px;
}

.comment-card p {
  margin: 12px 0;
}

.comment-card span {
  color: var(--color-muted);
  font-size: 13px;
}

.comment-card button {
  margin-left: 12px;
  border: 0;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
}

.comment-form {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.comment-form textarea {
  width: 100%;
  height: 72px;
  border: 0;
  resize: none;
  outline: none;
  font-size: 15px;
}

.comment-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}