/* dvlopcore base stylesheet.
   A site sets its look in its own css/site.css, mostly by giving the custom properties
   below other values. Everything here works without them. */

:root {
	--font-family: Verdana, sans-serif;
	--line-height: 1.5;
	--color-text: #000;
	--color-background: #fff;
	--color-link: #00e;
	--color-link-visited: #551a8b;

	/* Keyboard focus: a dark box with light text plus an outline. */
	--focus-text: #fff;
	--focus-background: #000;
	--focus-outline: #000;

	/* Page */
	--page-width: 20cm;
	--content-padding: 10%;

	/* Header: an image (or colour) in a 4:1 band, the site name, the language switcher, the menu. */
	--header-image: none;
	--header-position: center;
	--header-background: #333;
	--header-ratio: 4 / 1;
	--site-name-color: #fff;
	--site-name-size: 3em;
	--site-name-margin: 0.5em 0;
	--site-name-shadow: 0 0 0.2em #000;

	/* Menu and language switcher buttons */
	--nav-background: yellow;
	--nav-text: blue;
	--nav-hover-background: mediumblue;
	--nav-hover-text: #fff;
	--nav-font-size: 16pt;
	--language-switcher-width: 20%;

	/* Images in markdown pages float at the end of the text. */
	--image-width: 48%;
}

@media (width < 768px) {
	:root {
		--page-width: 98%;
		--site-name-size: 1.25em;
		--language-switcher-width: 33%;
	}
}

/* Page */

body {
	max-inline-size: var(--page-width);
	margin-inline: auto;
	font-family: var(--font-family);
	line-height: var(--line-height);
	color: var(--color-text);
	background: var(--color-background);
}

a {
	color: var(--color-link);
}

a:visited {
	color: var(--color-link-visited);
}

:focus-visible {
	outline: 3px solid var(--focus-outline);
	outline-offset: 2px;
}

a:focus-visible {
	font-weight: bold;
	color: var(--focus-text);
	background: var(--focus-background);
}

.sr-only {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	inset-block-start: 0.5rem;
	inset-inline-start: 0.5rem;
	z-index: 10;
	padding: 0.5em 1em;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

/* Header */

.site-header {
	display: flex;
	flex-direction: column;
	aspect-ratio: var(--header-ratio);
	background: var(--header-background) var(--header-image) var(--header-position) / cover no-repeat;
}

.site-name {
	order: 1;
	margin: var(--site-name-margin);
	font-size: var(--site-name-size);
	font-weight: bold;
	font-style: italic;
	text-align: center;
	color: var(--site-name-color);
	text-shadow: var(--site-name-shadow);
}

.site-header ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 1%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header li {
	flex: 1 1 0;
	min-inline-size: max-content;
}

.site-header nav a {
	display: block;
	padding-inline: 0.25em;
	font-size: var(--nav-font-size);
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	color: var(--nav-text);
	background: var(--nav-background);
}

.site-header nav a:hover {
	text-decoration: underline;
	color: var(--nav-hover-text);
	background: var(--nav-hover-background);
}

.site-header nav a:focus-visible {
	color: var(--focus-text);
	background: var(--focus-background);
}

.site-header nav [aria-current] {
	font-weight: bold;
	text-decoration: underline;
}

.language-switcher {
	order: 0;
	align-self: end;
	inline-size: var(--language-switcher-width);
}

.language-switcher a {
	border-radius: 50%;
}

.main-menu {
	order: 2;
	margin-block: auto 10px;
}

/* Content */

main {
	display: flow-root;
	padding: 1% var(--content-padding) 5%;
}

main:focus {
	outline: none;
}

h1,
h2,
h3 {
	line-height: 1.2;
}

h1 {
	text-align: center;
}

img,
video {
	max-inline-size: 100%;
	block-size: auto;
}

video {
	inline-size: 100%;
}

table {
	border-collapse: collapse;
}

th,
td {
	padding-inline: 1em;
	border: 2px solid;
}

/* Images in markdown. :where() keeps this rule weak, so the classes below win. */
:where(.markdown > img, .markdown > p > img, .markdown figure) {
	float: inline-end;
	inline-size: var(--image-width);
	margin: 0 0 1em 1em;
}

.markdown figure img {
	inline-size: 100%;
}

.quarterWidthImage {
	inline-size: 25%;
}

.fullWidthImage {
	float: none;
	inline-size: 100%;
	margin-inline: 0;
}

.leftImage {
	float: inline-start;
	margin-inline: 0 50px;
}

/* Footer */

.site-footer {
	padding: 1em var(--content-padding);
	border-block-start: 1px solid;
}
