.slidebox {
	padding-inline: 4rem;
	margin: 6rem auto 2rem;
	max-width: 120ch;

	@media screen and (max-width: 767px) {
		padding-inline: 1rem;
		margin: 3rem auto 2rem;
	}

	h2 {
		max-width: 48rem;
		margin-inline: auto;
	}

	footer {
		display: grid;
		grid-template-columns: calc(18rem - 20px) 64ch;
		column-gap: 2rem;
		width: max-content;
		margin-inline: auto;
		padding-top: 2rem;

		@media screen and (max-width: 767px) {
			grid-template-columns: 1fr;
			max-width: 80vw;
		}

		img {
			display: block;
			width: 80%;
			height: auto;
			box-sizing: border-box;

			@media screen and (max-width: 767px) {
				display: none;
			}
		}
	}
}

.slidebox-inner {
	padding: 2rem 4rem;
	box-sizing: border-box;
	position: relative;

	@media screen and (max-width: 767px) {
		padding: 2rem 1rem 0rem;

		&.no-bottom-line .slidebox-bottom-line {
			display: none;
		}
	}
}

.slidebox-top-line {
	max-width: calc(64ch + 20rem - 20px);
	margin-inline: auto;

	@media screen and (max-width: 767px) {
		display: none;
	}

	&::before {
		content: "";
		display: block;
		width: 64ch;
		height: 1px;
		background-color: #fff;
		margin-left: auto;
	}
}

.slidebox-bottom-line {
	max-width: calc(64ch + 20rem - 20px);
	margin-inline: auto;

	@media screen and (max-width: 767px) {
		max-width: 100vw;
	}

	&::before {
		content: "";
		display: block;
		width: 64ch;
		height: 4px;
		background-color: oklch(var(--theme-accent));
		margin-left: auto;

		@media screen and (max-width: 767px) {
			width: 30ch;
		}
	}
}

.slidebox-numbers {
	align-self: start;
	display: flex;
	align-items: center;
	justify-content: end;

	@media screen and (max-width: 767px) {
		align-self: center;
		flex-direction: column;
	}

	.slidebox-number {
		font-size: 4rem;
		font-weight: bold;
		font-variant-numeric: tabular-nums;
		width: 10rem;
		height: 10rem;
		display: flex;
		align-items: center;
		justify-content: center;
		border: 10px solid oklch(var(--theme-accent));
		border-radius: 9999px;
		overflow: hidden;

		@media screen and (max-width: 767px) {
			font-size: 3rem;
			width: 5rem;
			height: 5rem;
		}

		img {
			display: block;
			width: 100%;
			height: 100%;
			object-fit: cover;

			body.dark & {
				filter: invert();
			}
		}
	}

	&::after {
		content: "";
		width: 6rem;
		height: 2px;
		background-color: oklch(var(--theme-accent));

		@media screen and (max-width: 767px) {
			height: 2rem;
			width: 2px;
		}
	}
}

.slidebox-indicators {
	display: flex;
	column-gap: 3px;
	justify-self: end;

	@media screen and (max-width: 767px) {
		display: none;
	}
}

.slidebox-indicator {
	display: block;
	background-color: oklch(var(--theme-accent));
	width: 4px;
	height: 3rem;
	border: 0;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.3s ease;

	&.active {
		background-color: oklch(var(--theme-dark));

		body.dark & {
			background-color: #fff;
		}
	}
}

.slidebox-slides {
	position: relative;
	overflow: hidden;
	display: grid;
	grid-auto-columns: 100%;
	grid-auto-flow: column;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	padding-block: 0.5rem;
}

.slidebox-slide {
	inset: 0;
	display: flex;
	column-gap: 2rem;
	margin-inline: auto;
	scroll-snap-align: center;
	scroll-snap-stop: always;

	@media screen and (max-width: 767px) {
		flex-direction: column;
	}

	h3 {
		margin-top: 0;
		font-size: 1.25rem;
		color: inherit;

		@media screen and (max-width: 767px) {
			border-bottom: 1px black solid;
			padding-bottom: 1.5rem;

			body.dark & {
				border-bottom: 1px white solid;
			}
		}
	}

	.slidebox-content {
		max-width: 64ch;
		padding-top: 1.4rem;

		@media screen and (max-width: 767px) {
			text-align: center;

			p {
				text-align: left;
			}
		}
	}
}

.slidebox-button {
	border: 0;
	background: none;
	color: oklch(var(--theme-accent));
	cursor: pointer;
	padding: 0;
	position: absolute;
	top: calc(3rem + 10px);
	z-index: 10;

	svg {
		width: 9rem;
		height: 9rem;

		@media screen and (max-width: 767px) {
			width: 4rem;
			height: 4rem;
		}
	}

	&:hover {
		color: oklch(var(--theme-dark));

		body.dark & {
			color: #fff;
		}
	}
}

.slidebox-prev {
	left: -5vw;
}

.slidebox-next {
	right: -5vw;
}
