/* HTML Color Picker — scoped under .aah-tool via the shared wrapper. */

.aah-colorpicker__swatch {
	min-height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1rem;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
	/* The transparency checkerboard lives in script.js, layered
	 * UNDER the picked color. It used to be a background-image
	 * here, but a background-image paints on top of a
	 * background-color, so the grey squares showed through even
	 * at 100% opacity and mottled the solid color. */
	background-color: #ffffff;
}

.aah-colorpicker__sample {
	margin: 0;
	font-size: 1.25em;
	font-weight: 700;
}

.aah-colorpicker__astext {
	margin: 0.75rem 0 0;
	padding: 0.75rem 1rem;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
	background: #ffffff;
	font-weight: 700;
}

.aah-colorpicker__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-end;
}

.aah-colorpicker__field {
	flex: 1 1 140px;
}

.aah-colorpicker__field--native {
	flex: 0 0 auto;
}

.aah-colorpicker__field input[type="color"] {
	width: 64px;
	height: 44px;
	padding: 2px;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
	background: var(--aah-bg);
	cursor: pointer;
}

.aah-colorpicker__field input[type="range"] {
	width: 100%;
	accent-color: var(--aah-crimson);
}

/* The Opacity slider row: the range and its % value sit on one
 * line, the same height as the text inputs, so the slider track
 * lines up with the HEX value instead of sitting high with the
 * value dangling below it. The theme styles every input like a
 * text box (border + padding); a range slider is not a text box,
 * so those are reset here — otherwise the slider renders as a
 * bordered box with the thumb stuck at the top instead of centred
 * on its track. */
.aah-colorpicker__slider {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	height: 44px;
}
.aah-colorpicker__slider input[type="range"] {
	flex: 1;
	min-width: 0;
	width: auto;
	margin: 0;
	border: 0;
	padding: 0;
	background: transparent;
	/* Fully custom slider: the native track is invisible on this
	 * site (the theme's input styling leaves only a floating
	 * thumb dot), so the track and thumb are drawn explicitly
	 * below. accent-color stays as a fallback for browsers
	 * without pseudo-element support. */
	-webkit-appearance: none;
	appearance: none;
	height: 20px;
	cursor: pointer;
}
.aah-colorpicker__slider input[type="range"]::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 3px;
	background: #d9d9d9;
}
.aah-colorpicker__slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	margin-top: -6px;
	border-radius: 50%;
	background: var(--aah-crimson);
	border: 2px solid #ffffff;
	box-shadow: 0 1px 3px rgba(35, 35, 35, 0.35);
}
.aah-colorpicker__slider input[type="range"]::-moz-range-track {
	height: 6px;
	border-radius: 3px;
	background: #d9d9d9;
}
.aah-colorpicker__slider input[type="range"]::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--aah-crimson);
	border: 2px solid #ffffff;
	box-shadow: 0 1px 3px rgba(35, 35, 35, 0.35);
}

.aah-colorpicker__alpha-value {
	font-weight: 600;
	white-space: nowrap;
}

.aah-colorpicker__error {
	color: var(--aah-crimson-dark);
	font-weight: 600;
}

.aah-colorpicker__error:empty {
	display: none;
}

.aah-colorpicker__group {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem 1rem;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
}

.aah-colorpicker__group legend {
	font-weight: 700;
	padding: 0 0.4rem;
}

.aah-colorpicker__triplet {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 0.75rem;
}

.aah-colorpicker__triplet label {
	margin-top: 0;
}

.aah-colorpicker__rgb-string {
	margin-top: 0.75rem;
}

.aah-colorpicker__rgb-string label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.aah-colorpicker__rgb-string input {
	width: 100%;
	box-sizing: border-box;
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.95em;
}

.aah-colorpicker__formats {
	margin-top: 1rem;
	display: grid;
	gap: 0.5rem;
}

.aah-colorpicker__format {
	display: grid;
	grid-template-columns: 110px 1fr auto;
	gap: 0.5rem;
	align-items: center;
}

.aah-colorpicker__format label {
	margin: 0;
}

.aah-colorpicker__format input {
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.95em;
}

.aah-colorpicker__format button {
	margin: 0;
	padding: 0.45rem 0.8rem;
}

.aah-colorpicker__actions {
	margin-top: 0.25rem;
}

.aah-colorpicker__history {
	margin-top: 1.25rem;
}

.aah-colorpicker__history-label {
	font-weight: 700;
}

.aah-colorpicker__history-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.4rem;
}

.aah-colorpicker__history-swatch {
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
	cursor: pointer;
}

.aah-colorpicker__status {
	margin-top: 0.75rem;
	color: var(--aah-muted);
	font-weight: 600;
}

.aah-colorpicker__status:empty {
	display: none;
}

/* Desktop: taller swatch in the preview column (the two-column
 * layout itself is the shared .aah-split). */
@media (min-width: 900px) {
	.aah-colorpicker__swatch {
		min-height: 260px;
	}
}
