/**
 * content-embeds.css — 게시글 본문 임베드(유튜브·이미지 슬라이더) 공통 스타일
 *
 * 콘솔 게시물 미리보기와 퍼블릭 프론트가 **함께 로드**한다(단일 소스). 렌더 결과가
 * 두 곳에서 완전히 동일해야 하므로, 스타일/동작을 바꿀 땐 이 파일 + content-embeds.js만
 * 고치면 된다. (에디터 편집 화면의 노드뷰 스타일은 별개 — resources/css/editor.css)
 */

/* ── 본문 타이포그래피 계약(.of-post-body) ──────────────────────────
   of_post_content 예약어가 이 래퍼로 감싸 출력한다(SkinComponents — 모든 스킨 공통).
   값은 에디터(.tiptap-content .ProseMirror, editor.css)·콘솔 미리보기(.preview-content,
   console.css)와 동일 — 세 화면의 본문 렌더가 같아야 하므로 한쪽만 바꾸지 말 것.
   퍼블릭 셸 전역 리셋(margin/padding 0)이 지운 기본기를 여기서 복원한다.
   스킨이 다른 모양을 원하면 자체 CSS로 override 가능. */
.of-post-body { font-size: 14px; line-height: 1.8; word-break: break-word; }
.of-post-body > * + * { margin-top: 0.6em; }
.of-post-body h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 1.2em; margin-bottom: 0.4em; }
.of-post-body h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-top: 1.1em; margin-bottom: 0.4em; }
.of-post-body h3 { font-size: 16px; font-weight: 700; margin-top: 1em; margin-bottom: 0.4em; }
.of-post-body ul,
.of-post-body ol { padding-left: 1.6em; }
.of-post-body ul { list-style-type: disc; }
.of-post-body ol { list-style-type: decimal; }
.of-post-body li { margin-bottom: 0.2em; }
.of-post-body blockquote { border-left: 3px solid var(--ink-300, #c2c9d6); padding-left: 1em; color: var(--ink-500, #6b7280); }
.of-post-body code { background: var(--ink-50, #f4f6f9); border: 1px solid var(--ink-100, #e8ecf1); border-radius: 3px; padding: 0.1em 0.35em; font-family: var(--font-mono, monospace); font-size: 0.88em; }
.of-post-body pre { background: #0f1626; color: #f4f6f9; border-radius: 6px; padding: 14px 18px; font-family: var(--font-mono, monospace); font-size: 13px; overflow-x: auto; }
.of-post-body pre code { background: none; border: none; padding: 0; font-size: inherit; }
.of-post-body hr { border: none; border-top: 1px solid var(--ink-200, #d8dde5); margin: 1.5em 0; }
.of-post-body img { max-width: 100%; height: auto; border-radius: 4px; display: block; margin: 8px 0; }
.of-post-body table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 16px 0; }
.of-post-body table p { margin: 0; }
.of-post-body table td,
.of-post-body table th { border: 1px solid var(--ink-200, #d8dde5); padding: 8px 10px; vertical-align: top; }
.of-post-body table th { background: var(--ink-50, #f4f6f9); font-weight: 600; text-align: left; }

/* ── YouTube 임베드 ─────────────────────────────────────────────
   저장 마크업: <div data-youtube-video><div class="yt-embed-wrap"><iframe></iframe></div></div>
   JS 불필요 — CSS만으로 16:9 반응형. (프론트가 이 CSS를 안 실으면 iframe이 raw 640x480로 나옴) */
div[data-youtube-video] {
  display: block;
  max-width: 100%;
}
.yt-embed-wrap {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  margin: 12px 0;
}
.yt-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── 이미지 슬라이더 — content-embeds.js가 [data-image-slider]를 cs-* 구조로 승격 ── */
.content-slider {
  position: relative;
  margin: 16px 0;
  border-radius: 8px;
}
.cs-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
}
.cs-track {
  display: flex;
  transition: transform 0.35s ease;
}
.cs-slide {
  flex-shrink: 0;
  width: 100%;
}
.cs-slide img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  display: block;
  background: #111;
}
.cs-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
  padding: 0;
}
.cs-btn:hover { background: rgba(0, 0, 0, 0.72); }
.cs-prev { left: 10px; }
.cs-next { right: 10px; }
.cs-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.cs-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}
.cs-dot.active {
  background: #fff;
  transform: scale(1.25);
}
.cs-counter {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 2px 8px;
  z-index: 10;
}
.cs-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 2px 2px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-200, #e5e7eb) transparent;
}
.cs-thumbs::-webkit-scrollbar { height: 4px; }
.cs-thumbs::-webkit-scrollbar-track { background: transparent; }
.cs-thumbs::-webkit-scrollbar-thumb { background: var(--ink-200, #e5e7eb); border-radius: 2px; }
.cs-thumb {
  flex-shrink: 0;
  width: 58px; height: 58px;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, opacity 0.15s;
  opacity: 0.5;
}
.cs-thumb:hover { opacity: 0.8; }
.cs-thumb.active {
  border-color: var(--navy-600, #2563eb);
  opacity: 1;
}
.cs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
