#mangaBox {
	margin-top: -20px;
}

#main {
	position: relative;
	display: flex;
	flex-flow: column;
	gap: 15px;
}

#mangaSearch {
	display: flex;
	flex-flow: row;
	gap: 15px;
}

#mangaSearchInput {
	flex-grow: 1;
}

.mangaTagName, .mangaButton, .mangaTagButton, .mangaSortButton, .mangaHeaderButton {
    font-size: 18px;
    color: var(--fg);
	outline: none;
	padding: 10px;
	background-color: var(--bgalt);
	border-radius: 15px;
	white-space: nowrap;
}

.mangaButton, .mangaTagButton, .mangaSortButton, .mangaHeaderButton {
	border: none;
	cursor: pointer;
	transition: filter 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.mangaButton:hover, .mangaTagButton:hover, .mangaSortButton:hover, .mangaHeaderButton:hover {
	filter: brightness(1.3);
}

.mangaButton {
	min-width: 42px;
	justify-content: center;
	display: flex;
}

.mangaTagName.Completed, .mangaTagName.Oneshot {
	background-color: var(--blue);
	color: var(--bg);
}

.mangaTagName.Ongoing {
	background-color: var(--green);
	color: var(--bg);
}

.mangaTagName.Suggestive {
	background-color: var(--orange);
	color: var(--bg);
}

.mangaTagName.Erotica, .mangaTagName.Incest, .mangaTagName.Gore, .mangaTagName.Cancelled {
	background-color: var(--red);
	color: var(--bg);
}

.mangaTagName.Anthology {
	background-color: var(--purple);
	color: var(--bg);
}

.mangaTagButton {
	background-color: var(--bg);
	height: min-content; 
}

.mangaTagButton.included {
	background-color: var(--green);
	color: var(--bg);
}

.mangaTagButton.excluded {
	background-color: var(--red);
	color: var(--bg);
}

.mangaSortButton {
	background-color: var(--bg);
	height: min-content; 
}

.mangaSortButton.selected, .mangaHeaderButton.selected {
	background-color: var(--fg);
	color: var(--bg);
}

.mangaTagNames {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

#mangaTags {
	display: flex;
	flex-flow: column;
	max-height: 0;
	overflow: hidden;
	background-color: var(--bgalt);
	border-radius: 15px;
	gap: 10px;
	transition: max-height 0.3s ease, padding 0.3s ease, margin-top 0.3s ease;
}

#mangaTags.open {
	max-height: 2000px;
	margin-top: 15px;
	padding: 10px;
}

.mangaTagContainer, .mangaRatingBars, .mangaRatingLabels{
	display: flex;
	flex-flow: row;
	gap: 10px;
}

.mangaTagCategory {
	display: flex;
	flex-flow: column;
	gap: 10px;
	flex: 1 1;
}

.mangaRatingBars, .mangaRatingLabels {
	justify-content: space-evenly;
	align-items: end;
}

.mangaRatingBars {
	height: 192px;
}

.mangaRatingLabel, .mangaRatingBar {
	display: flex;
	justify-content: center;
	border-radius: 15px;
	color: var(--fg);
	background-color: var(--bg-alt);
	font-size: 18px;
	padding: 5px;
	width: 100%;
}

.mangaRatingBar {
	align-items: end;
	color: var(--bg);
	background-color: var(--fg);
}

#ratingExplanation {
	font-size: 18px;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease, margin-top 0.3s ease;
}

#ratingExplanation.open {
	max-height: 500px;
	margin-top: 10px;
}

.mangaTagHeader {
	font-size: 24px;
	padding: 10px;
	background-color: var(--bg);
	color: var(--fg);
	border-radius: 15px;
}

.mangaHeader {
	display: flex;
	justify-content: space-between;
	gap: 15px;
	padding-top: 20px;
}

.headerAnchor {
	display: none;
}

.mangaHeader:hover .headerAnchor {
	display: flex;
	gap: 15px;
	height: min-content;
}

.mangaHeaderButton {
	aspect-ratio: 1/1;
	font-size: 24px;
}

.mangaWrapper {
    display: flex;
    flex-flow: row;
    gap: 20px;
    margin-top: 20px;
}

.mangaImage {
    max-width: 40%;
    width: auto;
	max-height: 500px;
	height: min-content;
    object-fit: contain;
	object-position: top;
	user-select: none;
	cursor: pointer;
	scroll-snap-align: center;
	border-radius: 15px;
}

.mangaContent {
	display: flex;
	flex-flow: column;
	gap: 10px;
	overflow: hidden;
	transition: max-height 0.5s ease;
	position: relative;
}

.mangaContent::after {
	content: '';
	pointer-events: none;
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 3em;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--bg));
	transition: opacity 0.5s ease;
	opacity: 0;
}

.mangaContent.collapsible::after {
	opacity: 1;
}

.mangaContent.expanded::after {
	opacity: 0;
}

.mangaContentWrapper {
	display: flex;
	flex-flow: column;
	gap: 10px;
}

.mangaReview {
    font-size: 18px;
    color: var(--fg);
	margin-top: 10px;
}
/*
#backToTop {
	position: sticky;
	bottom: 0;
	align-self: center;
	font-size: 24px;
	border: 3px solid var(--bg);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

#backToTop.visible {
	opacity: 1;
	visibility: visible;
}
*/
@media all and (max-aspect-ratio: 2/3) {
	.mangaImage {
		max-width: 100%;
		max-height: unset;
		height: auto;
		overflow: hidden;
	}

	.mangaWrapper {
		flex-flow: row wrap;
	}

	#mangaSearch > * {
		flex-grow: 1;
	}

	#pageName {
		text-align: center;
	}
}

@media all and (max-aspect-ratio: 3/4) {
	#mangaBox {
		display: grid;
		grid-template-columns: auto;
		grid-auto-flow: row;
		column-gap: 20px;
	}

	.mangaTagContainer {
		flex-flow: column;
	}
}

/*@media all and (max-aspect-ratio: 1/1) {
	#backToTop {
		position: fixed;
		bottom: 20px;
		left: 50%;
		transform: translateX(-50%);
	}
}*/
