/* =========================================================
   HANDSUB 테마 — 피드 레이아웃 (handsub.com 복제)
   좌측 아이콘 레일 + 중앙 글 피드. 라이트/다크 자동 전환.
   토큰 출처: platform/projects/handsub/site/app/globals.css
   ========================================================= */

/* ── Pretendard (가변폰트, handsub.com 동일 자산) ── */
@font-face {
	font-family: "Pretendard Variable";
	src: url("../fonts/PretendardVariable.woff2") format("woff2-variations");
	font-weight: 400 800;
	font-display: swap;
}

/* ── Feed 토큰 (라이트 기본 · 시스템 다크 자동 따름) ── */
:root {
	--feed-bg: #ffffff;
	--feed-surface: #fafafa;
	--feed-surface-hover: #f5f5f5;
	--feed-border: #e5e5e5;
	--feed-text: #0a0a0a;
	--feed-text-dim: #555555;
	--feed-text-faint: #636363;
	--feed-accent: #ff4d4d;
}
@media (prefers-color-scheme: dark) {
	:root {
		--feed-bg: #0a0a0a;
		--feed-surface: #181818;
		--feed-surface-hover: #1f1f1f;
		--feed-border: #2a2a2a;
		--feed-text: #f5f5f5;
		--feed-text-dim: #999999;
		--feed-text-faint: #8a8a8a;
		--feed-accent: #ff4d4d;
	}
}

/* ── reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; vertical-align: top; }
a { color: inherit; text-decoration: none; }
ul, li { list-style: none; }
html { scroll-behavior: smooth; background: var(--feed-bg); }
body {
	font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, "Noto Sans KR", sans-serif;
	-webkit-font-smoothing: antialiased;
	background: var(--feed-bg);
	color: var(--feed-text);
	line-height: 1.6;
}
::selection { background: var(--feed-text); color: var(--feed-bg); }

/* ── 루트 레이아웃 ── */
.feed-root { min-height: 100vh; background: var(--feed-bg); }

/* ── 좌측 아이콘 레일 (데스크탑) ── */
.rail {
	position: fixed; left: 0; top: 0; z-index: 40;
	width: 120px; height: 100vh;
	display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
	background: var(--feed-bg);
}
.rail-logo {
	height: 64px; width: 100%;
	display: flex; align-items: center; justify-content: center;
	margin-bottom: 16px;
	color: var(--feed-text);
}
.rail-logo svg { width: 24px; height: auto; }
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rail-link {
	width: 48px; height: 48px;
	display: flex; align-items: center; justify-content: center;
	color: var(--feed-text-faint);
	transition: color .15s ease;
}
.rail-link:hover { color: var(--feed-text); }
.rail-link.is-active { color: var(--feed-text); }

/* ── 모바일 하단 탭바 ── */
.mobilebar { display: none; }

/* ── 메인 영역 ── */
.feed-main { margin-left: 120px; }

/* ── 상단 바 (모바일 로고) ── */
.feed-topbar {
	position: sticky; top: 0; z-index: 30;
	height: 64px; padding: 0 16px;
	display: flex; align-items: center;
	background: var(--feed-bg);
}
.feed-topbar-logo { display: none; color: var(--feed-text); }
.feed-topbar-logo svg { width: 90px; height: auto; }

/* ── 중앙 컨테이너 (max 676px) ── */
.feed-container { max-width: 676px; margin: 0 auto; padding: 0 16px; }

/* ── 피드 헤더 (최신 글) ── */
.feed-head { padding: 40px 0 16px; }
.feed-label { font-size: 12px; color: var(--feed-text-faint); }

/* ── 글 카드 (ThreadCard) ── */
.thread-card { border-bottom: 1px solid var(--feed-border); }
.thread-link { display: block; padding: 28px 0; border-radius: 2px; }
.thread-head { margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.thread-title { font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--feed-text); }
.thread-cat { font-size: 12px; color: var(--feed-text); }
.thread-summary { font-size: 14px; line-height: 1.65; color: var(--feed-text-dim); margin-bottom: 16px; }
.thread-more { display: flex; justify-content: flex-end; }
.thread-more span { font-size: 12px; color: var(--feed-text-faint); transition: color .15s ease; }
.thread-link:hover .thread-more span { text-decoration: underline; }

/* ── 빈 상태 ── */
.feed-empty { padding: 80px 0; text-align: center; color: var(--feed-text-faint); }
.feed-empty-title { font-size: 15px; font-weight: 600; color: var(--feed-text-dim); }
.feed-empty-sub { margin-top: 8px; font-size: 13px; line-height: 1.7; }

/* ── 페이지네이션 ── */
.feed-pagination { padding: 32px 0; }
.feed-pagination .nav-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.feed-pagination a, .feed-pagination .current {
	font-size: 13px; padding: 6px 12px; border-radius: 6px;
	color: var(--feed-text-dim); border: 1px solid var(--feed-border);
}
.feed-pagination .current { color: var(--feed-text); border-color: var(--feed-text); }

/* ── 싱글 글 / 고정페이지 ── */
.single { padding: 24px 0 40px; }
.single-cat { font-size: 12px; color: var(--feed-text-faint); margin-bottom: 10px; }
.single-title { font-size: 26px; font-weight: 700; line-height: 1.3; color: var(--feed-text); }
.single-meta { margin-top: 12px; font-size: 13px; color: var(--feed-text-faint); }
.single-body { margin-top: 32px; }
.single-back { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--feed-border); }
.single-back a { font-size: 13px; color: var(--feed-text-faint); }
.single-back a:hover { color: var(--feed-text); }

/* ── 본문 prose (다크/라이트 자동) ── */
.prose-feed { color: var(--feed-text-dim); font-size: 15px; line-height: 1.8; }
.prose-feed > * + * { margin-top: 1rem; }
.prose-feed h2 { font-size: 18px; font-weight: 600; color: var(--feed-text); margin: 2.5rem 0 .75rem; line-height: 1.4; }
.prose-feed h3 { font-size: 16px; font-weight: 600; color: var(--feed-text); margin: 2rem 0 .5rem; }
.prose-feed p { color: var(--feed-text-dim); }
.prose-feed strong { color: var(--feed-text); font-weight: 600; }
.prose-feed a { color: var(--feed-text); text-decoration: underline; text-underline-offset: 3px; }
.prose-feed ul, .prose-feed ol { padding-left: 1.5rem; }
.prose-feed li { margin-top: .25rem; list-style: revert; }
.prose-feed img { border-radius: 10px; margin: 1.5rem 0; }
.prose-feed code { background: var(--feed-surface); padding: .125rem .375rem; border-radius: 4px; font-size: .875em; }
.prose-feed pre { background: var(--feed-surface); padding: 1rem; border-radius: 8px; overflow-x: auto; }
.prose-feed blockquote { border-left: 3px solid var(--feed-border); padding-left: 1rem; color: var(--feed-text-faint); }
.prose-feed hr { border: 0; border-top: 1px solid var(--feed-border); margin: 2rem 0; }

/* ── 미니 푸터 ── */
.mini-footer {
	margin-top: 48px; padding: 24px 0 32px;
	border-top: 1px solid var(--feed-border);
	font-size: 11px; line-height: 1.7;
	color: var(--feed-text-faint);
}
.mf-brand { font-weight: 500; color: var(--feed-text-dim); }
.mf-line { margin-top: 2px; }
.mf-links { margin-top: 12px; display: flex; gap: 12px; }
.mf-links a { transition: opacity .15s ease; }
.mf-links a:hover { opacity: .7; }
.mf-note { margin-top: 12px; opacity: .7; }

/* ── 서비스/문의 등 정적 섹션 보조 ── */
.hs-section { padding: 8px 0 24px; }
.hs-section h2 { font-size: 20px; font-weight: 700; color: var(--feed-text); margin-top: 32px; }
.hs-lead { font-size: 15px; color: var(--feed-text-dim); line-height: 1.8; margin-top: 12px; }

/* =========================================================
   반응형 — 모바일 (≤768px): 레일 숨기고 하단 탭바
   ========================================================= */
@media (max-width: 768px) {
	.rail { display: none; }
	.feed-main { margin-left: 0; padding-bottom: 80px; }
	.feed-topbar { justify-content: center; }
	.feed-topbar-logo { display: flex; align-items: center; }

	.mobilebar {
		display: flex;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
		background: var(--feed-bg);
		border-top: 1px solid var(--feed-border);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.mobilebar-link {
		flex: 1 1 0;
		display: flex; flex-direction: column; align-items: center; justify-content: center;
		gap: 2px; padding: 10px 0;
		color: var(--feed-text-faint);
		transition: color .15s ease;
	}
	.mobilebar-link.is-active { color: var(--feed-text); }
	.mobilebar-link span { font-size: 11px; }
	.mobilebar-link svg { width: 22px; height: 22px; }
}

/* =========================================================
   개인정보처리방침 / 약관 (page-privacy.php) — 토큰 적용
   ========================================================= */
.privacy_page .pp_inner { max-width: 676px; margin: 0 auto; padding: 24px 16px 80px; }
.pp_head h1 { font-size: 26px; font-weight: 700; color: var(--feed-text); }
.pp_lead { margin-top: 14px; color: var(--feed-text-dim); line-height: 1.7; }
.pp_sec { margin-top: 36px; }
.pp_sec h2 { font-size: 17px; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--feed-border); margin-bottom: 16px; color: var(--feed-text); }
.pp_table { width: 100%; border-collapse: collapse; }
.pp_table th, .pp_table td { text-align: left; padding: 12px 14px; border: 1px solid var(--feed-border); font-size: 14px; color: var(--feed-text-dim); }
.pp_table th { width: 160px; background: var(--feed-surface); font-weight: 600; color: var(--feed-text); }
.pp_body { line-height: 1.7; color: var(--feed-text-dim); }
.pp_foot { margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--feed-border); color: var(--feed-text-faint); line-height: 1.7; }
.pp_hint { margin-top: 10px; font-size: 12px; color: var(--feed-text-faint); background: var(--feed-surface); border: 1px solid var(--feed-border); border-radius: 8px; padding: 10px 12px; line-height: 1.6; }
.pp_body ul { padding-left: 0; list-style: none; }
.pp_body li { margin-top: 4px; }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* , *::before, *::after { transition-duration: .01ms !important; }
}
