/*
Theme Name: 여백 (Yeobaek)
Description: A4 용지 한 장을 컨셉으로 한 글쓰기 테마. 선과 상자 없이 여백과 서체만으로 지면을 짭니다. 사이드바는 평소에 접혀 있다가 필요할 때만 종이 옆으로 쪽지처럼 펼쳐지고, 인쇄하면 그대로 A4 문서가 됩니다.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yeobaek
Tags: blog, one-column, custom-colors, custom-logo, custom-menu, featured-images, editor-style, wide-blocks, translation-ready
*/

/*
  차례
  1. 변수          5. 글 목록          9. 접는 여백(쪽지)
  2. 바탕          6. 글 한 편         10. 워드프레스 기본 클래스
  3. 종이          7. 본문 타이포      11. 좁은 화면
  4. 머리·바닥     8. 댓글·양식        12. 인쇄

  원칙: border, hr, 상자를 쓰지 않는다. 구분은 여백·크기·농도로만 한다.
*/

/* 1. 변수 -------------------------------------------------------------- */

:root {
	--desk: #ecebe6;
	--paper: #fefefc;
	--ink: #1d1d1b;
	--ink-soft: #4b4a45;
	--muted: #75746d;
	--tint: #f4f3ee;
	--accent: #2b4c7e;

	/* 서체 변수는 커스터마이저 선택에 따라 functions.php가 덮어쓴다. */
	--font-body: "Noto Serif KR", AppleMyungjo, Batang, serif;
	--font-head: var(--font-body);
	--font-ui: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	--font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "D2Coding", monospace;
	--w-head: 600;
	--w-bold: 600;
	--lh-body: 1.95;
	--ls-body: -0.012em;
	--ls-head: -0.03em;
	--fs-body: 1.0625rem;

	/* A4: 210 × 297mm. 너비 840px, 좌우 여백 96px(약 25mm) → 글줄 648px. */
	--sheet-w: 840px;
	--pad-x: 96px;
	--pad-y: 88px;
	--desk-gap: 48px;
	--bleed: 48px;

	--slip-w: 300px;
	--slip-gap: 32px;
	--ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	/* 로그인 중에는 관리자 막대 높이만큼 고정 요소를 내린다. */
	--bar: var(--wp-admin--admin-bar--height, 0px);
}

/* 2. 바탕 -------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(40px + var(--bar));
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--desk);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	letter-spacing: var(--ls-body);
	word-break: keep-all;
	overflow-wrap: anywhere;
	font-kerning: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body.no-desk {
	--desk: var(--paper);
}

::selection {
	background: color-mix(in srgb, var(--accent) 18%, transparent);
}

a {
	color: inherit;
	text-decoration: none;
	text-underline-offset: 0.3em;
	text-decoration-thickness: 1px;
	transition: color 0.2s;
}

a:hover {
	color: var(--accent);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 4px;
	border-radius: 2px;
}

img,
video,
svg,
iframe {
	max-width: 100%;
}

img,
video {
	height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-head);
	font-weight: var(--w-head);
	line-height: 1.5;
	letter-spacing: var(--ls-head);
	text-wrap: balance;
	margin: 0;
}

p {
	margin: 0;
}

b,
strong {
	font-weight: var(--w-bold);
}

button,
input,
select,
textarea {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}

/* 3. 종이 -------------------------------------------------------------- */

.sheet {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(100% - 2 * var(--desk-gap), var(--sheet-w));
	min-height: calc(var(--sheet-w) * 1.4142);
	margin: var(--desk-gap) auto;
	padding: var(--pad-y) var(--pad-x);
	background: var(--paper);
	box-shadow: 0 1px 2px rgb(29 29 27 / 0.03), 0 18px 48px rgb(29 29 27 / 0.045);
	transition: transform 0.5s var(--ease);
}

.no-desk .sheet {
	box-shadow: none;
}

.site-main {
	flex: 1;
}

/* 4. 머리·바닥 --------------------------------------------------------- */

.site-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem 2.5rem;
	flex-wrap: wrap;
	margin-bottom: 6.5rem;
}

.site-branding {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.custom-logo-link {
	display: block;
	line-height: 0;
}

.custom-logo {
	max-height: 56px;
	width: auto;
}

.site-title {
	font-family: var(--font-head);
	font-size: 1.1875rem;
	font-weight: var(--w-head);
	line-height: 1.4;
	letter-spacing: 0.01em;
}

.site-title a:hover {
	color: inherit;
}

.site-description {
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	line-height: 1.6;
	letter-spacing: 0;
	color: var(--muted);
}

.primary-nav ul,
.footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav,
.footer-nav {
	font-family: var(--font-ui);
	font-size: 0.875rem;
	line-height: 1.6;
	letter-spacing: 0;
	color: var(--ink-soft);
}

.primary-nav a:hover,
.footer-nav a:hover {
	color: var(--ink);
}

.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav .current-menu-ancestor > a {
	color: var(--ink);
	font-weight: 600;
}

.site-footer {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	flex-wrap: wrap;
	margin-top: 7rem;
	font-family: var(--font-ui);
	font-size: 0.75rem;
	line-height: 1.6;
	letter-spacing: 0.01em;
	color: var(--muted);
}

.footer-nav {
	font-size: inherit;
	color: inherit;
}

.colophon {
	margin-left: auto;
}

/* 5. 글 목록 ----------------------------------------------------------- */

.page-header {
	margin-bottom: 5rem;
}

.page-title {
	font-size: 1.625rem;
}

.archive-label {
	display: block;
	margin-bottom: 0.75rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-weight: 400;
	letter-spacing: 0.02em;
	color: var(--muted);
}

.archive-description {
	margin-top: 1rem;
	color: var(--ink-soft);
}

.entry-summary + .entry-summary {
	margin-top: 4.25rem;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 0.6em;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	line-height: 1.6;
	letter-spacing: 0.01em;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}

.entry-meta a:hover {
	color: var(--ink);
}

.entry-meta .sep {
	opacity: 0.6;
}

.sticky-label {
	color: var(--accent);
	font-weight: 600;
}

.entry-summary .entry-title {
	margin-top: 0.625rem;
	font-size: 1.4375rem;
	line-height: 1.55;
}

.entry-excerpt {
	margin-top: 0.75rem;
	color: var(--ink-soft);
	text-wrap: pretty;
}

/* 쪽 번호: 종이 아래 가운데에 작게. */
.pagination,
.comments-navigation {
	margin-top: 6rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}

.pagination .nav-links,
.comments-navigation .nav-links {
	display: flex;
	justify-content: center;
	align-items: baseline;
	gap: 1.4rem;
}

.pagination a:hover {
	color: var(--ink);
}

.pagination .current {
	color: var(--ink);
	font-weight: 600;
}

/* 6. 글 한 편 ---------------------------------------------------------- */

.entry-header {
	margin-bottom: 4rem;
}

.entry .entry-title {
	margin-top: 1.125rem;
	font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.25rem);
	line-height: 1.45;
	letter-spacing: calc(var(--ls-head) - 0.01em);
}

.page .entry .entry-title {
	margin-top: 0;
}

.entry-lead {
	margin-top: 1.5rem;
	font-size: 1.0625em;
	color: var(--ink-soft);
	text-wrap: pretty;
}

.entry-thumbnail {
	margin: 0 calc(-1 * var(--bleed)) 4rem;
}

.entry-thumbnail img {
	display: block;
	width: 100%;
}

.entry-footer {
	margin-top: 4.5rem;
}

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.1rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	letter-spacing: 0.01em;
	color: var(--muted);
}

.entry-tags a::before {
	content: "#";
	opacity: 0.55;
	margin-right: 0.1em;
}

.post-navigation {
	margin-top: 6rem;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem 3rem;
}

.post-navigation .nav-next {
	grid-column: 2;
	text-align: right;
}

.nav-label {
	display: block;
	margin-bottom: 0.4rem;
	font-family: var(--font-ui);
	font-size: 0.75rem;
	letter-spacing: 0.03em;
	color: var(--muted);
}

.nav-title {
	display: block;
	font-family: var(--font-head);
	font-weight: var(--w-head);
	font-size: 1rem;
	line-height: 1.6;
}

/* 7. 본문 타이포 ------------------------------------------------------- */

.entry-content {
	text-wrap: pretty;
}

.entry-content > * {
	margin-top: 0;
	margin-bottom: 1.5em;
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
	margin-bottom: 0.9em;
}

.entry-content h2 {
	margin-top: 2.9em;
	font-size: 1.5rem;
}

.entry-content h3 {
	margin-top: 2.5em;
	font-size: 1.25rem;
}

.entry-content h4 {
	margin-top: 2.2em;
	font-size: 1.0625rem;
}

.entry-content h5,
.entry-content h6 {
	margin-top: 2em;
	font-family: var(--font-ui);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--ink-soft);
}

.entry-content > h2:first-child,
.entry-content > h3:first-child {
	margin-top: 0;
}

.entry-content a,
.comment-content a,
.archive-description a {
	color: var(--accent);
}

.entry-content a:hover,
.comment-content a:hover,
.archive-description a:hover {
	text-decoration: underline;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.35em;
}

.entry-content li {
	margin: 0.35em 0;
	padding-left: 0.2em;
}

.entry-content li::marker {
	color: var(--muted);
	font-family: var(--font-ui);
	font-size: 0.9em;
	font-variant-numeric: tabular-nums;
}

.entry-content li > ul,
.entry-content li > ol {
	margin: 0.35em 0;
}

/* 인용: 세로선 대신 들여쓰기와 매달린 따옴표. */
.entry-content blockquote {
	position: relative;
	margin: 2.6em 0;
	padding: 0 0 0 2.25em;
	border: 0;
	color: var(--ink-soft);
}

.entry-content blockquote::before {
	content: "\201C";
	position: absolute;
	left: 0;
	top: -0.12em;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 3em;
	line-height: 1;
	color: var(--accent);
	opacity: 0.85;
}

.entry-content blockquote p + p {
	margin-top: 1em;
}

.entry-content blockquote cite,
.wp-block-pullquote cite {
	display: block;
	margin-top: 1em;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-style: normal;
	letter-spacing: 0.01em;
	color: var(--muted);
}

.entry-content .wp-block-pullquote {
	margin: 3.2em 0;
	padding: 0;
	border: 0;
	text-align: center;
	color: var(--accent);
}

.entry-content .wp-block-pullquote blockquote {
	margin: 0;
	padding: 0;
	color: inherit;
}

.entry-content .wp-block-pullquote blockquote::before {
	content: none;
}

.entry-content .wp-block-pullquote p {
	font-family: var(--font-head);
	font-size: 1.4375rem;
	line-height: 1.8;
	letter-spacing: -0.03em;
	text-wrap: balance;
}

/* 구분선: 선 대신 세 개의 점. */
.entry-content hr,
.entry-content .wp-block-separator {
	height: auto;
	width: auto;
	max-width: none;
	margin: 3.4em 0;
	border: 0;
	background: none;
	text-align: center;
	line-height: 1;
	color: var(--muted);
	opacity: 1;
	overflow: visible;
}

.entry-content hr::before {
	content: "·\2003·\2003·";
	font-family: var(--font-ui);
	font-size: 1.125rem;
}

.entry-content code,
.entry-content kbd {
	font-family: var(--font-mono);
	font-size: 0.875em;
	letter-spacing: 0;
	padding: 0.15em 0.4em;
	border-radius: 4px;
	background: var(--tint);
	word-break: normal;
}

.entry-content pre,
.entry-content .wp-block-code {
	padding: 1.3em 1.5em;
	border: 0;
	border-radius: 6px;
	background: var(--tint);
	font-family: var(--font-mono);
	font-size: 0.875rem;
	line-height: 1.75;
	letter-spacing: 0;
	overflow-x: auto;
	word-break: normal;
	overflow-wrap: normal;
	white-space: pre;
	tab-size: 4;
}

.entry-content pre code {
	padding: 0;
	background: none;
	font-size: inherit;
}

.entry-content .wp-block-verse {
	padding: 0;
	background: none;
	font-family: var(--font-body);
	font-size: inherit;
	line-height: var(--lh-body);
	white-space: pre-wrap;
}

.entry-content mark {
	padding: 0.05em 0.15em;
	background: color-mix(in srgb, var(--accent) 14%, transparent);
	color: inherit;
}

.entry-content figure {
	margin-left: 0;
	margin-right: 0;
}

.entry-content img {
	border-radius: 2px;
}

figcaption,
.wp-caption-text,
.wp-element-caption {
	margin: 0.9em 0 0;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	line-height: 1.65;
	letter-spacing: 0;
	text-align: center;
	color: var(--muted);
}

/* 표: 칸막이 없이 줄무늬 바탕으로만. */
.entry-content table {
	width: 100%;
	border: 0;
	border-collapse: collapse;
	font-family: var(--font-ui);
	font-size: 0.9375rem;
	line-height: 1.65;
	letter-spacing: 0;
	font-variant-numeric: tabular-nums;
}

.entry-content th,
.entry-content td,
.entry-content .wp-block-table th,
.entry-content .wp-block-table td {
	padding: 0.7em 0.9em;
	border: 0;
	text-align: left;
	vertical-align: top;
}

.entry-content thead th,
.entry-content .wp-block-table thead {
	border: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--muted);
}

.entry-content tbody tr:nth-child(odd) {
	background: var(--tint);
}

.entry-content .wp-block-table {
	overflow-x: auto;
}

.entry-content .wp-block-footnotes,
.entry-content .footnotes {
	margin-top: 4em;
	font-size: 0.875em;
	color: var(--ink-soft);
}

.entry-content .alignwide {
	margin-left: calc(-1 * var(--bleed));
	margin-right: calc(-1 * var(--bleed));
	max-width: none;
	width: auto;
}

.entry-content .alignfull {
	margin-left: calc(-1 * var(--pad-x));
	margin-right: calc(-1 * var(--pad-x));
	max-width: none;
	width: auto;
}

.entry-content .alignfull img {
	border-radius: 0;
}

.page-links {
	display: flex;
	justify-content: center;
	gap: 1.2rem;
	margin-top: 4rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	color: var(--muted);
}

.page-links .current {
	color: var(--ink);
	font-weight: 600;
}

/* 8. 댓글·양식 --------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select {
	width: 100%;
	padding: 0.8em 1em;
	border: 0;
	border-radius: 4px;
	background: var(--tint);
	font-family: var(--font-ui);
	font-size: 0.9375rem;
	line-height: 1.6;
	letter-spacing: 0;
	appearance: none;
	-webkit-appearance: none;
}

input::placeholder,
textarea::placeholder {
	color: var(--muted);
	opacity: 1;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline-offset: 0;
}

button,
input[type="submit"],
input[type="button"],
.wp-block-button__link,
.wp-element-button {
	display: inline-block;
	padding: 0.75em 1.5em;
	border: 0;
	border-radius: 4px;
	background: var(--ink);
	color: var(--paper);
	font-family: var(--font-ui);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background-color 0.2s;
}

button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
	background: var(--accent);
	color: var(--paper);
}

.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-form .search-field {
	flex: 1;
	min-width: 0;
}

.search-form .search-submit {
	flex: none;
}

.comments-area {
	margin-top: 6.5rem;
}

.comments-title,
.comment-reply-title {
	font-family: var(--font-ui);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--ink-soft);
}

.comment-reply-title small {
	margin-left: 0.8em;
	font-weight: 400;
	color: var(--muted);
}

.comment-list,
.comment-list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-list .children {
	padding-left: 1.75rem;
}

.comment-body {
	margin-top: 2.5rem;
}

.comment-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 0.75em;
	margin-bottom: 0.5rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	letter-spacing: 0.01em;
	color: var(--muted);
}

.comment-author .fn {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ink);
}

.comment-author .says {
	display: none;
}

.bypostauthor > .comment-body .fn::after {
	content: "글쓴이";
	margin-left: 0.6em;
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--accent);
}

.comment-content {
	font-size: 0.9375em;
}

.comment-content p + p {
	margin-top: 0.9em;
}

.comment-awaiting-moderation {
	display: block;
	width: 100%;
	color: var(--accent);
}

.reply {
	margin-top: 0.5rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	color: var(--muted);
}

.comment-respond {
	margin-top: 4.5rem;
}

.comment-list .comment-respond {
	margin-top: 2rem;
}

.comment-form {
	display: grid;
	gap: 1rem;
	margin-top: 1.25rem;
}

.comment-form label {
	display: block;
	margin-bottom: 0.4rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	color: var(--muted);
}

.comment-notes,
.logged-in-as,
.no-comments {
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	letter-spacing: 0;
	color: var(--muted);
}

.comment-form-cookies-consent {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
}

.comment-form-cookies-consent label {
	margin: 0;
}

.form-submit {
	margin: 0;
}

/* 9. 접는 여백(쪽지) --------------------------------------------------- */

/* 탭: 어디서든 닿는 작은 종이 조각. 햄버거(선 세 줄) 대신 글자로. */
.margin-toggle {
	position: fixed;
	top: calc(16px + var(--bar));
	right: 18px;
	z-index: 30;
	padding: 0.5em 1.05em;
	border-radius: 999px;
	background: color-mix(in srgb, var(--paper) 82%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: var(--ink-soft);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	transition: color 0.2s, background-color 0.2s;
}

.margin-toggle:hover {
	background: var(--paper);
	color: var(--ink);
}

.no-desk .margin-toggle {
	background: color-mix(in srgb, var(--tint) 85%, transparent);
}

/* 기본(좁은 화면): 오른쪽에서 덮으며 열린다. */
.margin {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 40;
	width: min(360px, 88vw);
	height: 100vh;
	height: 100dvh;
	padding: calc(1.5rem + var(--bar)) 2.25rem 3rem;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--paper);
	box-shadow: -24px 0 80px rgb(29 29 27 / 0.12);
	font-family: var(--font-ui);
	font-size: 0.9375rem;
	line-height: 1.7;
	letter-spacing: 0;
	visibility: hidden;
	transform: translateX(104%);
	transition: transform 0.45s var(--ease), opacity 0.35s var(--ease), visibility 0s 0.45s;
}

.margin-open .margin {
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.scrim {
	position: fixed;
	inset: 0;
	z-index: 35;
	background: color-mix(in srgb, var(--desk) 65%, transparent);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s var(--ease), visibility 0s 0.35s;
}

.margin-open .scrim {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.margin-head {
	display: flex;
	justify-content: flex-end;
	margin: 0 -0.75rem 1.5rem 0;
}

.margin-close {
	padding: 0.4em 0.75em;
	background: none;
	color: var(--muted);
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
}

.margin-close:hover {
	background: none;
	color: var(--ink);
}

.margin-section {
	margin-bottom: 2.75rem;
}

.margin-section[hidden] {
	display: none;
}

.margin .widget-title,
.margin .widget h2,
.margin .widget h3 {
	margin: 0 0 1rem;
	font-family: var(--font-ui);
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: 0.08em;
	color: var(--muted);
}

.margin ul,
.margin ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.margin li {
	margin: 0.55em 0;
}

.margin li ul,
.margin li ol {
	padding-left: 1em;
}

.margin a {
	color: var(--ink-soft);
}

.margin a:hover {
	color: var(--ink);
}

.margin .post-date,
.margin .wp-block-latest-posts__post-date {
	display: block;
	font-size: 0.75rem;
	color: var(--muted);
}

.margin-nav {
	display: none;
	font-size: 1.0625rem;
}

.margin-nav .current-menu-item > a {
	color: var(--ink);
	font-weight: 600;
}

/* 목차 */
.toc-list {
	counter-reset: toc;
}

.toc-list > li {
	counter-increment: toc;
}

.toc-list a {
	display: flex;
	gap: 0.85em;
	align-items: baseline;
	color: var(--muted);
	transition: color 0.2s;
}

.toc-list > li > a::before {
	content: counter(toc, decimal-leading-zero);
	flex: none;
	width: 1.1rem;
	font-size: 0.6875rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
	opacity: 0.75;
}

.margin .toc-list ol {
	padding-left: calc(1.1rem + 0.85em);
	font-size: 0.875rem;
}

.toc-list a:hover,
.toc-list a.is-active {
	color: var(--ink);
}

.toc-list a.is-active {
	font-weight: 600;
}

/* 넓은 화면: 덮지 않는다. 종이가 왼쪽으로 비켜나고, 그 밑에서 쪽지가 빠져나온다. */
@media (min-width: 1240px) {
	.margin {
		top: calc(var(--desk-gap) + var(--bar));
		right: auto;
		left: calc(50% + (var(--sheet-w) - var(--slip-w) + var(--slip-gap)) / 2);
		z-index: 0;
		width: var(--slip-w);
		height: auto;
		max-height: calc(100vh - 2 * var(--desk-gap) - var(--bar));
		padding: 2rem 1.75rem 0.5rem;
		box-shadow: 0 1px 2px rgb(29 29 27 / 0.03), 0 18px 48px rgb(29 29 27 / 0.045);
		opacity: 0;
		transform: translateX(-140px);
	}

	.margin-open .margin {
		opacity: 1;
	}

	.margin-open .sheet {
		transform: translateX(calc((var(--slip-w) + var(--slip-gap)) / -2));
	}

	.no-desk .margin {
		background: var(--tint);
		box-shadow: none;
	}

	.no-desk .margin input,
	.no-desk .margin select,
	.no-desk .margin textarea {
		background: var(--paper);
	}

	.scrim {
		display: none;
	}

	/* 넓은 화면에서는 오른쪽 위 탭 하나로 여닫는다. */
	.margin-head {
		display: none;
	}
}

/* 저장된 펼침 상태로 첫 화면을 그릴 때는 움직이지 않는다. */
.margin-restored .sheet,
.margin-restored .margin {
	transition: none;
}

/* 자바스크립트가 없으면 쪽지는 종이 아래에 그대로 펼쳐 둔다. */
html:not(.js) .margin-toggle,
html:not(.js) .margin-head,
html:not(.js) .scrim {
	display: none;
}

html:not(.js) .margin {
	position: static;
	width: min(100% - 2 * var(--desk-gap), var(--sheet-w));
	height: auto;
	max-height: none;
	margin: 0 auto var(--desk-gap);
	padding: 3rem var(--pad-x);
	visibility: visible;
	opacity: 1;
	transform: none;
}

/* 10. 워드프레스 기본 클래스 ------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	word-wrap: normal !important;
	white-space: nowrap;
}

.skip-link:focus {
	top: 12px;
	left: 12px;
	z-index: 100;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0.7em 1.2em;
	clip: auto !important;
	clip-path: none;
	border-radius: 4px;
	background: var(--ink);
	color: var(--paper);
	font-family: var(--font-ui);
	font-size: 0.875rem;
	white-space: normal;
}

.alignleft {
	float: left;
	margin: 0.4em 2em 1em 0;
}

.alignright {
	float: right;
	margin: 0.4em 0 1em 2em;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

.wp-caption {
	max-width: 100%;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.gallery-item {
	margin: 0;
}

/* 11. 좁은 화면 -------------------------------------------------------- */

/* 종이가 화면을 가득 채우면 책상은 사라진다. */
@media (max-width: 900px) {
	:root {
		--desk-gap: 0px;
		--pad-x: clamp(24px, 7vw, 72px);
		--pad-y: 64px;
		--bleed: calc(var(--pad-x) / 2);
	}

	body {
		background: var(--paper);
	}

	.sheet {
		min-height: 100vh;
		min-height: 100dvh;
		box-shadow: none;
	}

	/* 탭이 머리글과 같은 줄에, 글줄의 오른쪽 끝에 맞춰 놓인다. */
	.sheet {
		padding-top: 30px;
	}

	.margin-mode-drawer .site-header {
		padding-right: 5rem;
	}

	.margin-toggle {
		top: calc(24px + var(--bar));
		right: calc(var(--pad-x) - 1.05em);
		background: color-mix(in srgb, var(--tint) 85%, transparent);
	}

	.site-header {
		margin-bottom: 5rem;
	}
}

@media (max-width: 640px) {
	:root {
		--pad-y: 52px;
	}

	body {
		font-size: min(var(--fs-body), 1.0625rem);
	}

	/* 메뉴는 쪽지 안으로 들어간다. */
	.margin-mode-drawer .primary-nav {
		display: none;
	}

	.margin-mode-drawer .margin-nav {
		display: block;
	}

	.site-header {
		margin-bottom: 4rem;
	}

	.entry-header {
		margin-bottom: 3rem;
	}

	.entry-summary + .entry-summary {
		margin-top: 3.5rem;
	}

	.entry-summary .entry-title {
		font-size: 1.3125rem;
	}

	.entry-content h2 {
		font-size: 1.375rem;
	}

	.entry-content h3 {
		font-size: 1.1875rem;
	}

	.entry-content blockquote {
		padding-left: 1.75em;
	}

	.entry-content .wp-block-pullquote p {
		font-size: 1.25rem;
	}

	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next {
		grid-column: 1;
	}

	.site-footer {
		margin-top: 5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.sheet,
	.margin,
	.scrim {
		transition: none;
	}
}

/* 12. 인쇄: 화면의 종이가 실제 A4가 된다. ------------------------------ */

@page {
	size: A4;
	margin: 25mm;
}

@media print {
	body {
		background: #fff;
		color: #000;
		font-size: 10.5pt;
	}

	.sheet {
		width: auto;
		min-height: 0;
		margin: 0;
		padding: 0;
		box-shadow: none;
		transform: none !important;
		background: none;
	}

	.margin-toggle,
	.margin,
	.scrim,
	.primary-nav,
	.footer-nav,
	.post-navigation,
	.pagination,
	.comment-respond,
	.reply,
	.skip-link {
		display: none !important;
	}

	.site-header {
		margin-bottom: 18mm;
	}

	.entry .entry-title {
		font-size: 22pt;
	}

	.entry-content a {
		color: inherit;
	}

	.entry-content .alignwide,
	.entry-content .alignfull,
	.entry-thumbnail {
		margin-left: 0;
		margin-right: 0;
	}

	h1,
	h2,
	h3,
	h4 {
		break-after: avoid;
	}

	p,
	li {
		orphans: 3;
		widows: 3;
	}

	figure,
	pre,
	blockquote,
	table {
		break-inside: avoid;
	}

	.entry-content pre,
	.entry-content code,
	.entry-content tbody tr:nth-child(odd) {
		background: none;
	}
}
