/* ==========================================================================
   게시글 본문(관리자 편집기로 쓴 HTML) 기본 스타일
   - 아임웹 게시판 본문(Froala 편집기 .fr-view)과 같은 모양이 나도록 맞춘 값입니다.
   - 모든 규칙이 .post-content 안에서만 적용되므로 사이트 다른 곳에는 영향이 없습니다.
   - 공개 게시글 화면(pages/post.html)과 관리자 편집기(admin/post_form.html)가
     이 파일 하나를 같이 씁니다 → 편집기 미리보기 = 실제 사이트 모양
   - 본문 안에 직접 넣은 style(글자색·크기·배경색 등)이 있으면 그쪽이 우선합니다.
   ========================================================================== */

.post-content {
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #222;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: auto;           /* 화면보다 넓은 표는 본문 안에서 옆으로 밀어 보기 */
}

/* 본문 너비 — 아임웹 게시판 본문과 같은 870px, 가운데 정렬 (예전 텍스트 글은 기존 너비 그대로) */
.post-content:not(.post-content--text) { max-width: 870px; margin-inline: auto; }

.post-content *,
.post-content *::before,
.post-content *::after { box-sizing: border-box; }

/* ---------- 문단 · 제목 ---------- */
/* 아임웹처럼 문단 사이 여백 없음 — 간격은 빈 줄(<p><br></p>)로 띄웁니다 */
.post-content p,
.post-content p + p { margin: 0; padding: 0; }
.post-content div { margin: 0; }

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 { margin: 20px 0 10px; font-weight: 700; line-height: 1.4; color: inherit; }
.post-content h2 { font-size: 26px; }
.post-content h3 { font-size: 22px; }
.post-content h4 { font-size: 18px; }
.post-content h5 { font-size: 16px; }
.post-content h6 { font-size: 14px; }

.post-content strong,
.post-content b { font-weight: 700; }
.post-content em,
.post-content i { font-style: italic; }
.post-content u { text-decoration: underline; }
.post-content s,
.post-content strike { text-decoration: line-through; }
.post-content small { font-size: 85%; }
.post-content sub,
.post-content sup { font-size: 75%; line-height: 0; }
.post-content mark { padding: 0 2px; background: #fff3a8; }

.post-content blockquote {
  margin: 10px 0;
  padding: 2px 0 2px 14px;
  color: #555;
  border-left: 3px solid #ddd;
}
.post-content pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 14px;
  white-space: pre-wrap;
  background: #f5f5f5;
  border-radius: 4px;
}

/* ---------- 링크 ---------- */
.post-content a { color: #0086cd; text-decoration: none; }
.post-content a:hover { text-decoration: underline; }

/* 아임웹 '더보기' 같은 버튼 모양 링크 (class="btn") */
.post-content a.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 12px;
  line-height: 1.42857;
  letter-spacing: 1px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  color: #fff;
  background: #0086cd;
  border: 1px solid #0086cd;
  border-radius: 2px;
}
/* 아임웹 테마처럼 버튼 안 글자는 흰색으로 */
.post-content a.btn,
.post-content a.btn * { color: #fff !important; }
.post-content a.btn:hover { text-decoration: none; opacity: .88; }

/* ---------- 목록 ---------- */
.post-content ul,
.post-content ol { margin: 0 0 10px; padding: 0 0 0 40px; }
.post-content ul { list-style: disc outside; }
.post-content ol { list-style: decimal outside; }
.post-content ul ul { list-style-type: circle; }
.post-content ul ul ul { list-style-type: square; }
.post-content li { display: list-item; margin: 0; padding: 0; }
.post-content li::before { content: none; }
.post-content li > ul,
.post-content li > ol { margin-bottom: 0; }

/* ---------- 구분선 ---------- */
.post-content hr {
  display: block;
  height: 0;
  margin: 20px 0;
  border: 0;
  border-top: 1px solid #ddd;
}

/* ---------- 이미지 ---------- */
.post-content img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  margin: 0;
  vertical-align: middle;
}
/* Froala(아임웹) 이미지 배치 class */
.post-content img.fr-dii { margin: 5px 0; }
.post-content img.fr-dib { display: block; margin: 10px auto; vertical-align: top; }
.post-content img.fr-dib.fr-fil { margin-left: 0; }
.post-content img.fr-dib.fr-fir { margin-right: 0; }
.post-content img.fr-dii.fr-fil { float: left; margin: 5px 10px 5px 0; max-width: calc(100% - 10px); }
.post-content img.fr-dii.fr-fir { float: right; margin: 5px 0 5px 10px; max-width: calc(100% - 10px); }
.post-content::after { content: ""; display: table; clear: both; }

/* ---------- 표 ---------- */
.post-content table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
  empty-cells: show;
}
.post-content th,
.post-content td {
  text-align: inherit;
  vertical-align: top;
}
/* 아임웹 class="table" 표는 아래 여백이 있고, 칸 안 줄간격이 조금 좁습니다 */
.post-content table.table { margin-bottom: 20px; }
.post-content table.table > * > tr > th,
.post-content table.table > * > tr > td { line-height: 1.42857; }
/* 칸 여백·테두리 기본값 — 예전 방식 cellpadding / border 속성을 쓴 표는 그 값을 그대로 따릅니다 */
.post-content table:not([cellpadding]) > * > tr > th,
.post-content table:not([cellpadding]) > * > tr > td { padding: 8px; }
.post-content table:not([border]) > * > tr > th,
.post-content table:not([border]) > * > tr > td { border: 1px solid #ddd; }
.post-content th { font-weight: 700; background: #f5f5f5; }
/* 아임웹 '테두리 없는 표' */
.post-content table.noBorder > * > tr > th,
.post-content table.noBorder > * > tr > td { border: 0; }
.post-content .table-responsive { width: 100%; overflow-x: auto; }

/* ---------- 편집기 정렬 버튼(class) ---------- */
.post-content .align-center { text-align: center; }
.post-content .align-right { text-align: right; }
.post-content .align-left { text-align: left; }

/* ---------- 예전 일반 텍스트 글: 한 줄 = 한 문단, 문단 사이를 띄움 (기존 화면과 같게) ---------- */
.post-content--text p + p { margin-top: 1.2em; }

/* ---------- 휴대폰 ---------- */
@media (max-width: 767px) {
  .post-content ul,
  .post-content ol { padding-left: 24px; }
}
