@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
	--ep-point: #4a4a4a;   /* 버튼, 강조 */
	--ep-ink: #222222;     /* 본문 글자 */
	--ep-muted: #8a8a8a;   /* 보조 글자 */
	--ep-line: #cfcfcf;    /* 목록 구분선 */
	--ep-rule: #555555;    /* 제목 아래 굵은 선 */
	--ep-mist: #f4f4f4;    /* 행 호버 */
	--ep-field: #e9e9e9;   /* 검색창 */
	--ep-backdrop: #666666;/* 카드 바깥 배경 */
	--ep-paper: #ffffff;
	--ep-max: 1030px;
	--ep-font: 'Jost', 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

html, body { margin: 0; }
body { background: var(--ep-backdrop); }

/* ---------- 카드 ---------- */
.ep-wrap {
	box-sizing: border-box;
	width: calc(100% - 100px);
	max-width: 1320px;
	min-height: calc(100vh - clamp(20px, 3vw, 36px) - 48px);
	margin: clamp(20px, 3vw, 36px) auto 48px; /* 위쪽 회색 여백: 화면 폭에 따라 20~36px */
	display: flex;
	flex-direction: column;
	background: var(--ep-paper);
	box-shadow: 0 6px 18px rgba(0,0,0,.28);
	font-family: var(--ep-font);
	color: var(--ep-ink);
	font-size: 14px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
.ep-wrap a { color: inherit; text-decoration: none; }
.ep-wrap :focus-visible { outline: 2px solid var(--ep-point); outline-offset: 3px; }

/* ---------- 상단 메뉴 ---------- */
.ep-header { position: relative; z-index: 100; }
.ep-header__inner {
	max-width: var(--ep-max);
	margin: 0 auto;
	padding: 24px 32px 0;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: 54px;
}

/* 홈 버튼 (그림) */
.ep-home {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin-left: -2px;
	color: var(--ep-ink) !important;
	transition: opacity .15s;
}
.ep-home:hover { opacity: .6; }
.ep-home svg { width: 19px; height: 19px; display: block; }
.ep-home img { display: block; max-height: 22px; width: auto; }

.ep-logo {
	flex: none;
	font-size: 18px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: -.01em;
	color: var(--ep-ink) !important;
	white-space: nowrap;
}
.ep-logo img { display: block; max-height: 28px; width: auto; }

.ep-gnb {
	flex: 1;
	display: flex;
	align-items: center;
	min-width: 0;
}
.ep-gnb__notice { margin: 0; font-size: 12px; color: var(--ep-muted); }
.ep-gnb__list {
	display: flex;
	gap: 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ep-gnb__item { position: relative; }
.ep-gnb__link {
	display: block;
	padding: 6px 0;
	font-size: 15px;
	color: var(--ep-ink) !important;
	text-decoration: underline !important;
	text-decoration-thickness: 1px !important;
	text-underline-offset: 4px;
	transition: opacity .15s;
}
.ep-gnb__item:hover > .ep-gnb__link { opacity: .6; }
.ep-gnb__item.is-active > .ep-gnb__link { text-decoration-thickness: 2px !important; }

/* 2차 메뉴 */
.ep-sub {
	position: absolute;
	top: 100%;
	left: -16px;
	min-width: 150px;
	margin: 6px 0 0;
	padding: 6px 0;
	list-style: none;
	background: var(--ep-paper);
	border: 1px solid var(--ep-line);
	box-shadow: 0 6px 16px rgba(0,0,0,.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .15s, transform .15s, visibility 0s .15s;
}
.ep-sub::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; } /* 호버 끊김 방지 */
.ep-gnb__item:hover > .ep-sub,
.ep-gnb__item:focus-within > .ep-sub {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .15s, transform .15s, visibility 0s;
}
.ep-sub a {
	display: block;
	padding: 7px 16px;
	font-size: 13px;
	color: var(--ep-ink) !important;
	white-space: nowrap;
}
.ep-sub a:hover,
.ep-sub li.is-active > a { background: var(--ep-mist); }

.ep-sub-toggle { display: none; }

/* 3차 메뉴: 2차 메뉴 오른쪽으로 펼침 */
.ep-sub__item { position: relative; }
.ep-sub__item.has-sub > .ep-sub__link { padding-right: 32px; }
.ep-sub__item.has-sub > .ep-sub__link::after {
	content: '';
	position: absolute;
	right: 14px;
	top: 50%;
	width: 5px; height: 5px;
	border-top: 1px solid currentColor;
	border-right: 1px solid currentColor;
	transform: translateY(-50%) rotate(45deg);
	opacity: .6;
}
.ep-sub--3 {
	top: -7px;
	left: 100%;
	margin: 0 0 0 -1px;
	transform: translateX(-4px);
}
.ep-sub--3::before { display: none; }
.ep-sub__item:hover > .ep-sub--3,
.ep-sub__item:focus-within > .ep-sub--3 {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .15s, transform .15s, visibility 0s;
}
/* 화면 오른쪽 끝에 닿으면 왼쪽으로 펼침 (layout.js가 붙임) */
.ep-sub__item.is-flip > .ep-sub--3 { left: auto; right: 100%; margin: 0 -1px 0 0; transform: translateX(4px); }
.ep-sub__item.is-flip:hover > .ep-sub--3,
.ep-sub__item.is-flip:focus-within > .ep-sub--3 { transform: none; }


.ep-util {
	margin-left: auto;
	display: flex;
	gap: 24px;
	padding-left: 24px;
	font-size: 15px;
}
.ep-util a {
	color: var(--ep-ink) !important;
	text-decoration: underline !important;
	text-decoration-thickness: 1px !important;
	text-underline-offset: 4px;
}
.ep-util a:hover { opacity: .6; }

.ep-burger { display: none; }

/* ---------- 본문 ---------- */
.ep-main { flex: 1; }
.ep-container {
	max-width: var(--ep-max);
	margin: 0 auto;
	padding: 52px 32px 96px;
	box-sizing: border-box;
}
.ep-page-title {
	margin: 0 0 32px;
	font-family: var(--ep-font);
	font-weight: 400;
	font-size: 40px;
	line-height: 1.15;
	letter-spacing: -.005em;
	color: var(--ep-ink);
}

/* 메인 페이지: 제목(h1)은 화면에서 숨기고 스크린리더에는 남김 */
.ep-wrap.is-home .ep-main h1,
.ep-wrap.is-home .epb-title {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.ep-footer .ep-container { padding: 0 32px 40px; font-size: 12px; color: var(--ep-muted); }

/* ---------- 모바일 ---------- */
@media (max-width: 860px) {
	.ep-wrap {
		width: 100%;
		min-height: 100vh;
		margin: 0;
		box-shadow: none;
	}
	.ep-header__inner { padding: 18px 20px 0; gap: 16px; }

	.ep-burger {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		width: 40px;
		height: 40px;
		margin-left: auto;
		padding: 0 9px;
		background: none;
		border: 0;
		cursor: pointer;
	}
	.ep-burger span { display: block; height: 1.5px; background: var(--ep-ink); transition: transform .2s, opacity .2s; }
	.ep-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
	.ep-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
	.ep-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

	.ep-gnb {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		margin-top: 8px;
		max-height: calc(100vh - 80px);
		overflow-y: auto;
		flex-direction: column;
		align-items: stretch;
		background: var(--ep-paper);
		border-top: 1px solid var(--ep-rule);
		border-bottom: 1px solid var(--ep-line);
		box-shadow: 0 10px 20px rgba(0,0,0,.08);
		display: none;
	}
	.ep-gnb.is-open { display: flex; }
	.ep-gnb__notice { padding: 14px 20px 0; }
	.ep-gnb__list { flex-direction: column; gap: 0; }
	.ep-gnb__item { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--ep-line); }
	.ep-gnb__link { flex: 1; padding: 14px 20px; text-decoration: none !important; }
	.ep-gnb__item.is-active > .ep-gnb__link { font-weight: 500; }

	.ep-sub-toggle {
		display: block;
		width: 52px;
		background: none;
		border: 0;
		cursor: pointer;
		position: relative;
	}
	.ep-sub-toggle::after {
		content: '';
		position: absolute;
		top: 50%; left: 50%;
		width: 7px; height: 7px;
		border-right: 1.5px solid var(--ep-ink);
		border-bottom: 1.5px solid var(--ep-ink);
		transform: translate(-50%, -70%) rotate(45deg);
		transition: transform .2s;
	}
	.ep-sub-toggle[aria-expanded="true"]::after { transform: translate(-50%, -30%) rotate(-135deg); }

	.ep-gnb .ep-sub {
		position: static;
		flex-basis: 100%;
		display: none;
		margin: 0;
		opacity: 1;
		visibility: visible;
		transform: none;
		border: 0;
		box-shadow: none;
		background: var(--ep-mist);
		padding: 4px 0;
	}
	.ep-gnb .ep-sub::before { display: none; }
	.ep-gnb .is-open > .ep-sub { display: block; }
	.ep-sub a { padding: 10px 36px; }

	.ep-sub__item { display: flex; flex-wrap: wrap; }
	.ep-sub__item > .ep-sub__link { flex: 1; }
	.ep-sub__item.has-sub > .ep-sub__link { padding-right: 0; }
	.ep-sub__item.has-sub > .ep-sub__link::after { display: none; }
	.ep-gnb .ep-sub--3 { background: #ebebeb; }
	.ep-sub--3 a { padding: 9px 52px; font-size: 12.5px; }

	.ep-util { margin: 0; padding: 14px 20px; }

	.ep-container { padding: 40px 20px 64px; }
	.ep-page-title { font-size: 32px; }
	.ep-footer .ep-container { padding: 0 20px 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.ep-sub, .ep-burger span, .ep-sub-toggle::after { transition: none !important; }
}

/* ---------- 본문 탭 (my-tabs) ---------- */
/* 본문 문단 사이에 끼워 쓰는 용도: 옅은 회색 상자 안에 작은 밑줄 탭 */
.ep-wrap .my-tabs {
	margin: 1.2em 0;
	padding: 4px 20px 18px;
	background: var(--ep-mist);
	border-radius: 2px;
}
.ep-wrap .my-tabs > ul {
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--ep-line);
	overflow-x: auto;
	scrollbar-width: none;
}
.ep-wrap .my-tabs > ul::-webkit-scrollbar { display: none; }
.ep-wrap .my-tab-link {
	flex: none;
	margin: 0 0 -1px;
	padding: 10px 0 8px;
	list-style: none;
	font-size: 13px;
	line-height: 1.4;
	color: var(--ep-muted);
	border-bottom: 1px solid transparent;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	transition: color .15s;
}
.ep-wrap .my-tab-link:hover { color: var(--ep-ink); }
.ep-wrap .my-tab-link.current {
	color: var(--ep-ink);
	border-bottom-color: var(--ep-point);
	cursor: default;
}

.ep-wrap .my-tab-content { display: none; padding-top: 14px; }
.ep-wrap .my-tab-content.current { display: block; }
.ep-wrap .my-tab-content > :first-child { margin-top: 0; }
.ep-wrap .my-tab-content > :last-child { margin-bottom: 0; }

@media (max-width: 860px) {
	.ep-wrap .my-tabs { padding: 2px 16px 16px; }
	.ep-wrap .my-tabs > ul { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.ep-wrap .my-tab-link { transition: none; }
}

/* ---------- 본문(에디터) 글꼴 ---------- */
/* 라이믹스 에디터 기본 글꼴 대신 레이아웃 글꼴을 쓰도록 맞춤. 게시판 본문과 같은 크기·행간 */
.ep-wrap .rhymix_content,
.ep-wrap .xe_content {
	font-family: var(--ep-font);
	font-size: 15px;
	line-height: 1.95;
	color: var(--ep-ink);
	word-break: keep-all;
	overflow-wrap: anywhere;
}

/* ---------- 본문 표 ---------- */
/* 에디터가 넣는 테두리·너비·높이·여백 값을 무시하고 테마 모양으로 통일 */
.ep-wrap .rhymix_content table,
.ep-wrap .xe_content table {
	width: 100% !important;
	max-width: 100%;
	height: auto !important;
	margin: 1.4em 0 !important;
	border: 0 !important;
	border-collapse: collapse !important;
	border-spacing: 0;
	border-top: 1px solid var(--ep-rule) !important;
	background: var(--ep-paper);
	font-size: 13px;
	line-height: 1.6;
}
.ep-wrap .rhymix_content table caption,
.ep-wrap .xe_content table caption {
	caption-side: top;
	padding: 0 0 8px;
	text-align: left;
	font-size: 12px;
	color: var(--ep-muted);
}
.ep-wrap .rhymix_content th,
.ep-wrap .rhymix_content td,
.ep-wrap .xe_content th,
.ep-wrap .xe_content td {
	height: auto !important;
	padding: 10px 14px !important;
	border: 0 !important;
	border-bottom: 1px solid var(--ep-line) !important;
	text-align: left;
	vertical-align: top;
}
/* 머리 칸: <th>, 또는 <thead> 안의 칸 */
.ep-wrap .rhymix_content th,
.ep-wrap .xe_content th,
.ep-wrap .rhymix_content thead td,
.ep-wrap .xe_content thead td {
	background: var(--ep-mist);
	font-weight: 500;
	white-space: nowrap;
}
.ep-wrap .rhymix_content td > :first-child,
.ep-wrap .xe_content td > :first-child { margin-top: 0; }
.ep-wrap .rhymix_content td > :last-child,
.ep-wrap .xe_content td > :last-child { margin-bottom: 0; }

/* 회색 탭 상자 안에 들어간 표는 흰 바탕 유지 */
.ep-wrap .my-tabs table { background: var(--ep-paper); }

/* 좁은 화면: 표가 넘치면 표만 가로로 스크롤 */
@media (max-width: 860px) {
	.ep-wrap .rhymix_content,
	.ep-wrap .xe_content { font-size: 15px; line-height: 1.85; }
	.ep-wrap .rhymix_content table,
	.ep-wrap .xe_content table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.ep-wrap .rhymix_content th,
	.ep-wrap .rhymix_content td,
	.ep-wrap .xe_content th,
	.ep-wrap .xe_content td { padding: 9px 12px !important; min-width: 80px; }
}
