/*
Theme Name: peterwalterpaul Theme
Theme URI: https://peterwalterpaul.com
Author: LSM
Author URI: https://peterwalterpaul.com
Description: peterwalterpaul 블로그를 위한 커스텀 워드프레스 테마입니다.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
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: peterwalterpaul
Tags: blog, one-column, right-sidebar, custom-menu, featured-images, threaded-comments
*/

/* ==========================================================================
   1. 변수 (CSS Custom Properties)
   ========================================================================== */
:root {
	--color-text: #222;
	--color-muted: #666;
	--color-bg: #fff;
	--color-border: #e5e5e5;
	--color-accent: #2563eb;
	--color-code-bg: #f1f1f1;
	--font-base: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
	--font-mono: "D2Coding", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	--container-width: 1100px;
	--gap: 2rem;
}

/* ==========================================================================
   2. 기본 리셋
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: var(--font-base);
	font-size: 16px;
	line-height: 1.7;
	color: var(--color-text);
	background: var(--color-bg);
	word-break: keep-all;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--color-accent);
	text-decoration: none;
}

a:hover,
a:focus {
	text-decoration: underline;
}

/* ==========================================================================
   3. 레이아웃
   ========================================================================== */
.container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 1rem;
}

.site-content {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: var(--gap);
	padding: var(--gap) 0;
}

.site-content.no-sidebar {
	grid-template-columns: 1fr;
}

/* ==========================================================================
   4. 헤더 & 내비게이션
   ========================================================================== */
.site-header {
	border-bottom: 1px solid var(--color-border);
	padding: 1rem 0;
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}

.site-title {
	margin: 0;
	font-size: 1.5rem;
}

.site-title a {
	color: var(--color-text);
}

.site-description {
	margin: 0;
	color: var(--color-muted);
	font-size: 0.875rem;
}

.main-navigation ul {
	display: flex;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-navigation a {
	color: var(--color-text);
}

.main-navigation a[aria-current="page"] {
	font-weight: 700;
}

/* ==========================================================================
   5. 글 목록 & 본문
   ========================================================================== */
.post {
	margin-bottom: 3rem;
}

.entry-title {
	margin: 0 0 0.5rem;
	line-height: 1.3;
}

.entry-title a {
	color: var(--color-text);
}

.entry-meta {
	color: var(--color-muted);
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.entry-thumbnail {
	margin-bottom: 1rem;
}

.entry-content > * + * {
	margin-top: 1.25em;
}

.entry-footer {
	margin-top: 1.5rem;
	font-size: 0.875rem;
	color: var(--color-muted);
}

/* 코드블럭 */
.entry-content pre,
.entry-content .wp-block-code {
	margin: 1.5em 0;
	padding: 1.25rem 1.5rem;
	border: 0;
	border-radius: 8px;
	background: var(--color-code-bg);
	color: var(--color-text);
	font-family: var(--font-mono);
	font-size: 0.875rem;
	line-height: 1.6;
	overflow-x: auto;
	word-break: normal; /* body 의 keep-all 해제 */
	white-space: pre;
	tab-size: 4;
}

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

/* 인라인 코드 */
.entry-content :not(pre) > code {
	padding: 0.15em 0.4em;
	border-radius: 4px;
	background: var(--color-code-bg);
	font-family: var(--font-mono);
	font-size: 0.875em;
}

/* 인용구 */
.entry-content blockquote,
.entry-content .wp-block-quote {
	margin: 1.75em 0;
	padding: 1.25rem 1.5rem;
	border: 0;
	border-left: 4px solid var(--color-accent);
	border-radius: 0 8px 8px 0;
	background: #f7f8fa;
	color: #444;
	font-size: 1.0625rem;
}

.entry-content blockquote > :first-child {
	margin-top: 0;
}

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

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

.entry-content blockquote cite {
	display: block;
	margin-top: 0.75rem;
	color: var(--color-muted);
	font-size: 0.875rem;
	font-style: normal;
}

.entry-content blockquote cite::before {
	content: "— ";
}

/* 페이지네이션 */
.pagination,
.post-navigation {
	margin: 2rem 0;
}

.nav-links {
	display: flex;
	gap: 0.5rem;
	justify-content: space-between;
}

/* ==========================================================================
   6. 사이드바 (sidebar.php, template-parts/sidebar/)
   ========================================================================== */
.side-section {
	margin-bottom: 2rem;
}

.side-section-title {
	font-size: 1rem;
	border-bottom: 2px solid var(--color-text);
	padding-bottom: 0.5rem;
}

.side-section ul {
	padding-left: 1.25rem;
}

.side-date,
.side-comment-author {
	color: var(--color-muted);
	font-size: 0.875rem;
}

.side-comment-author {
	font-weight: 600;
}

/* 검색 폼 (searchform.php) */
.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-field {
	flex: 1;
	min-width: 0;
	height: 40px;
	padding: 0 1rem;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	font: inherit;
}

.search-submit {
	height: 40px;
	padding: 0 1rem;
	border: 0;
	border-radius: 999px;
	background: var(--color-text);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

/* ==========================================================================
   7. 댓글
   레딧 스타일 스레드 댓글은 assets/css/comments.css 에서 관리합니다.
   ========================================================================== */

/* ==========================================================================
   8. 푸터
   ========================================================================== */
.site-footer {
	border-top: 1px solid var(--color-border);
	padding: 2rem 0;
	color: var(--color-muted);
	font-size: 0.875rem;
	text-align: center;
}

.footer-navigation ul {
	display: flex;
	justify-content: center;
	gap: 1rem;
	margin: 0 0 0.5rem;
	padding: 0;
	list-style: none;
}

.footer-navigation a {
	color: var(--color-muted);
}

/* ==========================================================================
   9. 워드프레스 필수 클래스
   ========================================================================== */
.alignleft {
	float: left;
	margin: 0 1.5em 1em 0;
}

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

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

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

.wp-caption-text,
.gallery-caption {
	font-size: 0.875rem;
	color: var(--color-muted);
	text-align: center;
}

.sticky .entry-title::before {
	content: "📌 ";
}

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

.screen-reader-text:focus {
	background-color: #f1f1f1;
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ==========================================================================
   10. 반응형
   ========================================================================== */
@media (max-width: 768px) {
	.site-content {
		grid-template-columns: 1fr;
	}

	.main-navigation ul {
		flex-wrap: wrap;
	}
}
