// Import colors module
@import '../../main';
@include oColors();
@import '@financial-times/o-fonts/main';
@include oFonts();
@import '@financial-times/o-normalise/main';
@include oNormalise();


body {
	box-sizing: border-box;
	font-family: MetricWeb, Arial, sans-serif;
	font-size: 18px;

	*,
	*:before,
	*:after {
		box-sizing: inherit;
	}
}

@each $color-details in oColorsGetPaletteDetails() {
	$name: map-get($color-details, 'name');
	.o-colors-border-#{$name} {
		border-width: 2px 2px 0;
		border-style: solid;
		border-color: oColorsByName($name);

		@if $name == 'white' {
			border-color: oColorsMix(black, white, 20);
		}
	}

	.o-colors-demo-#{$name} {
		background-color: oColorsByName($name);
		color: oColorsGetTextColor($name, 95, $minimum-contrast: null);
		> .hex {
			color: inherit;
		}
	}
}

.container {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
}

.demo-wrapper {
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 10px;
}

.demo-color {
	margin: 0 5px;

	h4 {
		margin: 0;
		padding: 8px;
		font-weight: normal;
		text-align: center;
	}
}

.swatch {
	position: relative;
	overflow: hidden;
	width: 100%;
	min-width: 174px;
	height: 120px;
	margin-bottom: 10px;

	&:after {
		position: absolute;
		content: "Click to copy";
		bottom: 20px;
		display: block;
		opacity: 0;
		transition: opacity 0.2s ease-in;
	}

	&.copied:after {
		content: "Copied!";
	}

	.o-copy-true &:hover:after {
		opacity: 1;
	}

	&.o-colors-demo-white {
		border: 2px solid oColorsMix(black, white, 20);
	}

	.hex {
		display: flex;
		flex-direction: column;
		align-content: center;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 120px;
		text-align: center;
		text-transform: uppercase;
		border: 0;
		background: transparent;
		font-family: inherit;
		font-size: inherit;
		cursor: pointer;
	}
}


.demo-wrapper--tones-mixes {
	justify-content: space-between;
}

.demo-tone-column {
	margin: 0 5px;
	flex: 1 0;

	h4 {
		text-align: center;
	}

	.swatch--tone {
		margin-bottom: 0;
		height: 100px;
		padding-top: 0px;
		padding-bottom: 30px;

		label {
			width: 100%;
			padding-left: 10px;
			text-align: left;
			padding-top: 10px;
			margin-bottom: 5px;
		}

		&:after {
			bottom: 15px;
		}
	}
}
