/*
 * Libra archive (PLAN §10.4, DESIGN §10.14, §11.4): hero, shelf, chips + grid.
 */

.books-hero { position: relative; display: grid; justify-items: start; gap: 20px; }
.books-hero__wm { position: absolute; right: var(--gutter); top: 10px; }
.books-hero__lead { max-width: 56ch; }

/* ---------- Shelf ---------- */
.shelf-section { padding-top: 12px; }
.shelf-scroll {
	overflow-x: auto;
	scrollbar-width: thin;
	overscroll-behavior-x: contain;
}
.shelf {
	display: flex;
	align-items: flex-end;
	justify-content: flex-start; /* aligned with the section text, like every other section */
	gap: 6px;
	width: max-content;
	min-width: 100%;
	min-height: 400px;
	padding: 40px 0 0;
}

.spine {
	flex: none;
	width: var(--w);
	height: var(--h);
	transition: width 380ms var(--ease), height 380ms var(--ease), transform 380ms var(--ease);
}
.spine.is-pulled {
	width: 220px;
	height: 380px;
	transform: translateY(-18px);
}

.spine__link {
	position: relative;
	display: block;
	height: 100%;
	overflow: hidden;
	border-radius: 4px 4px 2px 2px;
	background: repeating-linear-gradient(135deg, var(--tone-a) 0 10px, var(--tone-b) 10px 20px);
	box-shadow: inset -3px 0 0 rgba(0, 0, 0, .15);
	color: var(--parchment);
	text-decoration: none;
}
.spine__link:hover { color: var(--parchment); }
/* Gold rules 10px from top and bottom, 8px from the sides. */
.spine__link::before,
.spine__link::after {
	content: "";
	position: absolute;
	left: 8px;
	right: 8px;
	height: 1px;
	background: var(--gold-line);
	opacity: .8;
}
.spine__link::before { top: 10px; }
.spine__link::after { bottom: 10px; }

.spine__title {
	position: absolute;
	inset: 24px 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 50;
	font-size: 17px;
	line-height: 1;
	white-space: nowrap;
}

.spine__card { display: none; }

.spine.is-pulled .spine__link {
	border-radius: 14px;
	background: var(--card);
	box-shadow: 0 24px 40px rgba(19, 33, 58, .18), inset 0 0 0 1px var(--line);
	color: var(--fg);
}
.spine.is-pulled .spine__link::before,
.spine.is-pulled .spine__link::after,
.spine.is-pulled .spine__title { display: none; }
.spine.is-pulled .spine__card {
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto auto;
	gap: 10px;
	height: 100%;
	padding: 18px;
}
.spine__arch { width: 100%; height: 100%; aspect-ratio: auto; }
.spine__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--gold-ink);
}
.spine__meta .badge--best { font-size: 9px; padding: 3px 8px; }
.spine__name {
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 50;
	font-size: 19px;
	line-height: 1.15;
}

.shelf__base {
	width: max-content;
	min-width: 100%;
	height: 14px;
	border-top: 2px solid var(--gold-line);
	border-radius: 0 0 6px 6px;
	background: linear-gradient(var(--ph-1), var(--page));
}

/* ---------- Chips + grid ---------- */
.books-all {
	padding-top: 32px;
	padding-bottom: clamp(56px, 7cqi, 96px);
}
.books-all__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 28px;
}
.books-all__langs { margin-bottom: 14px; }

/* Search: filters the grid as you type (filters.js); without JS it is a GET form (?kerko=). */
.books-search { display: flex; gap: 8px; max-width: 560px; margin-bottom: 18px; }
.books-search__input {
	flex: 1;
	min-width: 0;
	min-height: 52px;
	padding: 0 18px;
	border: 1.5px solid var(--gold-line);
	border-radius: 999px;
	background-color: var(--page);
	color: var(--fg);
	font: inherit;
	font-size: 16px;
}
.books-search__input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.books-search__btn { min-height: 52px; }
.books-all__count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.books-all__empty { display: grid; justify-items: start; gap: 4px; padding: 24px 0; }
.books-all__empty p { font-size: 17px; }
