/* Project archive (the Architecture page), chosen on 26 September 2026, Figma row H04.
   A grid with the names under the photographs: three columns on desktop and tablet in
   landscape, two on tablet in portrait, one on phones. The Featured filter shows large
   photographs with the names on them, two to a row on desktop and one below that.
   The filter bar stays at the top while scrolling and moves down when the header returns. */

.sha-archive-view {
	--sha-deep: #fafaf9;
	--sha-gutter: clamp(20px, 3.2vw, 56px);
	--sha-ease: cubic-bezier(.22, .61, .36, 1);
	--sha-bar: var(--wp-admin--admin-bar--height, 0px);
	background: var(--sha-deep);
	color: #31312c;
	font-family: "Fact", "Inter", system-ui, sans-serif;
	font-weight: 300;
	-webkit-font-smoothing: antialiased;
}

html.lenis:has(.sha-archive-view) {
	scroll-behavior: auto;
}

/* The cover shown while "All projects" restores the scroll position (inc/assets.php). */
html.sha-theme-scroll-restoring:has(.sha-archive-view)::before {
	background: var(--sha-deep, #fafaf9);
}

.sha-archive-view .wp-site-blocks {
	padding: 0;
}

.sha-archive-view .wp-site-blocks > *,
.sha-archive-page > * {
	margin-block: 0;
}

.sha-archive-page {
	margin: 0;
	padding: 0;
}

.sha-archive,
.sha-archive * {
	box-sizing: border-box;
}

.sha-archive :where(h1, h2, p, ul, li) {
	margin: 0;
	padding: 0;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
}

.sha-archive ul {
	list-style: none;
}

.sha-archive a {
	color: inherit;
	text-decoration: none;
}

.sha-archive {
	--sha-archive-head: 0px;
	padding: clamp(112px, 11.9vw, 180px) 0 clamp(96px, 10vw, 150px);
}

.sha-archive__title {
	padding: 0 var(--sha-gutter);
	font-weight: 300;
	font-size: clamp(38px, 4.2vw, 64px);
	line-height: 1.1;
	letter-spacing: -.005em;
}

/* Filter bar */

.sha-archive__bar {
	position: sticky;
	top: calc(var(--sha-bar) + var(--sha-archive-head));
	z-index: 20;
	display: flex;
	align-items: baseline;
	gap: 24px;
	margin-top: clamp(20px, 2.4vw, 36px);
	padding: 14px var(--sha-gutter) 16px;
	background: var(--sha-deep);
	transition: top .5s var(--sha-ease), box-shadow .4s;
}

/* When the header slides back over a stuck bar, the band behind it stays the page colour. */
.sha-archive__bar::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 0;
	background: var(--sha-deep);
	transition: height .5s var(--sha-ease);
}

.sha-archive__bar.is-stuck {
	box-shadow: 0 1px 0 rgba(49, 49, 44, .09);
}

.sha-archive__bar.is-stuck::before {
	height: var(--sha-archive-head);
}

.sha-archive__filters {
	flex: 1;
	min-width: 0;
}

.sha-archive__filters ul {
	display: flex;
	gap: 0 clamp(22px, 2.4vw, 36px);
}

.sha-archive__filters li {
	flex: none;
}

.sha-archive__filter {
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
	padding-bottom: 6px;
	border-bottom: 1px solid transparent;
	font-size: clamp(15px, 1.12vw, 17px);
	line-height: 24px;
	white-space: nowrap;
	opacity: .6;
	transition: opacity .4s var(--sha-ease), border-color .4s var(--sha-ease);
}

.sha-archive__filter:hover,
.sha-archive__filter:focus-visible,
.sha-archive__filter.is-active {
	opacity: 1;
}

.sha-archive__filter.is-active {
	border-bottom-color: currentColor;
}

.sha-archive__filter:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: 4px;
}

.sha-archive__n {
	font-size: 12px;
	font-weight: 400;
	opacity: .5;
}

.sha-archive__count {
	flex: none;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	opacity: .5;
}

/* The list */

.sha-archive__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 36px 24px;
	padding: clamp(24px, 3.3vw, 40px) var(--sha-gutter) 0;
}

.sha-archive__item[hidden] {
	display: none;
}

.sha-archive__card {
	position: relative;
	display: block;
}

.sha-archive__card:focus-visible {
	outline: 1px solid #31312c;
	outline-offset: 6px;
}

.sha-archive__photo {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background: #ececea;
}

.sha-archive__photo img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--sha-project-focal, 50% 50%);
	transition: transform 1.2s var(--sha-ease), filter 1.2s var(--sha-ease);
}

.sha-archive__photo picture {
	display: contents;
}

@media (hover: hover) {
	.sha-archive__card:hover .sha-archive__photo img {
		transform: scale(1.03);
	}
}

.sha-archive__words {
	padding-top: 14px;
}

.sha-archive__name {
	font-weight: 300;
	font-size: clamp(17px, 1.26vw, 19px);
	line-height: 1.32;
}

.sha-archive__place {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	font-weight: 400;
	line-height: 18px;
	opacity: .55;
}

.sha-archive__empty {
	padding: 40px var(--sha-gutter) 0;
	opacity: .7;
}

/* Featured: large photographs with the names on them, as on the homepage chapters */

.sha-archive[data-view="large"] .sha-archive__list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px;
	padding-inline: 0;
}

.sha-archive[data-view="large"] .sha-archive__item.is-wide {
	grid-column: 1 / -1;
}

.sha-archive[data-view="large"] .is-wide .sha-archive__photo {
	aspect-ratio: 1512 / 700;
}

.sha-archive[data-view="large"] .sha-archive__photo::after {
	content: "";
	position: absolute;
	left: -30%;
	bottom: -55%;
	width: 120%;
	height: 130%;
	background: radial-gradient(closest-side, rgba(0, 0, 0, .46), rgba(0, 0, 0, .18) 60%, rgba(0, 0, 0, 0));
	pointer-events: none;
}

.sha-archive[data-view="large"] .sha-archive__words {
	color: #fff; /* over the photograph, on the light page too */
	position: absolute;
	left: 32px;
	right: 32px;
	bottom: 30px;
	padding: 0;
}

.sha-archive[data-view="large"] .sha-archive__name {
	font-size: clamp(24px, 2vw, 30px);
	line-height: 1.2;
}

.sha-archive[data-view="large"] .sha-archive__place {
	margin-top: 6px;
	font-size: 14px;
	line-height: 20px;
	opacity: .88;
}

/* Switching filters: the list fades out, then the new projects settle in. */

.sha-archive__list {
	transition: opacity .3s var(--sha-ease), transform .3s var(--sha-ease);
}

.sha-archive__list.is-leaving {
	opacity: 0;
	transform: translateY(8px);
}

.sha-archive__list.is-entering > .sha-archive__item {
	animation: sha-archive-rise .9s var(--sha-ease) both;
	animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes sha-archive-rise {
	from { opacity: 0; transform: translateY(18px); }
	to { opacity: 1; transform: none; }
}

/* Tablet in portrait: two columns; Featured one to a row. */

@media (max-width: 63.99rem) {
	.sha-archive__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px 20px;
	}

	.sha-archive[data-view="large"] .sha-archive__list {
		grid-template-columns: minmax(0, 1fr);
	}

	.sha-archive[data-view="large"] .is-wide .sha-archive__photo {
		aspect-ratio: 3 / 2;
	}
}

/* Phones: one column; Featured photographs are taller, the filters scroll sideways and the
   count is left to screen readers (each filter already shows its own). */

@media (max-width: 47.99rem) {
	.sha-archive__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.sha-archive[data-view="large"] .sha-archive__photo,
	.sha-archive[data-view="large"] .is-wide .sha-archive__photo {
		aspect-ratio: 4 / 5;
	}

	.sha-archive[data-view="large"] .sha-archive__words {
		left: 20px;
		right: 20px;
		bottom: 20px;
	}

	.sha-archive__bar {
		padding-inline: 0;
	}

	.sha-archive__filters {
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
		mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
	}

	.sha-archive__filters::-webkit-scrollbar {
		display: none;
	}

	.sha-archive__filters ul {
		width: max-content;
		padding: 0 var(--sha-gutter);
	}

	.sha-archive__count {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

.sha-archive-view .sha-site-footer {
	font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
	.sha-archive *,
	.sha-archive *::before,
	.sha-archive *::after,
	.sha-archive__list {
		animation: none !important;
		transition: none !important;
	}
}
