.jla-short-story-library,
.jla-short-story-reader {
	--jla-ink: #101216;
	--jla-panel: #1a1d22;
	--jla-copy: #f5eee1;
	--jla-muted: #bdb4a5;
	--jla-red: #c92a3b;
	--jla-line: rgba(241, 234, 220, .28);
	color: var(--jla-copy);
	font-family: inherit;
}

.jla-short-story-library {
	max-width: 1120px;
	margin: 0 auto;
	padding: clamp(28px, 4vw, 62px) clamp(18px, 3vw, 34px);
}

.jla-short-story-library > header {
	max-width: 760px;
	margin-bottom: 28px;
}

.jla-short-story-library h1,
.jla-short-story-reader h1,
.jla-short-story-reader h2 {
	font-family: Georgia, serif;
	letter-spacing: .01em;
}

.jla-short-story-library h1 {
	font-size: clamp(2.2rem, 5vw, 4.7rem);
	line-height: .95;
	margin: .2rem 0 1rem;
}

.jla-short-story-library > header > p:last-child {
	font-size: 1.1rem;
	max-width: 66ch;
}

.jla-short-story-library__eyebrow,
.jla-short-story-reader__eyebrow,
.jla-short-story-reader__label,
.jla-short-story-card__meta {
	color: #f3636f;
	text-transform: uppercase;
	letter-spacing: .12em;
	font-size: .72rem;
	font-weight: 700;
}

.jla-short-story-library__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
	gap: 18px;
}

.jla-short-story-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 430px;
	background: linear-gradient(140deg, rgba(46, 23, 28, .9), var(--jla-ink) 46%);
	border: 1px solid var(--jla-line);
	box-shadow: inset 0 0 0 7px rgba(255, 255, 255, .018);
	overflow: hidden;
}

.jla-short-story-card::before {
	content: "";
	position: absolute;
	inset: 8px;
	border: 1px solid rgba(241, 234, 220, .18);
	background: linear-gradient(90deg, #b51e27 0 34px, transparent 34px) top left / 104px 2px no-repeat,
		linear-gradient(270deg, #b51e27 0 34px, transparent 34px) bottom right / 104px 2px no-repeat,
		linear-gradient(180deg, rgba(240, 233, 218, .58) 0 17px, transparent 17px) top left / 2px 58px no-repeat,
		linear-gradient(0deg, rgba(240, 233, 218, .58) 0 17px, transparent 17px) bottom right / 2px 58px no-repeat;
	pointer-events: none;
	z-index: 3;
}


.jla-short-story-reader__stage::before {
	content: "";
	position: absolute;
	inset: 8px;
	border: 1px solid rgba(241, 234, 220, .18);
	pointer-events: none;
	z-index: 2;
}

.jla-short-story-card > * {
	position: relative;
	z-index: 1;
}

.jla-short-story-card__cover {
	position: relative;
	display: block;
	height: 185px;
	margin: 15px 15px 0;
	background: linear-gradient(130deg, #242a35, #611d28);
	background-image: linear-gradient(180deg, rgba(0, 0, 0, .02), rgba(0, 0, 0, .72)), var(--jla-card-image);
	background-size: cover;
	background-position: center;
	overflow: hidden;
}

.jla-short-story-card__cover::after {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .025) 4px);
}

.jla-short-story-card__cover span {
	position: absolute;
	right: 12px;
	bottom: 10px;
	z-index: 1;
	color: #fff;
	font-size: .74rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .12em;
}

.jla-short-story-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 18px 22px 26px;
}

.jla-short-story-card h2 {
	font-family: Georgia, serif;
	font-size: 1.8rem;
	line-height: 1.02;
	margin: .4rem 0 .8rem;
}

.jla-short-story-card h2 a,
.jla-short-story-card__link {
	color: inherit;
	text-decoration: none;
}

.jla-short-story-card__body > p:not(.jla-short-story-card__meta) {
	color: var(--jla-muted);
	margin-top: 0;
}

.jla-short-story-card__link {
	color: #fff;
	border-top: 1px solid var(--jla-line);
	margin-top: auto;
	padding-top: 13px;
	font-weight: 700;
}

.jla-short-story-empty {
	border: 1px solid var(--jla-line);
	padding: 26px;
	background: var(--jla-panel);
}

/* The reader is deliberately a portrait page. The outer reader and its active
 * page use the same frame, while the fixed control strip sits within it. */
.jla-short-story-reader {
	width: min(100%, 680px);
	margin: 0 auto;
	padding: clamp(22px, 3vw, 40px) clamp(12px, 2vw, 24px);
	box-sizing: border-box;
	/* Opening the cover swaps two portrait layouts of differing heights. It
	 * must not allow browser scroll anchoring to treat that as navigation. */
	overflow-anchor: none;
}

.jla-short-story-reader__cover,
.jla-short-story-reader__stage {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--jla-line);
	background: var(--jla-ink);
	overflow: hidden;
}

.jla-short-story-reader__cover {
	min-height: 0;
	aspect-ratio: 3 / 4;
	display: grid;
	place-items: end start;
	background-image: linear-gradient(90deg, rgba(8, 9, 11, .94) 0%, rgba(8, 9, 11, .66) 52%, rgba(8, 9, 11, .18)), var(--jla-cover);
	background-size: cover;
	background-position: center;
}

.jla-short-story-reader__cover > div {
	position: relative;
	z-index: 1;
	max-width: 100%;
	padding: clamp(28px, 6vw, 60px);
}

.jla-short-story-reader__cover h1 {
	font-size: clamp(2.35rem, 6vw, 4.8rem);
	line-height: .92;
	margin: .4rem 0 1rem;
}

.jla-short-story-reader__cover p:not(.jla-short-story-reader__eyebrow) {
	font-size: 1.04rem;
	line-height: 1.55;
}

.jla-short-story-reader__cover dl {
	display: flex;
	gap: 28px;
	margin: 24px 0;
}

.jla-short-story-reader__cover dt {
	color: var(--jla-muted);
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .1em;
}

.jla-short-story-reader__cover dd {
	margin: 3px 0;
	font-weight: 700;
}

.jla-short-story-reader button {
	font: inherit;
	cursor: pointer;
}

.jla-short-story-reader__open,
.jla-short-story-reader__controls button,
.jla-short-story-reader__return {
	border: 1px solid rgba(255, 255, 255, .3);
	background: #1d2128;
	color: #fff;
	padding: 11px 16px;
	font-weight: 700;
}

.jla-short-story-reader__return {
	text-decoration: none;
	white-space: nowrap;
}

.jla-short-story-reader__return:hover,
.jla-short-story-reader__return:focus-visible {
	border-color: rgba(201, 42, 59, .9);
	color: #fff;
	background: linear-gradient(135deg, rgba(201, 42, 59, .3), #1d2128);
}

.jla-short-story-reader__library-wrap {
	margin: 14px 0 0;
	text-align: center;
}

.jla-short-story-reader__library {
	display: inline-block;
	padding: 9px 13px;
	border: 1px solid rgba(241, 234, 220, .26);
	background: rgba(18, 21, 26, .72);
	color: var(--jla-copy);
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-decoration: none;
	text-transform: uppercase;
}

.jla-short-story-reader__library:hover,
.jla-short-story-reader__library:focus-visible {
	border-color: rgba(201, 42, 59, .9);
	color: #fff;
}

.jla-short-story-reader__open {
	background: var(--jla-red);
	border-color: var(--jla-red);
	text-transform: uppercase;
	letter-spacing: .08em;
}

.jla-short-story-reader__stage {
	min-height: 0;
	aspect-ratio: 3 / 4;
	display: flex;
	flex-direction: column;
	--jla-controls-reserve: 132px;
}

.jla-short-story-reader__pages {
	flex: 1;
	min-height: 0;
	display: grid;
	perspective: 1400px;
	overflow: hidden;
}

.jla-short-story-reader__page {
	grid-area: 1 / 1;
	min-height: 0;
	display: grid;
	align-items: end;
	overflow: hidden;
	background-image: linear-gradient(90deg, rgba(5, 7, 10, var(--jla-page-overlay)) 0%, rgba(5, 7, 10, calc(var(--jla-page-overlay) - .17)) 70%, rgba(5, 7, 10, .3)), var(--jla-page-image);
	background-size: cover;
	background-position: center;
	transform-origin: right center;
	backface-visibility: hidden;
}

/* An author-level display declaration otherwise overrides the HTML hidden
 * attribute, leaving all page backgrounds stacked in the same grid cell. */
.jla-short-story-reader [hidden] {
	display: none !important;
}

.jla-short-story-reader__page.is-turning-forward {
	transform-origin: left center;
	animation: jlaPageTurnForward .52s cubic-bezier(.18, .7, .16, 1) both;
}

.jla-short-story-reader__page.is-turning-back {
	transform-origin: left center;
	animation: jlaPageTurnForward .52s cubic-bezier(.18, .7, .16, 1) reverse both;
}

.jla-short-story-reader__page-inner {
	max-width: 100%;
	width: 100%;
	height: 100%;
	min-height: 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding: clamp(18px, 3.5vw, 34px);
	padding-bottom: calc(clamp(18px, 3.5vw, 34px) + var(--jla-controls-reserve));
	text-shadow: 0 2px 18px #000;
}

.jla-short-story-reader__page h2 {
	font-size: clamp(1.5rem, 3.2vw, 2.7rem);
	line-height: 1;
	margin: .22rem 0 .7rem;
	flex: 0 0 auto;
	text-align: var(--jla-page-heading-align, left);
}

.jla-short-story-reader__page-inner > .jla-short-story-reader__label {
	margin: 0;
	flex: 0 0 auto;
	text-align: var(--jla-page-heading-align, left);
}

.jla-short-story-reader__text-viewport {
	min-height: 0;
	flex: 1 1 auto;
	overflow: hidden;
}

.jla-short-story-reader__text {
	font-size: clamp(.96rem, 1.7vw, 1.1rem);
	line-height: 1.6;
	max-width: none;
	will-change: transform;
}

.jla-short-story-reader__text p {
	margin: .75em 0;
}

.jla-short-story-reader__controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 8px;
	padding: 13px 18px;
	background: rgba(10, 12, 16, .5);
	border-top: 1px solid var(--jla-line);
}

.jla-short-story-reader__controls button:disabled {
	opacity: .35;
	cursor: not-allowed;
}

.jla-short-story-reader__controls .jla-short-story-reader__play {
	background: var(--jla-red);
	border-color: var(--jla-red);
}

.jla-short-story-reader__return,
.jla-short-story-reader__controls [data-jla-share] {
	width: 100%;
	box-sizing: border-box;
}

.jla-short-story-reader__controls [data-jla-share] {
	grid-column: 3;
}

.jla-short-story-reader__utilities {
	grid-column: 3;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	width: 100%;
}

.jla-short-story-reader__utilities [data-jla-mute] {
	flex: 0 0 auto;
}

.jla-short-story-reader__utilities [data-jla-share] {
	width: auto;
	min-width: 0;
	flex: 1 1 auto;
}

.jla-short-story-reader__transport {
	grid-column: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	white-space: nowrap;
}

.jla-short-story-reader__controls [data-jla-share] {
	border-color: rgba(201, 42, 59, .7);
	background: linear-gradient(135deg, rgba(201, 42, 59, .3), #1d2128);
}

.jla-short-story-reader__progress {
	grid-column: 1 / -1;
	grid-row: 2;
	display: flex;
	min-width: 0;
	position: relative;
	padding-top: 27px;
}

.jla-short-story-reader__progress input {
	position: relative;
	z-index: 2;
	width: 100%;
	accent-color: var(--jla-red);
}

.jla-short-story-reader__markers {
	position: absolute;
	z-index: 3;
	left: 9px;
	right: 9px;
	bottom: 7px;
	height: 11px;
	pointer-events: none;
}

.jla-short-story-reader__markers span {
	position: absolute;
	top: 0;
	width: 2px;
	height: 11px;
	background: #f3eade;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .75), 0 0 8px rgba(201, 42, 59, .72);
	transform: translateX(-50%);
}

.jla-short-story-reader__time-index {
	position: absolute;
	z-index: 4;
	top: 0;
	max-width: calc(100% - 8px);
	padding: 3px 7px;
	border: 1px solid rgba(241, 234, 220, .24);
	background: rgba(8, 10, 14, .96);
	color: var(--jla-copy);
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .05em;
	line-height: 1.1;
	text-transform: uppercase;
	transform: translateX(-50%);
	white-space: nowrap;
	pointer-events: none;
}

@keyframes jlaPageTurnForward {
	from { opacity: 1; transform: translate3d(0, 0, 0) rotateY(0) scale(1); filter: brightness(1); }
	70% { opacity: .55; transform: translate3d(-4%, 18px, -130px) rotateY(-72deg) scale(.91); filter: brightness(.55); }
	to { opacity: 0; transform: translate3d(-7%, 28px, -190px) rotateY(-86deg) scale(.86); filter: brightness(.36); }
}

@media (prefers-reduced-motion: reduce) {
	.jla-short-story-reader__page { animation: none !important; }
}

@media (max-width: 620px) {
	.jla-short-story-reader { width: 100%; }
	.jla-short-story-reader__cover,
	.jla-short-story-reader__stage { aspect-ratio: 3 / 4; }
	.jla-short-story-reader__stage { --jla-controls-reserve: 144px; }
	.jla-short-story-reader__controls { padding: 10px; }
	.jla-short-story-reader__page-inner {
		padding: 30px 24px;
		padding-bottom: calc(30px + var(--jla-controls-reserve));
	}
	.jla-short-story-card { min-height: 400px; }
}

@media (max-width: 620px) {
	.jla-short-story-reader__stage { --jla-controls-reserve: 118px; }

	.jla-short-story-reader__controls {
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		gap: 6px;
		padding: 8px 10px;
	}

	/* Story Cover and Share remain available on larger screens. On compact
	 * phones, reserve the page for reading and keep just the core transport. */
	.jla-short-story-reader__return,
	.jla-short-story-reader__controls [data-jla-share] { display: none; }

	.jla-short-story-reader__utilities {
		grid-column: 3;
		justify-content: flex-end;
		width: auto;
	}

	.jla-short-story-reader__utilities [data-jla-mute],
	.jla-short-story-reader__transport button {
		min-height: 44px;
		padding: 8px 10px;
		font-size: .8rem;
	}

	.jla-short-story-reader__transport {
		grid-column: 2;
		grid-row: 1;
		gap: 5px;
	}

	.jla-short-story-reader__progress {
		grid-column: 1 / -1;
		grid-row: 2;
		padding-top: 23px;
	}

	.jla-short-story-reader__time-index {
		font-size: .63rem;
		padding: 3px 5px;
	}
}

@media (max-width: 360px) {
	.jla-short-story-reader__transport .jla-short-story-reader__play span {
		display: none;
	}
}
