/*
 * Tarot Arabi — P07 Tarot card library
 *
 * The card library, the arcana and suit hubs, and the individual card page.
 *
 * This is a composition layer, not a fourth design language: tokens, buttons,
 * breadcrumbs, icons and the page grid all come from the global layers, and the
 * library hero mirrors the approved P06 hero geometry so the card section is
 * unmistakably part of the same site. What is its own is the card object — a
 * portrait artwork slot, a compact reference card, a reading page with a
 * portrait stage — because Tarot cards are portrait objects and the P06
 * landscape heroes cannot hold them.
 *
 * Loaded only on card library surfaces: the homepage keeps its own card
 * component and the Learn family keeps its own system.
 */

/* ============================================================== Foundation */

.ta-cards {
	/* The library hero mirrors the approved P06 hero geometry. */
	--ta-cards-hero-top: clamp(28px, 3.4vw, 48px);
	--ta-cards-hero-copy: 540px;
	--ta-cards-hero-arc: clamp(380px, 30vw, 440px);
	--ta-cards-hero-arc-bite: 105px;

	--ta-cards-line: 1px solid var(--color-border);
	--ta-cards-shadow: 0 4px 18px rgba(23, 79, 58, 0.06);
	--ta-cards-shadow-hover: 0 12px 30px rgba(23, 79, 58, 0.1);
	--ta-cards-reading: 800px;

	background-color: var(--color-bg);
	color: var(--color-text);
	overflow-x: clip; /* the hero field may bleed; the page never scrolls sideways */
}

/*
 * The same wide page grid the Learn hub uses: ~1200px of content at 1440.
 *
 * The wrapper primitive itself lives in learn.css, which card surfaces do not
 * load, so the library carries the complete definition rather than only the
 * width: without the auto margins and the gutter the content would sit flush
 * against the physical right edge of the viewport.
 */
.ta-cards .ta-ec-wrap,
.ta-cards-read__wrap {
	inline-size: 100%;
	max-inline-size: 1264px;
	margin-inline: auto;
	padding-inline: clamp(20px, 2.2vw, 32px);
}

/*
 * The same brass eyebrow register the Guide and Secondary hub use — and the
 * whole approved eyebrow treatment with it.
 *
 * The eyebrow's typography base lives in the homepage and Learn layers, neither
 * of which a card surface loads, so without this the eyebrow inherits the body's
 * 400 weight, its 16px size and its loose leading — which is what every card
 * page was rendering until now. It is stated once here so the whole family
 * shares one eyebrow.
 */
.ta-cards .ta-eyebrow {
	margin: 0;
	color: var(--color-gold-action);
	font-size: clamp(14px, 1.05vw, 16px);
	font-weight: var(--weight-bold);
	line-height: 1.5;
}

/*
 * 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-cards > article > * {
	padding-block: 0;
}

.ta-cards > article > .ta-cards-hero,
.ta-cards > article > .ta-cards-single-hero {
	padding-block-start: var(--ta-cards-hero-top);
}

.ta-cards > article > .ta-cards-section {
	padding-block-start: var(--ta-section-gap);
}

.ta-cards > article > :last-child {
	padding-block-end: var(--ta-section-gap);
}

/* ------------------------------------------------------------ Section head */

.ta-cards-head {
	max-inline-size: 760px;
	margin-block-end: clamp(28px, 2.8vw, 36px);
}

.ta-cards-head .ta-eyebrow {
	margin: 0 0 10px;
}

.ta-cards-h2 {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(32px, 3vw, 46px);
	font-weight: var(--weight-bold);
	line-height: 1.2;
	text-wrap: balance;
}

.ta-cards-lead {
	margin: var(--space-3) 0 0;
	max-inline-size: 68ch;
	color: var(--color-text-muted);
	font-size: clamp(16px, 1.15vw, 18px);
	line-height: 1.8;
}

/* The Page's own editor-owned body, on the hub pages. */
.ta-cards-prose {
	max-inline-size: 68ch;
	font-size: 18px;
	line-height: 1.9;
}

.ta-cards-prose > * + * {
	margin-block-start: 1.3em;
}

.ta-cards-prose h2,
.ta-cards-prose h3 {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-weight: var(--weight-bold);
	line-height: 1.25;
}

.ta-cards-prose a {
	color: var(--color-green-900);
	font-weight: var(--weight-bold);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------- Library hero */

.ta-cards-hero {
	position: relative;
	min-block-size: clamp(400px, 30vw, 440px);
}

.ta-cards-hero__wrap {
	position: relative;
	z-index: 2;
}

.ta-cards-hero__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	max-inline-size: var(--ta-cards-hero-copy);
	margin-inline-end: auto; /* RTL: the copy keeps the page grid's right edge */
}

.ta-cards-hero__eyebrow {
	margin: clamp(20px, 1.6vw, 22px) 0 0;
}

.ta-cards-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-cards-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-cards-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-cards-hero-copy) - clamp(20px, 2.2vw, 32px) - 16px)
	);
}

.ta-cards-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-cards-hero__frame {
	border-radius: 0 18px 18px 0;
}

.ta-cards-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-cards-hero__media::after {
	content: "";
	position: absolute;
	z-index: 2;
	inset-block-start: 54%;
	inset-inline-start: calc(var(--ta-cards-hero-arc-bite) - var(--ta-cards-hero-arc));
	inline-size: var(--ta-cards-hero-arc);
	block-size: var(--ta-cards-hero-arc);
	border-radius: 50%;
	background-color: var(--color-bg);
	transform: translateY(-50%);
	pointer-events: none;
}

/* ------------------------------------------------------------- Media plate */

/*
 * The neutral plate. It is not drawn artwork: a soft Sage → Ivory wash with a
 * hairline edge, sized and rounded exactly like the media it stands in for, so
 * supplying the real image changes nothing but the pixels. The container owns
 * the ratio, so the same plate serves a landscape hero and a portrait card.
 */
.ta-cards-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(158deg, var(--color-sage-100) 0%, var(--color-ivory) 52%, var(--color-surface-warm) 100%);
}

/*
 * The card's own canonical name, held quietly in the lower part of the plate.
 * It is real structural identity rather than decoration: it is what stops a
 * library of empty slots reading as seventy-eight identical blanks. It is
 * decorative for assistive technology, because the card's name is already the
 * title of the card below it.
 */
.ta-cards-plate__label {
	position: absolute;
	inset-block-end: 14%;
	inset-inline: 14%;
	color: rgba(23, 79, 58, 0.42);
	font-family: var(--font-heading);
	font-size: clamp(13px, 1vw, 15px);
	font-weight: var(--weight-bold);
	line-height: 1.4;
	text-align: center;
	text-wrap: balance;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* Author-facing marker: the same plate, naming what is missing instead. */
.ta-cards-plate--admin .ta-cards-plate__label {
	inset-block-end: 10px;
	inset-inline: 10px auto;
	max-inline-size: calc(100% - 20px);
	padding: 3px 8px;
	border-radius: 6px;
	background-color: rgba(255, 255, 255, 0.9);
	color: rgba(23, 79, 58, 0.55);
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: var(--weight-medium);
	line-height: 1.3;
	text-align: start;
	white-space: nowrap;
	display: block;
	text-overflow: ellipsis;
}

/* ===================================================== Branch + suit cards */

.ta-cards-branches__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(24px, 2vw, 28px);
}

/*
 * A substantial editorial navigation card: content on the reading side, media
 * opposite. These are the two entry points to the whole library, so they are
 * sized and weighted like a landing card rather than a utility link.
 */
.ta-cards-branch__link {
	display: grid;
	grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); /* content ~58%, media ~42% */
	align-items: stretch;
	block-size: 100%;
	min-block-size: clamp(240px, 18vw, 280px);
	overflow: hidden;
	border: var(--ta-cards-line);
	border-radius: 22px;
	background-color: var(--color-surface);
	box-shadow: var(--ta-cards-shadow);
	color: inherit;
	text-decoration: none;
	transition:
		transform var(--duration-standard) var(--ease-interaction),
		box-shadow var(--duration-standard) var(--ease-interaction);
}

.ta-cards-branch__link:hover {
	transform: translateY(-3px);
	box-shadow: var(--ta-cards-shadow-hover);
}

.ta-cards-branch__link:focus-visible {
	outline: var(--focus-outline-width) solid var(--color-green-900);
	outline-offset: 3px;
}

.ta-cards-branch__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	justify-content: center;
	padding: clamp(24px, 2.4vw, 34px);
}

.ta-cards-branch__eyebrow {
	color: var(--color-gold-action);
	font-size: 13px;
	font-weight: var(--weight-bold);
	line-height: 1.5;
}

.ta-cards-branch__title {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(26px, 2.1vw, 30px);
	font-weight: var(--weight-bold);
	line-height: 1.25;
}

.ta-cards-branch__text {
	color: var(--color-text-muted);
	font-size: clamp(15px, 1.1vw, 16px);
	line-height: 1.7;
}

.ta-cards-branch__count {
	padding: 4px 12px;
	border-radius: 8px;
	background-color: var(--color-sage-100);
	color: var(--color-green-900);
	font-size: 14px;
	font-weight: var(--weight-bold);
	line-height: 1.5;
}

.ta-cards-branch__cta,
.ta-cards-suit__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-block-start: auto;
	padding-block-start: 12px;
	color: var(--color-green-900);
	font-size: 15px;
	font-weight: var(--weight-bold);
}

.ta-cards-branch__cta .ta-icon--directional,
.ta-cards-suit__cta .ta-icon--directional {
	transition: transform var(--duration-interaction) var(--ease-interaction);
}

.ta-cards-branch__link:hover .ta-cards-branch__cta .ta-icon--directional,
.ta-cards-branch__link:focus-visible .ta-cards-branch__cta .ta-icon--directional,
.ta-cards-suit__link:hover .ta-cards-suit__cta .ta-icon--directional,
.ta-cards-suit__link:focus-visible .ta-cards-suit__cta .ta-icon--directional {
	transform: translateX(-4px);
}

[dir="ltr"] .ta-cards-branch__link:hover .ta-cards-branch__cta .ta-icon--directional,
[dir="ltr"] .ta-cards-branch__link:focus-visible .ta-cards-branch__cta .ta-icon--directional,
[dir="ltr"] .ta-cards-suit__link:hover .ta-cards-suit__cta .ta-icon--directional,
[dir="ltr"] .ta-cards-suit__link:focus-visible .ta-cards-suit__cta .ta-icon--directional {
	transform: translateX(4px);
}

.ta-cards-branch__media {
	position: relative;
	display: block;
	overflow: hidden;
	background-color: var(--color-sage-100);
}

.ta-cards-branch__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

/*
 * Four category cards in one row, in the same family as the specialization
 * cards: media at the physical left with a Tarot-appropriate share, text beside
 * it. Horizontal, because the suit name and its count need a reading line.
 */
.ta-cards-suits__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(18px, 1.5vw, 22px);
}

.ta-cards-suit__link {
	display: grid;
	grid-template-columns: minmax(0, 0.68fr) minmax(0, 1fr); /* media ~40% */
	align-items: stretch;
	block-size: 100%;
	min-block-size: clamp(165px, 12.5vw, 190px);
	overflow: hidden;
	border: var(--ta-cards-line);
	border-radius: 18px;
	background-color: var(--color-surface);
	box-shadow: var(--ta-cards-shadow);
	color: inherit;
	text-decoration: none;
	transition:
		transform var(--duration-standard) var(--ease-interaction),
		box-shadow var(--duration-standard) var(--ease-interaction);
}

.ta-cards-suit__link:hover {
	transform: translateY(-3px);
	box-shadow: var(--ta-cards-shadow-hover);
}

.ta-cards-suit__link:focus-visible {
	outline: var(--focus-outline-width) solid var(--color-green-900);
	outline-offset: 3px;
}

.ta-cards-suit__media {
	position: relative;
	display: block;
	block-size: 100%;
	overflow: hidden;
	background-color: var(--color-sage-100);
}

.ta-cards-suit__media img {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.ta-cards-suit__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
	justify-content: center;
	min-inline-size: 0;
	padding: clamp(16px, 1.4vw, 20px);
}

.ta-cards-suit__eyebrow {
	padding: 3px 10px;
	border-radius: 8px;
	background-color: var(--color-sage-100);
	color: var(--color-green-900);
	font-size: 13px;
	font-weight: var(--weight-bold);
	line-height: 1.5;
}

.ta-cards-suit__title {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(19px, 1.5vw, 22px);
	font-weight: var(--weight-bold);
	line-height: 1.3;
}

.ta-cards-suit__text {
	display: -webkit-box;
	overflow: hidden;
	color: var(--color-text-muted);
	font-size: 14px;
	line-height: 1.6;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.ta-cards-suit__cta {
	margin-block-start: auto;
	padding-block-start: 10px;
	font-size: 14px;
	white-space: nowrap;
}

/* ------------------------------------------- Minor hub: featured suit cards */

/*
 * On the Minor Arcana hub the four suits are the page's primary branches, not a
 * row of shortcuts, so they take the larger card: two by two, editorial content
 * on the reading side, the suit's own image touching the physical-left edge, and
 * one circular affordance between them.
 *
 * This is a variant of the shared suit card, not a change to it: the compact
 * four-column card on the main library keeps its own geometry, surface and
 * hover grammar untouched, and the surface, radius and motion here come from the
 * base component.
 */
.ta-cards-suitnav__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 22px 26px; /* block, inline */
}

/* The section's own heading → grid rhythm, scoped so the shared heading rule
   used elsewhere is untouched. */
.ta-cards-suitnav .ta-cards-head {
	margin-block-end: clamp(32px, 2.6vw, 36px);
}

.ta-cards-suit--featured .ta-cards-suit__link {
	grid-template-columns: minmax(0, 1fr) auto 38%; /* content, cue, media */
	gap: clamp(14px, 1.4vw, 20px);
	min-block-size: clamp(200px, 15vw, 230px);
	border-radius: 20px;
}

/* The larger card lifts a touch less than the compact one. */
.ta-cards-suit--featured .ta-cards-suit__link:hover {
	transform: translateY(-2px);
}

.ta-cards-suit--featured .ta-cards-suit__body {
	gap: 8px;
	justify-content: center;
	padding: clamp(22px, 2.2vw, 30px);
}

.ta-cards-suit--featured .ta-cards-suit__title {
	font-size: clamp(26px, 1.95vw, 28px);
}

.ta-cards-suit--featured .ta-cards-suit__text {
	display: -webkit-box;
	overflow: hidden;
	max-inline-size: 46ch;
	font-size: clamp(15px, 1.1vw, 16px);
	line-height: 1.75;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.ta-cards-suit--featured .ta-cards-suit__cta {
	margin-block-start: 0;
	padding-block-start: 12px;
	font-size: 15px;
}

/* The one cue: a circular affordance on the physical-left side of the card. */
.ta-cards-suit--featured .ta-cards-suit__arrow {
	align-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: clamp(42px, 3.2vw, 44px);
	block-size: clamp(42px, 3.2vw, 44px);
	border: 1px solid rgba(198, 161, 91, 0.45);
	border-radius: 50%;
	background-color: var(--color-ivory);
	color: var(--color-green-900);
}

.ta-cards-suit--featured .ta-cards-suit__arrow .ta-icon--directional {
	transition: transform var(--duration-interaction) var(--ease-interaction);
}

.ta-cards-suit--featured .ta-cards-suit__link:hover .ta-cards-suit__arrow .ta-icon--directional,
.ta-cards-suit--featured .ta-cards-suit__link:focus-visible .ta-cards-suit__arrow .ta-icon--directional {
	transform: translateX(-4px);
}

[dir="ltr"] .ta-cards-suit--featured .ta-cards-suit__link:hover .ta-cards-suit__arrow .ta-icon--directional,
[dir="ltr"] .ta-cards-suit--featured .ta-cards-suit__link:focus-visible .ta-cards-suit__arrow .ta-icon--directional {
	transform: translateX(4px);
}

/* -------------------------------------------------------------- Card grid */

/*
 * The whole inventory lives inside one contained browser panel: its heading
 * cluster, the live count, the filters, the grid and the expand control are one
 * composition rather than a heading floating above an open wall of cards.
 */
.ta-cards-panel {
	padding: clamp(28px, 2.6vw, 40px);
	border: var(--ta-cards-line);
	border-radius: clamp(28px, 2.2vw, 32px);
	background-color: var(--color-surface);
	box-shadow: var(--ta-cards-shadow);
}

.ta-cards-panel__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: clamp(20px, 2.4vw, 36px);
	margin-block-end: clamp(28px, 2.2vw, 32px);
}

.ta-cards-panel__intro {
	max-inline-size: 720px;
}

.ta-cards-panel__intro .ta-eyebrow {
	margin: 0 0 10px;
}

/* The real inventory count, on the opposite side of the heading cluster. */
.ta-cards-panel__count {
	flex: 0 0 auto;
	margin: 0;
	padding: 6px 16px;
	border-radius: var(--radius-pill);
	background-color: var(--color-sage-100);
	color: var(--color-green-900);
	font-size: 15px;
	font-weight: var(--weight-bold);
	line-height: 1.5;
	white-space: nowrap;
}

/* Five columns, because readable Arabic titles and visible artwork matter more
   than fitting the maximum number of records in a row. */
.ta-cards-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: clamp(18px, 1.4vw, 20px);
}

.ta-cards-more {
	display: flex;
	justify-content: center;
	margin-block-start: clamp(28px, 2.4vw, 36px);
}

/*
 * A collapsed card, an empty notice and the expand control must be genuinely
 * absent, not merely styled away: an author `display` would otherwise beat the
 * user agent's `[hidden]` rule and leave a hidden control in the tab order.
 */
.ta-cards-grid .ta-cards-card[hidden],
.ta-cards-more[hidden],
.ta-cards-empty[hidden] {
	display: none;
}

.ta-cards-more__button {
	min-block-size: 48px;
	padding-inline: clamp(22px, 2vw, 28px);
}

.ta-cards-grid--related {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(16px, 1.5vw, 20px);
}

/*
 * One card language for every card in the library: the artwork, the canonical
 * Arabic name and one structural label. The whole card is one anchor, so there
 * is a single tab stop and never a nested control.
 */
.ta-cards-card {
	min-inline-size: 0;
}

.ta-cards-card__link {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	block-size: 100%;
	overflow: hidden;
	border: var(--ta-cards-line);
	border-radius: 16px;
	background-color: var(--color-surface);
	box-shadow: var(--ta-cards-shadow);
	color: inherit;
	text-decoration: none;
	transition:
		transform 200ms var(--ease-interaction),
		box-shadow 200ms var(--ease-interaction),
		border-color 200ms var(--ease-interaction);
}

.ta-cards-card__link:hover {
	transform: translateY(-3px);
	border-color: rgba(23, 79, 58, 0.18);
	box-shadow: var(--ta-cards-shadow-hover);
}

.ta-cards-card__link:focus-visible {
	outline: var(--focus-outline-width) solid var(--color-green-900);
	outline-offset: 3px;
}

/* Portrait, because Tarot artwork is portrait. The image is never mirrored.
   The frame matches the supplied artwork's native 350×600 ratio, so `cover`
   crops nothing. */
.ta-cards-card__media {
	display: block;
	aspect-ratio: 7 / 12;
	overflow: hidden;
	background-color: var(--color-ivory);
}

.ta-cards-card__media img {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	transition: transform 220ms var(--ease-interaction);
}

.ta-cards-card__link:hover .ta-cards-card__media img {
	transform: scale(1.02);
}

.ta-cards-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: clamp(11px, 0.95vw, 12px);
}

/*
 * A fixed two-line title block: a long Arabic card name can never push one
 * card's geometry out of line with the rest of its row.
 */
.ta-cards-card__title {
	display: -webkit-box;
	overflow: hidden;
	min-block-size: 2.6em;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(17px, 1.2vw, 18px);
	font-weight: var(--weight-bold);
	line-height: 1.3;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.ta-cards-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	color: var(--color-text-muted);
	font-size: 12px;
	line-height: 1.5;
}

/* The one structural badge a card carries: its branch, or its suit. */
.ta-cards-card__label {
	color: var(--color-green-900);
	font-size: 12px;
	font-weight: var(--weight-bold);
}

.ta-cards-card__number {
	color: var(--color-text-muted);
	font-size: 12px;
	font-weight: var(--weight-medium);
	font-variant-numeric: tabular-nums;
}

.ta-cards-card__state {
	color: var(--color-text-muted);
	font-size: 11px;
	font-weight: var(--weight-medium);
}

/* ------------------------------------------------------------- Filter bar */

.ta-cards-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-block-end: clamp(28px, 2.2vw, 32px);
}

.ta-cards-filter {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	padding-inline: 20px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-pill);
	background-color: var(--color-ivory);
	color: var(--color-green-900);
	font-family: inherit;
	font-size: 15px;
	font-weight: var(--weight-bold);
	line-height: 1;
	cursor: pointer;
	transition:
		background-color var(--duration-interaction) var(--ease-interaction),
		border-color var(--duration-interaction) var(--ease-interaction),
		color var(--duration-interaction) var(--ease-interaction);
}

.ta-cards-filter:hover {
	border-color: rgba(23, 79, 58, 0.35);
}

.ta-cards-filter:focus-visible {
	outline: var(--focus-outline-width) solid var(--color-green-900);
	outline-offset: 2px;
}

/* The pressed state is never colour alone: it also fills the surface. */
.ta-cards-filter.is-active {
	border-color: var(--color-green-900);
	background-color: var(--color-green-900);
	color: var(--color-white);
}

.ta-cards-empty {
	margin: 0;
	padding: var(--space-8) var(--space-6);
	border: 1px dashed var(--color-border);
	border-radius: var(--radius-md);
	color: var(--color-text-muted);
	font-size: var(--text-body);
	text-align: center;
}

.ta-cards-note {
	margin: 0 0 clamp(18px, 1.8vw, 24px);
	color: var(--color-text-muted);
	font-size: 13px;
	line-height: 1.6;
}

/* ================================================== Individual card page */

/*
 * The card hero is contained, not full-bleed: the artwork is a portrait object
 * and must stay one. Copy keeps the reading side; the stage sits opposite with
 * generous whitespace.
 */
/*
 * One contained hero: the portrait stage at the physical left and the whole
 * identity cluster at the physical right, vertically centred against it so the
 * two read as ONE composition rather than an image and a floating title.
 */
.ta-cards-single-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 448px); /* copy, stage */
	align-items: center;
	gap: clamp(40px, 5vw, 76px);
	margin-block-start: clamp(20px, 2.4vw, 36px);
}

.ta-cards-single-hero__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	min-inline-size: 0;
	max-inline-size: 660px;
}

.ta-cards-single-hero__eyebrow {
	margin: clamp(26px, 2vw, 28px) 0 0;
}

.ta-cards-single-hero__title {
	margin: clamp(12px, 1vw, 14px) 0 0;
	max-inline-size: 580px;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(40px, 4.4vw, 62px);
	font-weight: var(--weight-bold);
	line-height: 1.15;
	text-wrap: balance;
}

.ta-cards-single-hero__lead {
	margin: clamp(20px, 1.6vw, 24px) 0 0;
	max-inline-size: 580px;
	color: var(--color-text-muted);
	font-size: 18px;
	line-height: 1.85;
}

/*
 * One quiet factual row: the tradition, the branch, and for a Minor card its
 * suit and rank, plus the canonical number where the card has one. Real
 * structure only — never a stable key or a post ID.
 */
.ta-cards-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: clamp(24px, 2vw, 28px) 0 0;
	padding: 0;
	list-style: none;
}

.ta-cards-facts__item {
	display: inline-flex;
	align-items: center;
	min-block-size: 28px;
	padding-inline: 12px;
	border: var(--ta-cards-line);
	border-radius: 9px;
	background-color: var(--color-surface);
	color: var(--color-green-900);
	font-size: 13.5px;
	font-weight: var(--weight-bold);
	line-height: 1;
}

.ta-cards-facts__item--sage {
	border-color: transparent;
	background-color: var(--color-sage-100);
}

/*
 * The artwork stage: a Sage panel with one offset Ivory backing plate behind the
 * portrait, so the card reads with depth through layout alone. No ornamental
 * frame, no drawn symbols — the artwork will supply the richness later.
 */
.ta-cards-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-block-size: clamp(520px, 42vw, 600px);
	padding: clamp(24px, 2.4vw, 34px);
	border: var(--ta-cards-line);
	border-radius: 30px;
	background-color: var(--color-sage-100);
}

.ta-cards-stage__backing,
.ta-cards-stage__frame {
	inline-size: 100%;
	max-inline-size: 330px;
	aspect-ratio: 7 / 12;
}

.ta-cards-stage__backing {
	position: absolute;
	inset: 0;
	margin: auto;
	border-radius: 18px;
	background-color: var(--color-ivory);
	transform: translate(-16px, 16px); /* RTL: offset away from the copy */
}

html[dir="ltr"] .ta-cards-stage__backing {
	transform: translate(16px, 16px);
}

.ta-cards-stage__frame {
	position: relative;
	z-index: 1;
	display: block;
	overflow: hidden;
	border-radius: 18px;
	background-color: var(--color-ivory);
	box-shadow: var(--ta-cards-shadow);
}

.ta-cards-stage__image {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

/* -------------------------------------------------------- Reading column */

/*
 * The article sits on Warm Ivory at the reading side of the page grid, at a
 * comfortable Arabic measure. Ordinary paragraphs are never boxed; only a note
 * or a real callout takes a surface.
 */
.ta-cards-read__intro,
.ta-cards-read__section,
.ta-cards-split,
.ta-cards-preview-state {
	max-inline-size: 780px;
	margin-inline-end: auto; /* RTL: the reading (physical right) edge */
}

.ta-cards-read__intro {
	margin-block-end: clamp(28px, 2.6vw, 40px);
	font-size: 18px;
	line-height: 1.95;
}

.ta-cards-read__intro p {
	margin: 0 0 1.45em;
}

.ta-cards-read__intro p:last-child {
	margin-block-end: 0;
}

.ta-cards-read__intro a {
	color: var(--color-green-900);
	font-weight: var(--weight-bold);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Editorial subsection rhythm: an H2 is a section of ONE article, not a page
   chapter, so it never takes the major-section token. */
.ta-cards-read__section + .ta-cards-read__section,
.ta-cards-read__section + .ta-cards-split,
.ta-cards-split + .ta-cards-read__section {
	margin-block-start: clamp(48px, 4.4vw, 64px);
}

.ta-cards-read__title {
	margin: 0 0 clamp(12px, 1.2vw, 18px);
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(28px, 2.6vw, 40px);
	font-weight: var(--weight-bold);
	line-height: 1.25;
	text-wrap: balance;
}

.ta-cards-read__body {
	font-size: 18px;
	line-height: 1.95;
}

.ta-cards-read__body p {
	margin: 0 0 1.45em;
}

.ta-cards-read__body p:last-child {
	margin-block-end: 0;
}

.ta-cards-read__body h3 {
	margin: clamp(32px, 3vw, 44px) 0 0.5em;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(24px, 1.9vw, 30px);
	font-weight: var(--weight-bold);
	line-height: 1.3;
}

.ta-cards-read__body ul,
.ta-cards-read__body ol {
	margin: 0 0 1.45em;
	padding-inline-start: 1.5em;
}

.ta-cards-read__body li {
	margin-block-end: 0.5em;
}

.ta-cards-read__body li::marker {
	color: var(--color-green-900);
	font-weight: var(--weight-bold);
}

.ta-cards-read__body a {
	color: var(--color-green-900);
	font-weight: var(--weight-bold);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ta-cards-read__body strong {
	color: var(--color-heading);
	font-weight: var(--weight-bold);
}

/* A restrained Sage callout for a real note, with one brass logical edge. */
.ta-cards-read__section--note .ta-cards-read__body {
	padding: clamp(22px, 2.2vw, 28px);
	border: var(--ta-cards-line);
	border-inline-start: 3px solid var(--color-gold-action);
	border-radius: 16px;
	background-color: var(--color-sage-100);
	font-size: clamp(17px, 1.25vw, 19px);
	line-height: 1.85;
}

.ta-cards-review {
	margin: var(--space-4) 0 0;
	color: var(--color-text-muted);
	font-size: 13px;
	line-height: 1.6;
}

/* ---------------------------------------------------------- Key themes */

.ta-cards-themes {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ta-cards-themes__item {
	padding: 6px 14px;
	border: 1px solid rgba(23, 79, 58, 0.12);
	border-radius: 8px;
	background-color: var(--color-sage-100);
	color: var(--color-green-900);
	font-size: 14px;
	font-weight: var(--weight-medium);
	line-height: 1.5;
}

/* ------------------------------------------------- Two-column editorial */

.ta-cards-split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(28px, 3vw, 48px);
	align-items: start;
}

.ta-cards-split--single {
	grid-template-columns: minmax(0, 1fr);
}

.ta-cards-split__part + .ta-cards-split__part {
	margin-block-start: clamp(20px, 2vw, 28px);
}

.ta-cards-split__label {
	margin: 0 0 8px;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(17px, 1.35vw, 19px);
	font-weight: var(--weight-bold);
	line-height: 1.4;
}

/* ------------------------------------------------------ Preview state */

.ta-cards-preview-state {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: clamp(14px, 1.6vw, 20px);
	max-inline-size: 780px;
	min-block-size: 132px;
	padding: clamp(24px, 2.4vw, 30px);
	border: var(--ta-cards-line);
	border-radius: 20px;
	background-color: var(--color-surface);
	box-shadow: var(--ta-cards-shadow);
}

.ta-cards-preview-state__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 38px;
	block-size: 38px;
	border-radius: 50%;
	background-color: var(--color-sage-100);
	color: var(--color-green-900);
}

.ta-cards-preview-state__title {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(17px, 1.4vw, 19px);
	font-weight: var(--weight-bold);
	line-height: 1.4;
}

.ta-cards-preview-state__text {
	margin: 4px 0 0;
	color: var(--color-text-muted);
	font-size: 15px;
	line-height: 1.6;
}

.ta-cards-preview-state__action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border: 1px solid var(--color-border);
	border-radius: 10px;
	background-color: var(--color-ivory);
	color: var(--color-green-900);
	font-size: 14px;
	font-weight: var(--weight-bold);
	text-decoration: none;
	white-space: nowrap;
}

.ta-cards-preview-state__action:hover {
	border-color: rgba(23, 79, 58, 0.35);
	background-color: var(--color-sage-100);
	color: var(--color-action-hover);
}

.ta-cards-preview-state__action:focus-visible {
	outline: var(--focus-outline-width) solid var(--color-green-900);
	outline-offset: 2px;
}

/* ------------------------------------------------------- Deeper learning */

/*
 * A contained conversion panel with real balance: the destination's own artwork
 * at the physical left, and the message with its action grouped at the physical
 * right. The action is never detached across the panel.
 */
.ta-cards-deeper__panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 36%); /* copy, media */
	align-items: stretch;
	gap: clamp(24px, 2.6vw, 40px);
	min-block-size: clamp(210px, 16vw, 250px);
	padding: clamp(22px, 1.8vw, 26px) clamp(24px, 2.2vw, 32px);
	border-radius: 30px;
	background-color: var(--color-sage-100);
}

.ta-cards-deeper__panel--deep {
	background-color: var(--color-green-900);
	background-image: linear-gradient(150deg, var(--color-green-950) 0%, var(--color-green-900) 72%);
	color: var(--color-white);
}

.ta-cards-deeper__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	min-inline-size: 0;
}

.ta-cards-deeper__panel--deep .ta-eyebrow {
	color: var(--color-gold);
}

.ta-cards-deeper__title {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(26px, 2.5vw, 38px);
	font-weight: var(--weight-bold);
	line-height: 1.22;
	text-wrap: balance;
}

.ta-cards-deeper__panel--deep .ta-cards-deeper__title {
	color: var(--color-white);
}

.ta-cards-deeper__text {
	margin: var(--space-3) 0 0;
	max-inline-size: 62ch;
	color: var(--color-text-muted);
	font-size: clamp(16px, 1.2vw, 18px);
	line-height: 1.8;
}

.ta-cards-deeper__panel--deep .ta-cards-deeper__text {
	color: rgba(255, 255, 255, 0.82);
}

/* The action belongs directly beneath the copy it acts on. */
.ta-cards-deeper__action {
	flex: 0 0 auto;
	margin-block-start: clamp(24px, 2vw, 28px);
	min-block-size: clamp(48px, 3.6vw, 52px);
	padding-inline: clamp(22px, 2vw, 28px);
	border-color: var(--color-ivory);
	background-color: var(--color-ivory);
	color: var(--color-green-900);
}

.ta-cards-deeper__action:hover {
	border-color: var(--color-white);
	background-color: var(--color-white);
	color: var(--color-green-950);
}

.ta-cards-deeper__action:focus-visible {
	outline-color: var(--color-white);
}

.ta-cards-deeper__media {
	display: block;
	overflow: hidden;
	border-radius: 20px;
	background-color: var(--color-surface);
}

.ta-cards-deeper__media img,
.ta-cards-deeper__media .ta-cards-plate {
	inline-size: 100%;
	block-size: 100%;
	min-block-size: 100%;
	object-fit: cover;
}

/* --------------------------------------------------- Previous / next */

/*
 * Two contained panels inside the page's own wrapper. A card at the end of its
 * group keeps its own half rather than stretching across the page, and sits on
 * the side its direction implies.
 */
.ta-cards-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(20px, 1.8vw, 24px);
}

.ta-cards-nav--next-only .ta-cards-nav__link--next {
	grid-column: 2; /* RTL: the physical left, where "next" points */
}

.ta-cards-nav__link {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: clamp(14px, 1.4vw, 20px);
	min-block-size: clamp(140px, 11vw, 165px);
	padding: clamp(20px, 1.8vw, 24px);
	border: var(--ta-cards-line);
	border-radius: 20px;
	background-color: var(--color-surface);
	box-shadow: var(--ta-cards-shadow);
	color: inherit;
	text-decoration: none;
	transition:
		transform var(--duration-standard) var(--ease-interaction),
		box-shadow var(--duration-standard) var(--ease-interaction);
}

.ta-cards-nav__link:hover {
	transform: translateY(-3px);
	box-shadow: var(--ta-cards-shadow-hover);
}

.ta-cards-nav__link:focus-visible {
	outline: var(--focus-outline-width) solid var(--color-green-900);
	outline-offset: 3px;
}

.ta-cards-nav__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	min-inline-size: 0;
}

.ta-cards-nav__direction {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--color-text-muted);
	font-size: 13px;
	font-weight: var(--weight-bold);
}

.ta-cards-nav__arrow {
	display: inline-flex;
	color: var(--color-green-900);
	transition: transform var(--duration-interaction) var(--ease-interaction);
}

/* The shared directional grammar: the cue leads, the label stays put. */
.ta-cards-nav__link--next .ta-cards-nav__arrow {
	transform: none;
}

.ta-cards-nav__link--next:hover .ta-cards-nav__arrow,
.ta-cards-nav__link--next:focus-visible .ta-cards-nav__arrow {
	transform: translateX(-4px);
}

[dir="ltr"] .ta-cards-nav__link--next:hover .ta-cards-nav__arrow,
[dir="ltr"] .ta-cards-nav__link--next:focus-visible .ta-cards-nav__arrow {
	transform: translateX(4px);
}

/* Backward is the same glyph turned around, never a mirrored image. */
.ta-cards-nav__link--previous .ta-cards-nav__arrow {
	transform: rotate(180deg);
}

.ta-cards-nav__link--previous:hover .ta-cards-nav__arrow,
.ta-cards-nav__link--previous:focus-visible .ta-cards-nav__arrow {
	transform: rotate(180deg) translateX(-4px);
}

[dir="ltr"] .ta-cards-nav__link--previous:hover .ta-cards-nav__arrow,
[dir="ltr"] .ta-cards-nav__link--previous:focus-visible .ta-cards-nav__arrow {
	transform: rotate(180deg) translateX(4px);
}

.ta-cards-nav__card {
	display: block;
	flex: 0 0 auto;
}

.ta-cards-nav__thumb {
	display: block;
	flex: 0 0 auto;
	inline-size: clamp(64px, 5vw, 72px);
	block-size: clamp(96px, 7.4vw, 108px);
	overflow: hidden;
	border-radius: 10px;
	background-color: var(--color-ivory);
}

/* Portrait artwork is never cropped into an unrecognisable sliver. */
.ta-cards-nav__image {
	inline-size: 100%;
	block-size: 100%;
	object-fit: contain;
}

.ta-cards-nav__title {
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(17px, 1.4vw, 20px);
	font-weight: var(--weight-bold);
	line-height: 1.3;
}

/* ============================================================== Motion */

/*
 * The same grammar as the rest of the site, scoped to a class the card script
 * adds itself: with JavaScript unavailable nothing is ever hidden, and if the
 * observer never reports, the fallback timer reveals everything.
 */
.ta-cards-js .ta-cards [data-reveal] {
	opacity: 0;
	transform: translateY(18px);
	transition:
		opacity 560ms cubic-bezier(0.22, 1, 0.36, 1) var(--ta-reveal-delay, 0ms),
		transform 560ms cubic-bezier(0.22, 1, 0.36, 1) var(--ta-reveal-delay, 0ms);
}

.ta-cards-js .ta-cards [data-reveal="media"] {
	transform: translateY(14px) scale(0.985);
	transition:
		opacity 640ms cubic-bezier(0.22, 1, 0.36, 1) var(--ta-reveal-delay, 0ms),
		transform 640ms cubic-bezier(0.22, 1, 0.36, 1) var(--ta-reveal-delay, 0ms);
}

.ta-cards-js .ta-cards [data-reveal].is-revealed {
	opacity: 1;
	transform: none;
}

.ta-cards-js .ta-cards [data-reveal-group] > [data-reveal]:nth-child(2) {
	--ta-reveal-delay: 70ms;
}

.ta-cards-js .ta-cards [data-reveal-group] > [data-reveal]:nth-child(3) {
	--ta-reveal-delay: 140ms;
}

.ta-cards-js .ta-cards [data-reveal-group] > [data-reveal]:nth-child(n + 4) {
	--ta-reveal-delay: 210ms;
}

@media (prefers-reduced-motion: reduce) {
	.ta-cards-js .ta-cards [data-reveal],
	.ta-cards-js .ta-cards [data-reveal="media"],
	.ta-cards-js .ta-cards [data-reveal].is-revealed {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.ta-cards-card__link,
	.ta-cards-branch__link,
	.ta-cards-suit__link,
	.ta-cards-nav__link,
	.ta-cards-card__media img,
	.ta-cards-nav__arrow {
		transition: none;
	}

	.ta-cards-card__link:hover,
	.ta-cards-branch__link:hover,
	.ta-cards-suit__link:hover,
	.ta-cards-nav__link:hover {
		transform: none;
	}

	.ta-cards-card__link:hover .ta-cards-card__media img {
		transform: none;
	}

	.ta-cards-suit--featured .ta-cards-suit__arrow .ta-icon--directional {
		transform: none !important;
	}

	/* Nothing depends on the arrow's travel, so with reduced motion each one
	   simply stays in its resting position. */
	.ta-cards-nav__link--next:hover .ta-cards-nav__arrow,
	.ta-cards-nav__link--next:focus-visible .ta-cards-nav__arrow {
		transform: none;
	}

	.ta-cards-nav__link--previous:hover .ta-cards-nav__arrow,
	.ta-cards-nav__link--previous:focus-visible .ta-cards-nav__arrow {
		transform: rotate(180deg);
	}
}

/* ============================================================== Responsive */

/* The hero stacks at the approved P06 breakpoint. */
@media (max-width: 1119px) {
	.ta-cards-hero {
		min-block-size: 0;
	}

	.ta-cards-hero__body {
		max-inline-size: none;
		margin-inline-end: 0;
	}

	.ta-cards-hero__media {
		position: static;
		inline-size: auto;
		margin-inline: clamp(20px, 2.2vw, 32px);
		margin-block-start: 32px;
	}

	.ta-cards-hero__media::after {
		content: none;
	}

	.ta-cards-hero__frame {
		inline-size: 100%;
		block-size: auto;
		aspect-ratio: 16 / 10;
		max-block-size: 420px;
		border-radius: 20px;
	}

	html[dir="ltr"] .ta-cards-hero__frame {
		border-radius: 20px;
	}

	/* Stacked: copy first, then the portrait stage centred beneath it. */
	.ta-cards-single-hero__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(28px, 3.4vw, 44px);
	}

	.ta-cards-single-hero__body {
		max-inline-size: none;
	}

	.ta-cards-stage {
		inline-size: 100%;
		max-inline-size: 420px;
		margin-inline: auto;
		block-size: auto;
		padding: clamp(22px, 4vw, 30px);
	}
}

@media (max-width: 1199px) {
	.ta-cards-suits__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Four columns keep a ~205px card, which is the point of the row. */
	.ta-cards-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 1023px) {
	.ta-cards .ta-ec-wrap,
	.ta-cards-read__wrap {
		max-inline-size: 1180px;
	}

	.ta-cards-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.ta-cards-grid--related {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ta-cards-split {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 949px) {
	.ta-cards-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ta-cards-branches__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.ta-cards-branch__link {
		grid-template-columns: minmax(0, 1fr);
		min-block-size: 0;
	}

	.ta-cards-branch__media {
		order: -1;
		aspect-ratio: 16 / 10;
		max-block-size: 300px;
	}
}

@media (max-width: 767px) {
	.ta-cards .ta-ec-wrap,
	.ta-cards-read__wrap {
		padding-inline: clamp(18px, 4.4vw, 20px);
	}

	.ta-cards-hero__media {
		margin-inline: clamp(18px, 4.4vw, 20px);
	}

	/* The stacked card-hero stage keeps a deliberate width, not the full gutter. */
	.ta-cards-stage {
		max-inline-size: 390px;
	}

	.ta-cards-hero__title,
	.ta-cards-single-hero__title {
		font-size: clamp(38px, 10.4vw, 44px);
	}

	.ta-cards-h2 {
		font-size: clamp(26px, 7vw, 32px);
	}

	.ta-cards-grid--related {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ta-cards-deeper__panel,
	.ta-cards-nav {
		grid-template-columns: minmax(0, 1fr);
	}

	.ta-cards-deeper__action {
		inline-size: 100%;
		justify-content: center;
	}

	.ta-cards-preview-state {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
		padding: 22px 20px;
	}

	.ta-cards-preview-state__action {
		justify-self: start;
	}

	.ta-cards-read__body,
	.ta-cards-read__intro {
		font-size: 17px;
	}

	.ta-cards-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-block-end: 6px;
		scrollbar-width: thin;
	}

	.ta-cards-filter {
		flex: 0 0 auto;
	}
}

/*
 * Below this width three columns would put a card under ~190px, so the row
 * steps to two and the artwork stays readable instead of being squeezed.
 */
@media (max-width: 743px) {
	/* Below this a two-column card would be under ~330px, so the pair stacks. */
	.ta-cards-suitnav__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.ta-cards-panel {
		padding: clamp(22px, 4vw, 30px);
		border-radius: 24px;
	}

	.ta-cards-panel__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
	}

	.ta-cards-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}
}

/* Phones: two columns, one suit per row, and a panel that stops wasting width. */
@media (max-width: 519px) {
	.ta-cards .ta-ec-wrap,
	.ta-cards-read__wrap {
		padding-inline: 16px;
	}

	.ta-cards-panel {
		padding: 20px 12px;
		border-radius: 20px;
	}

	.ta-cards-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	/* Related readings stay a pair on a phone: one oversized card per row wastes
	   the screen and buries the comparison the row is for. */
	.ta-cards-grid--related {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.ta-cards-suits__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.ta-cards-suit--featured .ta-cards-suit__link {
		grid-template-columns: minmax(0, 1fr) auto 38%;
		gap: 10px;
		min-block-size: 160px;
	}

	.ta-cards-suit--featured .ta-cards-suit__body {
		gap: 6px;
		padding: 18px 16px;
	}

	.ta-cards-suit--featured .ta-cards-suit__title {
		font-size: clamp(22px, 6vw, 24px);
	}

	.ta-cards-suit--featured .ta-cards-suit__text {
		font-size: 14px;
		-webkit-line-clamp: 3;
	}

	.ta-cards-suit--featured .ta-cards-suit__cta {
		padding-block-start: 10px;
		font-size: 14px;
	}

	.ta-cards-suit--featured .ta-cards-suit__arrow {
		inline-size: 38px;
		block-size: 38px;
	}

	/* The detail hero: a smaller portrait stage, still centred under the copy. */
	.ta-cards-stage__frame,
	.ta-cards-stage__backing {
		max-inline-size: 240px;
	}

	.ta-cards-stage__backing {
		transform: translate(-12px, 12px);
	}

	html[dir="ltr"] .ta-cards-stage__backing {
		transform: translate(12px, 12px);
	}

	.ta-cards-deeper__panel {
		grid-template-columns: minmax(0, 1fr);
		min-block-size: 0;
	}

	.ta-cards-deeper__media {
		order: 1;
		aspect-ratio: 16 / 10;
	}

	.ta-cards-deeper__action {
		inline-size: 100%;
		justify-content: center;
	}

	.ta-cards-nav {
		grid-template-columns: minmax(0, 1fr);
	}

	.ta-cards-nav--next-only .ta-cards-nav__link--next {
		grid-column: auto;
	}

	.ta-cards-stage {
		padding: 18px;
	}
}

/* ================================== Single card stage: one calm display plate */

/*
 * The stage used to stack a second, offset ivory card behind the real one. It
 * read as a misaligned duplicate rather than depth, so the plate now holds one
 * card: centred, whole, with a hairline brass frame and a soft shadow.
 */
.ta-cards-stage {
	border-radius: 24px;
}

.ta-cards-stage__backing {
	display: none;
}

.ta-cards-stage__frame {
	border: 1px solid rgba(198, 161, 91, 0.45);
	border-radius: 18px;
	box-shadow: 0 10px 28px rgba(23, 79, 58, 0.16);
}

@media (max-width: 743px) {
	.ta-cards-stage {
		min-block-size: 0;
		padding: clamp(20px, 4vw, 28px);
	}

	.ta-cards-stage__frame {
		max-inline-size: 232px;
	}
}

/* Below 340 a pair of related cards is narrower than the artwork needs. */
@media (max-width: 339px) {
	.ta-cards-grid--related {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ================================================== Library section system */

/* A sticky header is 81px; 120px keeps a jumped-to heading clear of it. */
.ta-cards-library [id] {
	scroll-margin-block-start: 120px;
}

@media (prefers-reduced-motion: no-preference) {
	html:has(.ta-cards-library) {
		scroll-behavior: smooth;
	}
}

.ta-cards-total {
	display: inline-flex;
	align-items: center;
	margin-block-start: 14px;
	padding: 6px 16px;
	border-radius: var(--radius-pill);
	background-color: var(--color-sage-100);
	color: var(--color-green-900);
	font-size: 15px;
	font-weight: var(--weight-bold);
	line-height: 1.5;
}

/* Section navigation only: these are anchors, never filters. */
.ta-cards-anchors {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block-start: 22px;
}

.ta-cards-anchors__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-block-size: 44px;
	padding-inline: 18px;
	border: var(--ta-cards-line);
	border-radius: var(--radius-pill);
	background-color: var(--color-surface);
	color: var(--color-green-900);
	font-size: 14px;
	font-weight: var(--weight-bold);
	text-decoration: none;
	transition: background-color 180ms var(--ease-interaction), border-color 180ms var(--ease-interaction);
}

.ta-cards-anchors__link:hover {
	border-color: rgba(23, 79, 58, 0.24);
	background-color: var(--color-sage-100);
}

.ta-cards-anchors__link:focus-visible {
	outline: var(--focus-outline-width) solid var(--color-green-900);
	outline-offset: 3px;
}

/* The optional family-page link inside a section panel. */
.ta-cards-panel__action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-block-start: 14px;
	color: var(--color-gold-action);
	font-size: 15px;
	font-weight: var(--weight-bold);
	text-decoration: none;
}

.ta-cards-panel__action:hover {
	color: var(--color-gold-action-hover);
}

.ta-cards-panel__action .ta-icon--directional {
	transition: transform 200ms var(--ease-interaction);
}

.ta-cards-panel__action:hover .ta-icon--directional {
	transform: translateX(-4px);
}

/* ================================================= Arcana / suit family nav */

.ta-cards-familynav__grid {
	margin-block-start: clamp(20px, 2vw, 26px);
}

.ta-cards-familynav__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ta-cards-familynav__link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	block-size: 100%;
	padding: 18px 20px;
	border: var(--ta-cards-line);
	border-radius: 16px;
	background-color: var(--color-surface);
	color: inherit;
	text-decoration: none;
	transition:
		transform 200ms var(--ease-interaction),
		box-shadow 200ms var(--ease-interaction),
		border-color 200ms var(--ease-interaction),
		background-color 200ms var(--ease-interaction);
}

.ta-cards-familynav__link:hover {
	transform: translateY(-2px);
	border-color: rgba(23, 79, 58, 0.18);
	box-shadow: var(--ta-cards-shadow-hover);
}

.ta-cards-familynav__link:focus-visible {
	outline: var(--focus-outline-width) solid var(--color-green-900);
	outline-offset: 3px;
}

.ta-cards-familynav__link.is-current {
	border-color: rgba(23, 79, 58, 0.3);
	background-color: var(--color-sage-100);
}

.ta-cards-familynav__label {
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-size: clamp(18px, 1.35vw, 20px);
	font-weight: var(--weight-bold);
	line-height: 1.3;
}

.ta-cards-familynav__count {
	color: var(--color-text-muted);
	font-size: 13px;
	font-weight: var(--weight-medium);
	line-height: 1.4;
}

.ta-cards-familynav__state {
	margin-block-start: 6px;
	padding: 3px 10px;
	border-radius: var(--radius-pill);
	background-color: var(--color-green-900);
	color: var(--color-surface);
	font-size: 11px;
	font-weight: var(--weight-bold);
	line-height: 1.4;
}

@media (max-width: 767px) {
	.ta-cards-familynav__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.ta-cards-familynav__link {
		padding: 14px 16px;
	}

	.ta-cards-familynav__label {
		font-size: 17px;
	}
}
