/* Key Word Cloud 2.2.0 */

/* 래퍼가 칸을 다 쓰게 못 박는다. 테마가 이 자리를 flex 나 grid 로 두면 내용에 맞춰
   줄어들어, 단추 글자가 줄바꿈되고 구름이 좁아진다. */
.kwc {
	position: relative;
	display: block;
	width: 100%;
	margin: 1em 0;
}

/* 새로고침 단추는 구름의 오른쪽 위 모서리에 앉는다. */
/* 판 번호. 왼쪽 위에 흐리게 둔다. 읽으라고 두는 것이 아니라 찾으면 보이라고 두는 것이라
   구름의 가장 작은 글자보다 작고, 마우스를 올리면 진해진다. */
.kwc-version {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	font-family: inherit;
	font-size: 11px;
	line-height: 1.5;
	color: #6b6b66;
	opacity: 0.45;
	/* 테마가 span 에 word-break 를 걸어 두면 판 번호가 한 글자씩 세로로 선다. */
	white-space: nowrap;
	user-select: none;
	pointer-events: none;
}

.kwc:hover .kwc-version {
	opacity: 0.8;
}

.kwc-refresh {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	padding: 4px 12px;
	border: 1px solid #9a9a94;
	border-radius: 4px;
	background: #fff;
	color: #3a3a36;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.5;
	/* 테마가 버튼에 word-break 를 걸어 두면 "Refresh" 가 세 줄이 된다. */
	white-space: nowrap;
	width: auto;
	cursor: pointer;
}

/* 테마가 button:hover 에 짙은 배경을 깔면 그 위의 짙은 글씨가 사라진다. 배경까지 여기서
   정해야 글씨가 보인다. */
.kwc-refresh:hover:not([disabled]) {
	border-color: #7a7a74;
	background: #e6e6e6;
	color: #1b1b18;
	font-weight: 700;
}

.kwc-refresh:focus-visible {
	outline: 2px solid #1f66bd;
	outline-offset: 2px;
}

.kwc-refresh[disabled] {
	cursor: default;
	opacity: 0.6;
}

.kwc-refresh[data-state="failed"] {
	border-color: #bf3130;
	color: #bf3130;
}

/* 글꼴. 내려받지 않고 기기에 있는 것만 쓴다.
   rounded 가 기본이다. Apple 기기에는 둥근 시스템 글꼴이 있어 그대로 잡히고,
   Windows 에는 둥근 시스템 글꼴이 없어 부드러운 sans 로 내려간다. */
.kwc-cloud--font-rounded {
	font-family: ui-rounded, 'SF Pro Rounded', 'Varela Round', Nunito, Quicksand,
		'Trebuchet MS', 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.kwc-cloud--font-sans {
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Malgun Gothic',
		'Apple SD Gothic Neo', sans-serif;
	font-weight: 600;
}

.kwc-cloud--font-serif {
	font-family: Georgia, 'Times New Roman', 'Nanum Myeongjo', 'Apple SD Gothic Neo', serif;
	font-weight: 600;
}

.kwc-cloud--font-mono {
	font-family: ui-monospace, 'Cascadia Mono', Consolas, 'D2Coding', monospace;
	font-weight: 600;
}

.kwc-cloud {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: 0.35em 0.75em;
	margin: 0;
	padding: 0;
	line-height: 1.35;
}

/* 타원. kwc.js 가 낱말을 줄로 묶고 줄마다 폭을 타원 곡선에 맞춘다.
   세로 쌓기는 줄이 실제로 만들어졌을 때만 건다. 그러지 않으면 script 가 없거나 아직
   돌지 않은 곳에서 낱말이 한 줄에 하나씩 세로로 늘어선다. */
.kwc-cloud--ellipse.kwc-cloud--rows {
	flex-direction: column;
	align-items: center;
	gap: 0.2em;
}

.kwc-row {
	display: flex;
	flex-wrap: nowrap;
	align-items: baseline;
	justify-content: center;
	gap: 0.75em;
	max-width: 100%;
}

/* 모든 단어는 가로로만 놓는다. 테마가 회전/세로쓰기를 걸어도 무시한다. */
.kwc-cloud .kwc-word {
	position: relative;
	display: inline-block;
	white-space: nowrap;
	writing-mode: horizontal-tb !important;
	text-orientation: mixed !important;
	transform: none !important;
	rotate: none !important;
	text-decoration: none;
	border: 0;
	box-shadow: none;
	transition: opacity 0.15s ease;
}

.kwc-cloud a.kwc-word:hover,
.kwc-cloud a.kwc-word:focus {
	text-decoration: underline;
	opacity: 0.75;
}

.kwc-cloud .kwc-word--static {
	cursor: default;
}

/* 이웃한 topic 을 갈라 보이게 하는 색이다. 색 자체는 뜻이 없고, 크기가 글 수를 나타낸다.
   다섯 색은 색맹 구분과 4.5:1 대비를 검증해서 고른 것이다. */
.kwc-word--c0 { color: #1f66bd; }
.kwc-word--c1 { color: #0f7d57; }
.kwc-word--c2 { color: #c4501f; }
.kwc-word--c3 { color: #4a3aa7; }
.kwc-word--c4 { color: #7a6a00; }

/* 마우스를 올리면 어떤 구절에서 온 topic 인지 보인다. */
.kwc-word[data-tip]::after {
	content: attr(data-tip);
	position: absolute;
	left: 50%;
	bottom: 100%;
	z-index: 3;
	transform: translate(-50%, -6px);
	visibility: hidden;
	opacity: 0;
	min-width: 12em;
	max-width: 22em;
	padding: 6px 9px;
	border-radius: 5px;
	background: #1a1a19;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.45;
	white-space: normal;
	text-align: left;
	text-decoration: none;
	pointer-events: none;
	transition: opacity 0.12s ease;
}

.kwc-word[data-tip]:hover::after,
.kwc-word[data-tip]:focus::after {
	visibility: visible;
	opacity: 1;
}

.kwc-error {
	margin: 1em 0;
	padding: 0.6em 0.9em;
	border-left: 4px solid #bf3130;
	background: #fff4f4;
	color: #7a1620;
	font-size: 0.95em;
}
