/* Serve Category Page */
.wve-scp {
	--wve-scp-yellow: #fdfc3f;
	--wve-scp-ink: #121214;
	--wve-scp-line: #d9d9d9;
	--wve-scp-font-sans: "DM Sans", "Funnel Sans", Arial, sans-serif;
	--wve-scp-font-mono: "Space Mono", "Roboto Mono", ui-monospace, monospace;
	--wve-scp-font-wide: "Unbounded", "Funnel Sans", Arial, sans-serif;
	--wve-scp-pad: 40px;
	/* Post title size used across the site's post cards (18 / 20 / 22px). */
	--wve-scp-title: 18px;
	--wve-scp-width: 960px;
	box-sizing: border-box;
	width: 100%;
	overflow-x: clip;
	color: var(--wve-scp-ink);
}

.wve-scp *,
.wve-scp *::before,
.wve-scp *::after {
	box-sizing: border-box;
}

.wve-scp ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wve-scp li {
	margin: 0;
	padding: 0;
}

.wve-scp a {
	color: inherit;
	text-decoration: none;
}

/* Banner — full artwork, never cropped (header clearance is on body.archive.category). */
.wve-scp-banner {
	position: relative;
	width: 100%;
	overflow: visible;
	background: var(--wve-scp-banner-bg, var(--wve-scp-yellow));
	line-height: 0;
}

.wve-scp-banner--image {
	display: block;
	width: 100%;
	overflow: visible;
}

.wve-scp-banner--image picture,
.wve-scp-banner-img {
	display: block;
	width: 100%;
	max-width: 1600px;
	height: auto;
	max-height: none;
	margin: 0 auto;
	object-fit: contain;
	object-position: center top;
	vertical-align: top;
}

/* Built-in banner (no image uploaded): same proportions as the artwork. */
.wve-scp-banner--built {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1024 / 556;
	max-height: 870px;
	padding: 4% 6% 6%;
	line-height: normal;
}

.wve-scp .wve-scp-banner-title {
	margin: 0;
	padding: 0.06em 0.22em 0.02em;
	background: var(--wve-scp-ink);
	color: var(--wve-scp-banner-bg, var(--wve-scp-yellow));
	font-family: var(--wve-scp-font-sans);
	font-size: clamp(64px, 17vw, 260px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	transform: rotate(-11deg);
}

.wve-scp .wve-scp-banner-subtitle {
	max-width: 30em;
	margin: clamp(28px, 6vw, 90px) 0 0 18%;
	color: var(--wve-scp-banner-ink, var(--wve-scp-ink));
	font-family: var(--wve-scp-font-wide);
	font-size: clamp(10px, 1.6vw, 22px);
	font-weight: 500;
	line-height: 1.2;
}

/* Content container */
.wve-scp-inner {
	width: 100%;
	max-width: calc(var(--wve-scp-width) + 2 * var(--wve-scp-pad));
	margin: 0 auto;
	padding: 0 var(--wve-scp-pad) clamp(48px, 7vw, 96px);
}

/* Latest notes */
.wve-scp-latest {
	padding-top: clamp(36px, 5vw, 64px);
}

.wve-scp .wve-scp-latest-heading {
	margin: 0 0 clamp(36px, 4vw, 56px);
	color: var(--wve-scp-ink);
	font-family: var(--wve-scp-font-mono);
	font-size: clamp(32px, 4vw, 45px);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0;
	text-align: center;
	text-transform: none;
}

/* Desktop: larger "latest" title. Tablet and mobile keep the clamp above. */
@media (min-width: 1025px) {
	.wve-scp .wve-scp-latest-heading {
		font-size: 60px;
	}
}

.wve-scp-notes {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 80px 0 24px !important;
}

.wve-scp-note {
	position: relative;
	flex: 0 1 340px;
	min-width: 0;
	margin: 0 -10px !important;
}

.wve-scp-note-1 { transform: rotate(-8deg); }
.wve-scp-note-2 { z-index: 1; margin-top: 44px !important; transform: rotate(-3deg); }
.wve-scp-note-3 { margin-top: -6px !important; transform: rotate(12deg); }

.wve-scp-note-link {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 5;
	padding: 14% 12% 14% 18%;
	text-align: left;
	border-radius: 14px;
	background: var(--wve-scp-note, var(--wve-scp-yellow));
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	transition: transform 0.25s ease;
}

.wve-scp .wve-scp-note-link {
	color: var(--wve-scp-note-ink, var(--wve-scp-ink));
}

.wve-scp-note-link:hover,
.wve-scp-note-link:focus-visible {
	transform: translateY(-6px) rotate(-1deg);
}

/* Stickers hang over the top edge: near the middle on the first note, on the top-right corner on the others. */
.wve-scp-sticker {
	position: absolute;
	top: 0;
	left: 62%;
	display: block;
	width: 54%;
	transform: translate(-50%, -45%);
}

.wve-scp-note-2 .wve-scp-sticker {
	left: 80%;
	width: 62%;
	transform: translate(-50%, -40%);
}

.wve-scp-note-3 .wve-scp-sticker {
	left: 84%;
	width: 64%;
	transform: translate(-50%, -48%);
}

.wve-scp-sticker-img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 220px;
	object-fit: contain;
}

.wve-scp-note-title {
	position: relative;
	z-index: 1;
	display: -webkit-box;
	overflow: hidden;
	width: 100%;
	font-family: var(--wve-scp-font-wide);
	font-size: var(--wve-scp-title);
	font-weight: 400;
	line-height: 1.25;
	overflow-wrap: break-word;
	hyphens: auto;
	-webkit-line-clamp: 7;
	-webkit-box-orient: vertical;
}

/* Tabs */
.wve-scp-browse {
	padding-top: clamp(40px, 6vw, 80px);
}

.wve-scp-tabs {
	display: flex;
	gap: clamp(20px, 3vw, 40px);
	overflow-x: auto;
	margin: 0 0 clamp(28px, 4vw, 48px);
	border-bottom: 1px solid var(--wve-scp-line);
	scrollbar-width: none;
}

.wve-scp-tabs::-webkit-scrollbar {
	display: none;
}

.wve-scp .wve-scp-tab {
	flex: 0 0 auto;
	margin: 0 0 -1px;
	padding: 12px 2px;
	border: 0;
	border-bottom: 4px solid transparent;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: #6b6b6b;
	font-family: var(--wve-scp-font-mono);
	font-size: 20px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
}

.wve-scp .wve-scp-tab:hover,
.wve-scp .wve-scp-tab[aria-selected="true"],
.wve-scp .wve-scp-tab[aria-current="page"] {
	color: var(--wve-scp-ink);
}

.wve-scp .wve-scp-tab[aria-selected="true"],
.wve-scp .wve-scp-tab[aria-current="page"] {
	border-bottom-color: var(--wve-scp-ink);
}

/* Subcategory pages open at the tabs; keep them clear of the fixed header. */
.wve-scp-browse {
	scroll-margin-top: 150px;
}

.wve-scp .wve-scp-tab:focus-visible {
	outline: 2px solid var(--wve-scp-ink);
	outline-offset: 2px;
}

/* Post grid */
.wve-scp-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: start;
	gap: clamp(20px, 3.5vw, 20px) clamp(16px, 0.4vw, 32px);
}

.wve-scp-card {
	position: relative;
}

.wve-scp-card[hidden] {
	display: none;
}

/* Pagination */
.wve-scp-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: clamp(40px, 5vw, 64px) 0 0;
}

.wve-scp-pages[hidden] {
	display: none;
}

.wve-scp .wve-scp-page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--wve-scp-ink);
	border-radius: 22px;
	background: #fff;
	color: var(--wve-scp-ink);
	font-family: var(--wve-scp-font-mono);
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wve-scp .wve-scp-page.is-current,
.wve-scp a.wve-scp-page:hover,
.wve-scp a.wve-scp-page:focus-visible {
	background: var(--wve-scp-ink);
	color: #fff;
}

.wve-scp .wve-scp-page--gap {
	min-width: 0;
	padding: 0 4px;
	border-color: transparent;
}

.wve-scp a.wve-scp-page:focus-visible {
	outline: 2px solid var(--wve-scp-ink);
	outline-offset: 2px;
}

@media (max-width: 479px) {
	.wve-scp-pages {
		gap: 6px;
	}

	.wve-scp .wve-scp-page {
		min-width: 36px;
		height: 36px;
		padding: 0 8px;
		font-size: 15px;
	}
}

/* Category badge on the image, styled like the homepage cards' badges. */
.wve-scp .wve-scp-card-category {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1;
	display: inline-block;
	max-width: calc(100% - 20px);
	padding: 3px 9px;
	overflow: hidden;
	color: #fff;
	background: #000;
	border-radius: 20px;
	font-family: var(--wve-scp-font-sans);
	font-size: 10px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.04em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.wve-scp .wve-scp-card-category:hover,
.wve-scp .wve-scp-card-category:focus-visible {
	background: #333;
}

.wve-scp .wve-scp-card-category:focus-visible {
	outline: 2px solid var(--wve-scp-ink);
	outline-offset: 2px;
}

/* Search results */
.wve-scp--search .wve-scp-inner {
	padding-top: clamp(24px, 4vw, 48px);
}

.wve-scp .wve-scp-search-title {
	margin: 0 0 clamp(28px, 4vw, 48px);
	padding: 0 0 16px;
	border-bottom: 1px solid var(--wve-scp-line);
	color: var(--wve-scp-ink);
	font-family: var(--wve-scp-font-wide);
	font-size: clamp(24px, 3vw, 36px);
	font-weight: 400;
	line-height: 1.25;
	overflow-wrap: break-word;
	hyphens: auto;
}

.wve-scp .wve-scp-search-empty {
	margin: 0;
	padding: 0;
	font-family: var(--wve-scp-font-sans);
	font-size: 16px;
}

.wve-scp-card-media {
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: 12px;
	background: #eee;
}

.wve-scp-card-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.wve-scp-card:hover .wve-scp-card-img {
	transform: scale(1.03);
}

.wve-scp .wve-scp-card-title {
	display: -webkit-box;
	overflow: hidden;
	margin: 14px 0 0;
	padding: 0;
	color: var(--wve-scp-ink);
	font-family: var(--wve-scp-font-wide);
	font-size: var(--wve-scp-title);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
	overflow-wrap: break-word;
	-webkit-hyphens: auto;
	hyphens: auto;
	text-wrap: pretty;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
}

.wve-scp .wve-scp-card-title a:hover,
.wve-scp .wve-scp-card-title a:focus-visible {
	text-decoration: underline;
}

/* Tablet */
@media (max-width: 1024px) {
	.wve-scp {
		--wve-scp-pad: 30px;
		--wve-scp-title: 20px;
	}

	.wve-scp-notes {
		justify-content: flex-start;
		overflow-x: auto;
		margin: 0 calc(-1 * var(--wve-scp-pad)) !important;
		padding: 112px calc(var(--wve-scp-pad) + 16px) 24px !important;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.wve-scp-notes::-webkit-scrollbar {
		display: none;
	}

	.wve-scp-note {
		flex: 0 0 min(80%, 340px);
		scroll-snap-align: center;
	}
}

/* Mobile */
@media (max-width: 767px) {
	.wve-scp {
		--wve-scp-pad: 16px;
		--wve-scp-title: 22px;
	}

	.wve-scp-notes {
		padding: 80px calc(var(--wve-scp-pad) + 16px) 16px !important;
	}

	.wve-scp-note {
		margin: 0 -6px !important;
	}

	.wve-scp-note-2 {
		margin-top: 28px !important;
	}

	.wve-scp-note-link {
		padding: 11%;
		border-radius: 10px;
	}

	.wve-scp .wve-scp-card-title {
		margin-top: 10px;
	}
}

/* Small phones: two-column grid. */
@media (max-width: 479px) {
	.wve-scp-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.wve-scp-note-link,
	.wve-scp-card-img {
		transition: none;
	}
}
