/* ─────────────────────────────────────────────────────────
 * rhymix.kr docs — design unified with el_rhymix landing
 * Light theme · Pretendard + Inter + JetBrains Mono
 * ───────────────────────────────────────────────────────── */

:root {
	--rxred-50:  #fef2f2;
	--rxred-100: #fee2e2;
	--rxred-500: #ef4444;
	--rxred-600: #dc2626;
	--rxred-700: #b91c1c;

	--ink-50:  #fafafa;
	--ink-100: #f4f4f5;
	--ink-200: #e4e4e7;
	--ink-300: #d4d4d8;
	--ink-400: #a1a1aa;
	--ink-500: #71717a;
	--ink-600: #52525b;
	--ink-700: #3f3f46;
	--ink-800: #27272a;
	--ink-900: #18181b;
	--ink-950: #09090b;

	--bg:        #ffffff;
	--text:      var(--ink-900);
	--muted:     var(--ink-500);
	--border:    var(--ink-200);
	--code-bg:   var(--ink-950);
	--code-text: #e4e4e7;

	--sidebar-w: 280px;
	--topnav-h:  64px;
	--content-max: 880px;

	--font-sans: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
	--font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

	--shadow-sm: 0 1px 2px rgba(0,0,0,.04);
	--shadow:    0 4px 24px -8px rgba(0,0,0,.08);
}

/* ─── Reset / Base ───────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	padding: 0;
	max-width: none;
	font-family: var(--font-sans);
	font-size: 15px;
	line-height: 1.7;
	color: var(--text);
	background: var(--bg);
	letter-spacing: -.01em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: "ss01", "ss02";
}

a { color: var(--rxred-600); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--rxred-700); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .6em;
	font-weight: 700;
	line-height: 1.3;
	color: var(--text);
	letter-spacing: -.015em;
}
h1 { font-size: 2.25rem; margin-top: 0; }
h2 { font-size: 1.6rem; margin-top: 2.2em; padding-top: .5em; }
h3 { font-size: 1.25rem; margin-top: 1.8em; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.5em; margin: 0 0 1.1em; }
li { margin-bottom: .3em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

blockquote {
	margin: 1.5em 0;
	padding: 1em 1.4em;
	border-left: 3px solid var(--rxred-600);
	background: var(--rxred-50);
	color: var(--ink-700);
	border-radius: 0 8px 8px 0;
}
blockquote p:last-child { margin-bottom: 0; }

code {
	font-family: var(--font-mono);
	font-size: .88em;
	background: var(--ink-100);
	color: var(--ink-900);
	padding: .15em .4em;
	border-radius: 4px;
	border: 1px solid var(--ink-200);
}

pre {
	margin: 1.5em 0;
	padding: 1.2em 1.4em;
	background: var(--code-bg);
	color: var(--code-text);
	border-radius: 10px;
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: .88em;
	line-height: 1.65;
}
pre code { background: none; border: none; padding: 0; color: inherit; font-size: 1em; }

table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .94em; }
th, td { padding: .75em 1em; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: var(--ink-50); color: var(--ink-700); font-size: .82em; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: var(--ink-50); }

img { max-width: 100%; height: auto; border-radius: 8px; }
button { font-family: inherit; cursor: pointer; }

/* ─── Top Nav (el_rhymix 통일) ───────────────────────────── */

.ea-topnav {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, .85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
	height: var(--topnav-h);
}
.ea-topnav-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}
.ea-logo {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 800;
	font-size: 1.05rem;
	letter-spacing: -.02em;
	color: var(--text);
	text-decoration: none;
}
.ea-logo:hover { color: var(--text); text-decoration: none; }
.ea-logo-mark {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: var(--ink-950);
	color: white;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: .85rem;
	font-weight: 900;
}
.ea-logo-kr { color: var(--rxred-600); }
.ea-topnav-menu {
	display: flex;
	align-items: center;
	gap: 28px;
	flex: 1;
	justify-content: center;
}
.ea-topnav-menu a {
	color: var(--ink-600);
	font-size: .9rem;
	font-weight: 500;
	text-decoration: none;
	transition: color .15s;
}
.ea-topnav-menu a:hover { color: var(--text); text-decoration: none; }
.ea-topnav-menu a.active { color: var(--text); font-weight: 600; }
.ea-topnav-actions { display: flex; align-items: center; gap: 10px; }
.ea-btn-ghost, .ea-btn-primary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .82rem;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 7px;
	text-decoration: none;
	transition: all .15s;
	border: 1px solid transparent;
}
.ea-btn-ghost { color: var(--ink-600); }
.ea-btn-ghost:hover { color: var(--text); background: var(--ink-100); text-decoration: none; }
.ea-btn-primary { background: var(--ink-950); color: white; }
.ea-btn-primary:hover { background: var(--ink-800); color: white; text-decoration: none; }

@media (max-width: 768px) {
	.ea-topnav-menu { display: none; }
	.ea-topnav-inner { padding: 0 16px; }
}

/* ─── Container / Sidebar Layout ─────────────────────────── */

.container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
	display: grid;
	grid-template-columns: var(--sidebar-w) 1fr;
	gap: 48px;
	align-items: start;
}

.sidebar {
	position: sticky;
	top: calc(var(--topnav-h) + 24px);
	height: calc(100vh - var(--topnav-h) - 48px);
	overflow-y: auto;
	padding: 24px 0;
	font-size: .9rem;
	scrollbar-width: thin;
	scrollbar-color: var(--ink-300) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

.content {
	min-width: 0;
	padding: 32px 0 80px;
	max-width: var(--content-max);
}

@media (max-width: 1024px) {
	.container { grid-template-columns: 240px 1fr; gap: 32px; }
}
@media (max-width: 768px) {
	.container { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
	.sidebar { position: static; height: auto; max-height: none; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
}

/* ─── Sidebar Navigation ─────────────────────────────────── */

.nav-section { margin-bottom: 8px; }
.nav-section h3 {
	margin: 0 0 12px;
	font-size: .78rem;
	font-weight: 700;
	color: var(--ink-900);
	text-transform: uppercase;
	letter-spacing: .08em;
	padding: 0 12px;
}
.nav-section h3 a { color: inherit; text-decoration: none; }
.nav-section h3 a:hover { color: var(--rxred-600); }

.nav-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	cursor: pointer;
	border-radius: 6px;
	margin-bottom: 2px;
	user-select: none;
	transition: background .12s;
}
.nav-section-header:hover { background: var(--ink-50); }
.nav-section-header h4 { margin: 0; font-size: .85rem; font-weight: 600; color: var(--ink-800); }
.nav-section-toggle { font-size: .65rem; color: var(--ink-400); transition: transform .2s; }
.nav-section.collapsed .nav-section-toggle { transform: rotate(-90deg); }
.nav-section.collapsed .nav-section-content { display: none; }

.nav-section-content { padding: 4px 0 12px; }
.nav-section-content ul { list-style: none; padding: 0; margin: 0; }
.nav-section-content li { margin: 0; }
.nav-section-content a {
	display: block;
	padding: 6px 12px 6px 24px;
	color: var(--ink-600);
	text-decoration: none;
	font-size: .88rem;
	border-radius: 6px;
	border-left: 2px solid transparent;
	margin-left: 6px;
	transition: all .12s;
}
.nav-section-content a:hover { color: var(--text); background: var(--ink-50); text-decoration: none; }
.nav-section-content a.active,
.nav-section-content a.current {
	color: var(--rxred-600);
	background: var(--rxred-50);
	border-left-color: var(--rxred-600);
	font-weight: 600;
}
.sub-item { padding-left: 36px !important; font-size: .82rem !important; color: var(--ink-500) !important; }
.nav-section-empty { padding: 8px 12px; color: var(--ink-400); font-size: .82rem; font-style: italic; }
.nav-item-hidden { display: none; }

/* ─── Search ─────────────────────────────────────────────── */

.search-container { position: relative; padding: 0 12px; margin-bottom: 20px; }
.search-box {
	width: 100%;
	padding: 10px 36px 10px 36px;
	font-size: .88rem;
	font-family: inherit;
	background: var(--ink-50);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text);
	transition: all .15s;
}
.search-box:focus { outline: none; background: white; border-color: var(--ink-400); box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.search-box::placeholder { color: var(--ink-400); }
.search-icon { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
.search-clear { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--ink-400); cursor: pointer; padding: 4px; border-radius: 4px; display: none; }
.search-clear:hover { background: var(--ink-100); color: var(--ink-700); }
.search-kbd-hint { font-feature-settings: "tnum"; }

.search-results {
	position: absolute;
	top: calc(100% + 4px);
	left: 12px;
	right: 12px;
	max-height: 60vh;
	overflow-y: auto;
	background: white;
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: var(--shadow);
	z-index: 10;
	padding: 6px;
}
.search-result-item { display: block; padding: 10px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .85rem; transition: background .12s; }
.search-result-item:hover { background: var(--ink-50); text-decoration: none; }
.search-result-item strong { display: block; font-weight: 600; margin-bottom: 2px; }
.search-result-item small { color: var(--ink-500); font-size: .78rem; }
.search-highlight { background: var(--rxred-100); color: var(--rxred-700); font-weight: 600; padding: 0 2px; border-radius: 2px; }

/* ─── Content / Markdown Body ────────────────────────────── */

.markdown-body, .manual-content { font-size: 1rem; line-height: 1.75; }

.content-header { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.content-header h1 { margin: 0 0 8px; }
.content-header .meta { color: var(--ink-500); font-size: .85rem; }

.content-footer {
	margin-top: 64px;
	padding-top: 32px;
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-500); margin-bottom: 20px; }
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: var(--ink-300); }

.nav-links { display: flex; gap: 12px; flex-wrap: wrap; }
.nav-links a {
	flex: 1;
	min-width: 240px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 18px;
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text);
	text-decoration: none;
	transition: all .15s;
	background: white;
}
.nav-links a:hover { border-color: var(--ink-400); transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.nav-links a .label { font-size: .72rem; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: .08em; }
.nav-links a .title { font-size: .95rem; font-weight: 600; }

/* ─── Manual tabs ────────────────────────────────────────── */

.manual-tabs {
	display: flex;
	gap: 2px;
	background: var(--ink-100);
	padding: 3px;
	border-radius: 10px;
	margin-bottom: 24px;
	width: fit-content;
}
.manual-tab {
	padding: 7px 16px;
	border-radius: 7px;
	font-size: .85rem;
	font-weight: 500;
	color: var(--ink-600);
	background: transparent;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: all .15s;
}
.manual-tab.active { background: white; color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.manual-tab:hover:not(.active) { color: var(--text); text-decoration: none; }

/* ─── Chapter group / collapsible ────────────────────────── */

.chapter-group {
	margin-bottom: 16px;
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
	background: white;
}
.chapter-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	cursor: pointer;
	user-select: none;
	background: var(--ink-50);
	transition: background .12s;
}
.chapter-header:hover { background: var(--ink-100); }
.chapter-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.chapter-toggle { color: var(--ink-400); font-size: .8rem; transition: transform .2s; }
.chapter-group.collapsed .chapter-toggle { transform: rotate(-90deg); }
.chapter-group.collapsed .chapter-content { display: none; }
.chapter-content { padding: 16px 20px; }

/* ─── Callout boxes ──────────────────────────────────────── */

.note, .tip, .warning, .info {
	margin: 1.5em 0;
	padding: 1em 1.4em;
	border-radius: 10px;
	border-left: 3px solid;
	font-size: .94em;
}
.note     { background: var(--ink-50);    border-color: var(--ink-400);   color: var(--ink-700); }
.tip      { background: #ecfdf5;          border-color: #10b981;          color: #065f46; }
.warning  { background: #fffbeb;          border-color: #f59e0b;          color: #92400e; }
.info     { background: var(--rxred-50);  border-color: var(--rxred-600); color: var(--rxred-700); }
.note p:last-child, .tip p:last-child, .warning p:last-child, .info p:last-child { margin-bottom: 0; }

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	transition: all .15s;
	background: var(--ink-950);
	color: white;
	border: 1px solid transparent;
}
.btn:hover { background: var(--ink-800); color: white; text-decoration: none; transform: translateY(-1px); }
.btn.outline { background: white; color: var(--text); border-color: var(--border); }
.btn.outline:hover { background: var(--ink-50); color: var(--text); border-color: var(--ink-400); }
.btn.danger { background: var(--rxred-600); }
.btn.danger:hover { background: var(--rxred-700); }

/* ─── Table of contents (in-page) ────────────────────────── */

.table-of-contents {
	margin: 24px 0;
	padding: 18px 22px;
	background: var(--ink-50);
	border: 1px solid var(--border);
	border-radius: 10px;
	font-size: .9rem;
}
.table-of-contents h4 { margin: 0 0 10px; font-size: .8rem; font-weight: 700; color: var(--ink-700); text-transform: uppercase; letter-spacing: .08em; }
.table-of-contents ul { padding-left: 1.2em; margin: 0; }
.table-of-contents li { margin-bottom: 4px; }
.table-of-contents a { color: var(--ink-600); font-size: .88rem; }
.table-of-contents a:hover { color: var(--rxred-600); }

/* ─── Theme toggle (legacy) ──────────────────────────────── */

.theme-toggle {
	background: var(--ink-100);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 6px 10px;
	cursor: pointer;
	color: var(--ink-600);
	font-size: .85rem;
	transition: all .12s;
}
.theme-toggle:hover { background: var(--ink-200); color: var(--text); }

/* ─── Footer (el_rhymix 통일) ────────────────────────────── */

.ea-footer {
	border-top: 1px solid var(--border);
	background: white;
	margin-top: 80px;
}
.ea-footer-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 40px 24px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: center;
}
.ea-footer .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); text-decoration: none; }
.ea-footer .desc { font-size: .82rem; color: var(--ink-500); margin-top: 8px; line-height: 1.6; }
.ea-footer .links { display: flex; justify-content: flex-end; gap: 24px; font-size: .85rem; flex-wrap: wrap; }
.ea-footer .links a { color: var(--ink-600); text-decoration: none; }
.ea-footer .links a:hover { color: var(--text); }
@media (max-width: 768px) {
	.ea-footer-inner { grid-template-columns: 1fr; gap: 16px; }
	.ea-footer .links { justify-content: flex-start; }
}

.copyright { color: var(--ink-400); font-size: .78rem; text-align: center; padding: 16px; border-top: 1px solid var(--border); }

/* ─── Hero / Cards (index page) ──────────────────────────── */

.hero {
	text-align: center;
	padding: 80px 24px 60px;
	background: linear-gradient(180deg, var(--ink-50) 0%, white 100%);
	border-bottom: 1px solid var(--border);
	margin-bottom: 60px;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 3rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; margin-bottom: 16px; }
.hero p { font-size: 1.1rem; color: var(--ink-600); line-height: 1.6; margin-bottom: 28px; }
.hero .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero .actions .btn { padding: 12px 24px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 32px 0; }
.card {
	display: block;
	padding: 24px;
	background: white;
	border: 1px solid var(--border);
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	transition: all .15s;
}
.card:hover { border-color: var(--ink-400); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.card .card-icon {
	width: 40px;
	height: 40px;
	border-radius: 9px;
	background: var(--ink-950);
	color: white;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
}
.card .card-icon.accent { background: var(--rxred-600); }
.card h3 { font-size: 1.05rem; margin: 0 0 6px; }
.card p { font-size: .88rem; color: var(--ink-600); margin: 0; line-height: 1.55; }

/* ─── CTA banner (페이지 하단 마켓 유입) ────────────────── */

.docs-cta {
	margin-top: 64px;
	padding: 28px 32px;
	background: var(--ink-950);
	color: white;
	border-radius: 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}
.docs-cta .cta-text h4 { color: white; margin: 0 0 4px; font-size: 1.05rem; }
.docs-cta .cta-text p { color: var(--ink-300); margin: 0; font-size: .88rem; }
.docs-cta .btn { background: white; color: var(--ink-950); }
.docs-cta .btn:hover { background: var(--ink-100); color: var(--ink-950); }

/* ─── Anchors / Print ────────────────────────────────────── */

.markdown-body h2, .markdown-body h3 { scroll-margin-top: calc(var(--topnav-h) + 16px); }

@media print {
	.ea-topnav, .sidebar, .ea-footer, .content-footer, .nav-links, .docs-cta { display: none !important; }
	.container { grid-template-columns: 1fr; }
	.content { padding: 0; max-width: none; }
	body { font-size: 11pt; }
	pre, code { background: var(--ink-50) !important; color: var(--ink-900) !important; }
}
