@import url("./variables.css");
@import url("./nav.css");

:root {
	--view: 18rem;
}

body {
	font-family: "Rubik", sans-serif;
	font-size: 100%;
	margin: 0;
	padding: 0;

	& a,
	button {
		cursor: pointer;

		&:is(:hover, :focus) {
			outline: 0;
		}
	}
}

main {
	padding: var(--pad-xl);
	padding-left: calc(var(--view) + var(--pad-xl));
	overflow: hidden;
}

details {
	cursor: pointer;

	& summary::marker {
		content: none;
	}
}

h3 {
	font-size: 2rem;
}

.header-anchor {
	display: inline-block;
	transition: color var(--trans), background-color var(--trans);
	height: max-content;
	padding: 0 var(--pad-m);
	margin: 0 0 0 calc(var(--pad-xl) * -1);
	border-radius: 0 var(--round) var(--round) 0;
}
main article[id] {
	& p, li {
		font-size: 1.2rem;
	}
}
article {
	border-style: solid;
	border-width: 2px;
	border-radius: var(--round);
	height: max-content;
	padding: var(--pad-xl);

	& a {
		font-weight: 500;
	}

	& a:has(figure) {
		border-radius: var(--round);

		& figure {
			border-color: inherit;
		}
	}

	& s {
		text-decoration-style: line-through;
		text-decoration-thickness: 0.1em;
	}

	& u {
		text-decoration-style: double;
		text-decoration-thickness: 2px;
	}

	& em {
		font-weight: 200;
	}

	& p {
		word-wrap: break-word;
	}

	& p:not(:last-child, [aria-label]) {
		padding-bottom: var(--pad-sm);
	}

	& code:not(pre *) {
		padding: 0 var(--pad-sm);
	}

	& pre {
		display: flex;
		width: auto;
		overflow: scroll;
		padding: var(--pad-m);
		white-space: pre-wrap;
		word-break: break-word;
		border-style: solid;
		border-width: 2px;
	}

	& pre,
	code:not(pre *) {
		transition: background-color var(--trans), border-color var(--trans);
		border-radius: var(--round);
		font-weight: bold;
	}

	& figure {
		margin: 0;
		border-style: solid;
		border-width: 2px;
		padding: var(--pad-m);
		border-radius: var(--round);
		display: flex;
		flex-direction: column;

		& img {
			border-radius: inherit;
		}
	}

	& section {
		& a:has(figure) {
			height: max-content;
		}

		& figure img {
			border-radius: var(--round);
		}

		& figcaption {
			font-weight: normal;
			font-style: italic;
			padding-top: var(--pad-sm);
		}
	}
	& h3 code {
		display: flex;
		gap: var(--pad-l);
		width: fit-content;
		margin: var(--pad-l) 0;
	}
}

:is(main article, main section):not(:last-child) {
	margin-bottom: var(--pad-xl);
}

img[src*="/assets/img/flag/"] {
	height: 32px;
	border-radius: 0.2rem;
	border-style: solid;
	border-width: 2px;
	border-color: #fff;
}

a:has(img[src*="/assets/img/button"]):is(:hover, :focus) img {
	transform: translateY(-4px);
	transition: var(--trans);
}

@media screen and (max-width: 920px) {
	body>nav {
		position: initial;
		width: 100%;
	}

	main {
		padding: var(--pad-l);
	}

	main>section {
		flex-direction: column;
	}

	main>section {
		width: initial;
	}

	article {
		max-width: initial;
		width: auto;
	}

	body>nav::before {
		content: none;
	}

	body>nav {
		flex-direction: row;
		border: 0;
		width: 100%;

		& details {
			height: fit-content;
			width: 100%;
		}
	}

	body::after {
		content: "";
	}
}

@media screen and (max-width: 450px) {
	main {
		padding: var(--pad-sm);
	}

	article {
		padding: var(--pad-l);
		border: 0;
	}

	body>nav {
		flex-direction: column;
		justify-content: start;

		& details[open] {
			width: 100%;
		}
	}
}