/* NCS Chords public styles.
 *
 * Colours derive from the theme's own text colour (currentColor), so the song
 * page reads correctly on light and dark themes alike. Override --ncs-accent
 * in the theme's Additional CSS to change the chord colour.
 */

.ncs-song,
.ncs-library {
	--ncs-accent: #2563eb;
	--ncs-chord: #1d4ed8;
	--ncs-chord: color-mix(in srgb, var(--ncs-accent) 75%, currentColor);
	--ncs-line: rgba(127, 127, 127, 0.28);
	--ncs-soft: rgba(127, 127, 127, 0.09);
	--ncs-muted: rgba(127, 127, 127, 1);
	--ncs-muted: color-mix(in srgb, currentColor 62%, transparent);
	--ncs-scale: 1;
	--ncs-radius: 10px;
}

/* ------------------------------------------------------------------ */
/* Song page                                                           */
/* ------------------------------------------------------------------ */

.ncs-song-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0 0 16px;
	color: var(--ncs-muted);
	font-size: 0.95em;
}

.ncs-song-meta strong {
	color: var(--ncs-chord);
}

.ncs-meta-artist {
	font-weight: 600;
}

.ncs-toolbar {
	box-sizing: border-box;
	max-width: 100%;
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 20;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin: 0 0 20px;
	padding: 10px 12px;
	border: 1px solid var(--ncs-line);
	border-radius: var(--ncs-radius);
	background-color: var(--wp--preset--color--base, Canvas);
	color: var(--wp--preset--color--contrast, CanvasText);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	font-size: 14px;
	line-height: 1.2;
}

.ncs-toolbar[hidden],
.ncs-sheet[hidden] {
	display: none;
}

.ncs-control {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.ncs-control-label {
	margin-right: 4px;
	color: var(--ncs-muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.ncs-song .ncs-btn,
.ncs-library .ncs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	min-height: 36px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--ncs-line);
	border-radius: 8px;
	background: var(--ncs-soft);
	color: inherit;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	box-shadow: none;
}

.ncs-song .ncs-btn:hover,
.ncs-library .ncs-btn:hover {
	border-color: var(--ncs-accent);
}

.ncs-song .ncs-btn:focus-visible,
.ncs-library .ncs-btn:focus-visible,
.ncs-chord[role="button"]:focus-visible {
	outline: 2px solid var(--ncs-accent);
	outline-offset: 2px;
}

.ncs-song .ncs-btn-value {
	min-width: 40px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

span.ncs-btn-value {
	cursor: default;
}

.ncs-song .ncs-toggle[aria-pressed="true"],
.ncs-library .ncs-btn-primary {
	border-color: var(--ncs-accent);
	background: var(--ncs-accent);
	color: #fff;
}

.ncs-speed input {
	width: 90px;
	accent-color: var(--ncs-accent);
}

.ncs-key-status {
	margin-left: auto;
	color: var(--ncs-muted);
	font-size: 13px;
}

/* The sheet itself */

.ncs-sheet {
	font-size: calc(1.1em * var(--ncs-scale));
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.ncs-line {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	margin: 0 0 0.15em;
}

.ncs-line-plain {
	display: block;
	white-space: pre-wrap;
}

.ncs-chunk {
	display: inline-flex;
	flex-direction: column;
}

.ncs-chunk-pad .ncs-chord {
	padding-right: 0.5em;
}

.ncs-chord {
	min-height: 1.35em;
	color: var(--ncs-chord);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.85em;
	font-weight: 700;
	white-space: pre;
}

.ncs-chord[role="button"] {
	cursor: pointer;
}

.ncs-chord[role="button"]:hover {
	text-decoration: underline;
}

.ncs-annotation {
	color: var(--ncs-muted);
	font-family: inherit;
	font-style: italic;
	font-weight: 400;
}

.ncs-lyric {
	white-space: pre-wrap;
}

.ncs-blank {
	height: 0.8em;
}

.ncs-section-label {
	margin: 1em 0 0.3em;
	color: var(--ncs-chord);
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ncs-in-chorus {
	padding-left: 0.8em;
	border-left: 3px solid var(--ncs-line);
}

.ncs-comment {
	margin: 0.4em 0;
	color: var(--ncs-muted);
	font-style: italic;
}

.ncs-lyrics-only .ncs-chord,
.ncs-lyrics-only .ncs-diagrams-section {
	display: none;
}

/* Sections below the sheet */

.ncs-song-section {
	margin-top: 32px;
}

.ncs-song .ncs-song-heading {
	margin: 0 0 12px;
	font-size: 1.15em;
}

.ncs-diagrams {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.ncs-chip {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--ncs-soft);
	color: var(--ncs-chord);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
}

.ncs-diagram-card {
	margin: 0;
	padding: 8px 6px 4px;
	border: 1px solid var(--ncs-line);
	border-radius: var(--ncs-radius);
	text-align: center;
}

.ncs-diagram-name {
	color: var(--ncs-chord);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
}

.ncs-diagram-missing {
	padding: 30px 12px;
	color: var(--ncs-muted);
	font-size: 13px;
}

.ncs-diagram-svg {
	display: block;
	margin: 0 auto;
	overflow: visible;
}

.ncs-d-grid {
	stroke: currentColor;
	stroke-opacity: 0.35;
	stroke-width: 1;
}

.ncs-d-nut {
	stroke: currentColor;
}

.ncs-d-label {
	fill: currentColor;
	fill-opacity: 0.7;
	font-size: 11px;
}

.ncs-d-mute {
	fill: currentColor;
	fill-opacity: 0.7;
	font-size: 13px;
}

.ncs-d-open {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
}

.ncs-d-dot {
	fill: var(--ncs-accent);
}

.ncs-d-finger {
	fill: #fff;
	font-size: 10px;
	font-weight: 700;
}

.ncs-popover {
	--ncs-accent: #2563eb;
	--ncs-chord: #1d4ed8;
	--ncs-line: rgba(127, 127, 127, 0.28);
	position: absolute;
	z-index: 100000;
	padding: 4px;
	border-radius: 12px;
	background: #fff;
	color: #1d2327;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.ncs-popover .ncs-diagram-card {
	border: 0;
}

.ncs-popover-close {
	position: absolute;
	top: 2px;
	right: 4px;
	padding: 2px 6px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.ncs-video iframe {
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border-radius: var(--ncs-radius);
}

/* ------------------------------------------------------------------ */
/* Song lists ([ncs_songs] and "Similar songs")                         */
/* ------------------------------------------------------------------ */

.ncs-library-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.ncs-library-search {
	flex: 1 1 260px;
}

.ncs-library-filters input[type="search"],
.ncs-library-filters select {
	width: 100%;
	min-height: 40px;
	padding: 6px 10px;
	border: 1px solid var(--ncs-line);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
}

.ncs-library-filters select {
	width: auto;
	flex: 0 1 auto;
	max-width: 100%;
}

.ncs-library-filters select option {
	color: #1d2327;
}

.ncs-library-count {
	color: var(--ncs-muted);
	font-size: 0.9em;
}

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

.ncs-song-row {
	margin: 0;
	border-bottom: 1px solid var(--ncs-line);
}

.ncs-song-row a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 4px;
	color: inherit;
	text-decoration: none;
}

.ncs-song-row a:hover .ncs-song-row-title {
	color: var(--ncs-chord);
}

.ncs-song-row-main {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.ncs-song-row-title {
	font-weight: 600;
}

.ncs-song-row-artist,
.ncs-song-row-excerpt {
	overflow: hidden;
	color: var(--ncs-muted);
	font-size: 0.88em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ncs-song-row-key {
	flex: none;
	min-width: 2.6em;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--ncs-soft);
	color: var(--ncs-chord);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
	text-align: center;
}

.ncs-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}

.ncs-pagination-status {
	color: var(--ncs-muted);
	font-size: 0.9em;
}

/* ------------------------------------------------------------------ */
/* Small screens and print                                             */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {
	.ncs-toolbar {
		gap: 8px;
		padding: 8px;
	}

	.ncs-control-label {
		margin-right: 0;
		font-size: 10px;
	}

	.ncs-speed {
		display: none;
	}

	.ncs-song .ncs-btn {
		min-width: 34px;
		padding: 0 8px;
	}

	.ncs-key-status {
		width: 100%;
		margin-left: 0;
	}
}

@media print {
	.ncs-toolbar,
	.ncs-video,
	.ncs-song-section:not(.ncs-diagrams-section),
	.ncs-popover {
		display: none !important;
	}

	.ncs-song {
		--ncs-chord: #000;
		--ncs-accent: #000;
		color: #000;
	}

	.ncs-line {
		break-inside: avoid;
	}

	.ncs-diagrams-section {
		break-inside: avoid;
	}
}

.ncs-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
