/* This site's own styles, loaded after TUI386's. Its text grid has columns 8px wide
	and rows 16px tall. */
@layer components {
	/* A column up to 144 columns wide, as in TUI386's demo, centered to the nearest
		column */
	main,
	footer {
		max-width: 1152px;
		margin-left: round(down, max(0px, (100% - 1152px) / 2), 8px);
		padding-inline: 16px;
	}
	/* The light/dark toggle sits at the right of the menu bar */
	#theme-toggle {
		margin-left: auto;
	}
	/* Blocks side by side, or stacked on a narrow screen */
	.columns {
		column-gap: 32px;
	}
	@media (min-width: 768px) {
		.columns {
			display: grid;
			/* each a whole number of columns wide */
			grid-template-columns: repeat(2, round(down, (100% - 32px) / 2, 8px));
		}
	}
	/* Pictures shrink to fit.
		Off grid: a picture whose height isn't a multiple of 16px pushes what follows
		off the rows. TUI386's source marks its own exceptions the same way. */
	img,
	video {
		display: block;
		max-width: 100%;
		height: auto;
	}
	/* Keeps phones from enlarging text when turned sideways, which would break the grid */
	html {
		-webkit-text-size-adjust: 100%;
		text-size-adjust: 100%;
	}
	/* TUI386 removes list markers. Put them back on lists written in markdown,
		which have no class, and leave TUI386's menus, tabs and so on alone. */
	.content ul:not([class]) {
		list-style: "• ";
	}
	.content ol:not([class]) {
		list-style: decimal;
		padding-left: 32px;
	}
	/* A blank row above a banner, as on the TUI386 demo page */
	.content h1.tui386-banner {
		margin-top: 16px;
	}
	/* A button is two rows tall. Put the text after it on the lower row, so that
		wrapped lines follow on without a gap. */
	.content .tui386-btn {
		vertical-align: bottom;
	}
}
