/* self-contained components:
 * following https://rstacruz.github.io/rscss/index.html */

/* footer assets */
.jnl-mark {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	font-size: 1.8rem;
	margin: 32px 0 8px 0;
}

.jnl-mark__img {
	object-fit: contain;
	max-height: 2.4rem;
}

.jnl-copyright {
	font-size: 0.8rem;
}

/* checklist for static progress display */
ul.checklist {
	list-style: none;
	padding-left: 0;
}

/* main menu nav anchor */
#menu {
	scroll-margin-top: 200px;
}

/* viz display for rendering */
.viz-container {
	margin-bottom: 24px;
}

.viz-canvas {
	width: 100%;
}

/* workbook layout */
.workbook-layout {
	width: 100%;
	margin: 0 auto;
	position: relative;
}

.workbook-layout.layout--editor,
.workbook-layout.layout--results {
	max-width: 80ch;
}

.workbook-layout.layout--split {
	max-width: 161ch;
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;

	@media only screen and (min-width: 1000px) {
		grid-template-columns: 1fr 1fr;
	}
}

/* workbook menu */
.workbook-menu {
	position: sticky;
	top: 0;
	background-color: var(--bg);
	padding: 16px 0;
	display: flex;
	align-items: baseline;
	gap: 2px;
	grid-column: 1 / -1;
	z-index: 10;
}

.workbook-menu--thin {
	padding: 4px 0;
}

.menu-bar__interp-indicator {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 8px;
	--glyph-size: 8px;

	&::before {
		content: "";
		display: block;
		border: 1px solid var(--fg);
		width: var(--glyph-size);
		height: var(--glyph-size);
		background-color: var(--bg);
	}
}

.menu-bar__interp-indicator.menu-bar__interp-indicator--ready::before {
	background-color: var(--fg);
}

.menu-bar__push-right {
	margin-left: auto;
}

/* code editor */
.code-editor {
	font-family: "Fira Code", monospace;
	white-space: pre-wrap;
	flex: 72ch 1 0;
	outline: none;
	padding: 0.5em;
}

.editor-container {
	border-left: 1px solid var(--fg);
	padding-left: 2px;
	display: flex;
	overflow-x: auto;

	&:hover {
		border-left: 2px solid var(--fg);
		padding-left: 1px;
	}

	&:focus-within {
		border-left: 3px solid var(--fg);
		padding-left: 0;
	}

	&[hidden] {
		display: none;
	}
}

/* results table */
.results-pane {
	align-self: start;
}

.results-table-container {
	overflow-x: auto;
}
