/**
 * Studiolo — Projects (portfolio)
 *
 * Project grids and cards, discipline filter, "Load more", single project
 * (hero, details band, credits, next project) and the Projects block.
 *
 * Built only from design tokens (--st-*) and logical properties, so every
 * Customizer combination keeps working: dark presets, 40px corners, uppercase
 * headings, dense or airy spacing, large base sizes and steep type scales, RTL.
 */

/* ==========================================================================
   1. Card ratios
   Body class from the Customizer (st-ratio-*) or a grid-level override from
   the Projects block. Custom properties inherit, so the nearest class wins.
   ========================================================================== */

.st-ratio-landscape {
	--st-project-ratio: 4 / 3;
	--st-project-ratio-fallback: 4 / 3;
}

.st-ratio-square {
	--st-project-ratio: 1 / 1;
	--st-project-ratio-fallback: 1 / 1;
}

.st-ratio-portrait {
	--st-project-ratio: 4 / 5;
	--st-project-ratio-fallback: 4 / 5;
}

.st-ratio-wide {
	--st-project-ratio: 16 / 9;
	--st-project-ratio-fallback: 16 / 9;
}

.st-ratio-original {
	--st-project-ratio: auto;
	--st-project-ratio-fallback: 4 / 3;
}

/* ==========================================================================
   2. Listings: archive wrapper and block wrapper
   ========================================================================== */

.st-projects {
	padding-block-end: var(--st-section);
}

.st-projects__body,
.st-projects-block {
	container: st-projects / inline-size;
}

.st-projects-results {
	transition: opacity var(--st-duration-fast) var(--st-ease);
}

.st-projects.is-loading .st-projects-results {
	opacity: 0.35;
	pointer-events: none;
}

/* ==========================================================================
   3. Discipline filter (chips)
   ========================================================================== */

.st-project-filter {
	margin-block-end: var(--st-space-xl);
}

.st-project-filter__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--st-space-2xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.st-project-filter__item {
	margin: 0;
	padding: 0;
}

.st-project-filter__item::before {
	content: none;
}

.st-project-filter .st-chip {
	display: inline-flex;
	align-items: center;
	gap: var(--st-space-3xs);
	min-block-size: 44px;
	padding-inline: var(--st-space-s);
	text-decoration: none;
	white-space: nowrap;
}

.st-project-filter__count {
	align-self: flex-start;
	margin-block-start: 0.7em;
	font-size: 0.75em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--st-color-muted);
}

.st-project-filter .st-chip[aria-current] .st-project-filter__count,
.st-project-filter .st-chip.is-active .st-project-filter__count {
	color: inherit;
}

/* ==========================================================================
   4. Grid
   1 column on phones, 2 on tablets, --st-cols (set inline) on desktop.
   Sized by the listing's own width (container queries) so the block also
   behaves inside narrow columns.
   ========================================================================== */

.st-projects-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: var(--st-space-l);
	row-gap: var(--st-space-xl);
	margin: 0;
	padding: 0;
}

.st-projects-grid[tabindex="-1"]:focus {
	outline: none;
}

@container st-projects (min-width: 560px) {
	.st-projects-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: var(--st-space-2xl);
	}

	.st-projects-grid--cols-1 {
		grid-template-columns: minmax(0, 1fr);
	}
}

@container st-projects (min-width: 960px) {
	.st-projects-grid {
		grid-template-columns: repeat(var(--st-cols, 2), minmax(0, 1fr));
	}

	.st-projects-grid--cols-1,
	.st-projects-grid--cols-2 {
		column-gap: var(--st-space-xl);
		row-gap: var(--st-space-3xl);
	}

	/* Editorial stagger: every second card sits lower. */
	.st-projects-grid--staggered.st-projects-grid--cols-2 > .st-project-card:nth-child(even) {
		margin-block-start: var(--st-space-3xl);
	}
}

@supports not (container-type: inline-size) {
	@media (min-width: 600px) {
		.st-projects-grid {
			grid-template-columns: repeat(2, minmax(0, 1fr));
			row-gap: var(--st-space-2xl);
		}

		.st-projects-grid--cols-1 {
			grid-template-columns: minmax(0, 1fr);
		}
	}

	@media (min-width: 1024px) {
		.st-projects-grid {
			grid-template-columns: repeat(var(--st-cols, 2), minmax(0, 1fr));
		}
	}
}

/* ==========================================================================
   5. Project card
   ========================================================================== */

.st-project-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-inline-size: 0;
	margin: 0;
}

.st-project-card__link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--st-space-s);
	min-inline-size: 0;
	color: inherit;
	text-decoration: none;
	border-radius: var(--st-radius-media);
	-webkit-tap-highlight-color: transparent;
}

.st-project-card .st-project-card__link:hover {
	color: inherit; /* Cards signal hover with the underline and image, not a color shift. */
}

.st-project-card__link:focus-visible {
	outline: 2px solid var(--st-color-focus);
	outline-offset: var(--st-space-2xs);
}

/* Media */
.st-project-card__media {
	--st-ratio: var(--st-project-ratio, 4 / 3);
	position: relative;
	margin: 0;
	aspect-ratio: var(--st-project-ratio, 4 / 3);
	overflow: hidden;
	border-radius: var(--st-radius-media);
	background-color: var(--st-color-surface);
	isolation: isolate;
}

.st-project-card__img {
	display: block;
	inline-size: 100%;
	max-inline-size: none;
	block-size: 100%; /* Resolves to auto when the ratio is "original". */
	object-fit: cover;
	transform-origin: 50% 50%;
}

/* Placeholder (no cover image): surface tint + large initial. */
.st-project-card__media--placeholder {
	display: grid;
	place-items: center;
	aspect-ratio: var(--st-project-ratio-fallback, 4 / 3);
	container-type: inline-size;
	background-image: linear-gradient(
		135deg,
		transparent 0 50%,
		color-mix(in srgb, var(--st-color-text) 4%, transparent) 50% 100%
	);
}

.st-project-card__initial {
	font-family: var(--st-font-heading);
	font-size: clamp(var(--st-fs-3), 42cqi, var(--st-fs-7));
	font-weight: var(--st-heading-weight);
	font-synthesis-weight: none;
	letter-spacing: var(--st-heading-tracking);
	text-transform: var(--st-heading-case);
	line-height: 1;
	color: color-mix(in srgb, var(--st-color-text) 24%, var(--st-color-surface));
	user-select: none;
}

/* Body */
.st-project-card__body {
	display: grid;
	gap: var(--st-space-3xs);
	min-inline-size: 0;
}

.st-project-card__title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--st-space-xs);
	margin: 0;
	font-family: var(--st-font-heading);
	font-size: var(--st-fs-2);
	font-weight: var(--st-heading-weight);
	letter-spacing: var(--st-heading-tracking);
	line-height: var(--st-heading-leading);
	text-transform: var(--st-heading-case);
	color: inherit;
}

.st-projects-grid--cols-1 .st-project-card__title {
	font-size: var(--st-fs-3);
}

.st-projects-grid--cols-3 .st-project-card__title,
.st-projects-grid--cols-4 .st-project-card__title {
	font-size: var(--st-fs-1);
}

.st-project-card__title-text {
	min-inline-size: 0;
	overflow-wrap: break-word;
	hyphens: auto;
	text-decoration-line: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: max(1px, var(--st-border-width));
	text-underline-offset: 0.18em;
	transition: text-decoration-color var(--st-duration-fast) var(--st-ease);
}

.st-project-card__arrow {
	display: inline-flex;
	flex: none;
	margin-block-start: 0.1em;
	opacity: 0;
	translate: -0.3em 0.3em;
	transition:
		opacity var(--st-duration-fast) var(--st-ease),
		translate var(--st-duration-fast) var(--st-ease);
}

.st-project-card__arrow .st-icon {
	inline-size: 0.85em;
	block-size: 0.85em;
}

.st-project-card__meta {
	display: flex;
	flex-wrap: wrap;
	column-gap: var(--st-space-2xs);
	margin: 0;
	color: var(--st-color-muted);
}

.st-project-card__meta > span + span::before {
	content: "·";
	content: "·" / "";
	margin-inline-end: var(--st-space-2xs);
}

/* Hover / focus */
.st-project-card__link:focus-visible .st-project-card__title-text {
	text-decoration-color: currentColor;
}

.st-project-card__link:focus-visible .st-project-card__arrow {
	opacity: 1;
	translate: 0 0;
}

@media (hover: hover) {
	.st-project-card__link:hover .st-project-card__title-text {
		text-decoration-color: currentColor;
	}

	.st-project-card__link:hover .st-project-card__arrow {
		opacity: 1;
		translate: 0 0;
	}
}

/* ==========================================================================
   6. Card styles (follow the "Card style" setting: st-cards-*)
   ========================================================================== */

.st-cards-outline .st-project-card__link,
.st-cards-filled .st-project-card__link,
.st-cards-elevated .st-project-card__link {
	--st-project-card-pad: var(--st-space-xs);
	padding: var(--st-project-card-pad);
	border-radius: var(--st-radius-card);
}

.st-cards-outline .st-project-card__link {
	border: var(--st-border-width) solid var(--st-color-border);
}

.st-cards-filled .st-project-card__link {
	background-color: var(--st-color-surface);
}

.st-cards-elevated .st-project-card__link {
	background-color: var(--st-color-bg);
	box-shadow: var(--st-shadow-sm);
}

/* Nested corners: inner radius = outer radius − padding (never larger than the media setting). */
.st-cards-outline .st-project-card__media,
.st-cards-filled .st-project-card__media,
.st-cards-elevated .st-project-card__media {
	border-radius: min(var(--st-radius-media), max(0px, calc(var(--st-radius-card) - var(--st-project-card-pad))));
}

.st-cards-outline .st-project-card__body,
.st-cards-filled .st-project-card__body,
.st-cards-elevated .st-project-card__body {
	padding-inline: var(--st-space-2xs);
	padding-block-end: var(--st-space-2xs);
}

.st-cards-filled .st-project-card__media--placeholder {
	background-color: var(--st-color-surface-strong);
}

@media (hover: hover) {
	.st-cards-outline .st-project-card__link:hover {
		border-color: var(--st-color-text);
	}

	.st-cards-elevated .st-project-card__link:hover {
		box-shadow: var(--st-shadow-md);
	}
}

/* ==========================================================================
   7. Overlay captions (st-caption-overlay)
   Only for precise, hover-capable pointers; touch devices keep captions below.
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
	.st-caption-overlay .st-project-card__link {
		display: grid;
		grid-template-areas: "stack";
		gap: 0;
	}

	.st-caption-overlay .st-project-card__media,
	.st-caption-overlay .st-project-card__body {
		grid-area: stack;
	}

	.st-caption-overlay .st-project-card__media::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
		background-image:
			linear-gradient(to top, var(--st-color-overlay), transparent 75%),
			linear-gradient(to top, var(--st-color-overlay), transparent 45%);
		opacity: 0;
		pointer-events: none;
		transition: opacity var(--st-duration-fast) var(--st-ease);
	}

	/* Caption colour pairs with the scrim, which is built from the (scope's) text colour. */
	.st-caption-overlay .st-project-card__body {
		position: relative;
		z-index: 2;
		align-self: end;
		padding: var(--st-space-m);
		color: var(--st-color-bg);
		opacity: 0;
		transition:
			opacity var(--st-duration-fast) var(--st-ease),
			translate var(--st-duration) var(--st-ease);
	}

	/* A scrim right under the caption (fading out above it) keeps the text at
	   4.5:1 on any image, however many lines the caption wraps to. Its bottom
	   corners follow the media's (nested) radius. */
	.st-caption-overlay .st-project-card__body::before {
		--st-caption-radius: min(var(--st-radius-media), max(0px, calc(var(--st-radius-card) - var(--st-project-card-pad, 0px))));
		content: "";
		position: absolute;
		inset: calc(-1 * var(--st-space-xl)) 0 0;
		z-index: -1;
		border-end-start-radius: var(--st-caption-radius);
		border-end-end-radius: var(--st-caption-radius);
		background-image: linear-gradient(to top, color-mix(in srgb, var(--st-color-text) 70%, transparent) calc(100% - var(--st-space-xl) - var(--st-space-m)), transparent);
		pointer-events: none;
	}

	.st-caption-overlay .st-project-card__meta {
		color: inherit;
	}

	.st-caption-overlay .st-project-card__link:hover .st-project-card__media::after,
	.st-caption-overlay .st-project-card__link:focus-visible .st-project-card__media::after,
	.st-caption-overlay .st-project-card__link:hover .st-project-card__body,
	.st-caption-overlay .st-project-card__link:focus-visible .st-project-card__body {
		opacity: 1;
	}
}

/* ==========================================================================
   8. Pager: "Load more" + no-JS pagination, live status
   ========================================================================== */

.st-projects-pager {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--st-space-m);
	margin-block-start: var(--st-space-2xl);
}

.st-projects-pager [hidden],
.st-projects-pager .st-load-more[hidden] {
	display: none;
}

.st-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--st-space-xs);
	min-block-size: 44px;
	min-inline-size: min(100%, 16rem);
}

.st-load-more.is-busy {
	cursor: progress;
}

.st-load-more.is-busy::after {
	content: "";
	flex: none;
	inline-size: 1em;
	block-size: 1em;
	border: max(1px, var(--st-border-width)) solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
}

/* ==========================================================================
   9. Empty state
   ========================================================================== */

.st-projects-empty {
	display: grid;
	justify-items: start;
	gap: var(--st-space-s);
	padding-block: var(--st-space-2xl);
	border-block-start: var(--st-border-width) solid var(--st-color-border);
}

.st-projects-empty__title {
	margin: 0;
	font-family: var(--st-font-heading);
	font-size: var(--st-fs-4);
	font-weight: var(--st-heading-weight);
	letter-spacing: var(--st-heading-tracking);
	line-height: var(--st-heading-leading);
	text-transform: var(--st-heading-case);
	text-wrap: balance;
}

.st-projects-empty__text {
	margin: 0;
	max-inline-size: 36rem;
}

.st-projects-empty__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--st-space-s) var(--st-space-l);
	margin: 0;
}

.st-projects-empty__actions .st-btn {
	min-block-size: 44px;
}

/* ==========================================================================
   10. Single project: hero
   ========================================================================== */

.st-project-hero {
	--st-project-hero-overhang: clamp(4rem, 18vw, 16rem);
	padding-block-start: calc(var(--st-section) * 0.55);
}

.st-project-hero__inner {
	display: grid;
	gap: var(--st-space-m);
	padding-block-end: var(--st-space-2xl);
}

.st-project-hero__eyebrow {
	margin: 0;
}

.st-project-hero__title {
	margin: 0;
	max-inline-size: 18ch;
	font-size: var(--st-fs-7);
	line-height: var(--st-heading-leading);
	overflow-wrap: break-word;
	hyphens: auto;
	text-wrap: balance;
}

.st-project-hero__title--long {
	max-inline-size: 26ch;
	font-size: var(--st-fs-6);
}

.st-project-hero__lead {
	max-inline-size: var(--st-content-width);
	margin: 0;
}

.st-project-hero__lead > :first-child {
	margin-block-start: 0;
}

.st-project-hero__lead > :last-child {
	margin-block-end: 0;
}

@media (min-width: 960px) {
	.st-project-hero__inner {
		grid-template-columns: repeat(12, minmax(0, 1fr));
		column-gap: var(--st-space-l);
	}

	.st-project-hero__eyebrow,
	.st-project-hero__title {
		grid-column: 1 / -1;
	}

	.st-project-hero__lead {
		grid-column: 7 / -1;
		margin-block-start: var(--st-space-s);
	}
}

/* Cover image */
.st-project-hero__media {
	margin-block: 0;
}

.st-project-hero__media--full {
	margin-inline: 0;
}

.st-project-hero__frame {
	overflow: hidden;
	border-radius: var(--st-radius-media);
	background-color: var(--st-color-surface);
}

.st-project-hero__media--full .st-project-hero__frame {
	border-radius: 0;
}

.st-project-hero__img {
	display: block;
	inline-size: 100%;
	max-inline-size: none;
	block-size: auto;
	max-block-size: 88vh;
	max-block-size: 88svh;
	object-fit: cover;
}

.st-project-hero__media--full .st-project-hero__img {
	max-block-size: calc(100vh - var(--st-header-h));
	max-block-size: calc(100svh - var(--st-header-h));
}

.st-project-hero__caption {
	margin-block-start: var(--st-space-xs);
	font-size: var(--st-fs--1);
	color: var(--st-color-muted);
}

.st-project-hero__media--full .st-project-hero__caption {
	padding-inline: var(--st-gutter);
}

/* Project color: the tint runs behind the text and the top of the image. */
.st-project-hero.st-scheme-custom {
	padding-block-end: var(--st-space-2xl);
}

.st-project-hero.st-scheme-custom.has-media {
	padding-block-end: 0;
	background: linear-gradient(
		to bottom,
		var(--st-color-bg) calc(100% - var(--st-project-hero-overhang)),
		transparent 0
	);
}

.st-project-hero.st-scheme-custom.has-media .st-project-hero__caption {
	color: color-mix(in srgb, var(--st-ink) 72%, var(--st-paper));
}

.st-project-hero.st-scheme-custom.no-media .st-project-hero__inner {
	padding-block-end: 0;
}

/* ==========================================================================
   11. Single project: details band (hairline-divided definition list)
   ========================================================================== */

.st-project-details {
	padding-block-start: var(--st-space-2xl);
}

.st-project-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
	gap: var(--st-space-m) var(--st-space-l);
	margin: 0;
	padding: 0;
}

.st-project-meta__item {
	display: grid;
	align-content: start;
	gap: var(--st-space-2xs);
	min-inline-size: 0;
	padding-block-start: var(--st-space-s);
	border-block-start: var(--st-border-width) solid var(--st-color-border);
}

.st-project-meta__label,
.st-project-meta__value {
	margin: 0;
}

.st-project-meta__value {
	overflow-wrap: anywhere;
}

.st-project-meta__value a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-thickness: max(1px, var(--st-border-width));
	text-decoration-color: var(--st-color-border);
	text-underline-offset: 0.2em;
	transition: text-decoration-color var(--st-duration-fast) var(--st-ease);
}

.st-project-meta__value a:hover,
.st-project-meta__value a:focus-visible {
	text-decoration-color: currentColor;
}

.st-project-meta__link {
	display: inline-flex;
	align-items: center;
	gap: var(--st-space-3xs);
}

.st-project-meta__link .st-icon {
	flex: none;
	inline-size: 0.9em;
	block-size: 0.9em;
}

/* ==========================================================================
   12. Single project: content, credits, edit link, password form
   ========================================================================== */

.st-project-content {
	padding-block-start: var(--st-section);
}

.st-project-credits {
	display: grid;
	gap: var(--st-space-m);
	margin-block-start: var(--st-section);
}

.st-project-credits__title {
	margin: 0;
}

.st-project-credits__list {
	margin: 0;
	border-block-start: var(--st-border-width) solid var(--st-color-border);
}

.st-project-credits__row {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: var(--st-space-s);
	padding-block: var(--st-space-xs);
	border-block-end: var(--st-border-width) solid var(--st-color-border);
}

.st-project-credits__role,
.st-project-credits__name {
	margin: 0;
	min-inline-size: 0;
	overflow-wrap: break-word;
}

.st-project-credits__role {
	color: var(--st-color-muted);
}

.st-project-credits__role.screen-reader-text + .st-project-credits__name {
	grid-column: 1 / -1;
}

@media (min-width: 960px) {
	.st-project-credits {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
		column-gap: var(--st-space-l);
	}

	.st-project-credits__title {
		padding-block-start: var(--st-space-xs);
	}
}

.st-project-edit {
	margin-block: var(--st-space-xl) 0;
}

.st-project-edit a {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
}

.st-project-locked {
	padding-block: var(--st-space-2xl) var(--st-section);
}

/* ==========================================================================
   13. Next project teaser + previous / all-work navigation
   ========================================================================== */

.st-project-more {
	margin-block-start: var(--st-section);
	padding-block-end: var(--st-section);
}

.st-next-project {
	position: relative;
	display: grid;
	min-block-size: clamp(16rem, 42vw, 34rem);
	overflow: hidden;
	isolation: isolate;
	border-radius: var(--st-radius-media);
	color: var(--st-paper);
	background-color: var(--st-ink);
	text-decoration: none;
}

.st-project-more .st-next-project:hover {
	color: var(--st-paper);
}

.st-project-more .st-next-project.no-media:hover {
	color: var(--st-color-text);
}

.st-next-project:focus-visible {
	outline: 2px solid var(--st-color-focus);
	outline-offset: var(--st-space-2xs);
}

.st-next-project__media {
	position: relative;
	display: block;
	grid-area: 1 / 1;
}

.st-next-project__img {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	max-inline-size: none;
	block-size: 100%;
	object-fit: cover;
}

.st-next-project__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(to top, var(--st-color-overlay), transparent 80%),
		linear-gradient(to top, var(--st-color-overlay), transparent 50%);
}

.st-next-project__body {
	position: relative;
	z-index: 1;
	display: grid;
	align-self: end;
	justify-items: start;
	gap: var(--st-space-xs);
	grid-area: 1 / 1;
	min-inline-size: 0;
	padding: clamp(var(--st-space-m), 4vw, var(--st-space-2xl));
}

/* Scrim right under the text, fading out above it: the small label and terms
   stay at 4.5:1 even on a very light image. */
.st-next-project.has-media .st-next-project__body::before {
	content: "";
	position: absolute;
	inset: calc(-1 * var(--st-space-2xl)) 0 0;
	z-index: -1;
	background-image: linear-gradient(to top, color-mix(in srgb, var(--st-ink) 70%, transparent) calc(100% - var(--st-space-2xl) - clamp(var(--st-space-m), 4vw, var(--st-space-2xl))), transparent);
	pointer-events: none;
}

.st-next-project__label,
.st-next-project__terms {
	color: inherit;
}

.st-next-project__title {
	display: flex;
	align-items: center;
	gap: var(--st-space-s);
	max-inline-size: 100%;
	font-family: var(--st-font-heading);
	font-size: var(--st-fs-6);
	font-weight: var(--st-heading-weight);
	font-synthesis-weight: none;
	letter-spacing: var(--st-heading-tracking);
	line-height: var(--st-heading-leading);
	text-transform: var(--st-heading-case);
}

.st-next-project__title-text {
	min-inline-size: 0;
	overflow-wrap: break-word;
	hyphens: auto;
	text-wrap: balance;
}

.st-next-project__arrow {
	display: inline-flex;
	flex: none;
}

.st-next-project__arrow .st-icon {
	inline-size: 0.75em;
	block-size: 0.75em;
}

.st-next-project.no-media {
	color: var(--st-color-text);
	background-color: var(--st-color-surface);
}

.st-next-project.no-media .st-next-project__label,
.st-next-project.no-media .st-next-project__terms {
	color: var(--st-color-muted);
}

/* Previous / all work */
.st-project-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--st-space-s) var(--st-space-l);
	margin-block-start: var(--st-space-m);
}

.st-project-more .st-project-nav__link:hover {
	color: inherit;
}

.st-project-nav__link {
	display: inline-flex;
	align-items: center;
	gap: var(--st-space-xs);
	min-block-size: 44px;
	min-inline-size: 0;
	color: inherit;
	text-decoration: none;
}

.st-project-nav__link--index {
	margin-inline-start: auto;
}

.st-project-nav__link .st-icon {
	flex: none;
	inline-size: 1.1em;
	block-size: 1.1em;
}

.st-project-nav__text {
	display: grid;
	min-inline-size: 0;
}

.st-project-nav__label {
	font-family: var(--st-font-ui);
	font-size: var(--st-fs--2);
	letter-spacing: var(--st-ui-tracking);
	text-transform: var(--st-ui-case);
	color: var(--st-color-muted);
}

.st-project-nav__link--index .st-project-nav__label {
	color: inherit;
}

.st-project-nav__title {
	font-family: var(--st-font-heading);
	font-size: var(--st-fs-1);
	font-weight: var(--st-heading-weight);
	letter-spacing: var(--st-heading-tracking);
	text-transform: var(--st-heading-case);
	overflow-wrap: break-word;
}

.st-project-nav__title,
.st-project-nav__link--index .st-project-nav__label {
	text-decoration-line: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: max(1px, var(--st-border-width));
	text-underline-offset: 0.2em;
	transition: text-decoration-color var(--st-duration-fast) var(--st-ease);
}

.st-project-nav__link:hover .st-project-nav__title,
.st-project-nav__link:focus-visible .st-project-nav__title,
.st-project-nav__link--index:hover .st-project-nav__label,
.st-project-nav__link--index:focus-visible .st-project-nav__label {
	text-decoration-color: currentColor;
}

/* ==========================================================================
   14. Projects block
   ========================================================================== */

.st-projects-block > * {
	margin-block: 0;
}

.st-projects-block > * + * {
	margin-block-start: var(--st-space-xl);
}

.st-projects-block__more {
	display: flex;
	justify-content: flex-end;
}

.st-projects-block__more .st-btn {
	min-block-size: 44px;
}

/* ==========================================================================
   15. Motion (only with the Motion setting on and no reduced-motion preference)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
	.st-motion .st-project-card__img,
	.st-motion .st-next-project__img {
		transition: scale calc(var(--st-duration) * 1.4) var(--st-ease);
	}

	.st-motion .st-project-card__link:focus-visible .st-project-card__img {
		scale: 1.03;
	}

	.st-motion .st-cards-elevated .st-project-card__link,
	.st-motion.st-cards-elevated .st-project-card__link {
		transition:
			box-shadow var(--st-duration-fast) var(--st-ease),
			translate var(--st-duration-fast) var(--st-ease);
	}

	.st-motion .st-cards-outline .st-project-card__link,
	.st-motion.st-cards-outline .st-project-card__link {
		transition: border-color var(--st-duration-fast) var(--st-ease);
	}

	.st-motion .st-next-project__arrow {
		transition: translate var(--st-duration) var(--st-ease);
	}

	@media (hover: hover) and (pointer: fine) {
		.st-caption-overlay .st-project-card__body {
			translate: 0 var(--st-space-2xs);
		}

		.st-caption-overlay .st-project-card__link:hover .st-project-card__body,
		.st-caption-overlay .st-project-card__link:focus-visible .st-project-card__body {
			translate: 0 0;
		}
	}

	.st-load-more.is-busy::after {
		animation: st-projects-spin calc(var(--st-duration) * 2) linear infinite;
	}

	@media (hover: hover) {
		.st-motion .st-project-card__link:hover .st-project-card__img,
		.st-motion .st-next-project:hover .st-next-project__img {
			scale: 1.03;
		}

		.st-motion .st-cards-elevated .st-project-card__link:hover,
		.st-motion.st-cards-elevated .st-project-card__link:hover {
			translate: 0 calc(-1 * var(--st-space-3xs));
		}

		.st-motion .st-next-project:hover .st-next-project__arrow {
			translate: var(--st-space-xs) 0;
		}

		[dir="rtl"] .st-motion .st-next-project:hover .st-next-project__arrow {
			translate: calc(-1 * var(--st-space-xs)) 0;
		}
	}
}

@keyframes st-projects-spin {
	to {
		rotate: 360deg;
	}
}

/* ==========================================================================
   16. Right-to-left
   ========================================================================== */

[dir="rtl"] .st-project-card__arrow .st-icon,
[dir="rtl"] .st-next-project__arrow .st-icon,
[dir="rtl"] .st-project-nav__link .st-icon,
[dir="rtl"] .st-project-meta__link .st-icon,
[dir="rtl"] .st-projects-block__more .st-icon,
[dir="rtl"] .st-projects-empty__actions .st-icon--arrow-right {
	scale: -1 1;
}

[dir="rtl"] .st-project-card__arrow {
	translate: 0.3em 0.3em;
}

[dir="rtl"] .st-project-card__link:focus-visible .st-project-card__arrow {
	translate: 0 0;
}

@media (hover: hover) {
	[dir="rtl"] .st-project-card__link:hover .st-project-card__arrow {
		translate: 0 0;
	}
}

/* ==========================================================================
   17. Print
   ========================================================================== */

@media print {
	.st-project-filter,
	.st-projects-pager,
	.st-project-more,
	.st-project-edit,
	.st-project-card__arrow {
		display: none;
	}

	.st-project-card,
	.st-project-meta__item,
	.st-project-credits__row {
		break-inside: avoid;
	}

	.st-caption-overlay .st-project-card__link {
		display: flex;
	}

	.st-caption-overlay .st-project-card__body {
		position: static;
		padding: 0;
		color: inherit;
		opacity: 1;
		translate: none;
	}

	.st-caption-overlay .st-project-card__media::after,
	.st-caption-overlay .st-project-card__body::before,
	.st-next-project__media::after,
	.st-next-project__body::before {
		content: none;
	}

	.st-project-hero.st-scheme-custom {
		background: none;
	}
}
