/*
 * JEDI Suno Channel: front-end styles.
 * Fonts and colours come from the theme. Borders and tints are derived from
 * currentColor, so the component follows light, dark and custom palettes.
 */

.jsc-channel {
	--jsc-gap: 1rem;
	--jsc-radius: 12px;
	--jsc-player-height: 240px;
	--jsc-line: rgba(128, 128, 128, 0.35);
	--jsc-tint: rgba(128, 128, 128, 0.08);
	box-sizing: border-box;
	color: inherit;
	font: inherit;
	margin-block: 1.5em;
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
	.jsc-channel {
		--jsc-line: color-mix(in srgb, currentColor 22%, transparent);
		--jsc-tint: color-mix(in srgb, currentColor 6%, transparent);
	}
}

/* Set explicitly: content inside <details> doesn't inherit through the slot. */
.jsc-channel *,
.jsc-channel *::before,
.jsc-channel *::after {
	box-sizing: border-box;
}

/* Profile card */
.jsc-card {
	align-items: center;
	background: var(--jsc-tint);
	border: 1px solid var(--jsc-line);
	border-radius: var(--jsc-radius);
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	padding: 1rem;
}

.jsc-card__avatar {
	align-items: center;
	border: 2px solid currentColor;
	border-radius: 50%;
	display: inline-flex;
	flex: 0 0 auto;
	font-size: 1.25em;
	font-weight: 700;
	height: 3rem;
	justify-content: center;
	line-height: 1;
	width: 3rem;
}

.jsc-card__body {
	flex: 1 1 12rem;
	min-width: 0;
}

.jsc-card__kicker,
.jsc-card__handle,
.jsc-card__name {
	margin: 0;
}

.jsc-card__kicker {
	font-size: 0.8em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.jsc-card__name {
	font-size: 1.35em;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.jsc-card__handle {
	font-size: 0.9em;
	overflow-wrap: anywhere;
}

/* Buttons: inherit the theme's link colour, 44px minimum touch target */
.jsc-channel .jsc-button {
	align-items: center;
	border: 2px solid currentColor;
	border-radius: 999px;
	display: inline-flex;
	font-weight: 600;
	gap: 0.35em;
	justify-content: center;
	line-height: 1.2;
	min-height: 44px;
	padding: 0.5em 1.1em;
	text-decoration: none;
}

.jsc-channel .jsc-button::after {
	content: "\2197";
	content: "\2197" / "";
	font-weight: 400;
}

.jsc-channel .jsc-button:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.jsc-channel .jsc-button--small {
	min-height: 44px;
	padding: 0.35em 0.9em;
}

.jsc-channel a:focus-visible,
.jsc-channel iframe:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.jsc-card__link {
	flex: 0 0 auto;
}

/* Curated list */
.jsc-curated {
	margin-top: var(--jsc-gap);
}

.jsc-curated__label {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.75em;
	margin: 0 0 0.75rem;
}

.jsc-curated__hint {
	font-size: 0.85em;
}

.jsc-tracks {
	display: grid;
	gap: var(--jsc-gap);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.jsc-track {
	border: 1px solid var(--jsc-line);
	border-radius: var(--jsc-radius);
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin: 0;
	min-width: 0;
	padding: 0.85rem;
}

.jsc-track__title,
.jsc-track__by,
.jsc-track__note,
.jsc-track__actions {
	margin: 0;
}

.jsc-track__title {
	font-size: 1.05em;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.jsc-track__by,
.jsc-track__note {
	font-size: 0.9em;
}

.jsc-track__player {
	background: var(--jsc-tint);
	border-radius: 8px;
	overflow: hidden;
}

.jsc-track__player iframe {
	border: 0;
	display: block;
	height: var(--jsc-player-height);
	max-width: 100%;
	width: 100%;
}

/* Editor-only notes (never shown to visitors) */
.jsc-notes {
	border: 1px dashed var(--jsc-line);
	border-radius: 8px;
	font-size: 0.9em;
	margin-top: var(--jsc-gap);
	padding: 0.75rem 1rem;
}

.jsc-notes__title {
	margin: 0 0 0.4rem;
}

.jsc-notes ul {
	margin: 0;
	padding-left: 1.2em;
}

.jsc-note {
	margin: 0.25em 0;
	padding-left: 0.25em;
}

.jsc-note--error {
	border-left: 4px solid #d63638;
}

.jsc-note--warning {
	border-left: 4px solid #dba617;
}

.jsc-note--info {
	border-left: 4px solid #72aee6;
}

.jsc-sr {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* Phones: one column, full-width actions within thumb reach */
@media (max-width: 600px) {
	.jsc-card {
		padding: 0.85rem;
	}

	.jsc-card__link,
	.jsc-channel .jsc-track__link {
		width: 100%;
	}

	.jsc-tracks {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jsc-channel * {
		scroll-behavior: auto;
		transition: none;
	}
}

/* MP3 players from the Media Library */
.jsc-track__player--audio {
	background: none;
	border-radius: 0;
	overflow: visible;
}

.jsc-channel audio {
	display: block;
	min-height: 44px;
	width: 100%;
}

/* "Show all" list: compact rows, players load on tap */
.jsc-more {
	margin-top: var(--jsc-gap);
}

.jsc-channel .jsc-more__toggle {
	cursor: pointer;
	list-style: none;
}

.jsc-channel .jsc-more__toggle::-webkit-details-marker {
	display: none;
}

.jsc-channel .jsc-more__toggle::after {
	content: "\25BE";
	content: "\25BE" / "";
}

.jsc-channel .jsc-more[open] > .jsc-more__toggle::after {
	content: "\25B4";
	content: "\25B4" / "";
}

.jsc-channel .jsc-more__toggle:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.jsc-more__body {
	margin-top: 0.75rem;
}

.jsc-filter {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	margin-bottom: 0.75rem;
}

.jsc-filter[hidden],
.jsc-row[hidden],
.jsc-row__play[hidden],
.jsc-row__player[hidden],
.jsc-audio-error[hidden] {
	display: none;
}

.jsc-filter__input {
	border: 1px solid var(--jsc-line);
	border-radius: 8px;
	color: inherit;
	flex: 1 1 14rem;
	font: inherit;
	min-height: 44px;
	padding: 0.4em 0.7em;
	background: transparent;
}

.jsc-filter__status {
	font-size: 0.9em;
}

.jsc-list {
	border-top: 1px solid var(--jsc-line);
	list-style: none;
	margin: 0;
	padding: 0;
}

.jsc-row__num {
	display: inline-block;
	font-variant-numeric: tabular-nums;
	min-width: 2.6em;
}

.jsc-row {
	border-bottom: 1px solid var(--jsc-line);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	padding: 0.6rem 0;
}

.jsc-row__main {
	flex: 1 1 14rem;
	min-width: 0;
}

.jsc-row__title {
	overflow-wrap: anywhere;
}

.jsc-row__by,
.jsc-row__note {
	font-size: 0.9em;
	margin: 0.15em 0 0;
}

.jsc-row__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.jsc-channel button.jsc-button {
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}

.jsc-channel button.jsc-button::after {
	content: none;
}

.jsc-row__player {
	flex: 1 1 100%;
}

.jsc-row__player iframe {
	border: 0;
	border-radius: 8px;
	display: block;
	height: var(--jsc-player-height);
	width: 100%;
}

@media (max-width: 600px) {
	.jsc-row__actions,
	.jsc-row__actions .jsc-button,
	.jsc-channel .jsc-more__toggle {
		width: 100%;
	}

	.jsc-row__actions .jsc-button {
		flex: 1 1 auto;
	}
}

/* Other accounts on the card */
.jsc-card__also {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	font-size: 0.9em;
	gap: 0.25rem 0.4rem;
	margin: 0.35rem 0 0;
}

.jsc-channel .jsc-card__account {
	align-items: center;
	border: 1px solid var(--jsc-line);
	border-radius: 999px;
	display: inline-flex;
	min-height: 44px;
	overflow-wrap: anywhere;
	padding: 0.2em 0.75em;
	text-decoration: none;
}

.jsc-channel .jsc-card__account:hover {
	text-decoration: underline;
}
