/**
 * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
 * Based on https://github.com/chriskempson/tomorrow-theme
 * @author Rose Pritchard
 */

code[class*="language-"],
pre[class*="language-"] {
	color: #ccc;
	background: none;
	font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	word-wrap: normal;
	line-height: 1.5;

	-moz-tab-size: 4;
	-o-tab-size: 4;
	tab-size: 4;

	-webkit-hyphens: none;
	-moz-hyphens: none;
	-ms-hyphens: none;
	hyphens: none;

}

/* Code blocks */
pre[class*="language-"] {
	padding: 1em;
	margin: .5em 0;
	overflow: auto;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
	background: #2d2d2d;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
	padding: .1em;
	border-radius: .3em;
	white-space: normal;
}

.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: #999;
}

.token.punctuation {
	color: #ccc;
}

.token.tag,
.token.attr-name,
.token.namespace,
.token.deleted {
	color: #e2777a;
}

.token.function-name {
	color: #6196cc;
}

.token.boolean,
.token.number,
.token.function {
	color: #f08d49;
}

.token.property,
.token.class-name,
.token.constant,
.token.symbol {
	color: #f8c555;
}

.token.selector,
.token.important,
.token.atrule,
.token.keyword,
.token.builtin {
	color: #cc99cd;
}

.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
	color: #7ec699;
}

.token.operator,
.token.entity,
.token.url {
	color: #67cdcc;
}

.token.important,
.token.bold {
	font-weight: bold;
}
.token.italic {
	font-style: italic;
}

.token.entity {
	cursor: help;
}

.token.inserted {
	color: green;
}

.vp-playground {
	--vp-bg: #1e1e2e;
	--vp-panel: #232334;
	--vp-text: #e4e4e7;
	--vp-muted: #a1a1aa;
	--vp-accent: #60a5fa;
	--vp-border: #38384a;

	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin: 5em auto;
	color: var(--vp-text);
	font-family:
		system-ui,
		-apple-system,
		sans-serif;
	box-sizing: border-box;

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

	.vp-error {
		padding: 1rem;
		background: var(--vp-panel);
		border: 1px solid var(--vp-border);
		border-radius: 10px;
		color: #fca5a5;
		font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
		font-size: 13px;
	}

	.vp-pane {
		display: flex;
		flex-direction: column;
		background: var(--vp-panel);
		border: 1px solid var(--vp-border);
		border-radius: 10px;
		overflow: hidden;
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	}

	.vp-pane-code {
		position: relative;
		width: min(1200px, 100vw);
		left: calc(50% - min(1200px, 100vw) / 2);
	}

	.vp-label {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		padding: 0.5rem 0.75rem;
		font-size: 0.7rem;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: var(--vp-muted);
		background: #1a1a28;
		border-bottom: 1px solid var(--vp-border);
	}

	.vp-run {
		padding: 0.1rem 0.7rem;
		border: 1px solid var(--vp-border);
		border-radius: 5px;
		background: var(--vp-bg);
		color: var(--vp-accent);
		font: inherit;
		letter-spacing: inherit;
		text-transform: inherit;
		cursor: pointer;

		&:hover,
		&:focus-visible {
			border-color: var(--vp-accent);
		}

		.vp-key {
			margin-left: 0.5em;
			color: var(--vp-muted);
			font: inherit;
		}
	}

	.vp-preview-wrap {
		background: white;
		height: 500px;
	}

	.vp-preview {
		display: block;
		width: 100%;
		height: 100%;
		border: none;
	}

	.vp-editor {
		display: block;
		margin: 0;
		padding: 0.75rem;
		background: var(--vp-bg);
		color: var(--vp-text);
		font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
		font-size: 12.5px;
		line-height: 1.55;
		outline: none;
		tab-size: 2;
		white-space: pre;
		overflow: auto;
		max-height: 60vh;

		&:focus {
			box-shadow: inset 0 0 0 2px var(--vp-accent);
		}
	}

	@media (max-width: 800px) {
		.vp-preview-wrap {
			height: 60vh;
		}
	}

	/* Screenshot mode: fixed 16:9 frame, code on the left, preview on the right. */
	&.vp-screenshot {
		flex-direction: row-reverse;
		gap: 0;
		margin: 0;
		width: 1280px;
		height: 720px;
		max-width: none;

		.vp-pane {
			flex: 1 1 50%;
			width: 50%;
			height: 100%;
			border: none;
			border-radius: 0;
			box-shadow: none;
		}

		.vp-pane-code {
			position: static;
			left: auto;
		}

		.vp-preview-wrap {
			flex: 1;
			height: auto;
		}

		.vp-editor {
			flex: 1;
			max-height: none;
		}
	}
}

/* Index page: title and description next to the preview image. */
.vp-example {
	display: flex;
	flex-flow: row wrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin: 3em 0;
}

/* `flex-basis: 0` keeps the text column out of the size calculation, so a long
   description wraps inside the space that is left instead of widening the column
   and pushing the preview onto its own line. */
.vp-example-text {
	flex: 1 1 0;
	min-width: 300px;
}

/* Both rules have to beat the page template's `h3 { text-align: left }` and
   `main p { text-align: justify }`, so they target the elements themselves.
   `text-wrap: balance` spreads a wrapped title or description evenly over its
   lines, instead of leaving a single word on the last one. */
.vp-example-text h3,
.vp-example-text p {
	margin: 0;
	text-align: center;
	text-wrap: balance;
}

.vp-example a {
	text-decoration: none;
}

.vp-example-preview {
	flex: 0 0 auto;
}

/* Example page: the description below the headline. */
.vp-subtitle {
	text-align: center;
}
