/*
Theme Name: 도토리수다
Theme URI: https://dotorystory.1446.kr/
Author: 1446.kr
Description: 1446.kr 패밀리 크롬을 쓰는 도토리수다 클래식 테마. 이미지보다 글 요약을 앞에 둔다.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: dotorystory
*/

:root {
	--ds-navy: #2d3e50;
	--ds-navy-dark: #1a2533;
	--ds-accent: #1e40af;
	--ds-bg: #f7f8fa;
	--ds-text: #222;
	--ds-muted: #444;
	--ds-meta: #6b7280;
	--ds-border: #d0d4da;
	--ds-card: #fff;
	--ds-footer: #a7a8aa;
	--ds-radius: 8px;
	--ds-content: 800px;
	--ds-font: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
}

body {
	margin: 0;
	font-family: var(--ds-font);
	background: var(--ds-bg);
	color: var(--ds-text);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--ds-navy);
	color: #fff;
	padding: 8px 12px;
	z-index: 10002;
}
.skip-link:focus {
	left: 8px;
	top: 8px;
}

/* ----- 탑바 (1446.kr) ----- */
.topbar {
	background: var(--ds-navy);
	color: #fff;
	padding: 18px 32px;
	font-size: 1.5rem;
	font-weight: bold;
	letter-spacing: 1px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: relative;
	z-index: 10001;
}
.topbar-logo {
	color: #fff;
	text-decoration: none;
	font-weight: bold;
	font-size: 1.5rem;
	letter-spacing: 1px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.topbar-logo img {
	width: 25px;
	height: 25px;
}
.topbar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	flex-shrink: 0;
}
.topbar-search {
	display: flex;
	align-items: center;
}
.topbar-search .search-box {
	width: 240px;
	max-width: 36vw;
	display: flex;
	margin: 0;
}
.topbar-search .search-box input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 8px 12px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px 0 0 6px;
	font-size: 0.9rem;
	outline: none;
	background: rgba(255, 255, 255, 0.96);
	color: #222;
}
.topbar-search .search-box input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
}
.topbar-search .search-box button {
	padding: 8px 14px;
	border: none;
	background: var(--ds-navy-dark);
	color: #fff;
	font-size: 0.9rem;
	border-radius: 0 6px 6px 0;
	cursor: pointer;
}
.topbar-search .search-box button:hover {
	background: #111820;
}
.topbar-search-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 4px;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.topbar-search-toggle:hover,
.topbar-search-toggle[aria-expanded="true"] {
	background-color: rgba(255, 255, 255, 0.12);
}
.topbar-menu-toggle {
	cursor: pointer;
	padding: 8px;
	border-radius: 4px;
}
.topbar-menu-toggle:hover {
	background-color: rgba(255, 255, 255, 0.1);
}
.hamburger-icon {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(3, 1fr);
	gap: 2px;
	width: 20px;
	height: 20px;
}
.hamburger-icon span {
	background-color: #fff;
	border-radius: 1px;
}

/* ----- 햄버거 메뉴 ----- */
.menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}
.menu-overlay.active {
	opacity: 1;
	visibility: visible;
}
.menu-container {
	position: absolute;
	top: 0;
	right: 0;
	width: 100%;
	max-width: 500px;
	height: 100%;
	background: #fff;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	overflow-y: auto;
}
.menu-overlay.active .menu-container {
	transform: translateX(0);
}
.menu-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px;
	background: #4a545a;
	color: white;
}
.menu-logo-text {
	color: #b1b7b8;
	text-decoration: none;
	font-size: 1.15rem;
	font-weight: bold;
}
.menu-close {
	cursor: pointer;
	font-size: 2rem;
	line-height: 1;
	padding: 5px;
}
.menu-content {
	padding: 20px;
}
.main-navigation {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.menu-section {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.menu-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.menu-row .menu-item {
	flex: 1 1 40%;
}
.menu-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 15px;
	border-radius: var(--ds-radius);
	text-decoration: none;
	color: #333;
	border: 2px solid transparent;
}
.menu-item:hover {
	border: 2px solid #8995bb;
	background-color: #f8f9fa;
}
.menu-item.active {
	background-color: var(--ds-accent);
	color: white;
	border-color: #1e3a8a;
}
.menu-item.primary {
	font-size: 1.15rem;
	font-weight: 600;
}
.menu-item.secondary {
	font-size: 0.95rem;
	font-weight: 500;
}
.menu-item.info {
	font-size: 1rem;
	font-weight: 500;
}
.menu-icon {
	font-size: 1.3rem;
	width: 24px;
	text-align: center;
}
.menu-title {
	flex: 1;
}
.menu-footer {
	padding: 20px;
	text-align: center;
	color: #666;
	font-size: 0.9rem;
	border-top: 1px solid #e5e7eb;
	background-color: #f8f9fa;
}
.menu-footer a {
	color: var(--ds-accent);
	text-decoration: none;
	font-weight: bold;
}
body.menu-open {
	overflow: hidden;
}

/* ----- 본문 레이아웃 ----- */
.site-main {
	flex: 1;
	width: 100%;
}
.home-intro,
.list-wrap {
	max-width: var(--ds-content);
	width: 100%;
	margin: 0 auto;
	padding: 28px 16px 8px;
	box-sizing: border-box;
}
.home-title {
	font-size: 1.45rem;
	color: var(--ds-navy);
	margin: 0 0 10px;
	font-weight: 700;
	line-height: 1.35;
}
.home-intro p,
.archive-lead {
	margin: 0 0 8px;
	line-height: 1.75;
	color: var(--ds-muted);
}

.category-tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	background: #f0f2f5;
	padding: 15px 20px;
	border-bottom: 1px solid #e0e3e8;
}
.category-tab {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 20px;
	background: #fff;
	color: var(--ds-navy);
	font-size: 0.9rem;
	font-weight: 500;
	border: 1px solid var(--ds-border);
	text-decoration: none;
	white-space: nowrap;
}
.category-tab.active,
.category-tab:hover {
	background: var(--ds-navy);
	color: #fff;
	border-color: var(--ds-navy);
}

/* 글 목록: 이미지보다 제목·요약 */
.post-list {
	list-style: none;
	padding: 0;
	margin: 0 0 28px;
}
.post-card {
	background: var(--ds-card);
	border: 1px solid #e5e7eb;
	border-radius: var(--ds-radius);
	padding: 18px 20px;
	margin-bottom: 12px;
	box-sizing: border-box;
}
.post-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin-bottom: 6px;
	font-size: 0.82rem;
	color: var(--ds-meta);
}
.post-card-cat {
	color: var(--ds-accent);
	font-weight: 600;
	text-decoration: none;
}
.post-card-cat:hover {
	text-decoration: underline;
}
.post-card-title {
	margin: 0 0 8px;
	font-size: 1.12rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--ds-navy);
}
.post-card-title a {
	color: var(--ds-navy);
	text-decoration: none;
}
.post-card-title a:hover {
	color: var(--ds-accent);
}
.post-card-excerpt {
	margin: 0 0 10px;
	color: var(--ds-muted);
	font-size: 0.95rem;
	line-height: 1.7;
}
.post-card-more {
	color: var(--ds-accent);
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
}
.post-card-more:hover {
	text-decoration: underline;
}

.pagination-wrap {
	display: flex;
	justify-content: center;
	margin: 8px 0 36px;
}
.pagination-wrap .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}
.pagination-wrap a,
.pagination-wrap span {
	display: inline-block;
	padding: 8px 12px;
	border: 1px solid var(--ds-border);
	border-radius: 6px;
	background: #fff;
	color: var(--ds-navy);
	text-decoration: none;
	font-size: 0.9rem;
}
.pagination-wrap .current {
	background: var(--ds-navy);
	color: #fff;
	border-color: var(--ds-navy);
}

.empty-state {
	background: #fff;
	border-radius: var(--ds-radius);
	padding: 28px 20px;
	text-align: center;
	color: var(--ds-muted);
}

/* ----- 글 상세 ----- */
.public-container {
	max-width: 800px;
	margin: 20px auto;
	background: white;
	padding: 30px;
	border-radius: var(--ds-radius);
	flex: 1;
	width: 100%;
	box-sizing: border-box;
}
.public-header {
	margin-bottom: 28px;
	border-bottom: 2px solid var(--ds-accent);
	padding-bottom: 16px;
}
.guide-kicker {
	color: var(--ds-accent);
	font-weight: 600;
	margin: 0 0 8px;
	font-size: 0.92rem;
}
.guide-kicker a {
	color: var(--ds-accent);
	text-decoration: none;
}
.public-title {
	color: var(--ds-navy);
	margin: 0 0 8px;
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.4;
}
.public-subtitle {
	color: #666;
	font-size: 0.92rem;
	margin: 0;
}

.entry-body {
	line-height: 1.85;
	font-size: 1.02rem;
	color: #222;
}
.entry-body > *:first-child {
	margin-top: 0;
}
.entry-body p {
	margin: 0 0 1em;
}
.entry-body h1,
.entry-body h2,
.entry-body h3 {
	color: var(--ds-navy);
	border-left: 4px solid var(--ds-accent);
	padding-left: 12px;
	margin: 1.5em 0 0.7em;
	line-height: 1.4;
	font-weight: 700;
}
.entry-body p.has-small-font-size,
.entry-body p.has-medium-font-size,
.entry-body p.has-large-font-size,
.entry-body p.has-x-large-font-size,
.entry-body .has-medium-font-size {
	font-size: 1.02rem;
}
.entry-body .wp-block-cover {
	min-height: 180px !important;
	max-height: 280px;
}
.entry-body h1 {
	font-size: 1.2rem;
}
.entry-body h2 {
	font-size: 1.15rem;
}
.entry-body h3 {
	font-size: 1.05rem;
}
.entry-body a {
	color: var(--ds-accent);
}
.entry-body ul,
.entry-body ol {
	padding-left: 1.3em;
	margin: 0 0 1em;
}
.entry-body li {
	margin-bottom: 0.35em;
}
.entry-body blockquote {
	margin: 0 0 1em;
	padding: 12px 16px;
	background: #f8f9fa;
	border-left: 4px solid var(--ds-accent);
	color: #374151;
}
.entry-body figure,
.entry-body .wp-block-image,
.entry-body .wp-block-gallery {
	margin: 1em 0;
}
.entry-body img,
.entry-body video {
	max-width: 100%;
	height: auto;
	border-radius: var(--ds-radius);
}
.entry-body .wp-block-image img,
.entry-body .wp-block-image .components-resizable-box__container {
	max-height: 280px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}
.entry-body .alignwide,
.entry-body .alignfull,
.entry-body .wp-block-image.alignwide,
.entry-body .wp-block-image.alignfull {
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}
.entry-body .wp-block-heading {
	margin-top: 1.4em;
}
.entry-body figcaption,
.entry-body .wp-element-caption {
	font-size: 0.85rem;
	color: var(--ds-meta);
	text-align: center;
	margin-top: 6px;
}
.entry-body pre,
.entry-body code {
	font-family: ui-monospace, Consolas, monospace;
}
.entry-body pre {
	background: #f8f9fa;
	padding: 14px;
	border-radius: 6px;
	overflow-x: auto;
	border: 1px solid #e5e7eb;
}

.related-block {
	margin-top: 36px;
	padding-top: 8px;
	border-top: 1px solid #e5e7eb;
}
.related-block h2 {
	font-size: 1.1rem;
	color: var(--ds-navy);
	margin: 0 0 10px;
}
.related-block ul {
	list-style: none;
	padding: 0;
	margin: 0;
}
.related-block li {
	margin-bottom: 8px;
	line-height: 1.5;
}
.related-block a {
	color: var(--ds-accent);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
}
.related-block a:hover {
	text-decoration: underline;
}

.comments-area {
	margin-top: 32px;
	padding-top: 8px;
	border-top: 1px solid #e5e7eb;
}
.comments-area h2,
.comments-area .comment-reply-title {
	font-size: 1.1rem;
	color: var(--ds-navy);
}
.comment-list {
	list-style: none;
	padding: 0;
	margin: 0 0 20px;
}
.comment-body {
	padding: 12px 0;
	border-bottom: 1px solid #eef0f3;
}
.comment-meta {
	font-size: 0.85rem;
	color: var(--ds-meta);
	margin-bottom: 6px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	max-width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ds-border);
	border-radius: 6px;
	box-sizing: border-box;
	font-family: inherit;
}
.comment-form .submit {
	padding: 10px 18px;
	border: none;
	background: var(--ds-accent);
	color: #fff;
	border-radius: 6px;
	cursor: pointer;
}

/* ----- 푸터 ----- */
.footer-service-nav {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 10px;
	padding: 18px 16px 8px;
	background: var(--ds-bg);
	font-size: 0.95rem;
	margin-top: auto;
}
.footer-service-nav a {
	color: var(--ds-navy);
	text-decoration: none;
}
.footer-service-nav a:hover {
	color: var(--ds-accent);
	text-decoration: underline;
}
.footer-service-sep {
	color: #9aa3ad;
}
.footer {
	background: var(--ds-footer);
	color: #f7f8fa;
	text-align: center;
	padding: 18px 0 12px;
	font-size: 1rem;
}
.footer a {
	text-decoration: none;
	color: inherit;
}
.footer-brand {
	color: #fff;
	font-weight: bold;
	font-size: 1.15rem;
	vertical-align: 2px;
}
.footer img {
	width: 20px;
	height: 20px;
	vertical-align: middle;
}

.dropup {
	position: fixed;
	right: 15px;
	bottom: 73px;
	display: inline-block;
	z-index: 99;
}
.dropbtn {
	background-color: transparent;
	padding: 0;
	border: none;
	cursor: pointer;
}
.dropup-content {
	display: none;
	position: absolute;
	bottom: 50px;
	z-index: 1;
}
.dropup-content a {
	padding: 0 0 5px;
	display: block;
}
.dropup:hover .dropup-content,
.dropup:focus-within .dropup-content {
	display: block;
}
.share {
	width: 50px;
	height: auto;
	opacity: 0.9;
}
.gotop-wrap {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99;
}
.gotop-btn {
	width: 48px;
	height: 47px;
	border-radius: 7px;
	border: none;
	background: #74839eaa;
	color: #fff;
	cursor: pointer;
	font-size: 20px;
}

@media (max-width: 768px) {
	.topbar {
		padding: 15px 20px;
		font-size: 1.3rem;
	}
	.topbar-logo {
		font-size: 1.2rem;
	}
	.topbar-search {
		display: none;
		position: fixed;
		left: 0;
		right: 0;
		width: 100%;
		max-width: none;
		margin: 0;
		box-sizing: border-box;
		padding: 12px 16px;
		background: var(--ds-navy);
		z-index: 10002;
	}
	body.search-open .topbar-search {
		display: flex;
	}
	.topbar-search .search-box {
		width: 100%;
		max-width: none;
	}
	.topbar-search .search-box input[type="search"] {
		font-size: 16px;
	}
	.topbar-search-toggle {
		display: inline-flex;
	}
	.menu-container {
		max-width: 100%;
	}
	.public-container {
		margin: 0;
		padding: 20px 16px 28px;
		border-radius: 0;
	}
	.public-title,
	.home-title {
		font-size: 1.28rem;
	}
	.post-card {
		padding: 16px;
	}
	.category-tabs {
		padding: 12px 15px;
		gap: 6px;
	}
}

@media (max-width: 480px) {
	.topbar {
		padding: 12px 15px;
	}
	.post-card-title {
		font-size: 1.05rem;
	}
}
