/* ==========================================================================
   Catalogue (page-catalogue.php). The original banner, then the catalogues as books:
   the general catalogue on black, the nine format catalogues on three shelves, the news.
   ========================================================================== */

.cat {
	--cat-ink: #0b0b0b;
	--cat-graphite: #151514;
	--cat-porcelain: #f4f2ee;
	--cat-line: #e3dfd6;
	--cat-text: #55524c;
	--cat-muted: #8b877f;
	--cat-gold: #c99a3f;
	--cat-gold-soft: #e3c27a;
	--cat-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--cat-head: "Red Hat Display", var(--o-heading, sans-serif);
	font-family: var(--o-body, Arial, sans-serif);
	color: var(--cat-text);
	background: var(--cat-porcelain);
}
.cat-wrap {
	width: min(1200px, 100% - 40px);
	margin-inline: auto;
}
.cat-kicker {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	font-family: var(--cat-head);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--cat-gold-soft);
}
.cat-kicker span {
	width: 36px;
	height: 1px;
	background: currentColor;
}
.cat-kicker--dark {
	color: var(--cat-gold);
}
.cat-h2 {
	margin: 0;
	font-family: var(--cat-head);
	font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.015em;
	color: var(--cat-ink);
	text-wrap: balance;
}

/* ------------------------------------------------------------ 1. Banner */
.cat-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: max(560px, 100svh);
	max-height: 1100px;
	padding: calc(var(--header-h) + 40px) 0 clamp(36px, 7vh, 72px);
	overflow: hidden;
	color: #fff;
	background: #000; /* the picture's own ground */
	isolation: isolate;
}
.cat-hero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--cat-banner) 50% 0 / cover no-repeat;
	transform: scale(1.06);
	animation: cat-settle 2.4s var(--cat-ease) forwards;
}
/* The bottom of the picture darkens a little under the title. */
.cat-hero::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	z-index: -1;
	height: 45%;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
	pointer-events: none;
}
.cat-hero__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
}
.cat-hero__title {
	margin: 0;
	font-family: var(--cat-head);
	font-size: clamp(3.4rem, 1rem + 11vw, 10.5rem);
	font-weight: 700;
	line-height: 0.85;
	letter-spacing: -0.04em;
	overflow: hidden;
}
.cat-hero__title span {
	display: block;
	padding-bottom: 0.16em;
	animation: cat-rise 1.2s var(--cat-ease) 0.25s backwards;
}
.cat-hero__scroll {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 0 20px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 999px;
	color: #fff;
	font-family: var(--cat-head);
	font-weight: 600;
	text-decoration: none;
	animation: cat-fade 1s ease 1s backwards;
	transition: background-color 0.35s var(--cat-ease), color 0.35s, border-color 0.35s;
}
.cat-hero__scroll svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	animation: cat-nudge 2.2s ease-in-out 2s infinite;
}

/* ------------------------------------------------------------ Books (shared) */
.cat-book {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	perspective: 1400px;
	-webkit-tap-highlight-color: transparent;
}
.cat-book__cover {
	position: relative;
	z-index: 1;
	display: block;
	aspect-ratio: 837 / 1024;
	border-radius: 2px 8px 8px 2px;
	overflow: hidden;
	transform-origin: left center;
	transform: rotateY(-8deg);
	box-shadow: 0 30px 40px -28px rgba(0, 0, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.12);
	transition: transform 0.7s var(--cat-ease), box-shadow 0.7s var(--cat-ease);
}
.cat-book__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
/* Spine shading and a light sweep across the cover. */
.cat-book__cover::before,
.cat-book__cover::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.cat-book__cover::before {
	z-index: 1;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.32) 0, rgba(255, 255, 255, 0.18) 2.5%, rgba(0, 0, 0, 0.1) 5%, rgba(0, 0, 0, 0) 9%);
}
.cat-book__cover::after {
	z-index: 2;
	background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.28) 50%, transparent 60%) no-repeat;
	background-size: 250% 100%;
	background-position: 120% 0;
	transition: background-position 0.9s var(--cat-ease);
}
/* Page block behind the cover. */
.cat-book__pages {
	position: absolute;
	top: 2%;
	right: -2px;
	bottom: 2%;
	left: 4%;
	border-radius: 0 6px 6px 0;
	background: repeating-linear-gradient(90deg, #f7f5f0 0 2px, #dcd8cf 2px 3px);
	box-shadow: 0 20px 30px -24px rgba(0, 0, 0, 0.5);
	transform: translateX(6px);
	transition: transform 0.7s var(--cat-ease);
}
.cat-book:focus-visible {
	outline: none;
}
.cat-book:focus-visible .cat-book__cover {
	outline: 3px solid var(--cat-gold);
	outline-offset: 4px;
}

/* General catalogue: a black cover built in CSS (logo, gold rule). */
.cat-book--general .cat-book__cover {
	display: grid;
	align-content: center;
	justify-items: start;
	gap: 18px;
	padding: 14% 12%;
	background:
		radial-gradient(120% 80% at 80% 10%, rgba(227, 194, 122, 0.16), rgba(0, 0, 0, 0) 55%),
		linear-gradient(160deg, #1c1b19, #050505);
	box-shadow: 0 40px 60px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.cat-book--general .cat-book__cover img {
	width: 78%;
	height: auto;
}
.cat-book__line {
	width: 46%;
	height: 2px;
	background: var(--cat-gold);
}
.cat-book__label {
	font-family: var(--cat-head);
	font-size: clamp(1.1rem, 0.8rem + 1.2vw, 1.6rem);
	font-weight: 700;
	line-height: 1.1;
	color: #fff;
}
.cat-book__year {
	font-family: var(--cat-head);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.08em;
	color: var(--cat-gold-soft);
}

/* ------------------------------------------------------------ 2. General catalogue */
.cat-feature {
	padding: clamp(64px, 10vw, 130px) 0;
	color: rgba(255, 255, 255, 0.78);
	background:
		radial-gradient(60% 70% at 18% 50%, rgba(227, 194, 122, 0.1), rgba(0, 0, 0, 0) 65%),
		var(--cat-ink);
	scroll-margin-top: calc(var(--mh-compact, 60px));
}
.cat-feature__inner {
	display: grid;
	gap: 48px;
	align-items: center;
}
.cat-feature__book {
	width: min(340px, 72vw);
	margin-inline: auto;
	transform: perspective(1200px) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
	transition: transform 0.4s var(--cat-ease);
}
.cat-feature .cat-h2 {
	color: #fff;
}
.cat-lead {
	max-width: 56ch;
	margin: 20px 0 0;
	font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
	line-height: 1.7;
}
.cat-features__intro {
	margin: 22px 0 10px;
	font-weight: 700;
	color: #fff;
}
.cat-features {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.cat-features li {
	position: relative;
	padding-left: 26px;
	line-height: 1.55;
}
.cat-features li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 8px;
	height: 8px;
	border: 1.5px solid var(--cat-gold-soft);
	transform: rotate(45deg);
}
/* Links styled as the original buttons (catalogue page). */
.cat-book,
.cat-btn,
.cat-link {
	text-decoration: none;
}
.cat-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 32px;
}
.cat-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 50px;
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-family: var(--cat-head);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.35s var(--cat-ease), color 0.35s, border-color 0.35s;
}
.cat-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.cat-btn--solid {
	background: var(--cat-gold);
	color: #fff;
}
.cat-btn--ghost {
	border-color: rgba(255, 255, 255, 0.4);
	background: transparent;
	color: #fff;
}
.cat-btn:focus-visible,
.cat-link:focus-visible,
.cat-hero__scroll:focus-visible {
	outline: 2px solid var(--cat-gold);
	outline-offset: 3px;
}

/* ------------------------------------------------------------ 3. Shelves */
.cat-shelf {
	padding: clamp(60px, 8vw, 110px) 0;
	background: var(--cat-porcelain);
}
.cat-shelf--alt {
	background: #fff;
}
.cat-shelf__inner {
	display: grid;
	gap: 32px;
}
.cat-shelf__head p {
	max-width: 46ch;
	margin: 16px 0 0;
	font-size: 16px;
	line-height: 1.7;
}
/* Mobile: books in a swipeable row. */
.cat-books {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: min(62vw, 260px);
	gap: 22px;
	margin: 0 -20px;
	padding: 10px 20px 26px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 20px;
	scrollbar-width: none;
}
.cat-books::-webkit-scrollbar {
	display: none;
}
.cat-item {
	scroll-snap-align: start;
}
.cat-item__meta {
	padding-top: 22px;
}
.cat-item__kind {
	margin: 0;
	font-size: 13px;
	color: var(--cat-muted);
}
.cat-item__title {
	margin: 2px 0 12px;
	font-family: var(--cat-head);
	font-size: 22px;
	font-weight: 700;
	color: var(--cat-ink);
	font-variant-numeric: tabular-nums;
}
.cat-item__title small {
	font-size: 0.62em;
	font-weight: 600;
	color: var(--cat-muted);
}
.cat-item__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
}
.cat-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--cat-ink);
	font-family: var(--cat-head);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	background-image: linear-gradient(var(--cat-gold), var(--cat-gold));
	background-size: 0 1px;
	background-position: 0 calc(100% - 10px);
	background-repeat: no-repeat;
	transition: background-size 0.4s var(--cat-ease), color 0.3s;
}
.cat-link svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: var(--cat-gold);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ------------------------------------------------------------ 4. News */
.cat-news {
	padding: clamp(60px, 8vw, 110px) 0;
	background: var(--cat-porcelain);
}
.cat-news__head {
	margin-bottom: 36px;
}
.cat-news__grid {
	padding: 0;
}

/* ------------------------------------------------------------ Reveal & motion */
.cat-js [data-cat-reveal] {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.8s var(--cat-ease) var(--d, 0ms), transform 0.8s var(--cat-ease) var(--d, 0ms);
}
.cat-js [data-cat-reveal].is-in {
	opacity: 1;
	transform: none;
}
@keyframes cat-settle {
	to {
		transform: none;
	}
}
@keyframes cat-rise {
	from {
		transform: translateY(105%);
	}
}
@keyframes cat-fade {
	from {
		opacity: 0;
	}
}
@keyframes cat-nudge {
	0%,
	100% {
		transform: none;
	}
	50% {
		transform: translateY(4px);
	}
}

/* ------------------------------------------------------------ Hover (pointer devices) */
@media (hover: hover) {
	.cat-book:hover .cat-book__cover {
		transform: rotateY(-24deg) translateY(-6px);
		box-shadow: 18px 40px 50px -30px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.12);
	}
	.cat-book:hover .cat-book__cover::after {
		background-position: -20% 0;
	}
	.cat-book:hover .cat-book__pages {
		transform: translateX(12px);
	}
	.cat-btn--solid:hover {
		background: #fff;
		color: var(--cat-ink);
	}
	.cat-btn--ghost:hover {
		border-color: #fff;
		background: #fff;
		color: var(--cat-ink);
	}
	.cat-hero__scroll:hover {
		border-color: #fff;
		background: #fff;
		color: var(--cat-ink);
	}
	.cat-link:hover {
		background-size: 100% 1px;
	}
}

/* ------------------------------------------------------------ Larger screens */
@media (min-width: 700px) {
	.cat-books {
		grid-auto-flow: row;
		grid-auto-columns: auto;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: clamp(24px, 3vw, 44px);
		margin: 0;
		padding: 10px 0 0;
		overflow: visible;
	}
}
@media (min-width: 1000px) {
	.cat-feature__inner {
		grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
		gap: 80px;
	}
	.cat-feature__book {
		width: min(380px, 100%);
	}
	.cat-shelf__inner {
		grid-template-columns: minmax(0, 0.75fr) minmax(0, 2fr);
		align-items: start;
		gap: 60px;
	}
	.cat-shelf__head {
		position: sticky;
		top: calc(var(--mh-compact, 60px) + 40px);
	}
	.cat-shelf--alt .cat-shelf__inner {
		grid-template-columns: minmax(0, 2fr) minmax(0, 0.75fr);
	}
	.cat-shelf--alt .cat-shelf__head {
		order: 2;
	}
}
@media (max-width: 699px) {
	.cat-hero {
		min-height: 78svh;
	}
	/* The picture's ground is pure black: shown almost whole (logo, words, hand) under the header,
	   the title below it. */
	.cat-hero__media {
		background-size: 135% auto;
		background-position: 50% calc(var(--header-h) + 4svh);
	}
	.cat-hero__scroll {
		width: 100%;
		justify-content: space-between;
	}
	.cat-btn {
		flex: 1 1 auto;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cat-hero__media,
	.cat-hero__title span,
	.cat-hero__scroll,
	.cat-hero__scroll svg {
		animation: none;
		transform: none;
	}
	.cat-js [data-cat-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.cat-book__cover,
	.cat-book__pages,
	.cat-feature__book {
		transition: none;
	}
}
