/**
 * "Aureon Settings" editor sidebar — see ./index.js.
 *
 * A grey ground with one white card per question, so each setting reads as its
 * own block rather than a run of collapsible panels. Accents follow the admin
 * colour scheme (--wp-admin-theme-color), like the rest of the block editor.
 */

.aureon-ps {
	--aureon-ps-accent: var(--wp-admin-theme-color, #3858e9);
	--aureon-ps-border: #e0e0e0;
	--aureon-ps-muted: #757575;
	--aureon-ps-ink: #1e1e1e;
	--aureon-ps-ground: #f6f7f9;
}

.aureon-ps__stack {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 100%;
	padding: 10px;
	background: var(--aureon-ps-ground);
}

.aureon-ps__card {
	padding: 12px;
	border: 1px solid var(--aureon-ps-border);
	border-radius: 12px;
	background: #fff;
}

// Nested for specificity over core's sidebar heading rule (11px uppercase).
.aureon-ps .aureon-ps__card .aureon-ps__title {
	margin: 0 0 2px;
	color: var(--aureon-ps-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
}

.aureon-ps__desc {
	margin: 0;
	color: var(--aureon-ps-muted);
	font-size: 12px;
	line-height: 1.45;
}

.aureon-ps__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 12px;

	.components-base-control__help {
		margin-bottom: 0;
	}

	// Dropdowns and the width field: rounded, on a soft border rather than
	// core's dark outline. Core sets that border through a tripled emotion
	// class no selector here outranks, but it reads the colour from
	// --wp-components-color-gray-600 — so the variable is re-pointed on the
	// control itself. Focus uses the accent variable and is untouched.
	.components-input-control__container {
		--wp-components-color-gray-600: var(--aureon-ps-border);
	}

	.components-input-control__backdrop {
		border-radius: 8px;
	}

	.components-input-control__container,
	.components-select-control__input {
		border-radius: 8px;
	}

	.components-text-control__input {
		border-color: var(--aureon-ps-border);
		border-radius: 8px;
	}
}

// Picture choices: a row of tiles, pictogram over label.
.aureon-ps__choices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	grid-auto-flow: column;
	gap: 4px;
}

.aureon-ps__choice {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	min-width: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--aureon-ps-muted);
	cursor: pointer;

	&:hover:not(.is-active) .aureon-ps__choice-tile {
		border-color: #949494;
	}

	&.is-active {
		color: var(--aureon-ps-accent);

		.aureon-ps__choice-tile {
			border-color: var(--aureon-ps-accent);
			box-shadow: 0 0 0 1px var(--aureon-ps-accent);
			background: color-mix(in srgb, var(--aureon-ps-accent) 6%, #fff);
		}
	}

	&:focus-visible {
		outline: none;

		.aureon-ps__choice-tile {
			outline: 2px solid var(--aureon-ps-accent);
			outline-offset: 2px;
		}
	}
}

.aureon-ps__choice-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	max-height: 48px;
	border: 1px solid var(--aureon-ps-border);
	border-radius: 8px;
	background: #fff;
	transition:
		border-color 0.12s ease,
		box-shadow 0.12s ease;
}

// Two-word labels ("Full width") wrap under the tile rather than truncate.
.aureon-ps__choice-label {
	max-width: 100%;
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1.25;
	text-align: center;

	.is-active > & {
		font-weight: 600;
	}
}

.aureon-ps__picture {
	display: block;
	width: 70%;
	max-width: 30px;
	height: auto;
}

.aureon-ps__picture-frame {
	fill: #fff;
	stroke: currentcolor;
	stroke-opacity: 0.55;
}

.aureon-ps__picture-bar {
	fill: currentcolor;
	fill-opacity: 0.18;
}

.aureon-ps__picture-block {
	fill: currentcolor;
	fill-opacity: 0.55;
}

.aureon-ps__picture-column {
	fill: currentcolor;
	fill-opacity: 0.25;
}

// Disable Elements: compact switches, one per line.
.aureon-ps__toggles {
	display: flex;
	flex-direction: column;
	gap: 10px;

	.components-toggle-control__label {
		color: var(--aureon-ps-ink);
		font-size: 13px;
	}
}

.aureon-ps__radios .components-radio-control__group-wrapper,
.aureon-ps__radios .components-v-stack {
	gap: 10px;
}

.aureon-ps__radios label {
	color: var(--aureon-ps-ink);
	font-size: 12.5px;
	line-height: 1.4;
}

.aureon-ps__help {
	display: flex;
	gap: 10px;
	padding: 14px;
	border: 1px solid color-mix(in srgb, var(--aureon-ps-accent) 18%, #fff);
	border-radius: 12px;
	background: color-mix(in srgb, var(--aureon-ps-accent) 5%, #fff);
}

.aureon-ps__help-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: color-mix(in srgb, var(--aureon-ps-accent) 12%, #fff);
	color: var(--aureon-ps-accent);
}

.aureon-ps__help-title {
	margin: 0 0 2px;
	color: var(--aureon-ps-ink);
	font-size: 13px;
	font-weight: 600;
}

.aureon-ps__help-text {
	margin: 0;
	color: var(--aureon-ps-muted);
	font-size: 12px;
	line-height: 1.45;
}
