/* 인용구 6가지 모양(네이버 카페 인용구 메뉴 순서). 글쓰기 편집기와 공개 글 화면이 함께 쓴다.
   인용구 맨 앞에 보이지 않는 표시 글자 <span class="qs-모양">​</span>이 들어 있고(admin_editor.js),
   그 표시가 든 인용구를 :has()로 찾아 모양을 입힌다. 표시가 없는 인용구는 각 화면의 기본 모양을 쓴다.
   선택자 앞 :is(.prose, .toastui-editor-contents)는 각 화면의 기본 인용구 규칙보다 우선하기 위해서다. */
:root {
  --qs-ink: #161616;
  --qs-muted: #8a8a8a;           /* 장식(따옴표 기호·선)용 회색 */
  --qs-line: #d4d4d4;
  --qs-bg: #ffffff;              /* 말풍선 꼬리 안쪽(글 바탕과 같은 흰색) */
  --qs-postit-bg: #fff6bf;
  --qs-postit-fold: #eadf9c;
  --qs-gap: 16px;
  --qs-gap-lg: 24px;
  --qs-radius: 14px;
  --qs-mark-size: 44px;
  --qs-corner: 18px;
  --qs-stroke: 2px;
}

:is(.prose, .toastui-editor-contents) blockquote:has(.qs-quote),
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-vline),
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-bubble),
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-linequote),
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-postit),
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-frame) {
  position: relative;
  margin: var(--qs-gap-lg) 0;
  padding: var(--qs-gap) var(--qs-gap-lg);
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--qs-ink);
  font-family: inherit;
}
:is(.prose, .toastui-editor-contents) blockquote :is(p) { margin: 0; color: inherit; }

/* 말풍선·포스트잇·프레임은 상자 모양이라 글 길이에 맞춰 줄이고 가운데 둔다(길면 글 폭까지만 늘어나 줄바꿈) */
:is(.prose, .toastui-editor-contents) blockquote:is(:has(.qs-bubble), :has(.qs-postit), :has(.qs-frame)) {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

/* 따옴표: 가운데 정렬, 위아래 큰 따옴표 */
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-quote) { text-align: center; padding-block: calc(var(--qs-mark-size) * 0.9); }
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-quote)::before,
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-quote)::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--qs-muted);
  font-family: Georgia, serif;
  font-size: var(--qs-mark-size);
  line-height: 1;
}
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-quote)::before { content: "\201C"; top: 0; }
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-quote)::after { content: "\201D"; bottom: -8px; }

/* 버티컬 라인: 왼쪽 세로줄 */
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-vline) { border-left: 3px solid var(--qs-ink); padding-block: 4px; }

/* 말풍선: 둥근 테두리 + 왼쪽 아래 꼬리 */
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-bubble) { border: var(--qs-stroke) solid var(--qs-ink); border-radius: var(--qs-radius); text-align: center; }
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-bubble)::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -9px;
  width: 14px;
  height: 14px;
  background: var(--qs-bg);
  border-right: var(--qs-stroke) solid var(--qs-ink);
  border-bottom: var(--qs-stroke) solid var(--qs-ink);
  transform: rotate(45deg) skew(10deg, 10deg);
}

/* 라인&따옴표: 위에 작은 따옴표, 아래에 밑줄 */
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-linequote) { text-align: center; padding-top: calc(var(--qs-mark-size) * 0.7); }
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-linequote)::before {
  content: "\201C";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  color: var(--qs-muted);
  font-family: Georgia, serif;
  font-size: calc(var(--qs-mark-size) * 0.7);
  line-height: 1;
}
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-linequote) p { display: inline; padding-bottom: 4px; border-bottom: var(--qs-stroke) solid var(--qs-ink); }

/* 포스트잇: 연노랑 메모지 + 접힌 모서리 */
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-postit) {
  background: linear-gradient(225deg, transparent var(--qs-corner), var(--qs-postit-bg) var(--qs-corner));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-postit)::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: var(--qs-corner);
  height: var(--qs-corner);
  background: linear-gradient(225deg, transparent 50%, var(--qs-postit-fold) 50%);
}

/* 프레임: 네 모서리 꺾쇠 */
:is(.prose, .toastui-editor-contents) blockquote:has(.qs-frame) {
  text-align: center;
  background:
    linear-gradient(var(--qs-ink), var(--qs-ink)) top left / var(--qs-corner) var(--qs-stroke),
    linear-gradient(var(--qs-ink), var(--qs-ink)) top left / var(--qs-stroke) var(--qs-corner),
    linear-gradient(var(--qs-ink), var(--qs-ink)) bottom right / var(--qs-corner) var(--qs-stroke),
    linear-gradient(var(--qs-ink), var(--qs-ink)) bottom right / var(--qs-stroke) var(--qs-corner);
  background-repeat: no-repeat;
}
