.library {
	height: calc(var(--window-height) - var(--header-opened));
	margin: 0 calc(-1 * var(--three-units)) calc(-1 * var(--two-units));
	padding-top: var(--two-units);
	overflow: hidden;
	position: relative;
}

.library_grid {
	display: grid;
	height: 100%;
	gap: var(--two-units);
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	position: relative;
}

.library_informations {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	min-width: 0;
	min-height: 0;
	flex-direction: column;
	height: 200%;
	padding-right: var(--three-units);
	overflow-x: hidden;
	overflow-y: auto;
	position: relative;
	z-index: 100;
	background-color: rgba(255, 255, 255, 0.95);
	font-size: 2.4vw;
	line-height: 1.125;
	text-align: center;
	text-transform: uppercase;
	transition: height 1s cubic-bezier(0.77, 0, 0.18, 1);
}

.library_informations--close {
	height: 100%;
}

.library_informations::before,
.library_informations::after {
	flex-shrink: 0;
	content: "";
	width: 100%;
	height: 0;
	position: sticky;
	border-bottom: 1px solid;
}

.library_informations::before {
	top: 0;
}

.library_informations::after {
	/* height: var(--two-units); */
	margin-top: auto;
	bottom: 0;
	/* background-image: linear-gradient(to top, white, transparent); */
}

.library_informations > div {
	padding-top: var(--quarter-unit);
}

.library_informations > div:not(:first-child) {
	border-top: 1px solid;
	transition: border-top-width 0s 0.5s;
}

.library_informations > div:not(:last-child) {
	padding-bottom: var(--two-units);
}

.library_informations > div:last-child {
	padding-bottom: var(--quarter-unit);
}

.library_informations > div > p + p {
	margin-top: var(--two-units);
	padding-top: var(--quarter-unit);
	border-top: 1px solid;
	transition: border-top-width 0s 0.5s;
}

.library_informations > div > p + p:not(:last-child) {
	padding-bottom: var(--quarter-unit);
}

.library_description {
	display: none;
	font-size: 2.4vw;
	line-height: 1.125;
	text-align: left;
	text-transform: none;
}

.library_informations > .library_description {
	display: block;
}

.library_highlights {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	gap: var(--two-units);
	padding: 0 var(--three-units) var(--two-units) 0;
	overflow: hidden;
	position: relative;
	cursor: pointer;
}

.library_highlights::before {
	content: "";
	display: block;
	/* width: 50%; */
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	background-color: white;
	mask-image:
		/* linear-gradient(to left, white var(--two-units), transparent var(--two-units)), */ radial-gradient(
		circle at center,
		transparent 2px,
		black 3px
	);
	mask-size:
		/* 100% 100%, */ 6px 6px;
	mask-repeat: /* repeat-y, */ round;
}

/* .library_highlights::after {
	content: "";
	display: block;
	width: 50%;
	height: 100%;
	position: absolute;
	top: 0;
	right: 0;
	z-index: 1;
	background-color: white;
	mask-image: radial-gradient(circle at center, transparent 5px, black 6px);
	mask-size: 12px 12px;
	mask-repeat: round;
} */

.library_previous {
	display: flex;
	flex-direction: row-reverse;
	width: var(--two-units);
	height: calc(50% - var(--three-units));
	overflow: hidden;
	position: absolute;
	right: calc(100% - var(--two-units));
	bottom: var(--two-units);
	mask-image: radial-gradient(circle at center, black 2px, transparent 3px);
	mask-size: 6px 6px;
	mask-repeat: round;
	cursor: pointer;
}

.highlight {
	height: 100%;
}

.library_grid > .highlight {
	grid-column: 1;
	grid-row: 1 / -1;
	display: grid;
	grid-template-rows: 1fr auto 0%;
	padding-left: calc(var(--unit) + var(--three-units));
	padding-bottom: var(--two-units);
	/* overflow-x: hidden; */
	/* overflow-y: auto; */
	overflow: hidden;
	position: relative;
	transition: grid-template-rows 1s cubic-bezier(0.77, 0, 0.18, 1);
	pointer-events: none;
}

.library_grid > .highlight--open:has(.highlight_description) {
	grid-template-rows: 1fr auto calc(50% - var(--two-units) + var(--half-unit));
}

.library_previous > .highlight:not(:first-child) {
	width: auto;
	height: 100%;
	position: absolute;
	top: 0;
	left: 100%;
}

.highlight_image,
.highlight_image > picture {
	height: 100%;
	overflow: hidden;
	position: relative;
}

.library_highlights > .highlight > .highlight_image,
.library_previous > .highlight > .highlight_image {
	display: flex;
	flex-direction: row-reverse;
}

.library_grid > .highlight > .highlight_image > picture {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow: hidden;
}

.library_grid > .highlight > .highlight_image > picture > img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center top;
	transform: translateX(0);
	transition: transform 1s cubic-bezier(0.77, 0, 0.18, 1);
}

.library_grid > .highlight--in > .highlight_image > picture > img {
	transform: translateX(calc(0.5 * var(--offset, 200%))) translateX(50%);
}

.library_grid > .highlight--out > .highlight_image > picture > img {
	transform: translateX(calc(-0.5 * var(--offset, 200%))) translateX(-50%);
}

.library_highlights > .highlight > .highlight_image > picture > img,
.library_previous > .highlight > .highlight_image > picture > img {
	width: auto;
	max-width: none;
	height: 100%;
	max-height: none;
}

.highlight > div:not(.highlight_image),
.highlight_details {
	display: none;
}

.library_grid > .highlight > div:not(.highlight_image),
.library_grid > .highlight > .highlight_image > .highlight_details {
	display: block;
}

.highlight_details {
	width: var(--width, 100%);
	max-width: 100%;
	height: var(--height, 100%);
	max-height: 100%;
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	transition: opacity 0.5s 0.5s;
	pointer-events: all;
	cursor: pointer;
}

.highlight:is(.highlight--in, .highlight--out) .highlight_details {
	opacity: 0;
	transition-delay: 0s;
}

.highlight_details > picture {
	display: none;
	width: 100%;
	height: 100%;
	/* opacity: 0; */
	/* visibility: hidden; */
	/* transition:
		opacity 0.5s,
		visibility 0s 0.5s; */
}

.highlight_details > picture > img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center top;
}

.highlight:not(.highlight--in, .highlight--out) .highlight_details:hover > picture {
	display: block;
	/* opacity: 1; */
	/* visibility: visible; */
	/* transition-delay: 0s; */
}

.highlight_details > div {
	position: absolute;
}

.highlight_price {
	padding: calc((var(--button) - 0.75rem) / 2 - 1px) 1em;
	top: 0;
	right: 0;
	background-color: rgba(240, 240, 240, 0.8);
	border-color: transparent;
	color: var(--color);
	font-size: 0.75rem;
	line-height: 1;
}

.highlight_price::after {
	content: "€";
	margin-left: 0.2em;
}

.highlight_isbn {
	display: flex;
	bottom: 0;
	left: 0;
}

.highlight_isbn > span {
	padding: calc((var(--button) - 0.75rem) / 2 - 1px) 1em;
	margin-top: 1px;
	margin-right: 1px;
	background-color: rgba(240, 240, 240, 0.8);
	border-color: transparent;
	color: var(--color);
	font-size: 0.75rem;
	line-height: 1;
}

.highlight_informations {
	width: var(--width, 100%);
	max-width: 100%;
	margin-right: auto;
	margin-left: auto;
	padding-top: var(--half-unit);
	transition: opacity 0.5s 0.5s;
	pointer-events: all;
	cursor: pointer;
}

.highlight:not(:has(.highlight_description:hover)):hover > .highlight_informations {
	color: var(--accent);
}

.highlight:is(.highlight--in, .highlight--out) .highlight_informations {
	opacity: 0;
	transition-delay: 0s;
}

.highlight_informations > div {
	display: flex;
	flex-wrap: wrap-reverse;
	gap: 0 var(--unit);
}

.highlight_informations > div > strong {
	font-weight: normal;
	text-transform: uppercase;
}

.highlight_description {
	overflow-x: hidden;
	overflow-y: auto;
	font-size: 2.4vw;
	line-height: 1.125;
	pointer-events: all;
}

.library_grid > .highlight > .highlight_description {
	display: flex !important;
	flex-direction: column;
}

.highlight_description::before,
.highlight_description::after {
	content: "";
	display: block;
	width: 100%;
	position: sticky;
	z-index: 1;
	border-bottom: 1px solid;
}

.highlight_description::before {
	height: calc(var(--half-unit) + 1px);
	top: 0;
	background-color: white;
}

.highlight_description::after {
	height: 0;
	margin-top: auto;
	bottom: 0;
}

.highlight_description > p {
	padding: var(--quarter-unit) 0;
}

.library_arrow {
	width: var(--two-units);
	height: var(--two-units);
	overflow: hidden;
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 100;
	transform: translate(-50%, -50%);
	transition: all 1s cubic-bezier(0.77, 0, 0.18, 1);
}

.library_arrow > svg {
	--offset: calc(0.75 * var(--half-unit));
	--offsetNeg: calc(-0.75 * var(--half-unit));
	width: var(--half-unit);
	height: var(--half-unit);
	position: absolute;
	transition: all 1s cubic-bezier(0.77, 0, 0.18, 1);
}

.library_arrow > svg:nth-of-type(1) {
	top: var(--offset);
	left: var(--offset);
}

.library_arrow > svg:nth-of-type(2) {
	top: var(--offset);
	right: var(--offset);
}

.library_arrow > svg:nth-of-type(3) {
	bottom: var(--offset);
	left: var(--offset);
}

.library_arrow > svg:nth-of-type(4) {
	right: var(--offset);
	bottom: var(--offset);
}

@media (max-width: 1023px) {
	.library {
		margin-right: calc(-1 * var(--unit));
		margin-bottom: calc(-1 * var(--unit));
		margin-left: calc(-1 * var(--unit));
		padding-top: var(--unit);
	}

	.library_grid {
		grid-template-rows: 2fr 1fr;
	}

	.library_informations {
		padding-right: var(--unit);
		font-size: 2rem;
	}

	.library_informations:not(.library_informations--close) {
		height: calc(150% + var(--unit));
	}

	.library_informations > div:not(:last-child) {
		padding-bottom: var(--unit);
	}

	.library_informations > div > p + p {
		margin-top: var(--unit);
	}

	.library_highlights {
		padding-right: var(--unit);
		padding-bottom: var(--unit);
	}

	.library_previous {
		display: none;
	}

	.library_grid > .highlight {
		padding-left: var(--unit);
		padding-bottom: var(--unit);
	}

	.library_informations,
	.library_description,
	.highlight_description {
		font-size: 2rem;
		line-height: inherit;
	}
}

@media (max-width: 768px) {
	/* .library {
		height: auto;
	} */

	.library_grid {
		gap: var(--unit);
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr 100px;
	}

	.library_grid > .highlight {
		grid-row: 2;
		padding-right: var(--unit);
		padding-bottom: 0;
	}

	.library_grid > .highlight > .highlight_image > picture {
		align-items: flex-end;
	}

	.library_grid > .highlight > .highlight_image > picture > img {
		object-position: center bottom;
	}

	.highlight_details {
		top: auto;
		bottom: 0;
	}

	.library_informations,
	.library_highlights {
		grid-column: 1;
	}

	.library_highlights {
		grid-row: 3;
		padding-left: var(--unit);
	}

	.library_informations {
		padding-left: var(--unit);
	}

	.library_informations:not(.library_informations--close) {
		height: 100%;
	}

	.library_informations > div:nth-last-child(2) {
		padding-bottom: var(--quarter-unit);
	}

	.library_description {
		display: block;
		margin-top: var(--unit);
	}

	.library_description > p + p {
		margin-top: var(--unit);
	}

	.library_informations > .library_description {
		display: none;
	}

	.library_informations,
	.library_description,
	.highlight_description {
		font-size: 1.5rem;
		line-height: inherit;
	}
}
