:root {
	--bg: #fbfaf7;
	--surface: #ffffff;
	--text: #20242a;
	--muted: #636a70;
	--line: #e3dfd5;
	--accent: #b4532a;
	--accent-dark: #8f3f1e;
	--wrap: 1160px;
}

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	font-size: 17px;
	line-height: 1.75;
	letter-spacing: -0.01em;
	word-break: keep-all;
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.025em; }

.wrap { width: min(var(--wrap), 100%); margin-inline: auto; padding-inline: 24px; }

/* 헤더 */
.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { color: var(--text); font-size: 20px; font-weight: 700; text-decoration: none; }
.brand:hover { color: var(--text); }
.site-nav { display: flex; gap: 24px; font-size: 15px; }
.site-nav a { color: var(--text); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.nav-toggle { position: absolute; opacity: 0; width: 44px; height: 44px; right: 16px; margin: 0; cursor: pointer; display: none; z-index: 2; }
.nav-button { display: none; width: 44px; height: 44px; position: relative; }
.nav-button span, .nav-button span::before, .nav-button span::after {
	content: "";
	position: absolute;
	left: 10px;
	width: 24px;
	height: 2px;
	background: var(--text);
}
.nav-button span { top: 21px; }
.nav-button span::before { left: 0; top: -7px; }
.nav-button span::after { left: 0; top: 7px; }

/* 목록 */
.hero { padding: 40px 0 20px; }
.hero h1 { margin: 0; font-size: clamp(22px, 3.2vw, 34px); }
.hero.compact { padding: 48px 0 24px; }
.hero.compact h1 { font-size: clamp(28px, 4vw, 40px); }

.category-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.category-pills a {
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-size: 14px;
	text-decoration: none;
}
.category-pills a:hover { border-color: var(--accent); color: var(--accent); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
}
.card-cover img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .3s ease; }
.card-cover { overflow: hidden; }
.card:hover .card-cover img { transform: scale(1.03); }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 20px 22px 22px; }
.card-category { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.card h2 { margin: 6px 0 8px; font-size: 21px; line-height: 1.4; }
.card h2 a { color: var(--text); text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card p {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin: 0 0 12px;
	color: var(--muted);
	font-size: 15px;
}
.card time { margin-top: auto; color: var(--muted); font-size: 13px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 48px; font-size: 15px; }

/* 글 */
.entry { max-width: 720px; margin: 48px auto 0; }
.entry h1 { margin: 6px 0 8px; font-size: clamp(30px, 5vw, 42px); }
.entry header time { color: var(--muted); font-size: 14px; }
.entry-cover { width: 100%; margin: 24px 0; border-radius: 12px; }
.entry-content h2 { margin: 2em 0 .6em; font-size: 28px; }
.entry-content h3 { margin: 1.8em 0 .5em; font-size: 22px; }
.entry-content img { margin: 1.5em auto; border-radius: 8px; }
.entry-content .gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 1.5em 0;
}
.entry-content .gallery figure { margin: 0; }
.entry-content .gallery > figure:only-child { grid-column: 1 / -1; }
.entry-content .gallery img { width: 100%; height: 100%; margin: 0; object-fit: cover; }
.entry-content > figure { margin: 1.5em 0; }
.entry-content figcaption { margin-top: 6px; color: var(--muted); font-size: 14px; text-align: center; }
.entry-content table { width: 100%; margin: 1.5em 0; border-collapse: collapse; font-size: 15px; }
.entry-content th, .entry-content td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content th { color: var(--muted); font-size: 13px; font-weight: 600; }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.entry-ad { margin: 2em 0; text-align: center; }
.entry-ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.entry-ad-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.entry-ad-unit { display: inline-block; width: 720px; height: 90px; }

.entry-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 32px; font-size: 14px; }
.entry-tags a { color: var(--muted); text-decoration: none; }
.entry-tags a:hover { color: var(--accent); }

/* 댓글 */
.comments { max-width: 720px; margin: 64px auto 0; padding-top: 32px; border-top: 1px solid var(--line); }
.comments h2 { margin-top: 0; font-size: 22px; }
.comments ol { margin: 0 0 32px; padding: 0; list-style: none; }
.comments li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comments li time { margin-left: 8px; color: var(--muted); font-size: 13px; }
.comments li p { margin: 6px 0 0; }
.comments form, .stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
input, textarea, select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-weight: 400;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .button {
	display: inline-block;
	justify-self: start;
	padding: 10px 20px;
	border: 0;
	border-radius: 8px;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
button:hover, .button:hover { background: var(--accent-dark); color: #fff; }
.hp { position: absolute; left: -9999px; }
.muted { color: var(--muted); font-size: 14px; }
.notice { padding: 10px 14px; border-radius: 8px; background: #f3e4d9; font-size: 15px; }

.search-form { display: flex; gap: 8px; max-width: 520px; margin-top: 16px; }
.search-form button { flex: none; }
.result-count { color: var(--muted); }

/* 푸터 */
.site-footer { margin-top: 80px; background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px; color: var(--muted); font-size: 14px; }
.footer-inner a { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }

@media (max-width: 960px) {
	.card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

@media (max-width: 760px) {
	.nav-toggle, .nav-button { display: block; }
	.site-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		flex-direction: column;
		gap: 0;
		padding: 8px 24px 16px;
		background: var(--surface);
		border-bottom: 1px solid var(--line);
	}
	.site-nav a { padding: 12px 0; font-size: 17px; }
	.nav-toggle:checked ~ .site-nav { display: flex; }
	.hero { padding: 28px 0 14px; }
}

@media (max-width: 600px) {
	.wrap { padding-inline: 18px; }
	.card-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
	.entry-ad-unit { width: 468px; height: 60px; }
}

@media (max-width: 520px) {
	.entry-ad-unit { width: 320px; height: 100px; }
}

@media (max-width: 355px) {
	.entry-ad-unit { width: 300px; height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
	.card-cover img { transition: none; }
	.card:hover .card-cover img { transform: none; }
}
