/* =====================================================================
   Academy CC tag, Edge Dots "Every language" (a room rule over V2 · B)
   Loads after academy-cc-tag.css and changes one thing: when a course's
   subtitle languages would ALL fit if the "CC" mark stepped out of the
   way, the mark steps aside while the card is hovered and every code
   opens. "+N" is left for the rows where they really do not fit.

   Why (Marc, 2026-11-16): a course with four subtitle languages opened
   to "CC EN ES +2", hiding two languages behind a number in a row that
   is 101px of codes in 102.8px of room (prod's "Technical" cards on the
   four-across grid). Four languages is something to show.

   The rule, in px of room (the .academy-cc-edge container):
     hovered, hover screens   n languages all open from 26n - 3
                              (3: 75, 4: 101, 5: 127 … 8: 205); the mark
                              is back beside them from 26n + 22
                              (3: 100, 4: 126, 5: 152 … 8: 230)
     touch screens            the tag is open at rest and the mark never
                              leaves, so all n open only from 26n + 22
     at rest, hover screens   unchanged: the mark and a dot per language
   Everything below those widths, one or two languages, three languages
   from 100px, and every row that still needs "+N" are academy-cc-tag.css's
   own and are not restated here.

   Motion. The codes open with the tag's own spring, left to right. The
   mark's exit is the one new move: it fades in place first (.11s) so the
   outline is never seen being squeezed, then gives up its room; on the
   way back its room reopens first and it fades in last. Reduced motion
   is academy-cc-tag.css's own `transition: none !important`.

   Paint is untouched (no colour, background or shadow here), so Candy
   and Fine both wear it. The sizes 23px / 3px / 4px are the tag's own
   (code width, code gap, mark gap) and must follow academy-cc-tag.css
   if those ever change.

   Switch: Academy LMS → Design → Edge Dots → "On hover" → "Every
   language" (the default) / "First two + N" (the rule as it was, which
   loads nothing from here). Option academy_cc_edge_langs; admin preview
   ?cc_langs=every|classic; filter academy/cc_edge_langs. Loaded by
   Assets::enqueue_cc_edge_every_layer() after academy-cc-tag, only while
   Edge Dots (v2b) is the live indicator. A missing file is a silent
   no-op. Ledger: M2-PATCHES.md "Every language".
   ===================================================================== */

/* ---- 1. Touch screens: every code that fits beside the mark ---------
   The open tag is the resting state there and the mark never steps
   aside, so this is the only gain: four codes beside the mark from
   126px (21 + 4 + 4 × 23 + 3 × 3), and 26px more for each one after. */
@media (hover: none) {
	@container academy-cc-edge (width >= 126px) {
		/* 4 languages */
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(5)):not(:has(> :nth-child(6))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(5)):not(:has(> :nth-child(6))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (width >= 152px) {
		/* 5 languages */
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(6)):not(:has(> :nth-child(7))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(6)):not(:has(> :nth-child(7))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (width >= 178px) {
		/* 6 languages */
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(7)):not(:has(> :nth-child(8))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(7)):not(:has(> :nth-child(8))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (width >= 204px) {
		/* 7 languages */
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(8)):not(:has(> :nth-child(9))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(8)):not(:has(> :nth-child(9))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (width >= 230px) {
		/* 8 languages */
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(9)):not(:has(> :nth-child(10))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-cc-edge .academy-cc-tag .academy-cc-tag__langs:has(> :nth-child(9)):not(:has(> :nth-child(10))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
}

/* ---- 2. Hover screens, while the card is hovered or focused ---------
   Every code opens wherever they all fit once the mark is out of the
   way (three from 75px, four from 101px: 4 × 23 + 3 × 3, then 26px
   each), and the mark only steps aside in the band where they would
   not fit beside it. There it fades first and folds second; leaving,
   its room reopens first and it fades back last (the not-hovered rule
   in each band). At rest nothing else changes: the mark and a dot per
   language, academy-cc-tag.css's own rule. */
@media (hover: hover) {
	/* 3 languages: all of them from 75px, the mark back beside them from 100px */
	@container academy-cc-edge (width >= 75px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(4)):not(:has(> :nth-child(5))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(4)):not(:has(> :nth-child(5))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (75px <= width < 100px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(4)):not(:has(> .academy-cc-tag__langs > :nth-child(5))) > .academy-cc-tag__cc {
			width: 0;
			margin-right: -4px;
			opacity: 0;
			transition: width .46s var(--cc-spring) 60ms, margin .46s var(--cc-spring) 60ms, opacity .11s ease-out;
		}
		.academy-course:not(:hover):not(:focus-within):not(.academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(4)):not(:has(> .academy-cc-tag__langs > :nth-child(5))) > .academy-cc-tag__cc {
			transition: width .22s cubic-bezier(.4, 0, .2, 1), margin .22s cubic-bezier(.4, 0, .2, 1), opacity .14s ease-out .1s;
		}
	}
	/* 4 languages: all of them from 101px, the mark back beside them from 126px */
	@container academy-cc-edge (width >= 101px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(5)):not(:has(> :nth-child(6))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(5)):not(:has(> :nth-child(6))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (101px <= width < 126px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(5)):not(:has(> .academy-cc-tag__langs > :nth-child(6))) > .academy-cc-tag__cc {
			width: 0;
			margin-right: -4px;
			opacity: 0;
			transition: width .46s var(--cc-spring) 60ms, margin .46s var(--cc-spring) 60ms, opacity .11s ease-out;
		}
		.academy-course:not(:hover):not(:focus-within):not(.academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(5)):not(:has(> .academy-cc-tag__langs > :nth-child(6))) > .academy-cc-tag__cc {
			transition: width .22s cubic-bezier(.4, 0, .2, 1), margin .22s cubic-bezier(.4, 0, .2, 1), opacity .14s ease-out .1s;
		}
	}
	/* 5 languages: all of them from 127px, the mark back beside them from 152px */
	@container academy-cc-edge (width >= 127px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(6)):not(:has(> :nth-child(7))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(6)):not(:has(> :nth-child(7))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (127px <= width < 152px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(6)):not(:has(> .academy-cc-tag__langs > :nth-child(7))) > .academy-cc-tag__cc {
			width: 0;
			margin-right: -4px;
			opacity: 0;
			transition: width .46s var(--cc-spring) 60ms, margin .46s var(--cc-spring) 60ms, opacity .11s ease-out;
		}
		.academy-course:not(:hover):not(:focus-within):not(.academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(6)):not(:has(> .academy-cc-tag__langs > :nth-child(7))) > .academy-cc-tag__cc {
			transition: width .22s cubic-bezier(.4, 0, .2, 1), margin .22s cubic-bezier(.4, 0, .2, 1), opacity .14s ease-out .1s;
		}
	}
	/* 6 languages: all of them from 153px, the mark back beside them from 178px */
	@container academy-cc-edge (width >= 153px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(7)):not(:has(> :nth-child(8))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(7)):not(:has(> :nth-child(8))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (153px <= width < 178px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(7)):not(:has(> .academy-cc-tag__langs > :nth-child(8))) > .academy-cc-tag__cc {
			width: 0;
			margin-right: -4px;
			opacity: 0;
			transition: width .46s var(--cc-spring) 60ms, margin .46s var(--cc-spring) 60ms, opacity .11s ease-out;
		}
		.academy-course:not(:hover):not(:focus-within):not(.academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(7)):not(:has(> .academy-cc-tag__langs > :nth-child(8))) > .academy-cc-tag__cc {
			transition: width .22s cubic-bezier(.4, 0, .2, 1), margin .22s cubic-bezier(.4, 0, .2, 1), opacity .14s ease-out .1s;
		}
	}
	/* 7 languages: all of them from 179px, the mark back beside them from 204px */
	@container academy-cc-edge (width >= 179px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(8)):not(:has(> :nth-child(9))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(8)):not(:has(> :nth-child(9))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (179px <= width < 204px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(8)):not(:has(> .academy-cc-tag__langs > :nth-child(9))) > .academy-cc-tag__cc {
			width: 0;
			margin-right: -4px;
			opacity: 0;
			transition: width .46s var(--cc-spring) 60ms, margin .46s var(--cc-spring) 60ms, opacity .11s ease-out;
		}
		.academy-course:not(:hover):not(:focus-within):not(.academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(8)):not(:has(> .academy-cc-tag__langs > :nth-child(9))) > .academy-cc-tag__cc {
			transition: width .22s cubic-bezier(.4, 0, .2, 1), margin .22s cubic-bezier(.4, 0, .2, 1), opacity .14s ease-out .1s;
		}
	}
	/* 8 languages: all of them from 205px, the mark back beside them from 230px */
	@container academy-cc-edge (width >= 205px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(9)):not(:has(> :nth-child(10))) > .academy-cc-tag__lang:not(.academy-cc-tag__lang--more) {
			width: 23px;
			margin-left: 0;
			opacity: 1;
			counter-increment: none;
		}
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag__langs:has(> :nth-child(9)):not(:has(> :nth-child(10))) > .academy-cc-tag__lang--more {
			width: 0;
			margin-left: -3px;
			opacity: 0;
		}
	}
	@container academy-cc-edge (205px <= width < 230px) {
		.academy-course:is(:hover, :focus-within, .academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(9)):not(:has(> .academy-cc-tag__langs > :nth-child(10))) > .academy-cc-tag__cc {
			width: 0;
			margin-right: -4px;
			opacity: 0;
			transition: width .46s var(--cc-spring) 60ms, margin .46s var(--cc-spring) 60ms, opacity .11s ease-out;
		}
		.academy-course:not(:hover):not(:focus-within):not(.academy-course--tooltip-open) .academy-cc-edge .academy-cc-tag:has(> .academy-cc-tag__langs > :nth-child(9)):not(:has(> .academy-cc-tag__langs > :nth-child(10))) > .academy-cc-tag__cc {
			transition: width .22s cubic-bezier(.4, 0, .2, 1), margin .22s cubic-bezier(.4, 0, .2, 1), opacity .14s ease-out .1s;
		}
	}
}
