/* 게시판 편집기 · 본문 스타일.
   본문(.community-markdown)은 카지노인(casinoin.kr) wysiwyg-editor.css 를 옮기고 카지노인 색 이름을 포켓몬허브 토큰으로 이어 준 것
   (토큰이라 밝게/어둡게 테마를 그대로 따라간다). 232차: 편집기는 TOAST UI → SunEditor — 맨 아래 '.sun-editor' 칸. */
.wysiwyg-editor-host, .community-markdown {
  --brand-border: var(--border);
  --brand-border-strong: var(--border-strong);
  --brand-surface: var(--surface);
  --brand-surface-muted: var(--surface-muted);
  --brand-surface-strong: var(--surface-muted);
  --brand-bg: var(--bg);
  --brand-text-primary: var(--text);
  --brand-text-secondary: var(--text-2);
  --brand-text-muted: var(--text-3);
  --brand-accent: var(--poke-yellow);
  --brand-highlight: var(--poke-blue);
  --brand-success: var(--poke-green);
  --brand-warning: #f08c00;
  --brand-danger: var(--poke-red);
  --brand-purple: #9b59d0;
  --ui-border: var(--border);
  --ui-border-strong: var(--border-strong);
  --ui-muted: var(--surface-muted);
  --ui-muted-foreground: var(--text-3);
  --ui-foreground: var(--text);
  --ui-background: var(--bg);
  --ui-card: var(--surface);
  --ui-popover: var(--surface);
  --ui-accent: var(--surface-muted);
  --ui-primary: var(--poke-yellow);
  --ui-ring: var(--poke-yellow);
  --ui-radius: 12px;
  --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --ui-shadow-popover: 0 10px 30px -10px rgba(0, 0, 0, .25);
}
.wysiwyg-color-gray { color: var(--text-2); }
.wysiwyg-color-red { color: var(--poke-red); }
.wysiwyg-color-orange { color: #f08c00; }
.wysiwyg-color-green { color: var(--poke-green); }
.wysiwyg-color-blue { color: var(--poke-blue); }
.wysiwyg-color-purple { color: #9b59d0; }

.wysiwyg-editor-field {
  /* The field is a grid/flex item on every page that embeds this editor.
     Without an explicit min-width, its automatic minimum size defaults to
     the toolbar's min-content width, which forces the item (and the page)
     wider than the viewport on mobile instead of letting the toolbar's own
     overflow-x:auto handle it. */
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.wysiwyg-editor-host {
  --editor-border: var(--ui-border, var(--brand-border));
  --editor-surface: var(--ui-card, var(--brand-surface));
  --editor-background: var(--ui-background, var(--brand-bg));
  --editor-foreground: var(--ui-foreground, var(--brand-text-primary));
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  font-family: inherit !important;
}

.wysiwyg-editor-host button,
.wysiwyg-editor-host input,
.wysiwyg-editor-host select,
.wysiwyg-editor-host textarea { font-family: inherit !important; }

.wysiwyg-editor-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.community-markdown p,
.tip-body p { margin: 0 0 1em; line-height: 1.75; }
.community-markdown strong,
.tip-body strong { font-weight: 750; }
.community-markdown em,
.tip-body em { font-style: italic; }
.community-markdown ul,
.tip-body ul { margin: .8em 0; padding-left: 1.55em; list-style: disc outside; }
.community-markdown ol,
.tip-body ol { margin: .8em 0; padding-left: 1.55em; list-style: decimal outside; }
.community-markdown li,
.tip-body li { margin: .28em 0; line-height: 1.7; }
.community-markdown ul ul,
.tip-body ul ul { list-style-type: circle; }
.community-markdown ol ol,
.tip-body ol ol { list-style-type: lower-alpha; }
.community-markdown h1,
.tip-body h1 { margin: 1.35em 0 .55em; font-size: 2em; line-height: 1.2; letter-spacing: -.025em; }
.community-markdown h2,
.tip-body h2 { margin: 1.3em 0 .55em; font-size: 1.55em; line-height: 1.3; letter-spacing: -.018em; }
.community-markdown h3,
.tip-body h3 { margin: 1.2em 0 .5em; font-size: 1.25em; line-height: 1.38; }
.community-markdown blockquote,
.tip-body blockquote {
  margin: 1.1em 0;
  padding: 10px 16px;
  border-left: 3px solid var(--ui-border-strong, var(--brand-border-strong));
  background: var(--ui-muted, var(--brand-surface));
  color: var(--ui-muted-foreground, var(--brand-text-muted));
}
.community-markdown pre,
.tip-body pre {
  max-width: 100%;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--editor-border, var(--brand-border));
  border-radius: 6px;
  background: #111318;
  color: #edf0f5;
}
.community-markdown pre,
.tip-body pre {
  position: relative;
}
.code-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 5px;
  background: rgba(255, 255, 255, .08);
  color: #d7dbe3;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.code-copy-button:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; }
.code-copy-button:focus-visible { outline: 2px solid var(--ui-ring, var(--brand-accent)); outline-offset: 2px; }
.code-copy-button svg { width: 13px; height: 13px; flex: 0 0 auto; }
.code-copy-button.is-copied { border-color: #3ecf7f; color: #3ecf7f; }
.code-copy-button.is-error { border-color: #ef6671; color: #ef6671; }
.community-markdown code,
.tip-body code { overflow-wrap: anywhere; }
.community-markdown table,
.tip-body table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.community-markdown th,
.community-markdown td,
.tip-body th,
.tip-body td { min-width: 110px; padding: 8px 10px; border: 1px solid var(--editor-border, var(--brand-border)); }
.community-markdown th,
.tip-body th { background: var(--ui-muted, var(--brand-surface)); }
/* 본문에 넣은 사진이 첨부파일 사진과 같은 모양이 되도록 한 곳에서 정한다.
   예전에는 폭 상한만 있고 높이 상한이 없어서, 세로로 긴 사진 한 장이 화면을
   통째로 차지하고 그 아래 글이 안 보였다. 쓰는 화면(에디터)과 읽는 화면에
   같은 규칙을 걸어, 올릴 때 본 크기가 올린 뒤에도 그대로다. */
.community-markdown img,
.tip-body img {
  display: block;
  max-width: min(100%, 760px);
  max-height: 620px;
  height: auto;
  margin: 22px 0;
  /* 사진 둘레의 매트. 테두리와 배경을 같은 색으로 둬서 인화지 여백처럼
     보이게 하고, 페이지와의 분리는 색이 아니라 그림자가 만든다 - 라이트에서
     흰 종이 위 흰 매트가 성립하는 이유다. 다크에서는 같은 토큰이 어두운
     매트가 되므로 흰 테가 눈을 찌르지 않는다. */
  border: 8px solid var(--brand-bg);
  border-radius: 18px;
  background: var(--brand-bg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .2);
  object-fit: contain;
}

/* 다크에서는 같은 그림자가 배경에 묻힌다. 더 넓고 깊게 준다. */
html[data-theme="dark"] .community-markdown img,
html[data-theme="dark"] .tip-body img {
  box-shadow: 0 6px 28px rgba(0, 0, 0, .55);
}
.community-markdown hr,
.tip-body hr { margin: 2em 0; border: 0; border-top: 1px solid var(--editor-border, var(--brand-border)); }
.community-markdown .task-list-item,
.tip-body .task-list-item { list-style: none; }
.community-markdown .task-list-item input[type="checkbox"],
.tip-body .task-list-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0 7px 0 0;
  vertical-align: -2px;
}

@media (max-width: 760px) {
  .community-post-content.community-markdown {
    font-size: 14px;
    line-height: 1.8;
  }
  .community-post-content.community-markdown h1 { font-size: 1.75em; }
  .community-post-content.community-markdown h2 { font-size: 1.45em; }
  .community-post-content.community-markdown h3 { font-size: 1.2em; }
}


/* ---------- 232차: HTML 편집기(SunEditor 3.3.3) — 색은 사이트 토큰으로 (라이트 · 다크 그대로 따라감) ---------- */
.sun-editor-host .sun-editor,
.sun-editor-host .sun-editor-editable,
.sun-editor.se-fullscreen,
.sun-editor-common {
  --se-main-font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --se-content-font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --se-main-color: var(--text);
  --se-main-color-lighter: var(--text-2);
  --se-main-font-color: var(--text);
  --se-main-background-color: var(--bg);
  --se-main-border-color: var(--border-strong);
  --se-main-out-color: var(--border);
  --se-main-divider-color: var(--border);
  --se-main-outline-color: var(--border-strong);
  --se-main-shadow-color: transparent;
  --se-statusbar-font-color: var(--text-3);
  --se-caret-color: var(--text);
  --se-placeholder-color: var(--text-3);
  --se-edit-font-color: var(--text);
  --se-edit-font-pre: var(--text-2);
  --se-edit-font-quote: var(--text-3);
  --se-edit-background-color: var(--bg);
  --se-edit-background-pre: var(--surface-muted);
  --se-edit-border-light: var(--border);
  --se-edit-border-dark: var(--border-strong);
  --se-edit-border-dark-n1: var(--border-strong);
  --se-edit-border-dark-n2: var(--border);
  --se-edit-border-table: var(--border-strong);
  --se-edit-hr-color: var(--border-strong);
  --se-edit-hover: var(--surface-muted);
  --se-edit-anchor: var(--highlight, #3b82f6);
  --se-hover-color: var(--text);
  --se-hover-light-color: var(--surface-muted);
  --se-hover-light2-color: var(--surface-muted);
  --se-hover-light3-color: var(--border);
  --se-hover-dark-color: var(--border-strong);
  --se-hover-dark2-color: var(--border-strong);
  --se-hover-dark3-color: var(--text-3);
  --se-active-light-color: color-mix(in srgb, var(--poke-yellow) 16%, var(--bg));
  --se-active-light2-color: color-mix(in srgb, var(--poke-yellow) 12%, var(--bg));
  --se-active-light3-color: color-mix(in srgb, var(--poke-yellow) 22%, var(--bg));
  --se-active-light4-color: color-mix(in srgb, var(--poke-yellow) 18%, var(--bg));
  --se-active-light5-color: color-mix(in srgb, var(--poke-yellow) 26%, var(--bg));
  --se-active-color: var(--poke-yellow);
  --se-active-dark3-color: var(--poke-yellow);
  --se-select-menu-hover-bg: var(--surface-muted);
  --se-select-menu-active-bg: color-mix(in srgb, var(--poke-yellow) 18%, var(--bg));
  --se-modal-background-color: var(--surface);
  --se-modal-color: var(--text);
  --se-modal-border-color: var(--border);
  --se-modal-preview-color: var(--text-2);
  --se-modal-file-input-background-color: var(--surface-muted);
  --se-modal-input-disabled-color: var(--text-3);
  --se-modal-input-disabled-background-color: var(--surface-muted);
  --se-dropdown-font-color: var(--text);
  --se-controller-border-color: var(--border-strong);
  --se-controller-background-color: var(--surface);
  --se-controller-color: var(--text);
  --se-input-btn-border-color: var(--border-strong);
  --se-table-picker-color: var(--surface-muted);
  --se-table-picker-border-color: var(--border-strong);
  --se-code-view-color: var(--text);
  --se-code-view-background-color: var(--surface-muted);
  --se-code-view-line-color: var(--text-3);
  --se-code-view-line-background-color: var(--surface);
  --se-border-radius: 10px;
  --se-border-radius-lg: 14px;
  --se-edit-font-size: 15px;
  --se-edit-line-height: 1.75;
}
html[data-theme="dark"] .sun-editor-host .sun-editor,
html[data-theme="dark"] .sun-editor-common { --se-shadow-layer-color: #000000a0; --se-overlay-background-color: #000; }
.sun-editor-host .sun-editor { overflow: visible; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--bg); color: var(--text); }
.sun-editor-host .sun-editor .se-toolbar { border-radius: 14px 14px 0 0; background: var(--surface); outline: 0; }
.sun-editor-host .sun-editor .se-wrapper { border-radius: 0 0 14px 14px; }
.sun-editor-host .sun-editor .se-wrapper-inner { max-height: min(640px, 64vh); overflow-y: auto; overscroll-behavior: contain; }
.sun-editor-host .sun-editor .se-status-bar,
.sun-editor-host .sun-editor .se-status-bar * { border-radius: 0 0 14px 14px; background: var(--surface); color: var(--text-3); }
/* 사이트 공용 입력칸 · 버튼 모양(둥근 테두리 · 그림자)이 편집기 안의 칸에 번지지 않게 */
.sun-editor input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.sun-editor select,
.sun-editor textarea {
  min-height: 0;
  border-radius: 6px;
  box-shadow: none;
  font: inherit;
}
.sun-editor .se-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { border-color: transparent; background: transparent; padding: 0 4px; }
.sun-editor .se-toolbar input:focus { outline: 2px solid var(--poke-yellow); outline-offset: 0; }
.sun-editor .se-modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { padding: 0 10px; min-height: 34px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); }
.sun-editor button { color: inherit; }
.sun-editor .se-btn:focus-visible { outline: 2px solid var(--poke-yellow); outline-offset: 1px; }
.sun-editor-editable { font-family: var(--se-content-font-family); }
.sun-editor-editable img { max-width: 100%; height: auto; }
.sun-editor.se-fullscreen { z-index: 2000; }
/* 휴대폰: 툴바가 여러 줄로 접혀도 화면 밖으로 나가지 않게 */
@media (max-width: 700px) {
  .sun-editor-host .sun-editor .se-toolbar { padding: 2px; }
  .sun-editor-host .sun-editor .se-wrapper-inner { max-height: 52vh; }
}

/* 232차: HTML 글 본문 — 편집기 사진 정렬(class) · 꾸밈이 읽는 화면에서도 같게 */
.community-markdown .se-component { margin: 1em 0; }
.community-markdown .__se__float-left { float: left; margin: 0 1.2em .6em 0; max-width: 50%; }
.community-markdown .__se__float-right { float: right; margin: 0 0 .6em 1.2em; max-width: 50%; }
.community-markdown .__se__float-center { display: flex; justify-content: center; }
.community-markdown .__se__float-center img { margin-left: auto; margin-right: auto; }
.community-markdown::after { content: ""; display: block; clear: both; }
.community-markdown figure { margin: 0; max-width: 100%; }
.community-markdown figcaption { color: var(--text-3); font-size: 13px; text-align: center; }
.community-markdown mark { padding: 0 .15em; border-radius: 3px; }
.community-markdown sub, .community-markdown sup { font-size: .75em; }
.community-markdown h4 { margin: 1.1em 0 .45em; font-size: 1.1em; }
.community-markdown h5, .community-markdown h6 { margin: 1em 0 .4em; font-size: 1em; }
.community-markdown div, .community-markdown p { max-width: 100%; }
.community-markdown caption { padding: 6px; color: var(--text-3); }
/* 편집기 '문단 형식' · '글자 스타일' · 선 모양 (suneditor-contents.css 와 같은 모양을 읽는 화면에서도) */
.community-markdown hr.__se__solid { border-top-style: solid; }
.community-markdown hr.__se__dotted { border-top-style: dotted; }
.community-markdown hr.__se__dashed { border-top-style: dashed; }
.community-markdown .__se__p-bordered { padding: 4px 0; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
.community-markdown .__se__p-spaced { letter-spacing: 1px; }
.community-markdown .__se__p-neon { padding: 6px 4px; border: 2px solid #fff; border-radius: 6px; background: #000; color: #fff; font-style: italic; font-weight: 200; text-transform: uppercase;
  text-shadow: 0 0 4px #fff, 0 0 11px #fff, 0 0 19px #fff, 0 0 40px var(--poke-yellow), 0 0 80px var(--poke-yellow); }
.community-markdown .__se__t-shadow { text-shadow: 0 0 .2rem #999, 0 0 .4rem #888, 0 0 .6rem #777; }
.community-markdown .__se__t-code { padding: .2em .4em; border-radius: 6px; background: var(--surface-muted); color: var(--text-2); font-family: monospace; }
