/*
 * Tarot Arabi — P10 books
 *
 * The book library and the single book product.
 *
 * This is a composition layer, not a new design language: tokens, buttons,
 * badges, breadcrumbs and icons all come from the global layers, and the library
 * hero mirrors the approved Page-family hero geometry so the book section is
 * unmistakably part of the same site. What is its own is the book object — a
 * portrait cover stage that never crops real artwork, a library grid that is
 * deliberately quieter than the course grid, and a cover-first product hero.
 *
 * Loaded only on book surfaces: the homepage, the Learn family, the card library,
 * the spread family and the course family each keep their own system, and none of
 * them receives these rules.
 *
 * There is no book script. The reveal gate the other families use is scoped to a
 * class their own script adds, and the global `ta-js` marker is already present on
 * every request — hiding book content behind it without an observer to reveal it
 * would leave the page invisible. Book pages therefore ship no motion and no
 * script, and every book is visible immediately.
 */

/* ============================================================== Foundation */

.ta-books {
	/* The library hero mirrors the approved Page-family hero geometry. */
	--ta-books-hero-top: clamp(28px, 3.4vw, 48px);
	--ta-books-hero-copy: 540px;
	--ta-books-hero-arc: clamp(380px, 30vw, 440px);
	--ta-books-hero-arc-bite: 105px;

	--ta-books-line: 1px solid var(--color-border);
	--ta-books-shadow: 0 4px 18px rgba(23, 79, 58, 0.06);
	--ta-books-shadow-hover: 0 10px 26px rgba(23, 79, 58, 0.1);
	--ta-books-reading: 780px;

	background-color: var(--color-bg);
	color: var(--color-text);
	overflow-x: clip; /* the hero field may bleed; the page never scrolls sideways */
}

/*
 * The family's own content wrapper. The shared `.ta-ec-wrap` primitive lives in
 * the Learn layer, which this family does not load, so the complete definition
 * lives here: without the auto margins and the gutter the content would sit flush
 * against the physical right edge of the viewport.
 */
.ta-books-wrap {
	inline-size: 100%;
	max-inline-size: 1264px; /* ~1200px of content at 1440 */
	margin-inline: auto;
	padding-inline: clamp(20px, 2.2vw, 32px);
}

/*
 * The approved eyebrow treatment, stated locally.
 *
 * `.ta-eyebrow`'s typography base lives in the homepage and Learn layers, so a
 * family that loads neither must restate it or inherit the body's 400 weight and
 * loose leading.
 */
.ta-books .ta-eyebrow {
	margin: 0;
	color: var(--color-gold-action);
	font-size: clamp(14px, 1.05vw, 16px);
	font-weight: var(--weight-bold);
	line-height: 1.45;
}

/*
 * The badge list primitive also lives in the homepage layer, so the family
 * restates the list itself and then unifies the badge surface: every book fact is
 * metadata, so none of them may wear an action-like brass outline.
 */
.ta-books .ta-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ta-books .ta-badge {
	min-block-size: 28px;
	padding-block: 0;
	padding-inline: 10px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-xs);
	background-color: var(--color-surface);
	color: var(--color-green-900);
	font-size: 13px;
	font-weight: var(--weight-bold);
	line-height: 1;
}

.ta-books .ta-badge--physical,
.ta-books .ta-badge--bundle {
	background-color: var(--color-sage-100);
	border-color: transparent;
}

/*
 * The base layer's global `li + li` rhythm would push the second badge, and the
 * second card in a member row, below its neighbour — a 2px offset in a badge row
 * and a 4px one in a two-column grid. Inside the family's own flex/grid lists the
 * container's gap owns the spacing, so the base rule is cancelled where it leaks.
 */
.ta-books .ta-badges > li + li,
.ta-books .ta-books-members > li + li {
	margin-block-start: 0;
}

/*
 * ONE canonical major-section gap, owned by the section below it, so a boundary
 * is the token and nothing else. Spacing inside a section is internal.
 */
.ta-books > article > * {
	padding-block: 0;
}

.ta-books > article > .ta-books-hero,
.ta-books > article > .ta-books-product-hero {
	padding-block-start: var(--ta-books-hero-top);
}

.ta-books > article > .ta-books-section {
	padding-block-start: var(--ta-section-gap);
}

/*
 * Two related modules — series navigation, then the bundle this book belongs to —
 * are one relationship region, so the join between them is an internal gap rather
 * than a second full chapter. The canonical token still owns the region's outer
 * boundaries.
 */
.ta-books > article > .ta-books-relations + .ta-books-membership {
	padding-block-start: clamp(32px, 3vw, 48px);
}

.ta-books > article > :last-child {
	padding-block-end: var(--ta-section-gap);
}

/* ------------------------------------------------------------ Section head */

/*
 * One heading cluster, stacked: eyebrow, heading, then the line that belongs to
 * it. The head never splits its own content across the page, so a count or a
 * supporting sentence always reads as part of the heading it describes.
 */
.ta-books-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	margin-block-end: clamp(28px, 3vw, 40px);
}

.ta-books-head__cluster {
	max-inline-size: 760px;
}

.ta-books-head .ta-eyebrow {
	margin: 0 0 10px;
}

.ta-books-h2 {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(30px, 3vw, 44px);
	font-weight: var(--weight-bold);
	line-height: 1.18;
	text-wrap: balance;
}

/*
 * The inventory count is a secondary line of the heading cluster, not a badge:
 * body-scale type, secondary colour, and only the internal heading gap above it.
 */
.ta-books-head__count {
	margin: 12px 0 0;
	color: var(--color-text-muted);
	font-size: 15px;
	font-weight: var(--weight-bold);
	line-height: 1.5;
}

.ta-books-head__intro {
	margin: var(--space-4) 0 0;
	max-inline-size: 62ch;
	color: var(--color-text-muted);
	font-size: 16px;
	line-height: 1.8;
}

/* --------------------------------------------------- Neutral cover plate */

/*
 * The neutral plate: a plain Sage → Ivory surface that never imitates a cover and
 * carries no generated symbol. It is decorative for assistive technology, and the
 * author-facing marker is added only for someone who can fix it.
 */
.ta-books-plate {
	position: relative;
	display: block;
	inline-size: 100%;
	block-size: 100%;
	min-block-size: 100%;
	background-color: var(--color-sage-100);
	background-image: linear-gradient(160deg, var(--color-sage-100) 0%, var(--color-ivory) 55%, var(--color-surface-warm) 100%);
}

.ta-books-plate__label {
	position: absolute;
	inset-block-end: 12%;
	inset-inline: 12%;
	color: rgba(23, 79, 58, 0.42);
	font-family: var(--font-heading);
	font-size: clamp(13px, 0.95vw, 14px);
	font-weight: var(--weight-bold);
	line-height: 1.4;
	text-align: center;
	text-wrap: balance;
}

/* ============================================================== Page hero */

.ta-books-hero {
	position: relative;
	min-block-size: clamp(400px, 30vw, 440px);
}

.ta-books-hero__wrap {
	position: relative;
	z-index: 2;
}

.ta-books-hero__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	max-inline-size: var(--ta-books-hero-copy);
	margin-inline-end: auto; /* RTL: the copy keeps the page grid's right edge */
}

.ta-books-hero__eyebrow {
	margin: clamp(20px, 1.6vw, 22px) 0 0;
}

.ta-books-hero__title {
	margin: clamp(14px, 1.1vw, 16px) 0 0;
	max-inline-size: 520px;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(46px, 4.3vw, 62px);
	font-weight: var(--weight-bold);
	line-height: 1.14;
	text-wrap: balance;
}

.ta-books-hero__lead {
	margin: clamp(16px, 1.3vw, 18px) 0 0;
	max-inline-size: 520px;
	color: var(--color-text-muted);
	font-size: clamp(17px, 1.25vw, 19px);
	line-height: 1.8;
}

/* The photographic field: out of flow, so it can reach the physical left
   viewport edge while the copy keeps the centred grid. */
.ta-books-hero__media {
	position: absolute;
	z-index: 1;
	inset-block: 0;
	inset-inline-end: 0; /* RTL: the physical left edge */
	inline-size: min(
		55.5vw,
		calc(100% - var(--ta-books-hero-copy) - clamp(20px, 2.2vw, 32px) - 16px)
	);
}

.ta-books-hero__frame {
	position: relative;
	display: block;
	block-size: 100%;
	overflow: hidden;
	border-radius: 18px 0 0 18px; /* physical left corners only */
	background-color: var(--color-surface);
}

html[dir="ltr"] .ta-books-hero__frame {
	border-radius: 0 18px 18px 0;
}

.ta-books-hero__image {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

/*
 * The transition: one oversized Ivory disc whose centre sits well inside the
 * photograph, so only a shallow arc brushes into it. Pure layout geometry.
 */
.ta-books-hero__media::after {
	content: "";
	position: absolute;
	z-index: 2;
	inset-block-start: 54%;
	inset-inline-start: calc(var(--ta-books-hero-arc-bite) - var(--ta-books-hero-arc));
	inline-size: var(--ta-books-hero-arc);
	block-size: var(--ta-books-hero-arc);
	border-radius: 50%;
	background-color: var(--color-bg);
	transform: translateY(-50%);
	pointer-events: none;
}

/* =============================================================== Library */

/*
 * The library grid: twenty-four internal tracks so an incomplete final row can be
 * centred exactly, without changing any card's width. Four per row on desktop,
 * three, then two, then one — driven by the real minimum usable card width rather
 * than by device names.
 *
 * Twenty-four rather than twelve because a leftover row must divide evenly on
 * both sides: a card that spans six tracks leaves nine tracks of margin either
 * side, where twelve tracks would have left four and a half and pushed the card
 * visibly off centre.
 */
.ta-books-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(16px, 1.5vw, 20px);
	align-items: stretch;
}

/* Two columns from the smallest phone: a portrait cover at full phone width
   would otherwise make one card taller than the viewport. */
@media (min-width: 360px) {
	.ta-books-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 560px) {
	.ta-books-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 800px) and (max-width: 1099px) {
	.ta-books-grid {
		grid-template-columns: repeat(24, minmax(0, 1fr));
	}

	.ta-books-grid > .ta-books-card {
		grid-column: span 8;
	}

	/* A leftover pair is centred as a unit, and a leftover single card in the middle. */
	.ta-books-grid > .ta-books-card:nth-last-child(2):nth-child(3n + 1) {
		grid-column: 5 / span 8;
	}

	.ta-books-grid > .ta-books-card:last-child:nth-child(3n + 2) {
		grid-column: 13 / span 8;
	}

	.ta-books-grid > .ta-books-card:last-child:nth-child(3n + 1) {
		grid-column: 9 / span 8;
	}
}

@media (min-width: 1100px) {
	.ta-books-grid {
		grid-template-columns: repeat(24, minmax(0, 1fr));
	}

	.ta-books-grid > .ta-books-card {
		grid-column: span 6;
	}

	/* A leftover row is centred as a unit rather than stranded at the reading edge. */
	.ta-books-grid > .ta-books-card:last-child:nth-child(4n + 1) {
		grid-column: 10 / span 6;
	}

	.ta-books-grid > .ta-books-card:nth-last-child(2):nth-child(4n + 1) {
		grid-column: 7 / span 6;
	}

	.ta-books-grid > .ta-books-card:last-child:nth-child(4n + 2) {
		grid-column: 13 / span 6;
	}

	.ta-books-grid > .ta-books-card:nth-last-child(3):nth-child(4n + 1) {
		grid-column: 4 / span 6;
	}

	.ta-books-grid > .ta-books-card:nth-last-child(2):nth-child(4n + 2) {
		grid-column: 10 / span 6;
	}

	.ta-books-grid > .ta-books-card:last-child:nth-child(4n + 3) {
		grid-column: 16 / span 6;
	}
}

/* ============================================================ Book card */

.ta-books-card {
	display: flex;
	min-inline-size: 0;
}

.ta-books-card__link {
	display: flex;
	flex-direction: column;
	inline-size: 100%;
	overflow: hidden;
	border: var(--ta-books-line);
	border-radius: 20px;
	background-color: var(--color-surface);
	color: inherit;
	text-decoration: none;
	box-shadow: var(--ta-books-shadow);
	transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ta-books-card__link:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 30px rgba(23, 79, 58, 0.1);
}

.ta-books-card__link:focus-visible {
	outline: 2px solid var(--color-gold-action);
	outline-offset: 3px;
}

/*
 * The portrait cover stage. The 3:4 slot matches the dominant A-series cover
 * ratio (the median real cover is 0.707), so the crop is a few percent of the
 * height rather than a letterboxed thumbnail. The slot owns the ratio; the
 * cover fills it with `cover` and can never resize the card.
 */
.ta-books-card__stage {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background-color: var(--color-sage-100);
	background-image: linear-gradient(168deg, var(--color-sage-100) 0%, var(--color-ivory) 100%);
}

.ta-books-card__cover {
	position: relative;
	display: block;
	inline-size: 100%;
	block-size: 100%;
	overflow: hidden;
}

.ta-books-cover__image {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	object-position: center;
}

.ta-books-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	min-inline-size: 0;
	padding: clamp(18px, 1.6vw, 22px);
}

.ta-books-card__format {
	color: var(--color-gold-action);
	font-size: clamp(13px, 1vw, 14px);
	font-weight: var(--weight-bold);
	line-height: 1.4;
}

/*
 * The title is the card's identity: it wraps naturally and is never clamped or
 * ellipsised, so a long Arabic title stays whole. Two lines are reserved so a
 * short title cannot pull its CTA out of line with the cards beside it.
 */
.ta-books-card__title {
	margin-block-start: 9px;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(23px, 1.75vw, 26px);
	font-weight: var(--weight-bold);
	line-height: 1.35;
	text-wrap: balance;
	min-block-size: 2.7em;
}

.ta-books-card__facts {
	margin-block-start: 10px;
}

.ta-books-card__price {
	margin-block-start: 12px;
	color: var(--color-heading);
	font-size: 17px;
	font-weight: var(--weight-bold);
	line-height: 1.4;
}

.ta-books-card__price del {
	color: var(--color-text-muted);
	font-size: 14px;
	font-weight: var(--weight-regular);
}

.ta-books-card__price ins {
	text-decoration: none;
}

/*
 * The one CTA, pinned to the bottom of the card so a row's actions line up while
 * the card above them is free to grow with a long title.
 */
.ta-books-card__cta {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	margin-block-start: auto;
	padding-block-start: 16px;
	color: var(--color-gold-action);
	font-size: 15px;
	font-weight: var(--weight-bold);
}

.ta-books-card__link:hover .ta-icon--directional {
	transform: translateX(-4px);
}

.ta-books-card__link:hover .ta-books-card__cta {
	color: var(--color-gold-action-hover);
}

/* ========================================================= Product hero */

.ta-books-product-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) clamp(340px, 32vw, 430px);
	gap: clamp(40px, 5vw, 68px);
	align-items: center;
}

.ta-books-product-hero__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	min-inline-size: 0;
}

.ta-books-product-hero__eyebrow {
	margin: clamp(18px, 1.5vw, 20px) 0 0;
}

.ta-books-product-hero__title {
	margin: clamp(12px, 1vw, 16px) 0 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(40px, 3.8vw, 58px);
	font-weight: var(--weight-bold);
	line-height: 1.16;
	text-wrap: balance;
}

.ta-books-product-hero__lead {
	margin: clamp(14px, 1.2vw, 18px) 0 0;
	max-inline-size: 62ch;
	color: var(--color-text-muted);
	font-size: clamp(17px, 1.25vw, 19px);
	line-height: 1.8;
}

.ta-books-product-hero__facts {
	margin-block-start: clamp(18px, 1.6vw, 22px);
}

/*
 * The portrait stage: a soft sage backing with one restrained offset layer, and a
 * 2:3 cover frame inside it. The cover is contained, never cropped, and the stage
 * is wide enough to give a real book presence without dominating the copy.
 */
.ta-books-product-hero__stage {
	position: relative;
	display: flex;
	justify-content: center;
	min-inline-size: 0;
	padding: clamp(18px, 1.8vw, 26px);
	border-radius: var(--radius-2xl);
	background-color: var(--color-sage-100);
	background-image: linear-gradient(166deg, var(--color-sage-100) 0%, var(--color-ivory) 100%);
}

.ta-books-product-hero__stage::before {
	content: "";
	position: absolute;
	z-index: 0;
	inset-block-start: clamp(24px, 2.4vw, 34px);
	inset-inline-end: calc(-1 * clamp(10px, 1vw, 16px));
	inline-size: 62%;
	block-size: 74%;
	border-radius: var(--radius-xl);
	background-color: var(--color-surface-warm);
	opacity: 0.7;
}

html[dir="ltr"] .ta-books-product-hero__stage::before {
	inset-inline-end: auto;
	inset-inline-start: calc(-1 * clamp(10px, 1vw, 16px));
}

.ta-books-product-hero__frame {
	position: relative;
	z-index: 1;
	display: block;
	inline-size: min(100%, 340px);
	aspect-ratio: 2 / 3;
	overflow: hidden;
	border-radius: 10px;
	background-color: var(--color-surface);
	box-shadow: 0 14px 34px rgba(23, 79, 58, 0.16);
}

.ta-books-product-hero__frame .ta-books-plate--cover {
	border-radius: 10px;
}

/* ========================================================== Detail facts */

/*
 * ONE contained facts component. The internal tracks are twelve wide and the REAL
 * number of confirmed facts decides how many tracks each cell takes, so the final
 * row is always filled and an absent fact never leaves an empty track behind.
 */
.ta-books-facts {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1px;
	margin: 0;
	border: var(--ta-books-line);
	border-radius: var(--radius-xl);
	background-color: var(--color-border);
	overflow: hidden;
}

.ta-books-facts__cell {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-inline-size: 0;
	padding: clamp(15px, 1.4vw, 20px) clamp(16px, 1.6vw, 22px);
	background-color: var(--color-surface);
}

.ta-books-facts__cell--contents {
	background-color: var(--color-sage-100);
}

.ta-books-facts__label {
	color: var(--color-text-muted);
	font-size: 13px;
	font-weight: var(--weight-bold);
	line-height: 1.4;
}

.ta-books-facts__value {
	margin: 0;
	color: var(--color-heading);
	font-size: clamp(16px, 1.25vw, 18px);
	font-weight: var(--weight-bold);
	line-height: 1.45;
}

@media (min-width: 700px) and (max-width: 1099px) {
	.ta-books-facts {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	.ta-books-facts__cell {
		grid-column: span 6;
	}

	.ta-books-facts--count-1 > .ta-books-facts__cell,
	.ta-books-facts--count-3 > .ta-books-facts__cell:nth-child(n + 3),
	.ta-books-facts--count-5 > .ta-books-facts__cell:nth-child(n + 5),
	.ta-books-facts--count-7 > .ta-books-facts__cell:nth-child(n + 7) {
		grid-column: span 12;
	}
}

@media (min-width: 1100px) {
	.ta-books-facts {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	.ta-books-facts__cell {
		grid-column: span 3;
	}

	.ta-books-facts--count-1 > .ta-books-facts__cell {
		grid-column: span 12;
	}

	.ta-books-facts--count-2 > .ta-books-facts__cell {
		grid-column: span 6;
	}

	.ta-books-facts--count-3 > .ta-books-facts__cell {
		grid-column: span 4;
	}

	.ta-books-facts--count-5 > .ta-books-facts__cell:nth-child(n + 5) {
		grid-column: span 12;
	}

	.ta-books-facts--count-6 > .ta-books-facts__cell:nth-child(n + 5) {
		grid-column: span 6;
	}

	.ta-books-facts--count-7 > .ta-books-facts__cell:nth-child(n + 5) {
		grid-column: span 4;
	}
}

/* ================================================== Bundle / link rows */

/*
 * A compact contained row list, used for bundle members and for related
 * destinations: substantial enough to read as content, quiet enough that 28 of
 * them never look like 28 products.
 */
.ta-books-members {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(10px, 1vw, 14px);
	max-inline-size: 980px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ta-books-members__item {
	display: flex;
	min-inline-size: 0;
}

.ta-books-members__link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	inline-size: 100%;
	padding: clamp(14px, 1.4vw, 18px) clamp(16px, 1.5vw, 20px);
	border: var(--ta-books-line);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
	color: inherit;
	text-decoration: none;
	transition: border-color 180ms ease, transform 180ms ease;
}

.ta-books-members__link:hover {
	transform: translateY(-2px);
	border-color: var(--color-gold-action);
}

.ta-books-members__link:focus-visible {
	outline: 2px solid var(--color-gold-action);
	outline-offset: 2px;
}

.ta-books-members__format {
	color: var(--color-gold-action);
	font-size: 13px;
	font-weight: var(--weight-bold);
}

.ta-books-members__title {
	color: var(--color-heading);
	font-size: 15px;
	font-weight: var(--weight-bold);
	line-height: 1.5;
}

.ta-books-members__more {
	margin-block-start: clamp(14px, 1.4vw, 18px);
	max-inline-size: 980px;
}

.ta-books-members__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	inline-size: 100%;
	gap: var(--space-3);
	padding: clamp(14px, 1.4vw, 18px) clamp(16px, 1.5vw, 20px);
	border: var(--ta-books-line);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
	color: var(--color-green-900);
	font-size: 14px;
	font-weight: var(--weight-bold);
	cursor: pointer;
	list-style: none;
}

.ta-books-members__summary::-webkit-details-marker {
	display: none;
}

.ta-books-members__summary:focus-visible {
	outline: 2px solid var(--color-gold-action);
	outline-offset: 2px;
}

.ta-books-members__marker {
	color: var(--color-text-muted);
	transition: transform 200ms ease;
}

.ta-books-members__more[open] .ta-books-members__marker {
	transform: rotate(180deg);
}

.ta-books-members--rest {
	margin-block-start: clamp(14px, 1.4vw, 18px);
}

/* ========================================================== Relations */

/*
 * The series cards hold the reading edge and never stretch across the viewport:
 * the tracks are width-driven, so two directions sit side by side while each card
 * still has at least 320px, and a single direction keeps one deliberately sized
 * card instead of an empty second cell.
 */
.ta-books-relations__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
	gap: clamp(14px, 1.4vw, 20px);
	max-inline-size: 980px;
}

.ta-books-relations__item {
	max-inline-size: 480px;
}

.ta-books-relations__item {
	display: flex;
}

.ta-books-relations__link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	inline-size: 100%;
	padding: clamp(18px, 1.7vw, 22px);
	border: var(--ta-books-line);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
	color: inherit;
	text-decoration: none;
	transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ta-books-relations__link:hover {
	transform: translateY(-2px);
	box-shadow: var(--ta-books-shadow-hover);
}

.ta-books-relations__link:focus-visible {
	outline: 2px solid var(--color-gold-action);
	outline-offset: 3px;
}

.ta-books-relations__label {
	color: var(--color-gold-action);
	font-size: 13px;
	font-weight: var(--weight-bold);
}

.ta-books-relations__title {
	margin-block-start: 8px;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(18px, 1.5vw, 21px);
	font-weight: var(--weight-bold);
	line-height: 1.32;
}

.ta-books-relations__link .ta-books-card__cta {
	padding-block-start: 16px;
}

.ta-books-relations__link:hover .ta-icon--directional {
	transform: translateX(-4px);
}

/* ==================================================== Bundle membership */

/*
 * ONE compact contained panel for the bundle a book belongs to. This is a
 * secondary relation, not a chapter: the real bundle title, one action, and a
 * single quiet sage surface — no heading of its own elsewhere on the page.
 */
.ta-books-membership__panel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: clamp(16px, 1.8vw, 28px);
	max-inline-size: 980px;
	padding: clamp(26px, 2.4vw, 34px) clamp(22px, 2vw, 30px);
	border: var(--ta-books-line);
	border-radius: var(--radius-xl);
	background-color: var(--color-sage-100);
}

.ta-books-membership__body {
	flex: 1 1 420px;
	min-inline-size: 0;
}

.ta-books-membership__title {
	margin: 10px 0 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(20px, 1.7vw, 24px);
	font-weight: var(--weight-bold);
	line-height: 1.34;
	text-wrap: balance;
}

.ta-books-membership__action {
	flex: 0 0 auto;
	margin-block-start: 0;
	padding-block-start: 0;
	color: var(--color-gold-action-on-sage);
}

.ta-books-membership__action:hover .ta-icon--directional {
	transform: translateX(-4px);
}

/* ============================================================= Author */

.ta-books-author__panel {
	max-inline-size: 900px;
	padding: clamp(22px, 2vw, 30px);
	border: var(--ta-books-line);
	border-radius: var(--radius-xl);
	background-color: var(--color-surface);
}

.ta-books-author__title {
	margin-block-start: 10px;
	font-size: clamp(24px, 2.2vw, 32px);
}

.ta-books-author__text {
	margin: 14px 0 0;
	color: var(--color-text-muted);
	font-size: 16px;
	line-height: 1.85;
}

.ta-books-author__panel .ta-button {
	margin-block-start: 20px;
}

/* =========================================================== Purchase */

.ta-books-purchase__panel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: clamp(20px, 2vw, 32px);
	padding: clamp(24px, 2.2vw, 32px);
	border: var(--ta-books-line);
	border-radius: var(--radius-xl);
	background-color: var(--color-surface);
	box-shadow: var(--ta-books-shadow);
}

.ta-books-purchase__title {
	margin-block-start: 10px;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(24px, 2.2vw, 32px);
	font-weight: var(--weight-bold);
	line-height: 1.2;
}

.ta-books-purchase__price {
	margin: 12px 0 0;
	color: var(--color-heading);
	font-size: 20px;
	font-weight: var(--weight-bold);
}

.ta-books-purchase__price del {
	color: var(--color-text-muted);
	font-size: 16px;
	font-weight: var(--weight-regular);
}

.ta-books-purchase__price ins {
	text-decoration: none;
}

.ta-books-purchase__action .cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3);
	margin: 0;
}

.ta-books-purchase--hero {
	padding-block-start: clamp(28px, 3vw, 40px);
}

.ta-books-purchase--pending {
	padding-block-start: clamp(24px, 2.6vw, 36px);
}

/* ================================================== Editor-only states */

.ta-books-preview-state,
.ta-books-admin-note {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-4);
	max-inline-size: var(--ta-books-reading);
	padding: clamp(18px, 1.6vw, 22px);
	border: 1px dashed var(--color-border);
	border-radius: var(--radius-lg);
	background-color: var(--color-surface);
}

.ta-books-preview-state__icon {
	display: inline-flex;
	color: var(--color-gold-action);
}

.ta-books-preview-state__body {
	flex: 1 1 260px;
}

.ta-books-preview-state__title,
.ta-books-admin-note__title {
	margin: 0;
	color: var(--color-heading);
	font-size: 15px;
	font-weight: var(--weight-bold);
}

.ta-books-preview-state__text,
.ta-books-admin-note__text {
	margin: 6px 0 0;
	color: var(--color-text-muted);
	font-size: 14px;
	line-height: 1.7;
}

.ta-books-preview-state__action,
.ta-books-admin-note__action {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	color: var(--color-gold-action);
	font-size: 14px;
	font-weight: var(--weight-bold);
	text-decoration: none;
}

.ta-books-preview-state__action:hover .ta-icon--directional,
.ta-books-admin-note__action:hover .ta-icon--directional {
	transform: translateX(-4px);
}

/* ======================================================= Article language */

.ta-books-prose {
	max-inline-size: 780px;
	color: var(--color-text);
	font-size: 18px;
	line-height: 1.92;
}

.ta-books-prose > * + * {
	margin-block-start: 1.1em;
}

.ta-books-prose h2 {
	margin-block-start: 1.5em;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(32px, 2.8vw, 40px);
	font-weight: var(--weight-bold);
	line-height: 1.2;
}

.ta-books-prose h3 {
	margin-block-start: 1.4em;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(24px, 2vw, 29px);
	font-weight: var(--weight-bold);
	line-height: 1.24;
}

.ta-books-prose ul,
.ta-books-prose ol {
	padding-inline-start: 1.4em;
}

.ta-books-prose li + li {
	margin-block-start: 0.5em;
}

.ta-books-prose a {
	color: var(--color-gold-action);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ta-books-prose blockquote {
	margin: 1.5em 0;
	padding-inline-start: 20px;
	border-inline-start: 3px solid var(--color-accent);
	color: var(--color-text-muted);
}

.ta-books-prose figure {
	margin: 1.6em 0;
}

.ta-books-prose img {
	inline-size: 100%;
	block-size: auto;
	border-radius: var(--radius-lg);
}

.ta-books-prose figcaption {
	margin-block-start: 10px;
	color: var(--color-text-muted);
	font-size: 14px;
	text-align: center;
}

.ta-books-prose table {
	inline-size: 100%;
	border-collapse: collapse;
	font-size: 16px;
}

.ta-books-prose th,
.ta-books-prose td {
	padding: 10px 12px;
	border-block-end: var(--ta-books-line);
	text-align: start;
}

/* ================================================================= Motion */

@media (prefers-reduced-motion: reduce) {
	.ta-books-card__link,
	.ta-books-members__link,
	.ta-books-relations__link,
	.ta-books-members__marker {
		transition: none;
	}

	.ta-books-card__link:hover,
	.ta-books-members__link:hover,
	.ta-books-relations__link:hover {
		transform: none;
	}

	.ta-books-card__link:hover .ta-icon--directional,
	.ta-books-relations__link:hover .ta-icon--directional,
	.ta-books-membership__action:hover .ta-icon--directional {
		transform: none;
	}
}

/* ============================================================ Responsive */

@media (max-width: 1119px) {
	.ta-books-hero__media {
		inline-size: 46vw;
	}
}

@media (max-width: 1023px) {
	.ta-books-hero {
		display: flex;
		flex-direction: column;
		min-block-size: 0;
	}

	.ta-books-hero__wrap {
		order: 1;
	}

	.ta-books-hero__media {
		position: relative;
		order: 2;
		inline-size: 100%;
		margin-block-start: clamp(28px, 4vw, 40px);
		block-size: clamp(220px, 34vw, 300px);
	}

	.ta-books-hero__media::after {
		display: none;
	}

	.ta-books-hero__frame,
	html[dir="ltr"] .ta-books-hero__frame {
		border-radius: 0;
	}

	.ta-books-product-hero__grid {
		grid-template-columns: minmax(0, 1fr) clamp(280px, 30vw, 340px);
		gap: clamp(28px, 3.6vw, 44px);
	}

	.ta-books-members {
		max-inline-size: none;
	}
}

@media (max-width: 899px) {
	/* Below this width the split hero stops being comfortable, so the copy leads
	   and the cover stage follows it. */
	.ta-books-product-hero__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(28px, 4vw, 40px);
	}

	.ta-books-product-hero__stage {
		order: 2;
		max-inline-size: 420px;
	}
}

@media (max-width: 767px) {
	.ta-books-head {
		align-items: flex-start;
	}

	.ta-books-purchase__panel {
		flex-direction: column;
		align-items: stretch;
	}

	.ta-books-purchase__action .cart {
		justify-content: stretch;
	}

	.ta-books-purchase__action .button {
		inline-size: 100%;
	}

	.ta-books-members {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 559px) {
	.ta-books-hero__title {
		font-size: clamp(34px, 9vw, 40px);
	}

	.ta-books-product-hero__title {
		font-size: clamp(34px, 10.5vw, 42px);
	}

	.ta-books-product-hero__stage {
		/* A definite width, not a max: the cover frame is sized as a percentage of
		   the stage, so a stage that shrank to its content would collapse it. */
		inline-size: min(100%, 320px);
		margin-inline: auto;
	}

	.ta-books-product-hero__frame {
		inline-size: min(100%, 250px);
	}
}

/* ------------------------------------------------------- Product hero author */

/*
 * One compact factual line under the title: who wrote this book, and the way to
 * read about her. Deliberately quiet — it states a fact, it does not compete with
 * the title or the purchase block.
 */
.ta-books-product-hero__author {
	margin-block-start: 10px;
	color: var(--color-text-muted);
	font-size: 14px;
	line-height: 1.6;
}

.ta-books-product-hero__author a {
	color: var(--color-green-900);
	font-weight: var(--weight-bold);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.ta-books-product-hero__author a:hover {
	text-decoration-color: var(--color-gold-action);
}

.ta-books-product-hero__author a:focus-visible {
	outline: 2px solid var(--color-green-900);
	outline-offset: 2px;
	border-radius: var(--radius-xs);
}

/* ------------------------------------------------------- Phone book cards */

@media (max-width: 559px) {
	.ta-books-card__body {
		padding: 14px 14px 16px;
	}

	.ta-books-card__title {
		font-size: clamp(18px, 4.6vw, 20px);
		line-height: 1.32;
		min-block-size: 0;
	}

	.ta-books-card__format {
		font-size: 12px;
	}

	.ta-books-card__facts {
		margin-block-start: 8px;
	}

	.ta-books-card__price {
		margin-block-start: 8px;
		font-size: 15px;
	}

	.ta-books-card__cta {
		padding-block-start: 12px;
		font-size: 14px;
	}
}
