// Clearfix.
@mixin clearfix {
	&:after {
		clear: both;
		content: '';
		display: block;
		height: 0;
		visibility: hidden;
	}
}

// Make links have the same styling as plain text.
@mixin link-plaintext {
	border: 0 none !important;
	box-shadow: none !important;
	color: inherit !important;
	text-decoration: none !important;
}

.ee-iframe {
	width: 100%;
}

.ee-card {
	background: rgb(250, 250, 250);
	border: 1px solid rgb(229, 229, 229);
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu,
		Cantarell, 'Helvetica Neue', sans-serif;
	font-size: 14px;
	padding: 25px;
	position: relative;
	width: 100%;

	@include clearfix;

	a {
		@include link-plaintext;
	}

	&__thumb {
		position: relative;
		width: 100%;

		// Use a 16:9 aspect ratio when the thumbnail is placed on top.
		&--top {
			height: 0;
			margin-bottom: 15px;
			padding-top: 56.25%;
			width: 100%;
		}

		// Use a square aspect ratio when the thumbnail is placed on the side.
		&--left {
			float: left;
			height: 0;
			margin-right: 15px;
			padding-top: min(160px, 30%);
			width: min(160px, 30%);
		}

		a {
			background-position: center;
			background-size: cover;
			display: block;
			height: 100%;
			left: 0;
			position: absolute;
			top: 0;
			width: 100%;
		}
	}

	&__info {
	}

	&__title {
		font-size: 1.3em;
		line-height: 1.3em;
		font-weight: bold;
	}

	&__description {
		font-size: 1em;
		line-height: 1.4em;
		padding-top: 0.5em;
	}

	&__meta {
		color: inherit;
		font-size: 0.8em;
		font-weight: bold;
		opacity: 0.5;
		padding-top: 0.7em;

		& a,
		& span {
			text-transform: uppercase;
		}
	}
}

.ee-code {
	background: rgb(250, 250, 250);

	a {
		@include link-plaintext;
	}

	pre {
		background: none;
		margin: 0;
		max-height: 700px;
		overflow-y: auto;
		padding: 0;
	}

	&__info {
		background: rgb(225, 225, 225);
		font-family: monospace;
		font-size: 0.9em;
		padding: 8px;
	}

	&__meta {
		font-weight: bold;
		opacity: 0.5;
	}

	// Override highlight.js styling.
	.hljs {
		background: none;
	}
}
