/* ---------------------------------------------------------------------------
   Galleries
   Hero slideshow, work cards on uniform "wall" panels, the filter bar, the
   single-work stage, pager and the "more from" strip. Images are never
   cropped anywhere in here.
--------------------------------------------------------------------------- */

/* --- Hero slideshow (front page) --------------------------------------------- */

.hero--section {
	padding-top: calc(var(--section-pad) * .6);
}

.hero--head {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	margin-bottom: var(--space-l);
}

.hero--title {
	font-size: var(--text-display);
	line-height: .95;
	letter-spacing: -.02em;
}

.hero--tagline {
	margin: 0;
	font-size: var(--text-lede);
	font-family: var(--font-serif);
	font-style: italic;
	color: var(--color-ink-soft);
}

@media (min-width: 768px) {
	.hero--head {
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
		gap: var(--space-m);
	}
}

/* Every slide is cropped to the same frame. The ratio is the artist's
   portrait (555 × 400); the frame fills the container until its height would
   pass 82vh, then it narrows and centres. */
.hero--stage {
	--hero-ratio: 555 / 400;
	position: relative;
	width: min(100%, calc(82vh * 555 / 400));
	aspect-ratio: var(--hero-ratio);
	margin-inline: auto;
	background: var(--color-wall);
	overflow: hidden;
}

.hero--slide {
	position: absolute;
	inset: 0;
	display: block;
	opacity: 0;
	transition: opacity .9s var(--ease);
}

.hero--slide.is-active {
	opacity: 1;
}

.hero--slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.hero--controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-m);
	padding-top: var(--space-s);
}

.hero--counter {
	display: flex;
	align-items: baseline;
	gap: .35em;
	margin: 0;
	font-family: var(--font-serif);
	font-size: 1.125rem;
	font-variant-numeric: tabular-nums;
	color: var(--color-ink-soft);
}

.hero--caption {
	margin-left: 1rem;
	font-family: var(--font-sans);
	font-size: var(--text-small);
}

.hero--caption:empty {
	display: none;
}

.hero--counter-sep {
	margin-inline: .35em;
	opacity: .6;
}

.hero--buttons {
	display: flex;
	gap: .25rem;
}

.hero--button {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--color-ink);
	transition: background-color .25s var(--ease);
}

.hero--button:hover {
	background: var(--color-wall);
}

.hero--button:focus-visible {
	outline: 2px solid var(--color-ink);
	outline-offset: 2px;
}

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

.work-grid--toolbar {
	margin-bottom: var(--space-m);
	padding-bottom: var(--space-s);
	border-bottom: 1px solid var(--color-line);
}

.work-grid--toolbar .eyebrow {
	margin-bottom: 0;
}

.filter-bar--list {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem .5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.filter-bar--item {
	display: inline-block;
	padding: .35rem .75rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: var(--text-small);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	color: var(--color-ink-soft);
	text-decoration: none;
	transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}

.filter-bar--item:hover {
	color: var(--color-ink);
	border-color: var(--color-line-strong);
}

.filter-bar--item[aria-current] {
	color: var(--color-paper);
	background: var(--color-ink);
	border-color: var(--color-ink);
}

.filter-bar--item:focus-visible {
	outline: 2px solid var(--color-ink);
	outline-offset: 2px;
}

/* --- Work cards -------------------------------------------------------------- */

.work-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
	gap: var(--space-l) var(--space-m);
}

.work-grid--empty {
	grid-column: 1 / -1;
	color: var(--color-ink-soft);
}

.work-card {
	margin: 0;
}

.work-card--link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.work-card--image {
	display: grid;
	place-items: center;
	aspect-ratio: 4 / 5;
	padding: 8%;
	background: var(--color-wall);
	overflow: hidden;
}

.work-card--image img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 1px 2px rgba(28, 27, 25, .08);
	transition: transform .6s var(--ease);
}

.work-card--link:hover .work-card--image img,
.work-card--link:focus-visible .work-card--image img {
	transform: scale(1.025);
}

.work-card--link:focus-visible {
	outline: 2px solid var(--color-ink);
	outline-offset: 4px;
}

.work-card--caption {
	display: flex;
	flex-direction: column;
	gap: .15rem;
	margin-top: var(--space-s);
}

.work-card--title {
	font-family: var(--font-serif);
	font-size: 1.25rem;
	line-height: 1.2;
}

.work-card--meta {
	font-size: var(--text-small);
	color: var(--color-ink-soft);
}

/* --- Single work -------------------------------------------------------------- */

.work--stage-section {
	padding-top: var(--space-m);
}

.work--stage {
	display: grid;
	place-items: center;
	min-height: 50vh;
	padding: clamp(1rem, 4vw, 3.5rem);
	background: var(--color-wall);
}

.work--zoom {
	display: block;
	max-width: 100%;
	cursor: zoom-in;
}

.work--zoom:focus-visible {
	outline: 2px solid var(--color-ink);
	outline-offset: 6px;
}

.work--image {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 78vh;
	box-shadow: 0 2px 6px rgba(28, 27, 25, .1);
}

.work--body {
	display: grid;
	gap: var(--space-l);
	padding-block: var(--space-l) var(--section-pad);
}

.work--header .eyebrow a {
	text-decoration: none;
}

.work--header .eyebrow a:hover {
	text-decoration: underline;
}

.work--title {
	font-size: var(--text-h1);
}

.work--year {
	margin: var(--space-xs) 0 0;
	font-family: var(--font-serif);
	font-size: var(--text-lede);
	color: var(--color-ink-soft);
}

.work--details {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: .5rem var(--space-m);
	padding-top: var(--space-m);
	border-top: 1px solid var(--color-line);
	font-size: var(--text-body);
}

.work--details dt {
	color: var(--color-ink-soft);
}

.work--details dd {
	margin: 0;
}

.work--notes {
	margin-top: var(--space-m);
	color: var(--color-ink-soft);
}

.work--pager {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: start;
	gap: var(--space-m);
	padding-top: var(--space-m);
	border-top: 1px solid var(--color-line);
	font-size: var(--text-small);
}

.work--pager-link {
	display: flex;
	flex-direction: column;
	gap: .2rem;
	text-decoration: none;
}

.work--pager-next {
	text-align: right;
}

.work--pager-label {
	font-size: var(--text-eyebrow);
	font-weight: 500;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--color-ink-soft);
}

.work--pager-title {
	font-family: var(--font-serif);
	font-size: 1.125rem;
}

.work--pager-link:hover .work--pager-title {
	text-decoration: underline;
	text-underline-offset: .2em;
	text-decoration-color: var(--color-line-strong);
}

.work--pager-all {
	align-self: center;
	padding: .35rem .9rem;
	border: 1px solid var(--color-line-strong);
	border-radius: 999px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.work--pager-all:hover {
	background: var(--color-ink);
	border-color: var(--color-ink);
	color: var(--color-paper);
}

@media (min-width: 992px) {
	.work--body {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: var(--space-xl);
	}

	.work--pager {
		grid-column: 1 / -1;
	}
}

/* --- Strip ("More paintings") -------------------------------------------------- */

.work-strip {
	display: flex;
	gap: var(--space-m);
	margin: 0 calc(var(--gutter) * -1);
	padding: 0 var(--gutter) var(--space-s);
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--gutter);
	scrollbar-width: thin;
	scrollbar-color: var(--color-line-strong) transparent;
}

.work-strip--item {
	flex: 0 0 auto;
	width: min(60vw, 220px);
	scroll-snap-align: start;
}

.work-strip--link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.work-strip--image {
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	padding: 10%;
	background: var(--color-wall);
}

.work-strip--image img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.work-strip--title {
	display: block;
	margin-top: .6rem;
	font-family: var(--font-serif);
	font-size: 1.0625rem;
	line-height: 1.2;
}

.work-strip--meta {
	display: block;
	font-size: var(--text-small);
	color: var(--color-ink-soft);
}

.work-strip--link:hover .work-strip--title {
	text-decoration: underline;
	text-underline-offset: .2em;
	text-decoration-color: var(--color-line-strong);
}

.work-strip--link:focus-visible {
	outline: 2px solid var(--color-ink);
	outline-offset: 4px;
}

/* --- Core gallery / image blocks inside page content ---------------------------- */

.wp-block-gallery.has-nested-images figure.wp-block-image img {
	background: var(--color-wall);
}
