/*
	Site additions for the world archive.
	Loaded after main.css. Only reuses the template's own values:
	Source Sans Pro 300/900, white text, the nav icons' 1px white outline,
	its hover/active fills (rgba(255,255,255,0.175) / 0.35), the overlay's
	translucent whites and line colour, the footer's rgba(0,0,0,0.5) shade,
	the header's entrance animation and the bundled Font Awesome icons.
	main.css itself is left unmodified.
*/

/* Scrolling: the template is a single fixed screen; let #main scroll instead */

	#main {
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

		#main:before {
			display: none;
		}

	#hero {
		align-items: center;
		display: flex;
		justify-content: center;
		min-height: 100vh;
		padding: 3em 0;
	}

		#hero #header {
			top: 0;
		}

/* Header additions */

	#header nav a.disabled {
		opacity: 0.35;
		pointer-events: none;
	}

	#header .pool-note {
		font-size: 1em;
		margin: 1em 0 0 0;
		min-height: 1.75em;
	}

/* Shared: outlined pill controls, styled like the template's nav circles */

	.chip,
	.button {
		-moz-appearance: none;
		-webkit-appearance: none;
		appearance: none;
		-moz-transition: background-color 0.2s ease-in-out;
		-webkit-transition: background-color 0.2s ease-in-out;
		-ms-transition: background-color 0.2s ease-in-out;
		transition: background-color 0.2s ease-in-out;
		background: transparent;
		border: solid 1px #fff;
		border-radius: 2em;
		color: #fff;
		cursor: pointer;
		display: inline-block;
		font-family: 'Source Sans Pro', sans-serif;
		font-weight: 300;
		letter-spacing: -0.025em;
		text-decoration: none;
	}

		.chip:hover,
		.button:hover {
			background-color: rgba(255, 255, 255, 0.175);
			border-color: #fff;
		}

		.chip:active,
		.button:active,
		.chip[aria-pressed="true"],
		.button.primary {
			background-color: rgba(255, 255, 255, 0.35);
		}

		.chip:focus-visible,
		.button:focus-visible,
		.tile:focus-visible,
		#header nav a:focus-visible:before {
			outline: solid 1px #fff;
			outline-offset: 3px;
		}

	.chip {
		font-size: 0.8em;
		line-height: 2em;
		padding: 0 1em;
	}

	.button {
		font-size: 0.9em;
		line-height: 2.75em;
		padding: 0 1.5em;
		white-space: nowrap;
	}

		.button.icon:before {
			margin-right: 0.5em;
		}

/* Filters */

	.filters {
		margin: 1em 0 0 0;
	}

	.chip-row {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5em;
		justify-content: center;
		margin: 0 0 0.5em 0;
	}

		.chip-row:empty {
			display: none;
		}

/* Panels: the footer's shade over the sky, edged with the overlay's line colour */

	.card,
	.tile,
	.empty-state {
		background: rgba(0, 0, 0, 0.5);
		border: solid 1px rgba(255, 255, 255, 0.45);
	}

/* Rolled world */

	.result,
	.browse {
		scroll-margin-top: 2em;
	}

	.result {
		margin: 0 auto 4em auto;
		max-width: 60em;
		width: 90%;
	}

		.result:empty {
			display: none;
		}

	.card {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
		text-align: left;
	}

	.card-media,
	.tile-media {
		background: rgba(255, 255, 255, 0.075);
		overflow: hidden;
		position: relative;
	}

		.card-media {
			aspect-ratio: 1 / 1;
		}

		.card-media img,
		.tile-media img {
			display: block;
			height: 100%;
			object-fit: cover;
			width: 100%;
		}

	/* No preview image: the template's own icon set stands in */

		.media-placeholder {
			align-items: center;
			display: flex;
			height: 100%;
			justify-content: center;
			opacity: 0.45;
			width: 100%;
		}

			.media-placeholder:before {
				font-size: 4em;
			}

			.tile-media .media-placeholder:before {
				font-size: 2.5em;
			}

	.card-body {
		display: flex;
		flex-direction: column;
		gap: 1em;
		min-width: 0;
		padding: 2em;
	}

		.card-body h2 {
			font-size: 2.25em;
			font-weight: 900;
			letter-spacing: -0.035em;
			line-height: 1em;
			overflow-wrap: anywhere;
		}

	.badges {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5em;
	}

		.badge {
			border: solid 1px rgba(255, 255, 255, 0.45);
			border-radius: 2em;
			font-size: 0.8em;
			line-height: 2em;
			padding: 0 1em;
		}

	.description {
		opacity: 0.75;
		white-space: pre-line;
	}

	.credits {
		display: flex;
		flex-direction: column;
		font-size: 0.9em;
	}

		.credits strong {
			font-weight: 900;
		}

	.tags {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5em;
	}

	.actions {
		align-items: center;
		display: flex;
		flex-wrap: wrap;
		gap: 0.75em;
		margin-top: auto;
		padding-top: 0.5em;
	}

	.copy-status {
		font-size: 0.8em;
		opacity: 0.75;
		overflow-wrap: anywhere;
	}

	.rolling .card-body h2 {
		opacity: 0.75;
	}

/* All worlds */

	@-moz-keyframes browse-in { 0% { opacity: 0; } 100% { opacity: 1; } }
	@-webkit-keyframes browse-in { 0% { opacity: 0; } 100% { opacity: 1; } }
	@keyframes browse-in { 0% { opacity: 0; } 100% { opacity: 1; } }

	.browse {
		-moz-animation: browse-in 1s 2.25s forwards;
		-webkit-animation: browse-in 1s 2.25s forwards;
		animation: browse-in 1s 2.25s forwards;
		margin: 0 auto;
		max-width: 60em;
		opacity: 0;
		padding: 0 0 2em 0;
		width: 90%;
	}

		.browse h2 {
			font-size: 1.75em;
			font-weight: 900;
			letter-spacing: -0.035em;
			line-height: 1em;
			margin: 0 0 1em 0;
		}

		.count {
			font-weight: 300;
			opacity: 0.75;
		}

	.grid {
		display: grid;
		gap: 1em;
		grid-template-columns: repeat(auto-fill, minmax(11em, 1fr));
	}

	.tile {
		-moz-transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
		-webkit-transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
		-ms-transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
		transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
		-moz-appearance: none;
		-webkit-appearance: none;
		appearance: none;
		color: #fff;
		cursor: pointer;
		display: flex;
		flex-direction: column;
		font-family: 'Source Sans Pro', sans-serif;
		font-size: 1em;
		font-weight: 300;
		letter-spacing: -0.025em;
		line-height: 1.75em;
		min-width: 0;
		padding: 0;
		text-align: left;
	}

		.tile:hover,
		.tile.active {
			border-color: #fff;
		}

		.tile-media {
			aspect-ratio: 16 / 10;
		}

		.tile-text {
			padding: 0.75em 1em;
		}

		.tile-name {
			font-weight: 900;
			overflow-wrap: anywhere;
		}

		.tile-meta {
			font-size: 0.8em;
			opacity: 0.75;
		}

	.empty-state {
		padding: 2em;
		text-align: center;
	}

		.empty-state code {
			font-weight: 900;
		}

/* Footer: same look, but placed at the end of the page instead of pinned */

	#footer {
		background-image: -moz-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.5) 75%);
		background-image: -webkit-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.5) 75%);
		background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.5) 75%);
		height: auto;
		line-height: 1.75em;
		padding: 3em 5% 2em 5%;
		position: relative;
	}

		#footer .copyright {
			font-size: 0.9em;
			opacity: 0.75;
		}

/* Mobile */

	@media screen and (max-width: 736px) {

		.card {
			grid-template-columns: 1fr;
		}

			.card-media {
				aspect-ratio: 16 / 10;
			}

			.card-body {
				padding: 1.5em;
			}

				.card-body h2 {
					font-size: 1.75em;
				}

		.grid {
			grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
		}

	}

/* Reduced motion: stop the drifting background and skip entrance delays */

	@media (prefers-reduced-motion: reduce) {

		#bg {
			-moz-animation: none;
			-webkit-animation: none;
			animation: none;
		}

		.browse {
			-moz-animation: none;
			-webkit-animation: none;
			animation: none;
			opacity: 1;
		}

	}
