/* ==========================================================================
   In-page embeds (block, shortcode, single archive page).
   They inherit the theme's text colour and only bring the type and the accent.
   ========================================================================== */

.crmtl-embed {
	--e-accent: var(--cwp-accent, var(--crmtl-accent, #ff5a36));
	--e-serif: var(--cwp-serif, "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif);
	--e-mono: var(--cwp-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
	--e-ease: var(--cwp-ease-out, cubic-bezier(.16, 1, .3, 1));
	--e-tint: color-mix(in srgb, currentColor 6%, transparent);
	--e-mute: color-mix(in srgb, currentColor 58%, transparent);

	margin-block: 2.5em;
	container-type: inline-size;
}

.crmtl-embed button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-align: inherit;
	cursor: pointer;
	width: auto;
	min-height: 0;
}

.crmtl-embed button:focus-visible,
.crmtl-embed a:focus-visible {
	outline: 2px solid var(--e-accent);
	outline-offset: 3px;
}

.crmtl-embed img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	margin: 0;
}

.crmtl-embed svg {
	display: block;
	fill: currentColor;
}

/* Play / pause glyph shared by every trigger */

.crmtl-embed__glyph {
	display: grid;
	place-items: center;
}

.crmtl-embed__glyph svg {
	grid-area: 1 / 1;
	width: 40%;
	height: 40%;
	transition: transform .4s var(--e-ease), opacity .2s;
}

.crmtl-embed__glyph .crmtl-i-play {
	margin-left: 6%;
}

.crmtl-embed__glyph .crmtl-i-pause,
.is-playing > .crmtl-embed__glyph .crmtl-i-play {
	opacity: 0;
	transform: scale(.4) rotate(-90deg);
}

.is-playing > .crmtl-embed__glyph .crmtl-i-pause {
	opacity: 1;
	transform: none;
}

.is-loading > .crmtl-embed__glyph {
	animation: crmtl-e-pulse .8s ease-in-out infinite alternate;
}

@keyframes crmtl-e-pulse {
	to { opacity: .4; }
}

/* ---- Cover ------------------------------------------------------------- */

.crmtl-embed__cover {
	position: relative;
	display: block;
	aspect-ratio: 1;
	border-radius: 6px;
	overflow: hidden;
	background: var(--e-tint);
	isolation: isolate;
}

.crmtl-embed__cover img {
	transition: transform 1.2s var(--e-ease), filter .6s;
}

.crmtl-embed__cover:hover img,
.crmtl-embed.is-active .crmtl-embed__cover img {
	transform: scale(1.04);
}

.crmtl-embed__nocover {
	display: block;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--e-accent) 55%, transparent), transparent 60%),
		radial-gradient(circle at 75% 80%, color-mix(in srgb, currentColor 25%, transparent), transparent 55%),
		#151411;
}

.crmtl-embed__cover > .crmtl-embed__glyph {
	position: absolute;
	right: 14px;
	bottom: 14px;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--e-accent);
	color: #0e0d0b;
	transform: scale(.9);
	transition: transform .5s var(--e-ease);
}

.crmtl-embed__cover:hover > .crmtl-embed__glyph,
.crmtl-embed__cover.is-current > .crmtl-embed__glyph {
	transform: scale(1);
}

/* ---- Collection -------------------------------------------------------- */

.crmtl-embed__head {
	display: grid;
	grid-template-columns: minmax(160px, 38%) 1fr;
	gap: clamp(20px, 4cqi, 48px);
	align-items: end;
}

.crmtl-embed__body {
	min-width: 0;
}

.crmtl-embed__kicker,
.crmtl-embed__meta {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	font-family: var(--e-mono);
	font-size: 11px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--e-mute);
}

.crmtl-embed__kicker span + span::before {
	content: "—";
	margin: 0 .7em;
	opacity: .5;
}

.crmtl-embed .crmtl-embed__title {
	margin: .3em 0 0;
	font-family: var(--e-serif);
	font-weight: 400;
	font-size: clamp(34px, 7cqi, 72px);
	line-height: .95;
	letter-spacing: -.015em;
	text-wrap: balance;
}

.crmtl-embed__title a {
	color: inherit;
	text-decoration: none;
}

.crmtl-embed__title a:hover {
	color: var(--e-accent);
}

.crmtl-embed__subtitle {
	margin: .5em 0 0;
	font-family: var(--e-serif);
	font-style: italic;
	font-size: 21px;
	color: var(--e-mute);
}

.crmtl-embed .crmtl-embed__play {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-top: 26px;
	padding: 10px 20px 10px 10px;
	border-radius: 14px;
	background: var(--e-tint);
	font-family: var(--e-serif);
	font-size: 20px;
	line-height: 1;
	transition: background-color .3s;
}

.crmtl-embed .crmtl-embed__play:hover {
	background: color-mix(in srgb, currentColor 11%, transparent);
}

.crmtl-embed__play .crmtl-embed__glyph {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--e-accent);
	color: #0e0d0b;
}

.crmtl-embed__tracks {
	display: grid;
	gap: 2px;
	margin: clamp(24px, 4cqi, 40px) 0 0;
	padding: 0;
	list-style: none;
}

.crmtl-embed__tracks li {
	margin: 0;
	padding: 0;
}

.crmtl-embed .crmtl-embed__track {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr) auto 56px;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 12px 12px 12px 8px;
	border-radius: 12px;
	transition: background-color .25s, color .25s;
}

.crmtl-embed .crmtl-embed__track:hover {
	background: var(--e-tint);
}

.crmtl-embed__n {
	display: grid;
	place-items: center;
	font-family: var(--e-mono);
	font-size: 11px;
	color: var(--e-mute);
	font-variant-numeric: tabular-nums;
}

.crmtl-embed__n > * {
	grid-area: 1 / 1;
}

.crmtl-embed__t {
	display: grid;
	min-width: 0;
}

.crmtl-embed__t-title {
	font-family: var(--e-serif);
	font-size: 21px;
	line-height: 1.15;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.crmtl-embed__t-artist {
	font-size: .82em;
	color: var(--e-mute);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.crmtl-embed__kind {
	font-family: var(--e-mono);
	font-size: 9.5px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--e-mute);
}

.crmtl-embed__d,
.crmtl-embed__duration {
	font-family: var(--e-mono);
	font-size: 11px;
	color: var(--e-mute);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.crmtl-embed .crmtl-embed__track.is-current {
	color: var(--e-accent);
}

.crmtl-embed__track.is-current .crmtl-embed__n-num {
	opacity: 0;
}

.crmtl-embed__eq {
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 12px;
	opacity: 0;
}

.crmtl-embed__eq i {
	width: 2px;
	height: 100%;
	background: currentColor;
	transform-origin: 50% 100%;
	transform: scaleY(.3);
}

.crmtl-embed__track.is-current .crmtl-embed__eq {
	opacity: 1;
}

.crmtl-embed__track.is-playing .crmtl-embed__eq i {
	animation: crmtl-e-eq .9s ease-in-out infinite alternate;
}

.crmtl-embed .crmtl-embed__eq i:nth-child(2) { animation-delay: -.35s; }
.crmtl-embed .crmtl-embed__eq i:nth-child(3) { animation-delay: -.6s; }

@keyframes crmtl-e-eq {
	0% { transform: scaleY(.25); }
	50% { transform: scaleY(1); }
	100% { transform: scaleY(.45); }
}

/* ---- Single track ------------------------------------------------------ */

.crmtl-embed--track {
	display: grid;
	grid-template-columns: clamp(56px, 16%, 84px) minmax(0, 1fr) auto;
	align-items: center;
	gap: clamp(12px, 3%, 20px);
	padding: 10px 22px 10px 10px;
	border-radius: 16px;
	background: var(--e-tint);
}

.crmtl-embed--track .crmtl-embed__cover {
	border-radius: 10px;
}

.crmtl-embed--track .crmtl-embed__cover > .crmtl-embed__glyph {
	inset: 0;
	width: auto;
	height: auto;
	border-radius: 0;
	background: color-mix(in srgb, #0e0d0b 35%, transparent);
	color: #fff;
	transform: none;
	opacity: 0;
	transition: opacity .3s;
}

.crmtl-embed--track .crmtl-embed__cover:hover > .crmtl-embed__glyph,
.crmtl-embed--track .crmtl-embed__cover.is-current > .crmtl-embed__glyph,
.crmtl-embed--track .crmtl-embed__cover:focus-visible > .crmtl-embed__glyph {
	opacity: 1;
}

.crmtl-embed--track .crmtl-embed__title {
	margin: 0;
	font-size: clamp(24px, 4cqi, 34px);
}

.crmtl-embed--track .crmtl-embed__meta {
	margin-top: 6px;
	gap: 0 .9em;
}

.crmtl-embed__meta a {
	color: inherit;
	text-decoration: none;
}

.crmtl-embed__meta a:hover {
	color: var(--e-accent);
}

.crmtl-embed--track.is-active .crmtl-embed__title {
	color: var(--e-accent);
}

/* ---- Actions / "Lire" ---------------------------------------------------- */

.crmtl-embed__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
	margin-top: 26px;
}

.crmtl-embed__actions .crmtl-embed__play {
	margin-top: 0;
}

.crmtl-embed .crmtl-embed__read {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--e-mono);
	font-size: 11px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--e-mute);
	transition: color .2s;
}

.crmtl-embed .crmtl-embed__read::before {
	content: "";
	width: 18px;
	height: 14px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M2 2.5C4.5 1.5 7.5 1.5 12 3c4.5-1.5 7.5-1.5 10-.5v13c-2.5-1-5.5-1-10 .5-4.5-1.5-7.5-1.5-10-.5z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M12 3v13' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M2 2.5C4.5 1.5 7.5 1.5 12 3c4.5-1.5 7.5-1.5 10-.5v13c-2.5-1-5.5-1-10 .5-4.5-1.5-7.5-1.5-10-.5z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M12 3v13' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.crmtl-embed .crmtl-embed__read:hover {
	color: var(--e-accent);
}

/* ---- Sections ---------------------------------------------------------- */

.crmtl-embed__tracks .crmtl-embed__section {
	padding: 18px 8px 6px;
	font-family: var(--e-mono);
	font-size: 10.5px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--e-accent);
}

.crmtl-embed__tracks .crmtl-embed__section:first-child {
	padding-top: 0;
}

/* ---- Compact (existing playlists of the site) --------------------------- */

.crmtl-embed--compact {
	margin-block: 1.4em;
	padding: 10px;
	border-radius: 16px;
	background: var(--e-tint);
}

.crmtl-embed__bar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	padding: 4px 8px 4px 4px;
}

.crmtl-embed .crmtl-embed__barplay .crmtl-embed__glyph {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--e-accent);
	color: #0e0d0b;
	transition: transform .4s var(--e-ease);
}

.crmtl-embed .crmtl-embed__barplay:hover .crmtl-embed__glyph {
	transform: scale(1.07);
}

.crmtl-embed__bartext {
	min-width: 0;
}

.crmtl-embed .crmtl-embed__bartitle {
	margin: 2px 0 0;
	font-family: var(--e-serif);
	font-size: 22px;
	line-height: 1.1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.crmtl-embed--compact .crmtl-embed__tracks {
	margin-top: 6px;
}

.crmtl-embed--compact .crmtl-embed__track {
	padding-block: 9px;
}

.crmtl-embed--compact .crmtl-embed__t-title {
	font-size: 19px;
}

/* ---- Track notes, in the page ------------------------------------------ */

.crmtl-note {
	--e-accent: var(--crmtl-accent, #ff5a36);
	--e-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--e-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--e-mute: color-mix(in srgb, currentColor 58%, transparent);
	margin-block: 2em;
}

.crmtl-note__head {
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	margin-bottom: .8em;
}

.crmtl-note .crmtl-note__play {
	-webkit-appearance: none;
	appearance: none;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--e-accent);
	color: #0e0d0b;
	cursor: pointer;
	transition: transform .4s cubic-bezier(.16, 1, .3, 1);
}

.crmtl-note .crmtl-note__play:hover {
	transform: scale(1.07);
}

.crmtl-note__n,
.crmtl-note__d {
	font-family: var(--e-mono);
	font-size: 11px;
	color: var(--e-mute);
	font-variant-numeric: tabular-nums;
}

.crmtl-note__t {
	display: grid;
	min-width: 0;
}

.crmtl-note__title {
	font-family: var(--e-serif);
	font-size: clamp(24px, 3vw, 32px);
	line-height: 1.05;
}

.crmtl-note__artist {
	font-style: italic;
	color: var(--e-mute);
}

.crmtl-note.is-active .crmtl-note__title {
	color: var(--e-accent);
}

.crmtl-note__details {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 26px;
	margin: 1.2em 0 0;
}

.crmtl-note__details div {
	display: grid;
}

.crmtl-note__details dt {
	font-family: var(--e-mono);
	font-size: 10px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--e-mute);
}

.crmtl-note__details dd {
	margin: 0;
}

.crmtl-note__docs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 1.2em 0 0;
	padding: 0;
	list-style: none;
}

.crmtl-note__doc a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	text-decoration: none;
}

.crmtl-note__doc--image img {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 6px;
}

.crmtl-note__doc--pdf span,
.crmtl-note__doc--file span {
	padding: 2px 6px;
	border-radius: 4px;
	font-family: var(--e-mono);
	font-size: 10px;
	color: #0e0d0b;
	background: var(--e-accent);
}

/* ---- Narrow containers ------------------------------------------------- */

@container (max-width: 560px) {
	.crmtl-embed__head {
		grid-template-columns: 1fr;
	}

	.crmtl-embed__head .crmtl-embed__cover {
		max-width: 320px;
	}

	.crmtl-embed .crmtl-embed__track {
		grid-template-columns: 28px minmax(0, 1fr) 44px;
		gap: 10px;
	}

	.crmtl-embed__kind {
		display: none;
	}

	.crmtl-embed .crmtl-embed__bartitle {
		font-size: 19px;
	}

	.crmtl-embed--track .crmtl-embed__duration {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.crmtl-embed *,
	.crmtl-embed *::before {
		animation: none !important;
		transition-duration: .001ms !important;
	}
}
