/* 게시판 전용 레이아웃: DESIGN.md의 Bulletin board 및 공통 토큰만 사용합니다. */
@import url("board-fonts.css?v=1");
/* 고수 게시판 댓글은 본문과 분리하되 기존 입력·버튼을 재사용한다. */
.boardComments { margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--hairline); }
.boardComments h3 { margin: 0 0 var(--space-md); color: var(--ink); }
.boardCommentList { list-style: none; margin: 0; padding: 0; }
.boardCommentList li { padding: var(--space-md) 0; border-bottom: 1px solid var(--hairline); }
.boardCommentList p { margin: var(--space-sm) 0 0; white-space: normal; overflow-wrap: anywhere; }
.boardCommentHead { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); }
.boardCommentHead time { color: var(--muted); font-size: 13px; }
.boardCommentHead form { margin-left: auto; }
.boardCommentForm { margin-top: var(--space-lg); }
.boardCommentForm textarea { min-height: calc(var(--space-section)); }
.boardCommentForm button { justify-self: start; }
/* 답글은 부모 바로 아래에 표시하고 깊은 대화도 최대 3단계만 들여쓴다. */
.boardCommentList .boardCommentReply { padding-left: var(--space-sm); border-left: 1px solid var(--hairline); }
.boardCommentDepth1 { margin-left: var(--space-md); }
.boardCommentDepth2 { margin-left: var(--space-xl); }
.boardCommentDepth3 { margin-left: var(--space-xxl); }
.boardCommentReplyForm { margin-top: var(--space-sm); }
.boardCommentReplyForm summary { display: flex; align-items: center; min-height: 40px; color: var(--ink); cursor: pointer; font-size: 13px; }
.boardCommentReplyForm summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 767px) {
  .boardCommentDepth2, .boardCommentDepth3 { margin-left: var(--space-md); }
}
.boardPage { padding-top: var(--space-section); padding-bottom: var(--space-section); }
.boardHeading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-xl); }
.boardHeading h1 { color: var(--ink); font: 600 15px/1.15 var(--font-display); letter-spacing: 0; margin: var(--space-md) 0; }
.boardHeading p { margin: 0; }
.boardCard { padding: var(--space-lg); background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow-wrap: anywhere; }
.boardCard h2 { margin: 0 0 var(--space-md); color: var(--ink); font: 600 15px/1.3 var(--font-body); letter-spacing: 0; }
.boardMeta { color: var(--muted); font: 400 14px/1.5 var(--font-body); margin: var(--space-xs) 0; }
.boardListRow { padding: var(--space-md) 0; border-bottom: 1px solid var(--hairline); }
.boardListRow:last-child { border-bottom: 0; }
.boardListRow h2 { font: 600 15px/1.4 var(--font-body); letter-spacing: 0; margin: 0; }
.boardListRow a:hover, .boardListRow a:focus-visible { text-decoration: underline; }
.boardSearch, .boardPagination { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-lg) 0; }
.boardPagination { justify-content: center; }
.boardSearch input { flex: 1; min-width: 0; }
.boardForm { display: grid; gap: var(--space-md); }
.boardForm label { color: var(--ink); font-weight: 600; }
.boardForm input:not([type=checkbox]), .boardSearch input, .boardForm textarea { min-height: 40px; min-width: 0; max-width: 100%; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--canvas); color: var(--ink); padding: var(--space-sm); font: 400 15px/1.5 var(--font-body); }
.boardForm textarea { width: 100%; min-height: 192px; resize: vertical; }
.boardForm input:not([type=checkbox]), .boardSearch input { height: 40px; padding: 10px 14px; }
.boardForm input:focus-visible, .boardForm textarea:focus-visible, .boardSearch input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.boardCheckbox { display: flex; align-items: center; gap: var(--space-xs); min-height: 40px; overflow-wrap: anywhere; }
.boardCheckbox input { accent-color: var(--primary); flex-shrink: 0; }
.boardNotice { padding: var(--space-md); background: var(--surface-soft); color: var(--ink); border-radius: var(--radius-md); }
.boardAttachments, .boardContent { margin-top: var(--space-lg); }
.boardContent { overflow-wrap: anywhere; overflow-x: auto; }
.boardContent p, .boardContent div, .boardContent ul, .boardContent ol { margin: var(--space-md) 0; }
.boardContent h2 { font: 600 15px/1.3 var(--font-body); letter-spacing: 0; }
.boardContent h3, .boardContent h4, .boardAttachments h3 { color: var(--ink); font: 600 15px/1.4 var(--font-body); }
.boardContent blockquote { border-left: 1px solid var(--hairline); margin: var(--space-md) 0; padding-left: var(--space-md); }
.boardContent table { border-collapse: collapse; max-width: 100%; }
.boardContent th, .boardContent td { border: 1px solid var(--hairline); padding: var(--space-xs); }
.boardContent pre { white-space: pre-wrap; }
.boardContent a, .boardFileLink { color: var(--ink); text-decoration: underline; }
.boardImage, .boardContent img { display: block; max-width: 100%; height: auto; }
.boardDelete { margin-top: var(--space-lg); }
.boardDelete summary { cursor: pointer; color: var(--ink); min-height: 40px; }
.boardForm button:disabled { background: var(--primary-disabled); color: var(--muted); cursor: wait; }
.boardHeading button:disabled { background: var(--primary-disabled); color: var(--muted); cursor: not-allowed; }
[hidden] { display: none !important; }
@media (max-width: 767px) {
  .boardPage { padding-top: var(--space-xxl); padding-bottom: var(--space-xxl); }
  .boardHeading h1 { font-size: 15px; line-height: 1.2; letter-spacing: 0; }
  .boardCard { padding: var(--space-md); }
  .boardSearch { align-items: stretch; flex-direction: column; }
}

/* 게시판 첫 콘텐츠도 다운로드와 같은 상단 여백을 사용한다. */
.boardPage { padding-top: 20px; }

/* 공개 목록은 제목과 메타데이터를 구분선이 있는 게시판 표로 정렬한다. */
.boardTableWrap { width: 100%; overflow-x: auto; }
.boardTable { width: 100%; border-collapse: collapse; table-layout: fixed; border-top: 1px solid var(--ink); }
.boardTable th, .boardTable td { padding: var(--space-md) var(--space-xs); border-bottom: 1px solid var(--hairline); text-align: center; font-size: 14px; overflow-wrap: anywhere; }
.boardTable th { background: var(--surface-soft); color: var(--ink); font-weight: 600; }
.boardTable th:first-child { width: 72px; }
.boardTable th:nth-child(3) { width: 100px; }
.boardTable th:nth-child(4) { width: 120px; }
.boardTable th:last-child { width: 80px; }
/* 통합 목록의 작성일은 열 개수와 관계없이 같은 너비를 사용한다. */
.boardTable.boardTableInstructorFeed th:last-child { width: calc(var(--space-xxl) * 3); }
/* 머리글이 없는 메인 표는 데이터 셀로 열 너비를 맞춘다. */
.boardTable.boardTableInstructorFeedCompact, .boardTableInstructorFeedCompact td { border: 0; }
/* 메인 게시글의 제목과 날짜에만 자체 호스팅 글꼴을 사용한다. */
@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-Regular.subset.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
.boardTable.boardTableInstructorFeedCompact td { padding-block: var(--space-xs); font-family: 'Pretendard', var(--font-body); }
/* 메인 목록에서만 제목을 한 줄로 줄이고 원문 링크를 보존한다. */
.boardTableInstructorFeedCompact .boardTableTitle a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boardTableInstructorFeedCompact td:last-child { width: calc(var(--space-xxl) * 3); }
.boardTable .boardTableTitle { text-align: left; }
.boardTableTitle a:hover, .boardTableTitle a:focus-visible { text-decoration: underline; }
.boardBottom { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); }
.boardBottom .boardSearch { width: min(100%, 360px); margin: 0; flex-direction: row; align-items: center; }
.boardCategoryFilter select { min-width: 0; max-width: 100%; height: 40px; padding: 10px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--canvas); color: var(--ink); }
/* 모바일에서 검색 폼의 전체 폭 확장을 분류 선택에만 해제한다. */
@media (max-width: 767px) {
  .boardCategoryFilter { align-items: flex-start; }
  .boardCategoryFilter select { max-width: min(100%, calc(var(--space-xxl) * 4)); }
}
.boardSearch label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.boardBottom .boardMeta { text-align: center; }
@media (max-width: 767px) {
  .boardTable th:first-child { width: 44px; }
  .boardTable th:nth-child(3) { width: 64px; }
  .boardTable th:nth-child(4) { width: 84px; }
  .boardTable th:last-child { width: 48px; }
  .boardTable.boardTableInstructorFeed th:last-child,
  .boardTableInstructorFeedCompact td:last-child { width: calc(var(--space-xxl) * 2); }
  .boardTable th, .boardTable td { font-size: 13px; padding: var(--space-sm) var(--space-xxs); }
}

/* 상세 제목과 목록 복귀 버튼은 구분선 위에 나란히 배치한다. */
.boardPost { overflow-wrap: anywhere; }
.boardPostHeader { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: var(--space-md) 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hairline); }
.boardPostHeader h2 { margin: 0 0 var(--space-xs); font: 600 15px/1.3 var(--font-body); }
.boardPostHeader .buttonSecondary { flex-shrink: 0; }
.boardPostActions { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--hairline); }

/* 모바일에서는 제목에 전체 폭을 주고 목록 버튼과 하단 동작을 다음 줄에 배치할 수 있게 한다. */
@media (max-width: 767px) {
  .boardPostHeader { flex-direction: column; align-items: stretch; gap: var(--space-sm); }
  .boardPostHeader .buttonSecondary { align-self: flex-end; }
  .boardPostActions { flex-wrap: wrap; }
}

/* DESIGN.md 압축뉴스 4열 규칙: 작성자 없이 메타데이터 열만 조금 넓힌다. */
.boardTableNews th:first-child { width: calc(var(--space-lg) * 4); }
.boardTableNews th:nth-child(3) { width: calc(var(--space-lg) * 6); }
.boardTableNews th:last-child { width: calc(var(--space-lg) * 4); }
@media (max-width: 767px) {
  .boardTableNews th:first-child { width: var(--space-xxl); }
  .boardTableNews th:nth-child(3) { width: calc(var(--space-xxl) * 2); }
  .boardTableNews th:last-child { width: calc(var(--space-xxl) + var(--space-xs)); }
}

/* 시각 편집기와 첨부 미리보기는 기존 게시판 입력·본문 토큰을 사용한다. */
.boardEditorHost { position: relative; min-width: 0; }
.boardEditorHost:not(.boardEditorReady) iframe { position: absolute; inset-inline: 0; visibility: hidden; }
.boardEditorHost iframe { display: block; max-width: 100%; border: 0; }
.boardImagePreview { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.boardImagePreview figure { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.boardImagePreview canvas { display: block; max-width: 100%; height: auto; }

/* 모바일 작성 화면만 상단 저장과 하단 도구 막대를 사용한다. */
.boardEditorNavigation { display: contents; }
.boardMobileEditorHeader, .boardMobileEditorDock, .boardMobileFiles { display: none; }
#board-title::placeholder { color: transparent; }

@media (max-width: 767px) {
  .boardEditorNavigation { display: none; }
  #board-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 0;
    padding: 0;
  }
  #board-form > * { grid-column: 1 / -1; }
  #board-form:has(> #news-category) > :is(label[for="editor-board"], #editor-board) { grid-column: 1; }
  #board-form > :is(label[for="news-category"], #news-category) { grid-column: 2; }
  #board-form > :is(label[for="editor-board"], label[for="news-category"]) { grid-row: 2; }
  #board-form > :is(#editor-board, #news-category) {
    grid-row: 3;
    min-width: 0;
    min-height: 40px;
    border: 1px solid var(--hairline);
    border-radius: 0;
    background: var(--canvas);
    color: var(--ink);
  }
  #board-title::placeholder { color: var(--muted); }
  #board-form > :is(label[for="editor-board"], #editor-board, label[for="news-category"], #news-category) {
    order: -2;
  }
  #board-form > :is(label[for="board-title"], #board-title) { order: -1; }
  #board-form > #board-title {
    padding-inline: 0;
    border: 0;
    border-bottom: 1px solid var(--hairline);
  }
  #board-form .boardMobileEditorHeader {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    order: -3;
    grid-row: 1;
    align-items: center;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--hairline);
  }
  .boardMobileEditorHeader a {
    justify-self: start;
    display: grid;
    place-items: center;
    min-width: 40px;
    min-height: 40px;
    color: var(--ink);
  }
  .boardMobileEditorHeader button { justify-self: end; }
  #board-form .boardEditorActions > button[type="submit"] { display: none; }
  #board-form.boardMobileEditorReady .boardMobileEditorDock {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: var(--space-xs) 0;
    border-top: 1px solid var(--hairline);
    background: var(--canvas);
  }
  .boardMobileEditorDock button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: var(--space-xxs);
    min-height: 40px;
    padding: 0;
    border: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 500 13px/1.4 var(--font-body);
  }
  .boardMobileEditorDock button[aria-expanded="true"] { background: var(--surface-soft); }
  .boardMobileEditorDock button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
  .boardMobileEditorDock svg {
    width: var(--space-lg);
    height: var(--space-lg);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
  }
  #board-form.boardMobileEditorReady > label:is([for="board-images"], [for="board-files"]):not([data-existing-attachments]),
  #board-form.boardMobileEditorReady > .boardEditorAttachmentHelp:not([data-existing-attachments]) { display: none; }
  #board-form.boardMobileEditorReady > input[type="file"]:not(:focus) {
    position: absolute;
    width: 1px;
    min-height: 0;
    height: 1px;
    padding: 0;
    clip-path: inset(50%);
  }
  .boardMobileFiles { display: block; overflow-wrap: anywhere; }
}
