@charset "utf-8";

/* ========================================================
   유경한의원 (YK2026) Medical Board Skin Styles
   - 게시판 목록 (list.skin.php)
   - 게시물 보기 (view.skin.php) + 자동 목차(TOC) & H2 카운터
   - 게시물 작성/수정 (write.skin.php)
======================================================== */

/* 본문 카운터 및 소제목 서식 자동화 */
#bo_v_con {
  counter-reset: article-section;
  color: rgb(55 65 63 / 74%);
  font-family: var(--serif, "Cinzel", "Batang", serif);
  font-size: 17px;
  line-height: 2.15;
  word-break: keep-all;
}

#bo_v_con p {
  margin: 0 0 24px;
}

#bo_v_con h2 {
  counter-increment: article-section;
  margin: 80px 0 35px;
  padding-top: 20px;
  color: var(--black, #222220);
  font-family: var(--serif, "Cinzel", "Batang", serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.035em;
  scroll-margin-top: 120px;
}

#bo_v_con h2::before {
  display: block;
  margin-bottom: 20px;
  color: #b8a33c;
  font-family: var(--serif, "Cinzel", "Batang", serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  content: counter(article-section, decimal-leading-zero);
}

#bo_v_con h3 {
  margin: 45px 0 18px;
  color: var(--black, #222220);
  font-family: var(--serif, "Cinzel", "Batang", serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.6;
}

#bo_v_con blockquote {
  position: relative;
  margin: 80px 0 40px;
  padding: 60px 45px;
  overflow: hidden;
  background: var(--ivory, #f7f4ee);
  text-align: center;
}

#bo_v_con blockquote::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 380px;
  height: 380px;
  border: 1px solid rgb(107 90 73 / 12%);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

#bo_v_con blockquote p {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--serif, "Cinzel", "Batang", serif);
  font-size: 24px;
  line-height: 1.8;
  color: var(--charcoal, #2d3330);
}

#bo_v_con img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 25px 0;
}

/* 좌측 목차 (CONTENTS) 자동 링크 서식 */
.view-aside .toc-links a {
  display: block;
  padding: 9px 0;
  color: rgb(55 65 63 / 58%);
  font-size: 11px;
  line-height: 1.6;
  text-decoration: none;
  transition: color 200ms ease, transform 200ms ease;
  word-break: keep-all;
}

.view-aside .toc-links a:hover,
.view-aside .toc-links a.active {
  color: var(--brown, #8c6d48);
  transform: translateX(4px);
  font-weight: 500;
}

/* 뷰 상단 관리자 제어 버튼 */
.view-admin-ctrls {
  display: inline-flex;
  gap: 8px;
  margin-left: 14px;
}

.view-admin-ctrls a {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgb(55 65 63 / 25%);
  border-radius: 3px;
  color: rgb(55 65 63 / 70%);
  font-size: 10px;
  text-decoration: none;
  transition: all 180ms ease;
}

.view-admin-ctrls a:hover {
  background: var(--charcoal, #2d3330);
  color: #fff;
  border-color: var(--charcoal, #2d3330);
}

/* 뷰 상단 커버 이미지 */
.view-cover-img {
  position: relative;
  width: min(86vw, 1240px);
  height: 520px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--charcoal, #2d3330);
}

.view-cover-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.view-cover-img .view-cover-badge {
  position: absolute;
  left: 60px;
  bottom: 60px;
  z-index: 2;
  color: #fff;
}

.view-cover-img .view-cover-badge strong {
  display: block;
  font-family: var(--serif, "Cinzel", "Batang", serif);
  font-size: clamp(32px, 3.8vw, 54px);
  font-weight: 500;
  line-height: 1.35;
}

.view-cover-img .view-cover-badge small {
  display: block;
  margin-top: 10px;
  color: rgb(255 255 255 / 65%);
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* 썸네일 커버 이미지 지원 */
.medical-thumbnail img.thumb-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.medical-thumbnail.has-img::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 2;
}

.medical-thumbnail.has-img strong,
.medical-thumbnail.has-img small {
  color: #fff;
  position: relative;
  z-index: 3;
}

/* 웹 접근성 스크린리더 전용 텍스트 숨김 */
.sound_only {
  display: inline-block !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* 피그마 규격 페이지네이션 */
.medical-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.medical-pagination .pg_inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.medical-pagination a,
.medical-pagination strong,
.medical-pagination span.pg_arrow {
  display: inline-flex;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  font-family: var(--serif, "Cinzel", "Noto Serif KR", serif);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  color: rgb(55 65 63 / 55%);
  box-sizing: border-box;
  transition: all 0.2s ease;
  user-select: none;
}

.medical-pagination strong.pg_current {
  background: var(--charcoal, #2d3330) !important;
  color: #fff !important;
  font-weight: 500;
  cursor: default;
}

.medical-pagination a.pg_page:hover {
  background: rgb(55 65 63 / 6%);
  color: var(--charcoal, #2d3330);
}

.medical-pagination .pg_arrow svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.3;
  fill: none;
  display: block;
}

.medical-pagination a.pg_arrow {
  color: rgb(55 65 63 / 40%);
}

.medical-pagination a.pg_arrow:hover {
  color: var(--charcoal, #2d3330);
  background: rgb(55 65 63 / 6%);
}

.medical-pagination .pg_arrow.is-disabled {
  color: rgb(55 65 63 / 20%) !important;
  background: transparent !important;
  cursor: default !important;
  pointer-events: none !important;
}


/* 에디터 래퍼 스타일 */
.medical-write-page .write-editor-wrap {
  grid-column: 2;
}

.medical-write-page .write-editor-wrap textarea#wr_content {
  width: 100%;
  min-height: 520px;
  padding: 20px;
  border: 1px solid rgb(55 65 63 / 22%);
  font-family: var(--sans, sans-serif);
  font-size: 15px;
  line-height: 1.8;
  box-sizing: border-box;
}

/* CKEditor 커스텀 컨테이너 */
.medical-write-page .cke {
  border: 1px solid rgb(55 65 63 / 22%) !important;
}

.medical-write-page .cke_top {
  background: #f7f5ef !important;
  border-bottom: 1px solid rgb(55 65 63 / 16%) !important;
}

.medical-write-page .cke_bottom {
  background: #f7f5ef !important;
  border-top: 1px solid rgb(55 65 63 / 16%) !important;
}

/* 글쓰기 버튼 호버 */
.write-actions a.btn_cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: rgb(55 65 63 / 80%);
  background: transparent;
  transition: all 180ms ease;
}

.write-actions a.btn_cancel:hover {
  border-color: var(--charcoal, #2d3330);
  color: var(--charcoal, #2d3330);
}

.write-actions button.btn_preview {
  background: transparent;
  color: rgb(55 65 63 / 80%);
  cursor: pointer;
  transition: all 180ms ease;
}

.write-actions button.btn_preview:hover {
  border-color: var(--charcoal, #2d3330);
  color: var(--charcoal, #2d3330);
}

.write-actions button.btn_submit {
  background: var(--charcoal, #2d3330);
  color: #fff;
  border-color: var(--charcoal, #2d3330);
  cursor: pointer;
  transition: all 180ms ease;
}

.write-actions button.btn_submit:hover {
  background: #1e2321;
}

/* 반응형 */
@media (max-width: 991px) {
  .view-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 60px 24px;
  }

  .view-aside {
    position: static;
    border-top: 1px solid var(--charcoal, #2d3330);
    padding-top: 15px;
  }

  .write-section {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .write-editor-wrap,
  .toc-guide {
    grid-column: 1;
  }
}
