/* ═══════════════════════════════════════════════════════
   Edge Dots · About card languages (2026-11-29)
   The "?" About card on a course card ends with the name of every
   subtitle language the course has, written in that language, each
   swept with a highlighter in its own colour, left to right, as the
   card opens. Nothing else on the line (no icon, no words), so it only
   ever breaks between two names, and a second line starts under the
   first name. Each stroke leans its own way, the way a hand draws them.

   Markup: academy_course_loop_card_info_languages() (includes/functions.php),
   printed by templates/loop/header.php right after the About text.
   Loaded by Assets::enqueue_cc_edge_about_layer() while Edge Dots (v2b)
   is the live indicator and Design → Edge Dots → About card is not Off.
   Pure CSS: no script, nothing on the card itself. The colours are
   academy-cc-tag.css's own values, re-declared for these names so that
   file is never touched. Proposal (option B, round 3, names only):
   https://claude.ai/artifact/7SmhUPQLG8iWSpd3AidN9z
   Ledger: M2-PATCHES.md "About card languages".
   ═══════════════════════════════════════════════════════ */

.academy-course .academy-course-card-info__tooltip .academy-cc-about {
	display: block;
	position: relative;
	margin-top: 10px;
	font-family: var(--ao-font-ui, 'DM Sans', system-ui, sans-serif);
	font-style: normal;
	text-transform: none;
	letter-spacing: normal;
}

/* Screen readers get "Subtitles:" and the names; the line itself is decorative */
.academy-course .academy-cc-about__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* The language colours (academy-cc-tag.css's values) */
.academy-cc-about [data-lang] { --cc-soft: #dfe2ea; --cc-ink: #2b2f3d; }
.academy-cc-about [data-lang="en"] { --cc-soft: #aacaff; --cc-ink: #1f3a8a; }
.academy-cc-about [data-lang="es"] { --cc-soft: #ffb19a; --cc-ink: #8a2a14; }
.academy-cc-about [data-lang="fr"] { --cc-soft: #c7afff; --cc-ink: #4a2e8a; }
.academy-cc-about [data-lang="de"] { --cc-soft: #9ee0b5; --cc-ink: #185a32; }
.academy-cc-about [data-lang="pt"] { --cc-soft: #ffc880; --cc-ink: #8a4d0e; }
.academy-cc-about [data-lang="it"] { --cc-soft: #ffa8c5; --cc-ink: #8a1f48; }
.academy-cc-about [data-lang="ja"] { --cc-soft: #ffe066; --cc-ink: #7a5a0a; }
.academy-cc-about [data-lang="zh"] { --cc-soft: #ff9a9a; --cc-ink: #8a1717; }

.academy-course .academy-cc-about .academy-cc-about__row {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 14px;
	line-height: 1.45;
}

/* A second line of names starts under the first name */
.academy-course .academy-cc-about .academy-cc-about__names {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	min-width: 0;
}

.academy-course .academy-cc-about .academy-cc-about__name {
	position: relative;
	z-index: 1;
	display: inline-block;
	padding: 0 2px;
	color: var(--cc-ink);
	font-weight: 700;
	white-space: nowrap;
}

/* The stroke: a pastel band with ragged, lighter ends, a little tilted */
.academy-course .academy-cc-about .academy-cc-about__name::before {
	content: '';
	position: absolute;
	z-index: -1;
	inset: 3px -3px 1px -3px;
	border-radius: 7px 3px 6px 2px / 4px 6px 3px 5px;
	background: linear-gradient(97deg,
		color-mix(in srgb, var(--cc-soft) 45%, transparent) 0,
		color-mix(in srgb, var(--cc-soft) 92%, transparent) 5%,
		var(--cc-soft) 22%,
		color-mix(in srgb, var(--cc-soft) 80%, transparent) 58%,
		var(--cc-soft) 88%,
		color-mix(in srgb, var(--cc-soft) 55%, transparent) 100%);
	transform: rotate(-1.4deg) skewX(-10deg) scaleX(0);
	transform-origin: 0 50%;
	transition: transform .14s ease;
}
.academy-course .academy-cc-about .academy-cc-about__name:nth-child(odd)::before {
	inset: 2px -3px 2px -2px;
	border-radius: 3px 8px 3px 7px / 6px 3px 6px 4px;
	transform: rotate(1.1deg) skewX(-8deg) scaleX(0);
}

/* Open (hover, keyboard focus, or a tap on touch screens): the strokes
   draw one after another once the card has popped in */
.academy-course-card-info:is(:hover, :focus-within, .is-expanded) .academy-cc-about .academy-cc-about__name::before {
	transform: rotate(-1.4deg) skewX(-10deg) scaleX(1);
	transition: transform .46s cubic-bezier(.5, .1, .25, 1) calc(.26s + var(--i, 0) * .2s);
}
.academy-course-card-info:is(:hover, :focus-within, .is-expanded) .academy-cc-about .academy-cc-about__name:nth-child(odd)::before {
	transform: rotate(1.1deg) skewX(-8deg) scaleX(1);
}

/* Reduced motion: the strokes are already drawn */
@media (prefers-reduced-motion: reduce) {
	.academy-course .academy-cc-about .academy-cc-about__name::before { transform: rotate(-1.4deg) skewX(-10deg) !important; transition: none !important; }
	.academy-course .academy-cc-about .academy-cc-about__name:nth-child(odd)::before { transform: rotate(1.1deg) skewX(-8deg) !important; }
}

/* Night: a highlighter is bright on any page, so the stroke stays pastel
   and the word keeps its dark ink */
html.m2-dark .academy-course .academy-cc-about .academy-cc-about__name { color: var(--cc-ink); }
