/* ==========================================================================
   행정실 고인물 — Magazine Layout for GeneratePress
   cookie.pe.kr
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 디자인 토큰 (라이트 모드 전용)
   -------------------------------------------------------------------------- */
:root {
	--cm-bg:          #ffffff;
	--cm-surface:     #f5f6f9;
	--cm-surface-2:   #eceef3;
	--cm-text:        #14161a;
	--cm-text-soft:   #5b616e;
	--cm-text-faint:  #8b919e;
	--cm-line:        #e4e6ec;
	--cm-accent:      #2b59ff;
	--cm-accent-soft: #eaefff;
	--cm-on-accent:   #ffffff;

	--cm-shadow-sm: 0 1px 2px rgba(16, 20, 30, .05);
	--cm-shadow:    0 1px 3px rgba(16, 20, 30, .06), 0 10px 28px rgba(16, 20, 30, .07);

	--cm-radius:    16px;
	--cm-radius-sm: 10px;
	--cm-max:       1220px;
	--cm-gap:       28px;

	--cm-font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
	           system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

/* --------------------------------------------------------------------------
   2. 전역 — GeneratePress 기본값 덮어쓰기
   (이 파일은 generate-style 뒤에 로드되므로 !important 없이도 대부분 이깁니다)
   -------------------------------------------------------------------------- */
html {
	scroll-behavior: smooth;
}

body {
	font-family: var(--cm-font);
	background-color: var(--cm-bg);
	color: var(--cm-text);
	-webkit-font-smoothing: antialiased;
}

.site-content,
.site-header,
.site-footer,
#page {
	background-color: var(--cm-bg);
}

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

h1, h2, h3, h4, h5, h6,
.entry-title {
	font-family: var(--cm-font);
	color: var(--cm-text);
	letter-spacing: -.026em;
	font-weight: 800;
	line-height: 1.3;
}

/* --------------------------------------------------------------------------
   3. 헤더 / 네비게이션
   -------------------------------------------------------------------------- */
.site-header {
	border-bottom: 1px solid var(--cm-line);
}

.main-navigation,
.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle {
	background-color: transparent;
	color: var(--cm-text);
}

.main-navigation .main-nav ul li a {
	font-weight: 600;
	letter-spacing: -.01em;
}

.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li.current-menu-item > a {
	background-color: transparent;
	color: var(--cm-accent);
}

.site-branding .site-title,
.site-branding .site-title a {
	font-weight: 800;
	letter-spacing: -.04em;
	color: var(--cm-text);
}

.site-branding .site-description {
	color: var(--cm-text-soft);
}

/* 로고 — 텍스트 사이트명을 SVG 로고로 대체
   (텍스트는 HTML에 그대로 남아 SEO/스크린리더에서 계속 읽힙니다) */
.site-branding .main-title,
.site-branding .site-title {
	margin: 0;
	line-height: 0;
}

.site-branding .main-title a,
.site-branding .site-title a {
	display: block;
	width: 198px;
	height: 48px;
	background-image: url('assets/logo.svg');
	background-repeat: no-repeat;
	background-position: left center;
	background-size: contain;
	text-indent: -9999px;
	white-space: nowrap;
	overflow: hidden;
}

@media (max-width: 768px) {
	.site-branding .main-title a,
	.site-branding .site-title a {
		width: 162px;
		height: 39px;
	}
}

/* --------------------------------------------------------------------------
   4. 홈(front-page) 전용 — 컨테이너 해제
   -------------------------------------------------------------------------- */
.home #page {
	max-width: none;
	padding: 0;
	margin: 0;
}

.home .site-content {
	display: block;
	padding: 0;
}

.cm-wrap {
	max-width: var(--cm-max);
	margin: 0 auto;
	padding: 0 20px;
}

/* --------------------------------------------------------------------------
   5. 카테고리 바 (가로 스크롤)
   -------------------------------------------------------------------------- */
.cm-catbar {
	border-bottom: 1px solid var(--cm-line);
	background: var(--cm-bg);
	position: sticky;
	top: 0;
	z-index: 40;
}

.cm-catbar-inner {
	max-width: var(--cm-max);
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	gap: 22px;
	overflow-x: auto;
	scrollbar-width: none;
}

.cm-catbar-inner::-webkit-scrollbar { display: none; }

.cm-catbar a {
	flex: 0 0 auto;
	padding: 14px 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--cm-text-soft);
	text-decoration: none;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}

.cm-catbar a:hover {
	color: var(--cm-text);
	border-bottom-color: var(--cm-accent);
}

/* --------------------------------------------------------------------------
   6. 히어로
   -------------------------------------------------------------------------- */
.cm-hero {
	display: grid;
	grid-template-columns: 1.55fr 1fr;
	gap: var(--cm-gap);
	margin: 40px auto 56px;
}

.cm-hero-main .cm-thumb {
	aspect-ratio: 16 / 10;
	border-radius: var(--cm-radius);
}

.cm-hero-main .cm-card-title {
	font-size: clamp(24px, 3.2vw, 38px);
	line-height: 1.28;
	margin: 14px 0 10px;
}

.cm-hero-main .cm-excerpt {
	font-size: 16px;
	-webkit-line-clamp: 3;
}

.cm-hero-side {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.cm-hero-side .cm-card {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: 16px;
	align-items: start;
}

.cm-hero-side .cm-thumb {
	aspect-ratio: 4 / 3;
	border-radius: var(--cm-radius-sm);
}

.cm-hero-side .cm-card-title {
	font-size: 17px;
	line-height: 1.42;
	margin: 8px 0 6px;
}

.cm-hero-side .cm-excerpt { display: none; }

/* --------------------------------------------------------------------------
   7. 카드 공통
   -------------------------------------------------------------------------- */
.cm-card {
	position: relative;
	min-width: 0;
}

.cm-thumb {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: var(--cm-radius-sm);
	background: var(--cm-surface-2);
	box-shadow: var(--cm-shadow-sm);
}

.cm-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}

.cm-card:hover .cm-thumb img {
	transform: scale(1.045);
}

/* 대표이미지 없을 때 플레이스홀더 */
.cm-thumb--empty {
	background: linear-gradient(135deg, var(--cm-surface-2), var(--cm-surface));
}

.cm-cat {
	display: inline-block;
	margin-top: 14px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--cm-accent);
	text-transform: uppercase;
	text-decoration: none;
}

.cm-card-title {
	font-size: 18px;
	line-height: 1.45;
	font-weight: 700;
	letter-spacing: -.028em;
	margin: 8px 0 8px;
}

.cm-card-title a {
	color: var(--cm-text);
	text-decoration: none;
	background-image: linear-gradient(var(--cm-accent), var(--cm-accent));
	background-size: 0 1.5px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size .3s ease, color .15s ease;
}

.cm-card-title a:hover {
	color: var(--cm-accent);
	background-size: 100% 1.5px;
}

.cm-excerpt {
	margin: 0 0 10px;
	font-size: 14.5px;
	line-height: 1.7;
	color: var(--cm-text-soft);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cm-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	color: var(--cm-text-faint);
	font-variant-numeric: tabular-nums;
}

.cm-meta .cm-dot {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	opacity: .6;
}

/* --------------------------------------------------------------------------
   8. 섹션
   -------------------------------------------------------------------------- */
.cm-section {
	margin-bottom: 60px;
}

.cm-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 14px;
	margin-bottom: 26px;
	border-bottom: 2px solid var(--cm-text);
}

.cm-section-head h2 {
	font-size: 21px;
	font-weight: 800;
	letter-spacing: -.035em;
	margin: 0;
}

.cm-section-more {
	flex: 0 0 auto;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--cm-text-soft);
	text-decoration: none;
	transition: color .15s ease;
}

.cm-section-more:hover { color: var(--cm-accent); }

.cm-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 34px var(--cm-gap);
}

.cm-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --------------------------------------------------------------------------
   9. 광고 영역
   -------------------------------------------------------------------------- */
.cm-ad {
	margin: 0 0 56px;
	padding: 20px 0;
	min-height: 280px;
	text-align: center;
	border-top: 1px solid var(--cm-line);
	border-bottom: 1px solid var(--cm-line);
}

.cm-ad__label {
	display: block;
	margin-bottom: 10px;
	font-size: 10.5px;
	letter-spacing: .12em;
	color: var(--cm-text-faint);
	text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   10. 단일 글 / 아카이브 타이포그래피 개선
   -------------------------------------------------------------------------- */
.single .entry-content,
.page .entry-content {
	font-size: 17px;
	line-height: 1.85;
	color: var(--cm-text);
	letter-spacing: -.01em;
}

.single .entry-content p { margin-bottom: 1.5em; }

.single .entry-content h2 {
	margin-top: 2.2em;
	margin-bottom: .7em;
	padding-bottom: .35em;
	font-size: 25px;
	border-bottom: 1px solid var(--cm-line);
}

.single .entry-content h3 {
	margin-top: 1.8em;
	margin-bottom: .6em;
	font-size: 20px;
}

.single .entry-content blockquote {
	margin: 2em 0;
	padding: 4px 0 4px 22px;
	border-left: 3px solid var(--cm-accent);
	color: var(--cm-text-soft);
	font-style: normal;
}

.single .entry-content img {
	border-radius: var(--cm-radius-sm);
}

.single .entry-content code {
	padding: 2px 6px;
	border-radius: 5px;
	background: var(--cm-surface-2);
	font-size: .9em;
}

.single .entry-content pre {
	border-radius: var(--cm-radius-sm);
	background: var(--cm-surface-2);
	padding: 18px;
	overflow-x: auto;
}

.entry-meta,
.entry-meta a {
	color: var(--cm-text-faint);
}

/* 사이드바 위젯 */
.widget-area .widget {
	background: transparent;
	border-bottom: 1px solid var(--cm-line);
	padding-bottom: 24px;
	margin-bottom: 24px;
}

.widget-area .widget-title {
	font-size: 14px;
	font-weight: 800;
	letter-spacing: -.02em;
	margin-bottom: 14px;
}

.widget-area ul li {
	padding: 6px 0;
	border: 0;
}

.widget-area a {
	color: var(--cm-text-soft);
	text-decoration: none;
}

.widget-area a:hover { color: var(--cm-accent); }

.widget-area input[type="search"],
.widget-area input[type="text"] {
	background: var(--cm-surface);
	border: 1px solid var(--cm-line);
	color: var(--cm-text);
	border-radius: var(--cm-radius-sm);
}

/* 푸터 */
.site-footer {
	border-top: 1px solid var(--cm-line);
	color: var(--cm-text-soft);
}

.site-info { background: var(--cm-bg); }

/* --------------------------------------------------------------------------
   11. 반응형
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.cm-grid     { grid-template-columns: repeat(2, 1fr); }
	.cm-grid--4  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	:root { --cm-gap: 20px; }

	.cm-hero {
		grid-template-columns: 1fr;
		margin: 24px auto 40px;
	}

	.cm-hero-side .cm-card {
		grid-template-columns: 108px 1fr;
	}

	.cm-section { margin-bottom: 44px; }

	.cm-section-head h2 { font-size: 19px; }
}

@media (max-width: 560px) {
	.cm-grid,
	.cm-grid--4 { grid-template-columns: 1fr; }

	.cm-card-title { font-size: 17px; }
}

/* 모션 최소화 선호 */
@media (prefers-reduced-motion: reduce) {
	.cm-thumb img,
	.cm-card-title a { transition: none; }
	html { scroll-behavior: auto; }
}
