/* global stuff */
body {
	font-family: sans-serif;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
}

html {
	transition: filter 0.2s;
}

html.dropping {
	filter: brightness(0.75);
}

#drop-modal {
	position: absolute;
	padding: 100px;
	background: #ddd;
	left: 0;
	right: 0;
	width: fit-content;
	top: 0;
	bottom: 0;
	height: fit-content;
	margin: auto;
	border: 5px dashed #888;
	border-radius: 10px;
}

#drop-modal.hidden {
	display: none;
}

/* heading */
header {
	margin: 0;
	padding: 10px 15px;
	background: #eee;
	border-bottom: 1px solid #ccc;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 80px 1fr;
	align-items: center;
	gap: 10px;
}

h1 {
	text-align: left;
}

#logo {
	width: 100%;
}

/* main content */

main {
	flex: 1;
	padding: 0 1em 1em;
}

#columns {
	display: flex;
	gap: 10px;
	align-items: center;
}

#columns > #main-column {
	flex: 1;
}

#screenshot {
	height: 300px;
	display: block;
	margin: -10px 0 -30px -30px;
}

form {
	margin: 20px auto;
	background: #eee;
	padding: 20px;
	border-radius: 10px;
	max-width: max-content;
	text-align: center;
}

.form-message {
	text-align: center;
	width: 300px;
	margin: 0 auto;
}

#inputs > * {
	display: block;
	margin-top: 1em;
}

#inputs > label {
	margin-top: 0;
}

form[inert] > * {
	display: none;
}

form[inert] > #loading {
	display: block;
}

form > #loading,
form > .hidden {
	display: none;
}

#settings {
	display: flex;
	flex-direction: row;
}

.settings-header {
	border-bottom: 1px solid #ccc;
}

/* h/t https://stackoverflow.com/a/47672457 */
.settings-section {
	flex: 1;
	text-align: left;
	background: #f8f8f8;
	border-radius: 10px;
}

.settings-section > legend {
	background: #f8f8f8;
	border-radius: 10px;
	border: 1px solid #ccc;
	padding: 0 1.5ch;
}

.settings-section > div {
	display: flex;
}

.settings-section > div > * {
	align-self: center;
}

.settings-section > div > input[type="checkbox"] {
	margin: 0 1ch 0 0;
	width: 1em;
	height: 1em;
}

.settings-section > div > label {
	margin-bottom: 4px;
}

.tooltip {
	text-decoration: underline dotted;
}

#wip {
	background: #feb;
	max-width: max-content;
	margin: 0 auto;
	padding: 1px 15px;
	border-radius: 10px;
}

/* footer */

footer {
	display: flex;
	flex-direction: row;
	gap: 10px;
	padding: 0 0.5em 0.5em;
	border-top: 1px solid #ccc;
	background: #eee;
	font-size: 0.9em;
}

footer > div {
	display: flex;
	align-items: center;
}

footer > p {
	text-align: center;
	width: 100%;
	margin: 0;
}

.footer-image {
	width: 80px;
}

#gitlab-logo {
	height: 1em;
	vertical-align: sub;

	/* provide width to prevent layout shuffling when SVG loads in */
	width: 1em;
}

#agpl {
	/* prevent AGPL badge from bumping into the edge of the window */
	margin-right: 10px;
}

/* mobile */
@media (max-width: 600px) {
	header {
		grid-auto-columns: 60px 1fr;
		padding: 5px 10px;
	}

	h1 {
		font-size: 1.5em;
	}

	main {
		padding: 0 0.5em 0.5em;
	}

	#columns,
	#settings {
		flex-direction: column;
		gap: 0;
	}

	form {
		margin-top: 0;
	}

	#or-drop {
		display: none;
	}

	.settings-section > div > input[type="checkbox"] {
		margin-right: 2ch;
		width: 1.5em;
		height: 1.5em;
	}

	ul {
		padding-left: 15px;
	}

	#screenshot {
		margin: 0 auto;
		height: unset;
		width: min(100%, 400px);
	}

	footer {
		gap: 5px;
	}

	.footer-image {
		width: 40px;
	}

	#agpl {
		margin-right: 5px;
	}
}
