/*
 * The cover of the theme's site (ADR-73): a rolled scroll in the middle that opens to both sides as
 * the reader scrolls left. CSS 3D only; the paper's text is real text. The colours are the theme's
 * (tate.css) plus the cover cloth, the back of the paper and the lacquer of the roller's ends.
 * hyoshi.js sets the sizes and positions. Without motion (prefers-reduced-motion, a narrow window)
 * the scroll lies open and flat (.hyoshi-shizuka).
 */
:root {
	--hyoshi-nuno: #6f5b3a;   /* the cover cloth */
	--hyoshi-ura: #eadfc8;    /* the back of the paper */
	--hyoshi-urushi: #3a2219; /* the roller's ends */
}

html.dark {
	--hyoshi-nuno: #4d4029;
	--hyoshi-ura: #2c2b31;
	--hyoshi-urushi: #0e0908;
}

/* Out to the scroll's edges: over main's padding at the right and above and below. */
.hyoshi {
	position: relative;
	margin-block-start: calc(-1 * var(--ma));
	margin-inline: -1.5rem;
}

.hyoshi-butai {
	position: sticky;
	inset-block-start: 0;
	inline-size: 100%;
	overflow: hidden;
	perspective: 1700px;
	perspective-origin: 50% 45%;
}

.hyoshi-shizuka .hyoshi-butai {
	position: relative;
}

.hyoshi-za {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	transform-origin: 50% 50%;
}

.hyoshi-kami {
	position: absolute;
	box-sizing: border-box;
	padding: 2.8rem calc(3.4rem + 2.6rem) 2.8rem 2.6rem;
	background: var(--hikari);
	border-block: 1px solid var(--sen);
	line-height: 1.8;
}

.hyoshi-kami::before,
.hyoshi-kami::after {
	content: '';
	position: absolute;
	left: 0;
	right: 3.4rem;
	border-top: 1px solid var(--shu);
	opacity: 0.55;
}

.hyoshi-kami::before {
	top: 1.5rem;
}

.hyoshi-kami::after {
	bottom: 1.5rem;
}

/* The cover cloth at the paper's right end, with the title slip. */
.hyoshi-omote {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 3.4rem;
	background:
		repeating-linear-gradient(45deg, rgb(255 255 255 / 0.06) 0 2px, transparent 2px 7px),
		repeating-linear-gradient(-45deg, rgb(0 0 0 / 0.08) 0 2px, transparent 2px 7px),
		var(--hyoshi-nuno);
}

.hyoshi-daisen {
	position: absolute;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3ecd9;
	color: #1c1b19;
	border: 1px solid #a99a7a;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1;
}

.hyoshi-omote .hyoshi-daisen {
	top: 7%;
	height: 40%;
	left: 50%;
	width: 1.9rem;
	margin-left: -0.95rem;
	font-size: 1rem;
}

.hyoshi-mae {
	margin: 0;
	font-size: 0.95rem;
	color: var(--usuzumi);
	font-family: var(--sans, sans-serif);
}

.hyoshi-daiji {
	margin: 0;
	margin-block-start: 0.5rem;
	font-size: clamp(2.2rem, 6.6vh, 5rem);
	line-height: 1.25;
	font-weight: 700;
	color: var(--shu);
	letter-spacing: 0.1em;
}

.hyoshi-lead {
	margin: 0;
	margin-block-start: 1.8rem;
	font-size: clamp(1rem, 2.15vh, 1.35rem);
}

.hyoshi-tokucho {
	list-style: none;
	margin: 0;
	margin-block-start: 1.6rem;
	padding: 0;
	font-size: clamp(0.95rem, 1.9vh, 1.2rem);
}

.hyoshi-tokucho li::before {
	content: '◆';
	color: var(--shu);
	font-size: 0.7em;
	margin-inline-end: 0.5em;
}

.hyoshi-tokucho b {
	margin-inline-end: 0.6em;
}

.hyoshi-yuki {
	margin: 0;
	margin-block-start: 2rem;
	font-family: var(--sans, sans-serif);
}

.hyoshi-botan {
	display: inline-block;
	padding: 0.9em 0.45em;
	margin-inline-end: 1rem;
	border: 1px solid var(--shu);
	border-radius: 3px;
	color: var(--shu);
	text-decoration: none;
}

.hyoshi-botan.koi {
	background: var(--shu);
	color: var(--hikari);
}

.hyoshi-han {
	margin: 0;
	margin-block-start: 1.6rem;
	text-align: end;
	font-size: 0.85rem;
	color: var(--usuzumi);
	font-family: var(--sans, sans-serif);
}

/* The rolled part: a tube of narrow faces round the roller, and the roller's two ends. */
.hyoshi-maki {
	position: absolute;
	transform-style: preserve-3d;
}

.hyoshi-jiku {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
}

.hyoshi-men {
	display: block;
	position: absolute;
	backface-visibility: hidden;
	background: color-mix(in srgb, var(--iro, var(--hyoshi-ura)), #000 var(--k, 0%));
}

.hyoshi-jiku .hyoshi-daisen {
	backface-visibility: hidden;
}

.hyoshi-gashira {
	position: absolute;
	border-radius: 3px;
	background: linear-gradient(90deg, #120a07, var(--hyoshi-urushi) 20%, #8a5236 46%, var(--hyoshi-urushi) 75%, #120a07);
}

.hyoshi-hint {
	position: absolute;
	left: 6%;
	bottom: 9%;
	margin: 0;
	font-family: var(--sans, sans-serif);
	font-size: 1rem;
	color: var(--usuzumi);
	letter-spacing: 0.1em;
}

.hyoshi-hint .seiritsu {
	color: var(--shu);
}

.hyoshi-shizuka .hyoshi-hint {
	display: none;
}

@media print {
	.hyoshi {
		display: none;
	}
}
