/**
 * Song card — new design (Oct 2026). Applies to cards with .dt-card
 * (inc/features/song-card-design.php). Overrides the inline "song-card-styles".
 *
 * Design: black card, big rounded corners, artwork left; artist (light caps),
 * bold title, round cyan headphones button top-right; 7-segment difficulty bar
 * with the length on the right and the level under it; pill buttons:
 * "Drum It" (cyan) + edition switch ("Simplified" outlined lime / "Original" solid lime).
 */

article.song-card.dt-card {
	--dc-cyan: #00e7fd;
	--dc-lime: #b1fd00;
	--dc-lime-bg: #1b2a06;
	--dc-ink: #050505;

	align-items: center;
	gap: 26px;
	padding: 18px 20px;
	background: #000;
	border-radius: 22px;
}

article.song-card.dt-card:hover {
	border-color: var(--dc-cyan);
}

/* Edition is shown by the switch button instead of a badge. */
article.song-card.dt-card .song-card__badge {
	display: none;
}

article.song-card.dt-card .song-card__image-wrap {
	flex: 0 0 170px;
	width: 170px;
	height: 170px;
	border-radius: 4px;
}

article.song-card.dt-card .song-card__content {
	gap: 16px;
	padding-right: 4px;
}

article.song-card.dt-card .song-card__header {
	gap: 2px;
	padding-right: 48px; /* room for the headphones button */
}

article.song-card.dt-card .song-card__artist {
	color: #fff;
	font-size: 15px;
	font-weight: 400;
	letter-spacing: 0.03em;
}

article.song-card.dt-card .song-card__title {
	color: #fff;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.2;
}

/* Difficulty row: bar + length on one line, level label under the bar. */
article.song-card.dt-card .song-card__header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: 14px;
}

article.song-card.dt-card .song-card__artist,
article.song-card.dt-card .song-card__title {
	grid-column: 1 / -1;
}

article.song-card.dt-card .song-card__difficulty-wrap {
	grid-column: 1;
	margin-top: 10px;
	gap: 6px;
}

article.song-card.dt-card .song-card__difficulty-bar {
	display: flex;
	gap: 5px;
	max-width: none;
}

article.song-card.dt-card .song-card__difficulty-segment {
	flex: 1;
	height: 4px;
	border-radius: 3px;
	background: #d4d4d4;
}

article.song-card.dt-card .song-card__difficulty-segment--active {
	background: var(--dc-cyan);
}

article.song-card.dt-card .song-card__difficulty-label {
	color: #fff;
	font-size: 14px;
	font-weight: 400;
}

article.song-card.dt-card .song-card__length {
	grid-column: 2;
	grid-row: 3;
	align-self: start;
	margin-top: 4px;
	color: #fff;
	font-size: 15px;
	font-weight: 400;
}

article.song-card.dt-card .dt-card__length-label {
	display: none;
}

/* Buttons */

article.song-card.dt-card .song-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

article.song-card.dt-card .song-card__btn--download,
article.song-card.dt-card .dt-card__edition {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 132px;
	height: 40px;
	padding: 0 18px 0 12px;
	border: 2px solid transparent;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	transition: box-shadow 0.2s, transform 0.2s;
}

article.song-card.dt-card .song-card__btn--download,
article.song-card.dt-card .song-card__btn--download:visited {
	background: var(--dc-cyan);
	border-color: var(--dc-cyan);
	color: var(--dc-ink);
}

article.song-card.dt-card .song-card__btn--download img {
	width: 24px !important;
	height: 24px !important;
	filter: brightness(0);
}

article.song-card.dt-card .dt-card__edition--simplified,
article.song-card.dt-card .dt-card__edition--simplified:visited {
	background: var(--dc-lime-bg);
	border-color: var(--dc-lime);
	color: #fff;
}

article.song-card.dt-card .dt-card__edition--original,
article.song-card.dt-card .dt-card__edition--original:visited {
	background: var(--dc-lime);
	border-color: var(--dc-lime);
	color: var(--dc-ink);
}

article.song-card.dt-card .dt-card__ed-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

article.song-card.dt-card .song-card__btn--download:hover,
article.song-card.dt-card .song-card__btn--download:focus-visible {
	color: var(--dc-ink);
	box-shadow: 0 0 14px rgba(0, 231, 253, 0.5);
	transform: translateY(-1px);
}

article.song-card.dt-card .dt-card__edition--simplified:hover,
article.song-card.dt-card .dt-card__edition--simplified:focus-visible {
	color: #fff;
	box-shadow: 0 0 14px rgba(177, 253, 0, 0.45);
	transform: translateY(-1px);
}

article.song-card.dt-card .dt-card__edition--original:hover,
article.song-card.dt-card .dt-card__edition--original:focus-visible {
	color: var(--dc-ink);
	box-shadow: 0 0 14px rgba(177, 253, 0, 0.45);
	transform: translateY(-1px);
}

/* Headphones (audio preview): round cyan button, top-right of the card. */
article.song-card.dt-card .song-card__btn--play {
	position: absolute;
	top: 16px;
	right: 18px;
	width: 40px;
	height: 40px;
	min-width: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--dc-cyan);
	border: 0;
	border-radius: 50%;
	color: var(--dc-ink);
}

article.song-card.dt-card .song-card__btn--play svg {
	width: 22px;
	height: 22px;
}

article.song-card.dt-card .song-card__btn--play:hover,
article.song-card.dt-card .song-card__btn--play.is-playing {
	box-shadow: 0 0 14px rgba(0, 231, 253, 0.55);
}

/* Narrow cards (tablet columns, phones) */
@media (max-width: 767px) {
	article.song-card.dt-card {
		gap: 14px;
		padding: 14px;
		border-radius: 18px;
	}
	article.song-card.dt-card .song-card__image-wrap {
		flex-basis: 104px;
		width: 104px;
		height: 104px;
	}
	article.song-card.dt-card .song-card__header {
		padding-right: 40px;
	}
	article.song-card.dt-card .song-card__artist {
		font-size: 12px;
	}
	article.song-card.dt-card .song-card__title {
		font-size: 16px;
	}
	article.song-card.dt-card .song-card__difficulty-wrap {
		margin-top: 6px;
	}
	article.song-card.dt-card .song-card__difficulty-label,
	article.song-card.dt-card .song-card__length {
		font-size: 12px;
	}
	article.song-card.dt-card .song-card__actions {
		gap: 8px;
	}
	article.song-card.dt-card .song-card__btn--download,
	article.song-card.dt-card .dt-card__edition {
		min-width: 0;
		height: 34px;
		padding: 0 12px 0 9px;
		font-size: 13px;
	}
	article.song-card.dt-card .song-card__btn--download img {
		width: 18px !important;
		height: 18px !important;
	}
	article.song-card.dt-card .dt-card__ed-icon {
		width: 16px;
		height: 16px;
	}
	article.song-card.dt-card .song-card__btn--play {
		top: 12px;
		right: 12px;
		width: 34px;
		height: 34px;
	}
	article.song-card.dt-card .song-card__btn--play svg {
		width: 18px;
		height: 18px;
	}
}

/* Length sits right after the bar (design: "━━━━━━━  3:55"). */
article.song-card.dt-card .song-card__header {
	grid-template-columns: auto minmax(0, 1fr);
}

article.song-card.dt-card .song-card__difficulty-segment {
	flex: 0 0 26px;
	width: 26px;
}

article.song-card.dt-card .song-card__length {
	justify-self: start;
	margin-top: 3px;
	line-height: 1;
}

@media (max-width: 767px) {
	article.song-card.dt-card .song-card__difficulty-segment {
		flex-basis: 18px;
		width: 18px;
	}
	article.song-card.dt-card .song-card__difficulty-bar {
		gap: 4px;
	}
}

/* Half-width cards (home carousels ~480px): smaller artwork so both pills stay on one row. */
@media (min-width: 768px) {
	.dtc-slide-grid article.song-card.dt-card,
	.swiper-slide article.song-card.dt-card {
		gap: 18px;
		padding: 16px 18px;
	}
	.dtc-slide-grid article.song-card.dt-card .song-card__image-wrap,
	.swiper-slide article.song-card.dt-card .song-card__image-wrap {
		flex-basis: 128px;
		width: 128px;
		height: 128px;
	}
	.dtc-slide-grid article.song-card.dt-card .song-card__btn--download,
	.dtc-slide-grid article.song-card.dt-card .dt-card__edition,
	.swiper-slide article.song-card.dt-card .song-card__btn--download,
	.swiper-slide article.song-card.dt-card .dt-card__edition {
		min-width: 0;
		padding: 0 14px 0 10px;
	}
	.dtc-slide-grid article.song-card.dt-card .song-card__difficulty-segment,
	.swiper-slide article.song-card.dt-card .song-card__difficulty-segment {
		flex-basis: 20px;
		width: 20px;
	}
}

/* ==========================================================================
   Size by the card's own width (grids of 1–3 columns, carousels, sidebars).
   Cards must never force their column wider than the layout gives them.
   ========================================================================== */

.dsv-related-songs-grid > *,
.dtc-slide-grid > *,
.elementor-loop-container > * {
	min-width: 0;
}

article.song-card.dt-card {
	container-type: inline-size;
	container-name: dt-card;
	min-width: 0;
}

@container dt-card (max-width: 540px) {
	.song-card__image-wrap {
		flex-basis: 120px !important;
		width: 120px !important;
		height: 120px !important;
	}
	.song-card__btn--download,
	.dt-card__edition {
		min-width: 0 !important;
		height: 36px !important;
		padding: 0 12px 0 9px !important;
		font-size: 14px !important;
	}
	.song-card__btn--download img {
		width: 20px !important;
		height: 20px !important;
	}
	.song-card__difficulty-segment {
		flex-basis: 18px !important;
		width: 18px !important;
	}
	.song-card__title {
		font-size: 18px !important;
	}
}

@container dt-card (max-width: 420px) {
	.song-card__image-wrap {
		flex-basis: 92px !important;
		width: 92px !important;
		height: 92px !important;
	}
	.song-card__artist {
		font-size: 12px !important;
	}
	.song-card__title {
		font-size: 15px !important;
	}
	.song-card__btn--download,
	.dt-card__edition {
		height: 32px !important;
		padding: 0 10px 0 8px !important;
		font-size: 12.5px !important;
		gap: 5px !important;
	}
	.dt-card__ed-icon {
		width: 15px !important;
		height: 15px !important;
	}
	.song-card__difficulty-segment {
		flex-basis: 13px !important;
		width: 13px !important;
	}
	.song-card__difficulty-bar {
		gap: 3px !important;
	}
	.song-card__difficulty-label,
	.song-card__length {
		font-size: 12px !important;
	}
}

/* Very narrow cards (e.g. the related-songs sidebar on song pages, ~270–330px). */
@container dt-card (max-width: 360px) {
	.song-card__image-wrap {
		flex-basis: 72px !important;
		width: 72px !important;
		height: 72px !important;
	}
	.song-card__header {
		grid-template-columns: minmax(0, 1fr) !important;
		padding-right: 38px !important;
	}
	.song-card__length {
		grid-column: 1 !important;
		grid-row: auto !important;
		margin-top: 0 !important;
	}
	.song-card__difficulty-segment {
		flex-basis: 11px !important;
		width: 11px !important;
	}
	.song-card__btn--play {
		top: 10px !important;
		right: 10px !important;
		width: 30px !important;
		height: 30px !important;
	}
	.song-card__btn--play svg {
		width: 16px !important;
		height: 16px !important;
	}
}

/* Card links (Shay, Nov 2026): visitors open the drum sheet page by clicking anywhere
   on the card; "Drum It" and "Simplified"/"Original" are labels for them, and only
   "Drum It" is a link, for subscribers (their cards are not clickable). */
article.song-card:not([data-href]) {
	cursor: default;
}

article.song-card .song-card__btn--static {
	pointer-events: none;
}

article.song-card .song-card__title-link,
article.song-card .song-card__title-link:visited,
article.song-card .song-card__title-link:hover {
	color: inherit;
	text-decoration: none;
}

/* Loop grids (/all-songs/): on mobile the Elementor box around each card wraps (flex-wrap
   in a column). With the card's container-type, the browser then sizes the card as if it
   were zero wide → 650–850px tall items with big gaps. No wrapping = the card's real height. */
.elementor-loop-container .e-con-inner:has(article.song-card) {
	flex-wrap: nowrap;
}
