@charset "UTF-8";
/* ============================================================
   note.css — 강의노트 게시판 (목록 · 비밀번호 확인 · 상세 · 글쓰기)
   기준 시안 : reference/designPage/SONGPRO Sub Note.dc.html
   사이드내비(.side-nav)와 버튼·폼은 common.css 를 사용한다.
   ============================================================ */

/* ------------------------------------------------------------
   1. 본문 레이아웃
   ------------------------------------------------------------ */
.note-main {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
    padding-block: 64px;
}

.note-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* 상세·글쓰기는 블록 사이 간격을 더 벌린다 */
.note-body--wide {
    gap: 40px;
}

/* 안내 문구 — 처리 결과를 한 번만 보여준다 */
.note-flash {
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    line-height: 19.5px;
    text-wrap: pretty;
}

.note-flash--error {
    background: var(--c-danger-bg);
    color: var(--c-danger);
}

.note-flash--info {
    background: var(--c-brand-subtle);
    color: var(--c-brand);
}

/* 게시판 공통 버튼 크기 — .btn 계열과 함께 쓴다 */
.note-btn {
    height: 44px;
    padding: 0 24px;
    border-radius: var(--r-md);
    font-size: 15px;
    line-height: 22.5px;
    font-weight: 700;
}

/* ------------------------------------------------------------
   2. 목록 — 머리말 · 검색
   ------------------------------------------------------------ */
.note-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.note-head__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-head__title {
    font-size: 32px;
    line-height: 48px;
    font-weight: 700;
    color: var(--c-text);
}

.note-head__lead {
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text-sub);
}

.note-head__count {
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text-sub);
}

.note-head__count strong {
    font-weight: 700;
    color: var(--c-brand);
}

.note-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* 검색 줄에 놓이는 글쓰기 버튼 — 검색창 높이에 맞추고 나머지 항목은 오른쪽으로 민다 */
.note-btn--tools {
    height: 40px;
    margin-right: auto;
    padding: 0 20px;
}

.note-search {
    display: flex;
    align-items: center;
    height: 40px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background: var(--c-bg);
    overflow: hidden;
}

.note-search__input {
    width: 200px;
    height: 100%;
    padding: 0 12px;
    border: 0;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text);
}

.note-search__submit {
    width: 44px;
    height: 100%;
    border: 0;
    border-left: 1px solid var(--c-border);
    background: var(--c-bg-alt);
    color: var(--c-text-sub);
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: color var(--t-dur) var(--t-ease);
}

.note-search__submit:hover {
    color: var(--c-text);
}

.note-search__reset {
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-sub);
}

/* ------------------------------------------------------------
   3. 목록 — 표
   ------------------------------------------------------------ */
.note-table {
    border-top: 2px solid var(--c-text);
}

.note-row {
    display: grid;
    grid-template-columns: 72px 1fr 80px;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--c-border);
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text);
    transition: background var(--t-dur) var(--t-ease);
}

.note-row--head {
    padding: 14px 16px;
    background: var(--c-bg-alt);
    font-weight: 700;
}

/* 조회 수를 감춘 목록 — 번호와 제목만 남는다 */
.note-table--no-views .note-row {
    grid-template-columns: 72px 1fr;
}

a.note-row:hover {
    background: var(--c-bg-alt);
    color: var(--c-text);
    text-decoration: none;
}

.note-row__no {
    color: var(--c-text-faint);
}

.note-row--notice .note-row__no {
    font-weight: 700;
    color: var(--c-brand);
}

.note-row__title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.note-row__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 댓글 수 — 상세 화면의 댓글 수와 같은 색을 쓴다 */
.note-row__comments {
    flex: none;
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 400;
    color: var(--c-brand);
}

.note-row__lock {
    flex: none;
    display: inline-flex;
    color: var(--c-warning);
}

.note-row__views {
    color: var(--c-text-faint);
    font-weight: 300;
    text-align: right;
}

/* 머리행의 `조회` 글자는 다른 항목과 같은 굵기를 유지한다 */
.note-row--head .note-row__views {
    color: var(--c-text);
    font-weight: 700;
}

.note-empty {
    padding: 40px 16px;
    border-bottom: 1px solid var(--c-border);
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text-sub);
    text-align: center;
}

.note-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
}

/* ------------------------------------------------------------
   4. 페이지 번호
   ------------------------------------------------------------ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding-top: 8px;
}

.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background: var(--c-bg);
    color: var(--c-text-sub);
    font-size: 15px;
    line-height: 22.5px;
    transition: background var(--t-dur) var(--t-ease), color var(--t-dur) var(--t-ease);
}

.pagination__item:hover {
    background: var(--c-bg-alt);
    color: var(--c-text);
    text-decoration: none;
}

.pagination__item.is-current,
.pagination__item.is-current:hover {
    border-color: var(--c-brand);
    background: var(--c-brand);
    color: var(--c-text-invert);
    font-weight: 700;
}

/* ------------------------------------------------------------
   5. 비밀번호 확인
   ------------------------------------------------------------ */
.gate {
    display: flex;
    justify-content: center;
    padding: 40px 0 64px;
}

.gate__form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 520px;
    padding: 40px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg);
}

.gate__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.gate__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--r-full);
    background: var(--c-brand-subtle);
    color: var(--c-brand);
}

.gate__title {
    font-size: 24px;
    line-height: 36px;
    font-weight: 700;
    color: var(--c-text);
}

.gate__intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.gate__post {
    width: 100%;
    padding: 16px 20px;
    border-left: 3px solid var(--c-brand);
    background: var(--c-bg-alt);
    font-size: 17px;
    line-height: 25.5px;
    font-weight: 700;
    color: var(--c-text);
    text-align: center;
    text-wrap: pretty;
}

.gate__desc {
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text-sub);
    text-align: center;
}

.gate__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gate__input {
    height: 48px;
    padding: 0 14px;
    letter-spacing: 0.08em;
}

.gate__input.is-error {
    border: 2px solid var(--c-danger);
}

.gate__actions {
    display: flex;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
}

.gate__btn {
    flex: 1;
    height: 48px;
    border-radius: var(--r-md);
    font-size: 17px;
    line-height: 25.5px;
    font-weight: 700;
}

/* ------------------------------------------------------------
   6. 상세 — 머리말 · 첨부 · 본문
   ------------------------------------------------------------ */
.post-head {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px 0 20px;
    border-top: 2px solid var(--c-text);
    border-bottom: 1px solid var(--c-border);
}

.post-head__title {
    font-size: 24px;
    line-height: 36px;
    font-weight: 700;
    color: var(--c-text);
    text-wrap: pretty;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-sub);
}

.post-meta strong {
    font-weight: 700;
    color: var(--c-text);
}

.post-meta__count {
    font-weight: 700;
    color: var(--c-brand);
}

.post-meta__bar {
    color: var(--c-text-invert-soft);
}

.post-files {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg-alt);
}

.post-files__label {
    font-size: 15px;
    line-height: 22.5px;
    font-weight: 700;
    color: var(--c-text);
}

.post-files__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background: var(--c-bg);
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text);
    transition: background var(--t-dur) var(--t-ease);
}

.post-file:hover {
    background: var(--c-brand-subtle);
    color: var(--c-text);
    text-decoration: none;
}

.post-file__icon {
    display: inline-flex;
    flex: none;
    color: var(--c-text-sub);
}

.post-file__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-file__meta {
    flex: none;
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-faint);
}

.post-file__action {
    flex: none;
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 700;
    color: var(--c-brand);
}

/* 본문 — 저장된 서식(문단·목록·표)을 그대로 살린다 */
.post-body {
    padding: 8px 4px 200px;
    border-bottom: 1px solid var(--c-border);
    font-size: 17px;
    line-height: 25.5px;
    color: var(--c-text);
    text-wrap: pretty;
    word-break: break-word;
}

.post-body p {
    margin: 0 0 12px;
}

.post-body p:last-child {
    margin-bottom: 0;
}

.post-body h2,
.post-body h3 {
    margin: 20px 0 10px;
    font-size: 19px;
    line-height: 28.5px;
    font-weight: 700;
}

.post-body ul,
.post-body ol {
    margin: 0 0 12px;
    padding-left: 20px;
    list-style: revert;
}

.post-body li {
    margin-bottom: 6px;
}

.post-body a {
    color: var(--c-brand);
    text-decoration: underline;
}

.post-body img {
    max-width: 100%;
    height: auto;
}

.post-body table {
    border-collapse: collapse;
    max-width: 100%;
}

.post-body td,
.post-body th {
    padding: 8px 12px;
    border: 1px solid var(--c-border);
}

/* 편집기가 넣는 요소 — 인용 · 수평선 · 이미지/표 묶음 */
.post-body blockquote {
    margin: 0 0 12px;
    padding: 8px 16px;
    border-left: 3px solid var(--c-border);
    color: var(--c-text-sub);
}

.post-body hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--c-border);
}

.post-body figure {
    max-width: 100%;
    margin: 0 0 12px;
}

.post-body figure.table {
    overflow-x: auto;
}

/* ------------------------------------------------------------
   7. 댓글
   ------------------------------------------------------------ */
.comments {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comments__head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments__title {
    font-size: 19px;
    line-height: 28.5px;
    font-weight: 700;
    color: var(--c-text);
}

.comments__count {
    font-size: 15px;
    line-height: 22.5px;
    font-weight: 700;
    color: var(--c-brand);
}

.comments__list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--c-text);
}

.comment {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 4px;
    border-bottom: 1px solid var(--c-border);
}

.comment__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.comment__author {
    font-size: 15px;
    line-height: 22.5px;
    font-weight: 700;
    color: var(--c-text);
}

.comment__badge {
    padding: 2px 8px;
    border-radius: var(--r-xs);
    background: var(--c-brand-subtle);
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 700;
    color: var(--c-brand);
}

.comment__badge--secret {
    background: var(--c-bg-alt);
    color: var(--c-danger);
}

.comment__date {
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-faint);
}

.comment__body {
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text);
    text-wrap: pretty;
    word-break: break-word;
}

.comment__body--locked {
    color: var(--c-text-faint);
}

.comment__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 2px;
}

/* 댓글의 답글·수정·삭제 줄은 본문과 조금 더 떨어뜨린다 (답글 안쪽 줄은 그대로) */
.comment > .comment__actions {
    margin-top: 20px;
}

.comment-chip {
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg);
    color: var(--c-text-sub);
    font-family: inherit;
    font-size: 13px;
    line-height: 19.5px;
    cursor: pointer;
    transition: background var(--t-dur) var(--t-ease), color var(--t-dur) var(--t-ease);
}

.comment-chip:hover {
    background: var(--c-brand-subtle);
    color: var(--c-brand);
}

.comment__replies {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.comment-reply {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-left: 2px solid var(--c-border);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--c-bg-alt);
}

.comment-reply__mark {
    flex: none;
    padding-top: 2px;
    color: var(--c-border-gray);
}

.comment-reply__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 답글 · 열람 · 수정 폼 — 해당 댓글 아래에 들여쓴다 */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    margin-left: 16px;
    padding: 16px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background: var(--c-bg);
}

.comment-form[hidden] {
    display: none;
}

.comment-form__label {
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 700;
    color: var(--c-text-sub);
}

.comment-form__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.comment-form__btn {
    height: 36px;
    padding: 0 16px;
    border-radius: var(--r-sm);
    font-size: 15px;
    line-height: 22.5px;
}

.comment-form__btn--primary {
    font-weight: 700;
}

.comment-form__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* 댓글 쓰기 상자 */
.comment-write {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg-alt);
}

.comment-write__label {
    font-size: 15px;
    line-height: 22.5px;
    font-weight: 700;
    color: var(--c-text);
}

.comment-write__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.comment-write__counter {
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-faint);
}

.comment-write__submit {
    height: 40px;
    padding: 0 20px;
    border-radius: var(--r-sm);
    font-size: 15px;
    line-height: 22.5px;
    font-weight: 700;
}

.comment-write__options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.field-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-sub);
    cursor: pointer;
}

.field-inline {
    width: 160px;
    height: 36px;
}

.field-inline[hidden] {
    display: none;
}

/* 게시물 아래 이동·관리 버튼 */
.post-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 8px;
}

.post-foot__admin {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

/* ------------------------------------------------------------
   8. 글쓰기
   ------------------------------------------------------------ */
.write-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.write-form__editor {
    min-height: 400px;
}

/* CKEditor 는 원래 입력칸을 대신하므로 편집 영역에 같은 높이를 준다 */
.write-form .ck-editor__editable {
    min-height: 400px;
}

/* 파일 첨부 — 눌러서 고르거나 끌어다 놓는다 */
.upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 36px 20px;
    border: 2px dashed var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg-alt);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-drop:hover,
.upload-drop.is-dragover {
    border-color: var(--c-brand);
    background: var(--c-brand-subtle);
}

.upload-drop__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--c-bg);
    color: var(--c-text-faint);
    transition: color 0.2s ease;
}

.upload-drop:hover .upload-drop__icon,
.upload-drop.is-dragover .upload-drop__icon {
    color: var(--c-brand);
}

.upload-drop__text {
    font-size: 15px;
    line-height: 22.5px;
    font-weight: 500;
    color: var(--c-text);
}

.upload-drop__help {
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-faint);
}

.upload-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-list:empty {
    display: none;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background: var(--c-bg);
    font-size: 15px;
    line-height: 22.5px;
    color: var(--c-text);
}

.upload-item__icon {
    display: flex;
    flex: none;
    color: var(--c-text-faint);
}

.upload-item__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item__size {
    flex: none;
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-faint);
}

.upload-item__check {
    flex: none;
}

/* 삭제를 선택한 기존 첨부는 지워질 파일임을 드러낸다 */
.upload-item--saved:has(input:checked) {
    border-color: var(--c-danger);
    background: var(--c-danger-bg);
}

.upload-item--saved:has(input:checked) .upload-item__name {
    color: var(--c-text-faint);
    text-decoration: line-through;
}

.upload-item__remove {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--c-text-faint);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.upload-item__remove:hover {
    background: var(--c-danger);
    color: var(--c-text-invert);
}

.write-hint {
    font-size: 13px;
    line-height: 19.5px;
    color: var(--c-text-faint);
    text-wrap: pretty;
}

.write-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--c-border);
}

/* ------------------------------------------------------------
   9. 반응형
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
    .note-main {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .note-main {
        padding-block: 56px;
    }

    .note-head__title {
        font-size: 24px;
        line-height: 36px;
    }

    .note-row,
    .note-table--no-views .note-row {
        grid-template-columns: 56px 1fr;
        gap: 8px 12px;
    }

    /* 좁은 화면에서는 조회 수를 제목 아래로 내린다 */
    .note-row__views {
        grid-column: 2;
        text-align: left;
        font-size: 13px;
        line-height: 19.5px;
    }

    .note-search__input {
        width: 100%;
    }

    .note-search {
        flex: 1;
    }

    .gate__form {
        padding: 28px 20px;
    }

    .post-foot__admin {
        margin-left: 0;
    }
}
