/*
 * 게시판 본문(에디터 산출물) 공통 타이포그래피
 *
 * 이 파일은 두 곳에서 함께 쓰인다.
 *  1) 게시물 상세 화면의 .board-content
 *  2) SunEditor 편집 영역 (sun-editor-editable)
 * 두 곳이 같은 규칙을 쓰기 때문에 "쓸 때 보이는 모습 = 올라간 모습" 이 된다.
 */

.board-content,
.sun-editor-editable {
    font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    font-size: 17px;
    line-height: 1.85;
    color: #2b2f36;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.board-content { min-height: 80px; }

/* 본문 리듬 ------------------------------------------------------- */
.board-content p,
.sun-editor-editable p {
    margin: 0 0 1.05em;
    line-height: 1.85;
}

.board-content p:last-child,
.sun-editor-editable p:last-child { margin-bottom: 0; }

/* 에디터에서 엔터 한 번(빈 줄)로 만든 여백이 사라지지 않도록 */
.board-content p:empty::after,
.sun-editor-editable p:empty::after {
    content: '';
    display: inline-block;
}

.board-content h1, .sun-editor-editable h1 { font-size: 1.75em; }
.board-content h2, .sun-editor-editable h2 { font-size: 1.45em; }
.board-content h3, .sun-editor-editable h3 { font-size: 1.25em; }
.board-content h4, .sun-editor-editable h4 { font-size: 1.1em; }
.board-content h5, .sun-editor-editable h5 { font-size: 1em; }
.board-content h6, .sun-editor-editable h6 { font-size: 0.95em; }

.board-content h1, .board-content h2, .board-content h3,
.board-content h4, .board-content h5, .board-content h6,
.sun-editor-editable h1, .sun-editor-editable h2, .sun-editor-editable h3,
.sun-editor-editable h4, .sun-editor-editable h5, .sun-editor-editable h6 {
    margin: 1.8em 0 0.7em;
    font-weight: 700;
    line-height: 1.45;
    color: #16191f;
}

.board-content > :first-child,
.sun-editor-editable > :first-child { margin-top: 0; }

.board-content strong, .sun-editor-editable strong { font-weight: 700; }
.board-content em, .sun-editor-editable em { font-style: italic; }
.board-content u, .sun-editor-editable u { text-underline-offset: 3px; }

.board-content a, .sun-editor-editable a {
    color: #1a56db;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.board-content a:hover { color: #123f9e; }

/* 목록 ------------------------------------------------------------ */
.board-content ul, .board-content ol,
.sun-editor-editable ul, .sun-editor-editable ol {
    margin: 0 0 1.05em;
    padding-left: 1.6em;
}
.board-content ul, .sun-editor-editable ul { list-style: disc; }
.board-content ol, .sun-editor-editable ol { list-style: decimal; }
.board-content li, .sun-editor-editable li { margin: 0.3em 0; line-height: 1.8; }
.board-content li > ul, .board-content li > ol { margin-bottom: 0; }

/* 인용 / 구분선 ---------------------------------------------------- */
.board-content blockquote, .sun-editor-editable blockquote {
    margin: 1.6em 0;
    padding: 0.2em 0 0.2em 1.2em;
    border-left: 4px solid #e2e6ec;
    color: #596170;
}

.board-content hr, .sun-editor-editable hr {
    margin: 2.4em 0;
    border: 0;
    border-top: 1px solid #e6e9ee;
}

/* 이미지 / 영상 ---------------------------------------------------- */
.board-content img, .sun-editor-editable img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.board-content figure { margin: 1.8em 0; }

/* SunEditor 가 이미지·영상을 감싸는 figure/컨테이너에 style="width:618px" 같은 고정 폭을 넣는다.
   안쪽 img 의 max-width:100% 는 이 figure 기준이라, figure 자체를 화면 폭 안에 가둬야 넘치지 않는다. */
.board-content figure,
.board-content .se-component,
.board-content .se-image-container,
.board-content .se-video-container {
    max-width: 100% !important;
    box-sizing: border-box;
}
.board-content img { max-width: 100% !important; }
.board-content figure figcaption {
    margin-top: 0.6em;
    font-size: 0.85em;
    color: #79818f;
    text-align: center;
}

.board-content iframe,
.board-content video {
    max-width: 100%;
    border-radius: 10px;
}

/* 표 --------------------------------------------------------------- */
.board-content .board-table-scroll {
    overflow-x: auto;
    margin: 1.8em 0;
    -webkit-overflow-scrolling: touch;
}

.board-content table, .sun-editor-editable table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    background: #fff;
}

.board-content table th, .board-content table td,
.sun-editor-editable table th, .sun-editor-editable table td {
    border: 1px solid #e2e6ec;
    padding: 10px 14px;
    vertical-align: middle;
}

.board-content table th, .sun-editor-editable table th {
    background: #f7f8fa;
    font-weight: 600;
    color: #2b2f36;
}

.board-content pre, .sun-editor-editable pre {
    margin: 1.6em 0;
    padding: 16px 18px;
    background: #f5f6f8;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.9em;
    line-height: 1.7;
}

/* 모바일 ----------------------------------------------------------- */
@media all and (max-width: 767px) {
    .board-content, .sun-editor-editable { font-size: 16px; line-height: 1.8; }
    .board-content img, .sun-editor-editable img { height: auto !important; border-radius: 8px; }
    .board-content table { font-size: 0.9em; }
    .board-content table th, .board-content table td { padding: 8px 10px; }
}

/* -----------------------------------------------------------------
 * 첨부파일 영역
 * ----------------------------------------------------------------- */
.board-attach {
    margin-top: 40px;
    border: 1px solid #e6e9ee;
    border-radius: 12px;
    background: #fbfcfd;
    overflow: hidden;
}

.board-attach__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #3c434f;
    border-bottom: 1px solid #eceff3;
    background: #f6f8fa;
}

.board-attach__list { margin: 0; padding: 6px 0; list-style: none; }

.board-attach__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
}

.board-attach__icon {
    flex: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eaeef3;
    color: #5a6270;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}
.board-attach__icon--pdf { background: #fdecec; color: #c0392b; }
.board-attach__icon--doc { background: #e8f0fd; color: #1a56db; }
.board-attach__icon--xls { background: #e8f7ee; color: #1a7f45; }
.board-attach__icon--img { background: #f3ecfd; color: #6b32c9; }

.board-attach__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    color: #2b2f36;
    text-decoration: none;
    word-break: break-all;
}
.board-attach__name:hover { text-decoration: underline; }
.board-attach__size { flex: none; font-size: 13px; color: #8b93a1; }

.board-attach__btn {
    flex: none;
    padding: 5px 12px;
    font-size: 13px;
    border: 1px solid #d8dee6;
    border-radius: 7px;
    background: #fff;
    color: #4a5261;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.board-attach__btn:hover { background: #f1f4f8; border-color: #c3ccd8; }

.board-attach__preview {
    padding: 0 18px 18px;
}
.board-attach__preview iframe {
    width: 100%;
    height: 76vh;
    min-height: 420px;
    border: 1px solid #e2e6ec;
    border-radius: 10px;
    background: #fff;
}

@media all and (max-width: 640px) {
    .board-attach__item { flex-wrap: wrap; }
    .board-attach__name { flex: 1 1 100%; order: 2; }
    .board-attach__preview iframe { height: 60vh; min-height: 320px; }
}
