/* Character pages (templates/character.php). Colours are the shared tokens
   (base.css); parts are told apart by their label, never by colour alone. */

/* Inside the theme's .page-wrap (width and side padding). */
.clh-char {
	max-width: 760px;
}

.clh-char-kicker {
	margin: 0 0 8px;
	color: var(--clh-accent-text);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.clh-char-hero {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 28px;
	align-items: flex-start;
	padding: 20px;
	background: var(--clh-card-bg);
	border-radius: var(--clh-radius);
	box-shadow: var(--clh-card-shadow);
}

.clh-char-glyph-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	position: relative;
}

.clh-char-glyph {
	margin: 0;
	width: 160px;
	height: 160px;
	display: grid;
	place-items: center;
	font-family: var(--clh-font-cn);
	font-size: 132px;
	font-weight: 400;
	line-height: 1;
	background: var(--clh-sunken);
	border-radius: var(--clh-radius-sm);
}

/* While the animation shows, the static character keeps its place (and its
   heading role) but is not seen. */
.clh-char-glyph.is-hidden {
	color: transparent;
}

.clh-char-strokes {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
}

.clh-char-replay {
	min-height: 44px;
	padding: 8px 14px;
	border: 2px solid var(--clh-control-border);
	border-radius: 12px;
	background: var(--clh-raised);
	color: var(--clh-text);
	font: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
}

.clh-char-replay:hover {
	border-color: var(--clh-select);
}

.clh-char-readings {
	flex: 1 1 240px;
	min-width: 0;
}

.clh-char-reading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	margin-bottom: 10px;
}

.clh-char-pinyin {
	font-size: 1.8rem;
	font-weight: 700;
}

.clh-char-en {
	font-size: 1.1rem;
	color: var(--clh-text-muted);
}

.clh-char-play {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: var(--clh-select-soft);
	color: var(--clh-select);
	cursor: pointer;
}

.clh-char-play[hidden] {
	display: none;
}

.clh-char-play.is-playing {
	background: var(--clh-select);
	color: #fff;
}

.clh-char-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	margin: 14px 0 0;
}

.clh-char-facts dt {
	font-size: 0.8rem;
	color: var(--clh-text-muted);
}

.clh-char-facts dd {
	margin: 0;
	font-weight: 600;
}

.clh-char-facts dd[lang] {
	font-size: 1.4rem;
	font-family: var(--clh-font-cn);
}

.clh-char-section {
	margin-top: 28px;
}

.clh-char-section h2 {
	font-size: 1.35rem;
	margin: 0 0 10px;
}

.clh-char-section h3 {
	font-size: 1rem;
	margin: 18px 0 8px;
	color: var(--clh-text-muted);
}

.clh-char-explain {
	margin: 0 0 14px;
}

.clh-char-hint {
	font-style: italic;
}

.clh-char-parts {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.clh-char-part {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 14px;
	background: var(--clh-card-bg);
	border: 2px solid var(--clh-border);
	border-radius: var(--clh-radius-sm);
}

.clh-char-part-zh {
	flex: none;
	font-family: var(--clh-font-cn);
	font-size: 2.6rem;
	line-height: 1;
}

.clh-char-part-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.clh-char-role {
	align-self: flex-start;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--clh-sunken);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.clh-char-part-py {
	font-weight: 600;
}

.clh-char-part-en,
.clh-char-part-form {
	color: var(--clh-text-muted);
	font-size: 0.9rem;
}

.clh-char-link {
	color: inherit;
	text-decoration-color: var(--clh-accent-text);
	text-underline-offset: 0.15em;
	text-decoration-thickness: 2px;
}

.clh-char-link.is-plain {
	text-decoration: none;
}

.clh-char-family {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.clh-char-family a {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 60px;
	padding: 8px 10px;
	border: 2px solid var(--clh-control-border);
	border-radius: 12px;
	background: var(--clh-raised);
	color: var(--clh-text);
	text-decoration: none;
}

.clh-char-family a:hover,
.clh-char-words a:hover {
	border-color: var(--clh-select);
}

.clh-char-family-zh {
	font-family: var(--clh-font-cn);
	font-size: 1.7rem;
	line-height: 1.2;
}

.clh-char-family-py {
	font-size: 0.85rem;
	color: var(--clh-text-muted);
}

.clh-char-words {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.clh-char-words a {
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-areas: "zh py lv" "zh en lv";
	gap: 0 14px;
	align-items: center;
	padding: 10px 14px;
	border: 2px solid var(--clh-border);
	border-radius: var(--clh-radius-sm);
	background: var(--clh-card-bg);
	color: var(--clh-text);
	text-decoration: none;
}

.clh-char-word-zh {
	grid-area: zh;
	font-family: var(--clh-font-cn);
	font-size: 1.5rem;
}

.clh-char-word-py {
	grid-area: py;
	font-weight: 600;
}

.clh-char-word-en {
	grid-area: en;
	color: var(--clh-text-muted);
	font-size: 0.9rem;
}

.clh-char-word-level {
	grid-area: lv;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--clh-text-muted);
}

.clh-char-more {
	color: var(--clh-text-muted);
	margin: 10px 0 0;
}

.clh-char-credit {
	margin-top: 36px;
	font-size: 0.8rem;
	color: var(--clh-text-muted);
}

.clh-char-credit a {
	color: inherit;
}

@media (max-width: 480px) {
	.clh-char-hero {
		padding: 16px;
	}

	.clh-char-glyph {
		width: 128px;
		height: 128px;
		font-size: 104px;
	}
}
