/**
 * 글 페이지 (프런트 + 편집기).
 * 기준: 시안 Post(PC 1440) / PostM(휴대폰 390) 보드.
 *
 * 본문 선택자 :is(.cn-prose, .wp-block-post-content.is-root-container)
 *   - .cn-prose: 템플릿의 '글 내용' 블록 (프런트·사이트 편집기)
 *   - .is-root-container: 글 편집 화면의 본문 영역 (편집기에서도 같은 모양)
 * 소제목 A~D 모양은 assets/css/headings/ 에 따로 있고, 고른 것 하나만 불러옵니다.
 */

:root {
	--cn-ink-2: #2b2a27;      /* 본문 문단 글자 */
	--cn-band: #f4f2ed;       /* 소제목 띠 바탕 */
	--cn-line-soft: #cfcac0;  /* 점선·옅은 선 */
	--cn-h5: #6b6860;         /* H5 글자 */
	--cn-sticky-top: calc(var(--cn-admin-bar) + var(--cn-header-h) + 16px);
}

/* ---------- 레이아웃: 본문 720 + 사이드바 280~300, 사이 64 ---------- */

.wp-site-blocks > .cn-post-layout,
.wp-site-blocks > .cn-page {
	margin-block-start: 0;
}

.cn-post-layout {
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 64px;
	max-width: calc(var(--wp--style--global--wide-size) + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right));
	margin-inline: auto;
	padding: 48px var(--wp--style--root--padding-right) 0 var(--wp--style--root--padding-left);
}

.cn-post-layout > .cn-post {
	flex: 999 1 560px;
	min-width: 0;
	max-width: var(--wp--style--global--content-size);
	margin: 0;
}

.cn-post-layout > .cn-sidebar {
	flex: 1 1 280px;
	max-width: 300px;
	margin: 0;
}

.cn-no-sidebar .cn-post-layout {
	justify-content: center;
}

/* 소개·문의 같은 페이지 */
.cn-page {
	box-sizing: border-box;
	max-width: calc(var(--wp--style--global--content-size) + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right));
	margin-inline: auto;
	padding: 48px var(--wp--style--root--padding-right) 0 var(--wp--style--root--padding-left);
}

/* ---------- 글 머리: 이동 경로 · 제목 · 정보 줄 · 대표 이미지 ---------- */

.cn-post.cn-post > *,
.cn-page.cn-page > * {
	margin-block: 0;
}

.cn-breadcrumb {
	margin-bottom: 16px !important;
	font-size: 13px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

.cn-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cn-breadcrumb li + li::before {
	content: "›";
	content: "›" / "";
	margin: 0 0.3em;
}

.cn-breadcrumb__cat {
	font-weight: 700;
	color: var(--accent-ink);
}

.cn-post__title,
.editor-post-title.wp-block-post-title {
	margin-bottom: 18px !important;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.38;
	letter-spacing: -0.035em;
}

.cn-post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-bottom: 32px !important;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

.cn-post__thumb {
	margin-bottom: 28px !important;
}

.cn-post__thumb img {
	display: block;
	width: 100%;
	border-radius: 6px;
	background: var(--wp--preset--color--surface);
}

/* ---------- 본문 목차 ---------- */

.cn-toc {
	margin-bottom: 32px !important;
	padding: 20px 28px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
}

.cn-toc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	list-style: none;
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
}

.cn-toc__head::-webkit-details-marker {
	display: none;
}

.cn-toc__toggle {
	font-size: 13px;
	font-weight: 400;
	color: var(--wp--preset--color--muted);
}

.cn-toc:not([open]) .cn-toc__when-open,
.cn-toc[open] .cn-toc__when-closed {
	display: none;
}

.cn-toc__list {
	margin: 12px 0 0;
	padding-left: 20px;
	font-size: 15px;
	line-height: 2;
	color: var(--wp--preset--color--soft);
}

.cn-toc__list-sub {
	margin: 0;
	padding: 0 0 0 14px;
	list-style: none;
	font-size: 14px;
	line-height: 1.9;
	color: var(--wp--preset--color--secondary);
}

.cn-toc__list-sub li::before {
	content: "–";
	content: "–" / "";
	margin-right: 6px;
	color: var(--cn-line-soft);
}

/* ---------- 본문 ---------- */

:is(.cn-prose, .wp-block-post-content.is-root-container) {
	margin-bottom: 40px !important;
	font-size: var(--cn-prose-size, 17px); /* 설정 › 디자인 '본문 글자 크기' (17 / 19px) */
	line-height: 1.8;
	color: var(--cn-ink-2);
	counter-reset: cn-h2;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) > * {
	margin-block: 0 22px;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) p {
	margin-block: 0 22px;
}

/* 예전 편집기·다른 빌더에서 옮겨 온 글: 블록이 아닌 사진·영상이 본문 폭을 넘지 않게.
 * :where 로 우선순위 0 — 커버·갤러리 같은 블록 자체 규칙이 항상 이깁니다. */
:where(.cn-prose, .wp-block-post-content.is-root-container) :where(img, video, iframe, embed, object) {
	max-width: 100%;
}

:where(.cn-prose, .wp-block-post-content.is-root-container) :where(img, video) {
	height: auto;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) :is(h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--contrast);
	scroll-margin-top: var(--cn-sticky-top);
}

:is(.cn-prose, .wp-block-post-content.is-root-container) h2 {
	margin-block: 56px 18px;
	font-size: 25px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.03em;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) h3 {
	margin-block: 36px 12px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.02em;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) h4 {
	margin-block: 28px 10px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: -0.01em;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) :is(h5, h6) {
	margin-block: 22px 8px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.02em;
	color: var(--cn-h5);
}

/* 본문 안 링크: 밑줄로 구분 (색만으로 구분하지 않음) */
:is(.cn-prose, .wp-block-post-content.is-root-container) :is(p, li, td, figcaption) a {
	color: var(--accent-ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) :is(ul, ol):not(.wp-block-gallery) {
	padding-left: 1.4em;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) li + li {
	margin-top: 4px;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) li > :is(ul, ol) {
	margin: 4px 0 0;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) :is(.wp-block-image, figure) img {
	border-radius: 6px;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) figcaption {
	margin-top: 8px;
	font-size: 13.5px;
	color: var(--wp--preset--color--muted);
	text-align: center;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) :is(.wp-block-image, .wp-block-table, .wp-block-embed, .wp-block-video, .wp-block-quote, .wp-block-pullquote, .wp-block-code, .wp-block-preformatted) {
	margin-block: 0 28px;
}

/* 인용 */
:is(.cn-prose, .wp-block-post-content.is-root-container) blockquote {
	padding: 4px 0 4px 18px;
	border-left: 3px solid var(--wp--preset--color--line-strong);
	color: var(--wp--preset--color--soft);
}

:is(.cn-prose, .wp-block-post-content.is-root-container) blockquote > :last-child {
	margin-bottom: 0;
}

/* 표 */
:is(.cn-prose, .wp-block-post-content.is-root-container) .wp-block-table {
	overflow-x: auto;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.6;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) :is(th, td) {
	padding: 12px 14px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
	vertical-align: top;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) thead :is(th, td) {
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
}

:is(.cn-prose, .wp-block-post-content.is-root-container) .wp-block-table thead {
	border-bottom: 0;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) tbody :is(th, td):first-child {
	color: var(--wp--preset--color--secondary);
}

/* 코드 */
:is(.cn-prose, .wp-block-post-content.is-root-container) :is(pre, .wp-block-code) {
	overflow-x: auto;
	padding: 16px 18px;
	border-radius: 6px;
	background: var(--wp--preset--color--surface);
	font-size: 14px;
	line-height: 1.7;
}

:is(.cn-prose, .wp-block-post-content.is-root-container) :not(pre) > code {
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--wp--preset--color--surface);
	font-size: 0.88em;
}

/* 버튼: 52px 알약 모양 (색은 theme.json 버튼 스타일) */
:is(.cn-prose, .wp-block-post-content.is-root-container) .wp-block-buttons {
	margin-block: 0 12px;
}

.wp-element-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	box-sizing: border-box;
}

/* ---------- 태그 ---------- */

.cn-post__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px !important;
}

.cn-post__tags .wp-block-post-terms__separator {
	display: none;
}

.cn-post__tags a {
	padding: 7px 14px;
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	font-size: 13px;
	line-height: 1.4;
	color: var(--wp--preset--color--soft);
}

.cn-post__tags a::before {
	content: "#";
}

.cn-post__tags a:hover {
	text-decoration: none;
	background: var(--wp--preset--color--line);
}

/* ---------- 작성자 상자 ---------- */

.cn-author {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-bottom: 56px !important;
	padding: 24px 0;
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.cn-author__avatar,
.cn-avatar {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-weight: 700;
	line-height: 1;
}

.cn-author__avatar {
	width: 56px;
	height: 56px;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: 17px;
}

.cn-author__name {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--wp--preset--color--contrast);
}

.cn-author__bio {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--wp--preset--color--secondary);
}

/* ---------- 함께 보면 좋은 글 ---------- */

.cn-related {
	margin-bottom: 40px !important;
}

.cn-related__title {
	margin: 0 0 20px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.02em;
}

.cn-related__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cn-related__item {
	display: block;
	color: inherit;
}

.cn-related__thumb {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 6px;
	background: var(--wp--preset--color--surface);
}

.cn-related__name {
	display: -webkit-box;
	margin-top: 10px;
	overflow: hidden;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
	color: var(--wp--preset--color--contrast);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* ---------- 이전 글 · 다음 글 ---------- */

.cn-post-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.cn-post-nav__item {
	display: block;
	padding: 18px 20px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--wp--preset--color--contrast);
}

.cn-post-nav__item:hover {
	text-decoration: none;
	border-color: var(--wp--preset--color--line-strong);
}

.cn-post-nav__next {
	grid-column: 2;
	text-align: right;
}

.cn-post-nav__label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	color: var(--wp--preset--color--muted);
}

/* ---------- 댓글 (설정에서 켰을 때) ---------- */

.cn-comments {
	margin-top: 48px !important;
}

.cn-comments__title {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
}

.cn-comments__count {
	font-weight: 500;
	color: var(--wp--preset--color--muted);
}

.cn-comments .comment-respond {
	margin: 0 0 8px;
}

/* 평소에는 '댓글 남기기' 제목을 숨기고, 답글을 달 때(입력 칸이 댓글 아래로 옮겨질 때)만 보여 줌 */
.cn-comments .wp-block-post-comments-form .comment-reply-title {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.cn-comments .comment-reply-title {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
}

.cn-comments .comment-reply-title small {
	margin-left: 8px;
	font-size: 13px;
	font-weight: 400;
}

.cn-comments .comment-form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.cn-comments .comment-form > * {
	flex: 1 1 100%;
	margin: 0;
}

.cn-comments .comment-notes,
.cn-comments .logged-in-as,
.cn-comments .comment-form-cookies-consent {
	font-size: 12.5px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

.cn-comments .comment-form-author,
.cn-comments .comment-form-email {
	flex: 1 1 200px;
}

.cn-comments .comment-form :is(label:not(.cn-visually-hidden)) {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	color: var(--wp--preset--color--secondary);
}

.cn-comments .comment-form-cookies-consent {
	display: flex;
	align-items: center;
	gap: 6px;
}

.cn-comments .comment-form-cookies-consent label {
	display: inline;
	margin: 0;
	font-size: 12.5px;
}

.cn-comments .comment-form :is(textarea, input[type="text"], input[type="email"]) {
	box-sizing: border-box;
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--wp--preset--color--line-strong);
	border-radius: 8px;
	background: var(--wp--preset--color--base);
	font: inherit;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--wp--preset--color--contrast);
}

.cn-comments .comment-form textarea {
	resize: vertical;
}

.cn-comments .form-submit {
	display: flex;
	justify-content: flex-end;
}

.cn-comments .form-submit .submit {
	min-height: 44px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.cn-comments .wp-block-comment-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cn-comments .wp-block-comment-template li {
	margin: 0;
}

.cn-comments .wp-block-comment-template ol.children {
	margin: 0 0 0 44px;
	padding: 0;
	list-style: none;
}

.cn-comment {
	gap: 12px !important;
	padding: 18px 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.cn-comment .wp-block-avatar {
	flex: none;
	margin: 0;
}

.cn-avatar {
	background: var(--wp--preset--color--highlight);
	color: var(--wp--preset--color--soft);
	font-size: 13px;
}

.cn-avatar--author {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.cn-comment__body {
	flex: 1;
	min-width: 0;
}

.cn-comment__body > * {
	margin-block: 0 !important;
}

.cn-comment__meta {
	gap: 6px !important;
	align-items: baseline;
	margin-bottom: 4px !important;
}

.cn-comment .wp-block-comment-author-name {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
}

.cn-badge {
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
}

.cn-comment .wp-block-comment-date {
	font-size: 12.5px;
	color: var(--wp--preset--color--muted);
}

.cn-comment .wp-block-comment-content {
	margin-bottom: 6px !important;
	font-size: 15px;
	line-height: 1.7;
	color: var(--cn-ink-2);
}

.cn-comment .wp-block-comment-content p {
	margin: 0;
}

.cn-comment .wp-block-comment-content p + p {
	margin-top: 8px;
}

.cn-comment .wp-block-comment-reply-link {
	font-size: 12.5px;
	color: var(--wp--preset--color--muted);
}

/* ---------- 사이드바 ---------- */

.cn-sidebar {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.cn-sidebar > * {
	margin: 0 !important;
}

/* 검색: 밑줄 하나 */
.cn-sidebar-search .wp-block-search__inside-wrapper {
	padding: 0;
	border: 0;
	border-bottom: 1.5px solid var(--wp--preset--color--contrast);
	border-radius: 0;
	background: none;
}

.cn-sidebar-search .wp-block-search__input {
	min-height: 0;
	padding: 12px 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--wp--preset--color--contrast);
}

.cn-sidebar-search .wp-block-search__input:focus {
	outline: none;
}

.cn-sidebar-search .wp-block-search__inside-wrapper:focus-within {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 4px;
}

.cn-sidebar-search .wp-block-search__button {
	width: 44px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--contrast);
}

.cn-sidebar-search .wp-block-search__button svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* 위젯 제목 */
.cn-widget__title {
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0;
}

/* 인기 글 */
.cn-popular__list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cn-popular__list li {
	display: flex;
	gap: 12px;
	font-size: 14.5px;
	line-height: 1.5;
}

.cn-popular__num {
	flex: none;
	width: 16px;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-weight: 700;
	color: var(--accent-ink);
}

/* 카테고리 */
.cn-cat-list .cn-widget__title {
	margin-bottom: 14px;
}

.cn-cat-list__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--wp--preset--color--soft);
}

.cn-cat-list__list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.cn-cat-list__count {
	color: var(--wp--preset--color--muted);
}

/* 따라오는 목차 */
.cn-sidebar__sticky {
	position: sticky;
	top: var(--cn-sticky-top);
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.cn-sidebar__sticky > * {
	margin: 0 !important;
}

.cn-sticky-toc {
	padding-top: 16px;
	border-top: 2px solid var(--wp--preset--color--contrast);
}

.cn-sticky-toc__title {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--muted);
}

.cn-sticky-toc__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	line-height: 1.5;
}

.cn-sticky-toc__list a {
	display: flex;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 6px;
	color: var(--wp--preset--color--soft);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cn-sticky-toc__list a:hover {
	text-decoration: none;
	background: var(--wp--preset--color--surface);
}

.cn-sticky-toc__num {
	flex: none;
	font-family: var(--wp--preset--font-family--space-grotesk);
	color: var(--wp--preset--color--muted);
}

.cn-sticky-toc__list a.is-active {
	background: var(--tag-bg);
	color: var(--tag-ink);
	font-weight: 700;
}

.cn-sticky-toc__list a.is-active .cn-sticky-toc__num {
	color: inherit;
}

.cn-sticky-toc__hint {
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

/* ---------- 휴대폰 '목차'·'맨 위로' 버튼 ---------- */

.cn-post-tools {
	position: fixed;
	right: 16px;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 30;
	display: none;
	gap: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.cn-post-tools.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

.cn-post-tools__toc {
	height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(26, 26, 24, 0.18);
}

.cn-post-tools__top {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--highlight);
	border-radius: 999px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(26, 26, 24, 0.1);
}

/* 아래에서 올라오는 목차 창 */
.cn-toc-sheet {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	max-height: 70vh;
	margin: auto 0 0;
	padding: 0 20px calc(24px + env(safe-area-inset-bottom, 0px));
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 0;
	border-radius: 16px 16px 0 0;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.cn-toc-sheet::backdrop {
	background: rgba(12, 12, 11, 0.45);
}

.cn-toc-sheet[open] {
	animation: cn-sheet-up 0.22s ease-out;
}

@keyframes cn-sheet-up {
	from {
		transform: translateY(24px);
		opacity: 0;
	}
}

.cn-toc-sheet__head {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 56px;
	margin-right: -8px;
	border-bottom: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--base);
}

.cn-toc-sheet__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
}

.cn-toc-sheet__list {
	margin: 12px 0 0;
	padding-left: 20px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--wp--preset--color--soft);
}

.cn-toc-sheet__list a {
	display: block;
	padding: 9px 0;
}

.cn-toc-sheet__list-sub {
	margin: 0;
	padding-left: 14px;
	list-style: none;
	font-size: 14px;
	color: var(--wp--preset--color--secondary);
}

.cn-toc-sheet__list-sub a {
	padding: 7px 0;
}

html.cn-sheet-open {
	overflow: hidden;
}

/* ---------- 태블릿: 사이드바가 본문 아래로 내려가는 폭 ---------- */

@media (max-width: 951px) {
	.cn-post-layout {
		justify-content: center;
	}

	.cn-post-layout > .cn-sidebar {
		flex-basis: 100%;
		max-width: var(--wp--style--global--content-size);
	}

	/* 본문 옆에 있지 않으면 따라오는 목차 대신 아래 버튼을 씀 */
	.cn-sidebar__sticky {
		display: none;
	}

	.cn-post-tools {
		display: flex;
	}
}

/* ---------- 휴대폰 (시안 PostM) ---------- */

@media (max-width: 781px) {
	.cn-post-layout,
	.cn-page {
		padding-top: 20px;
	}

	.cn-post-layout > .cn-sidebar {
		display: none;
	}

	.cn-breadcrumb {
		margin-bottom: 12px !important;
		font-size: 12.5px;
	}

	.cn-post__title,
	.editor-post-title.wp-block-post-title {
		margin-bottom: 12px !important;
		font-size: 25px;
		line-height: 1.4;
	}

	.cn-post-meta {
		gap: 10px;
		margin-bottom: 22px !important;
		font-size: 12px;
	}

	/* 휴대폰은 '6분'만 (화면 낭독기는 '읽는 시간 6분'으로 읽음) */
	.cn-post-meta__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.cn-post__thumb {
		margin-bottom: 22px !important;
	}

	.cn-toc {
		margin-bottom: 24px !important;
		padding: 14px 18px;
	}

	.cn-toc__head {
		display: list-item;
		list-style: revert;
		min-height: 24px;
	}

	.cn-toc__head::-webkit-details-marker {
		display: revert;
	}

	.cn-toc__toggle {
		display: none;
	}

	.cn-toc__list {
		margin-top: 10px;
		font-size: 14.5px;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) {
		margin-bottom: 28px !important;
		font-size: 16.5px;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) > *,
	:is(.cn-prose, .wp-block-post-content.is-root-container) p {
		margin-block: 0 20px;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) h2 {
		margin-block: 44px 16px;
		font-size: 22px;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) h3 {
		margin-block: 30px 12px;
		font-size: 18.5px;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) h4 {
		margin-block: 24px 8px;
		font-size: 16.5px;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) table {
		font-size: 14.5px;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) :is(th, td) {
		padding: 10px 12px;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) :is(.wp-block-image, .wp-block-table, .wp-block-embed, .wp-block-video, .wp-block-quote, .wp-block-pullquote, .wp-block-code, .wp-block-preformatted) {
		margin-block: 0 24px;
	}

	/* 휴대폰에서 버튼은 가로 꽉 차게 */
	:is(.cn-prose, .wp-block-post-content.is-root-container) .wp-block-buttons > .wp-block-button {
		flex: 1 1 100%;
	}

	:is(.cn-prose, .wp-block-post-content.is-root-container) .wp-block-buttons .wp-block-button__link {
		width: 100%;
	}

	.cn-post__tags {
		gap: 6px;
		margin-bottom: 22px !important;
	}

	.cn-post__tags a {
		padding: 6px 12px;
		font-size: 12.5px;
	}

	.cn-author {
		gap: 14px;
		margin-bottom: 36px !important;
		padding: 18px 0;
	}

	.cn-author__avatar {
		width: 48px;
		height: 48px;
		font-size: 16px;
	}

	.cn-author__name {
		margin-bottom: 2px;
		font-size: 14px;
	}

	.cn-author__bio {
		font-size: 13px;
		line-height: 1.55;
	}

	.cn-related {
		margin-bottom: 24px !important;
	}

	.cn-related__title {
		margin-bottom: 8px;
		font-size: 18px;
	}

	.cn-related__list {
		display: block;
	}

	.cn-related__item {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 10px 0;
	}

	.cn-related__thumb {
		flex: none;
		width: 88px;
	}

	.cn-related__name {
		margin-top: 0;
	}

	/* 작은 대체 카드에는 카테고리 이름만 (제목은 바로 옆에 있음) */
	.cn-related .cn-thumb--text {
		padding: 8px;
	}

	.cn-related .cn-thumb__cat {
		font-size: 10px;
	}

	.cn-related .cn-thumb__title {
		display: none;
	}

	.cn-post-nav {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}

	.cn-post-nav__item {
		padding: 14px 16px;
		font-size: 14px;
	}

	.cn-post-nav__next {
		grid-column: auto;
		text-align: left;
	}

	.cn-post-nav__label {
		margin-bottom: 4px;
		font-size: 11.5px;
	}

	.cn-comment .wp-block-comment-content {
		font-size: 14px;
	}
}

/* ---------- 편집기 전용 ---------- */

.cn-editor-note {
	margin: 0;
	padding: 10px 12px;
	border: 1px dashed var(--wp--preset--color--line-strong);
	border-radius: 6px;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

/* 헤더가 숨으면 따라오는 목차도 위로 붙음 (헤더 자리는 진행 막대 3px만 남음) */
html.cn-header-hidden {
	--cn-sticky-top: calc(var(--cn-admin-bar) + 3px + 16px);
}

/* 헤더 방식 '고정 안 함': 따라오는 목차는 화면 맨 위에 붙음 */
body.cn-header-static {
	--cn-sticky-top: calc(var(--cn-admin-bar) + 16px);
}

.cn-sidebar__sticky {
	transition: top 0.25s ease;
}
