/*
	https://prog255.dev/css255/
	elements.css
	0.0
*/

@layer css255.base, css255.site, css255.elements;

@layer css255.elements {
	nav {
		--link: var(--fg-3);
		--link-visited: var(--link);
		--link-focus: var(--fg-2);
		--link-active: var(--fg);

		display: flex;
		position: sticky;
		flex-direction: row;
		justify-content: space-between;
		top: 0;
		height: var(--content-top);

		background-color: var(--surface);

		> div {
			display: flex;
			flex-direction: row;
			padding: 0 var(--space-small);
			gap: var(--nav-gap, var(--space-small));

			&.smallgap {
				gap: var(--nav-gap, calc(var(--space-small) * 0.5));
			}
		}

		a {
			height: var(--content-top);
			display: flex;
			flex-direction: row;
			flex: none;
			align-items: center;
			gap: var(--link-gap, calc(var(--space-small) * 0.15));

			font-size: calc(var(--content-top) * 0.4);
			font-family: var(--font-mono);
			text-decoration: none;

			transition: var(--duration);

			img {
				opacity: 0.8;
				transition: var(--duration);

				height: var(--content-top);
				width: auto;

				padding: calc(var(--content-top) * 0.2) 0;

				&.inline-img {
					padding: calc(var(--content-top) * 0.275) 0;
				}
			}

			&:hover img {
				opacity: 1.0;
			}

			&:hover > img.rotate-animation {
				transform: rotate(90deg);
			}

			&:hover > img.shadow-animation {
				filter: drop-shadow(0 0 8px var(--shadow-color));
			}
		}
	}

	h1, h2, h3, h4, h5, h6 {
		margin: var(--space);
		padding-bottom: 0.1em;

		line-height: 1.25em;
		font-weight: 600;
		color: var(--fg);

		border-bottom: 1px solid var(--surface-2);

		mark, b, strong {
			font-weight: 800;
		}

		code {
			vertical-align: 0.2em;
			font-size: 0.6em;
		}
	}

	h1 {
		text-align: center;
		font-size: 3em;
	}

	h2 {
		font-size: 2.75em;
	}

	h3 {
		font-size: 2.25em;
	}

	h4 {
		font-size: 2em;
	}

	h5 {
		font-size: 2em;
		color: var(--fg-2);
	}

	h6 {
		font-size: 2em;
		font-weight: 500;
		color: var(--fg-2);
	}

	p {
		margin: var(--space);

		line-height: 1.5em;
		font-size: 1.125em;

		mark, b {
			font-weight: 600;
		}

		strong {
			font-weight: 800;
		}
	}

	a {
		color: var(--link);
		text-decoration: underline;

		transition: var(--transition);
		cursor: pointer;

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

		&:hover, &:focus-visible {
			color: var(--link-focus);
		}

		&:active {
			color: var(--link-active);
		}
	}

	hr {
		border-top: 1px solid var(--surface-2);
		border-bottom: none;
		border-left: none;
		border-right: none;
		margin: var(--space);
	}

	mark {
		background-color: transparent;
		color: var(--accent);
	}

	ul, ol {
		margin: var(--space);

		li {
			font-size: 1.125em;
			line-height: 1.5em;

			margin: var(--space) 0;

			ul, ol {
				margin: 0;
			}

			mark, b {
				font-weight: 600;
			}

			strong {
				font-weight: 800;
			}
		}
	}

	ul li {
		list-style-type: disc;
	}

	code {
		padding: 0.2em 0.4em 0.3em 0.4em;
		margin: 0 0.1em;

		background-color: var(--surface-2);
		font-family: var(--font-mono);
		font-weight: 500;

		font-size: 0.75em;
		line-height: 1.5em;
		border-radius: 0.3em;
	}

	pre {
		margin: var(--space);
		padding: var(--space);
		border-radius: var(--radius);
		overflow-x: auto;

		background-color: var(--surface-2);
		font-family: var(--font-mono);
		font-weight: 500;
	}

	button {
		margin-right: var(--space);
		font-size: 1.25em;
		padding: 0.4em 0.8em;

		border: 3px solid;
		border-radius: var(--radius);

		transition: var(--transition);
		cursor: pointer;

		&:hover, &:focus {
			transform: scale(1.025);
		}

		&:active {
			transform: scale(1.05);
		}

		border-color: var(--fg-2);
		background-color: var(--surface);
		color: var(--fg);

		&:hover {
			border-color: var(--fg);
			background-color: var(--surface-2);
		}

		&:focus-visible {
			outline: none;
			border-color: var(--accent);
		}

		&:active {
			background-color: var(--surface-3);
			transform: scale(1.05);
		}
	}
}
