
.contents {
	background-color: var(--paper);
	color: var(--black);
	min-height: 78vh;
	display: flex;
	flex-direction: column;
}

.contents-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	border-bottom: 4px solid var(--black);
	padding-bottom: 10px;
	margin-bottom: 34px;
}

.contents-head .eyebrow {
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	display: block;
	position: relative;
	top: -8px;
	margin-bottom: 4px;
}

.contents-head h2 {
	font-weight: 900;
	letter-spacing: -0.045em;
	font-size: clamp(3.2rem, 9vw, 6.5rem);
	line-height: 0.85;
}

/* Language toggle at the top-right of the cover; scrolls away with it.
   The whole control is one button, so any click flips the language. */
.lang-switch {
	display: flex;
	width: max-content;
	margin: 0 0 8px auto;
	padding: 0;
	background: var(--paper);
	border: 1px solid var(--black);
	box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

.lang-opt {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 4px 6px;
	font-family: var(--mono);
	font-size: 0.56rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--black);
	background: transparent;
	border-left: 1px solid var(--black);
	transition:
		background 0.25s ease,
		color 0.25s ease;
}

.lang-opt:first-child {
	border-left: 0;
}

.lang-switch:hover .lang-opt:not(.is-active) {
	background: rgba(0, 0, 0, 0.06);
}

.lang-opt.is-active {
	background: var(--crimson);
	color: var(--paper);
}

@media (hover: none) and (pointer: coarse) {
	.lang-switch {
		min-height: 44px;
		align-items: center;
		background: none;
		border: 0;
		box-shadow: none;
		filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.12));
	}
	.lang-opt {
		background: var(--paper);
		border: 1px solid var(--black);
	}
	.lang-opt:first-child {
		border-left: 1px solid var(--black);
	}
	.lang-opt + .lang-opt {
		border-left: 0;
	}
	.cover-tool {
		width: 32px;
		height: 32px;
	}
	.cover-select select {
		height: 32px;
	}
}

/* The controls are a full row now, so the foot stacks before it runs out of
   width. */
@media (max-width: 767px) {
	.cover-foot {
		flex-direction: column;
		gap: 14px;
	}
	.cover-foot .right {
		text-align: left;
	}
	.cover-tools {
		justify-content: flex-start;
	}
}

.contents-body {
	display: flex;
	flex-direction: column;
	gap: 30px;
	flex-grow: 1;
}

@media (min-width: 768px) {
	.contents-body {
		flex-direction: row;
		gap: 40px;
	}
}

.contents-portrait {
	position: relative;
	border: 2px solid var(--black);
	overflow: hidden;
	min-height: 300px;
	background: var(--hot-red);
}

@media (min-width: 768px) {
	.contents-portrait {
		width: 42%;
		flex-shrink: 0;
	}
}

.contents-portrait .contents-open {
	position: absolute;
	inset: 0;
}

.contents-portrait .procedural-visual {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1);
	transition: transform 0.7s ease;
}

.contents-portrait:hover .procedural-visual {
	transform: scale(1.04);
}

.name-tag {
	position: absolute;
	bottom: 16px;
	left: 16px;
	background: var(--white);
	color: var(--black);
	padding: 5px 10px;
	font-size: 0.66rem;
	font-weight: 700;
	text-transform: uppercase;
	border: 1px solid var(--black);
	transition:
		background 0.3s ease,
		color 0.3s ease;
}

.contents-portrait:hover .name-tag {
	background: var(--crimson);
	color: var(--paper);
}

.toc {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}

.toc-row {
	display: block;
	width: 100%;
	text-align: left;
	border-bottom: 1px solid var(--gray-300);
	padding: 13px 2px;
	transition: border-color 0.25s ease;
}

.toc-row:hover {
	border-color: var(--black);
}

.toc-inner {
	display: flex;
	align-items: baseline;
	gap: 16px;
}

.toc-index {
	font-family: var(--mono);
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--gray-400);
	transition: color 0.25s ease;
}

.toc-row:hover .toc-index {
	color: var(--hot-red);
}

.toc-title {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: -0.01em;
	font-size: clamp(1.1rem, 2.4vw, 1.5rem);
	line-height: 1.05;
	transition: transform 0.3s ease;
	display: block;
}

.toc-row:hover .toc-title {
	transform: translateX(10px);
}

.toc-sub {
	font-family: var(--mono);
	font-size: 0.62rem;
	text-transform: uppercase;
	color: var(--gray-500);
	margin-top: 5px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.toc-row:hover .toc-sub {
	opacity: 1;
}


