/* VFX grid: the poster grid of the VFX page (one grid per set of work: movies, ads, ...).
   Everything is driven by custom properties and classes printed by soul_vfx_grid_html() (inc/vfx-grid.php):
     --vg-cols / --vg-cols-md / --vg-cols-sm   columns on desktop / tablet / phone
     --vg-gap-x / --vg-gap-y                   gap between columns / between rows
     vg--shape-*       poster shape            vg--no-title, vg--no-role, vg--no-company   hide a text line (the rest closes up)
     vg--hover-*       hover effect
   Loaded on the front end whenever a grid is on the page, and inside WP Admin for the live preview on the grid's edit screen. */

.vg {
	--vg-cols: 3;
	--vg-cols-md: 3;
	--vg-cols-sm: 2;
	--vg-gap-x: 24px;
	--vg-gap-y: 40px;
	margin: clamp(24px, 3vw, 40px) 0;
}
.vg__list {
	display: grid;
	grid-template-columns: repeat(var(--vg-cols), minmax(0, 1fr));
	column-gap: var(--vg-gap-x);
	row-gap: var(--vg-gap-y);
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (max-width: 1000px) {
	.vg__list {
		grid-template-columns: repeat(var(--vg-cols-md), minmax(0, 1fr));
	}
}
@media (max-width: 640px) {
	.vg__list {
		grid-template-columns: repeat(var(--vg-cols-sm), minmax(0, 1fr));
		column-gap: min(var(--vg-gap-x), 16px);
		row-gap: min(var(--vg-gap-y), 28px);
	}
}

.vg__item {
	margin: 0;
	min-width: 0;
}
.vg__link,
.vg__card {
	display: block;
	color: inherit;
	text-decoration: none;
}
.vg__link:focus-visible {
	outline: 2px solid var(--accent, #8a6f45);
	outline-offset: 4px;
}

/* the picture */
.vg__poster {
	position: relative;
	margin: 0;
}
.vg__img {
	display: block;
	position: relative;
	overflow: hidden;
	aspect-ratio: 2 / 3;
	background: var(--tint, rgb(0 0 0 / .08));
	transition: transform .5s ease, box-shadow .5s ease, filter .5s ease, outline-color .4s ease;
}
.vg--shape-poster .vg__img { aspect-ratio: 2 / 3; }
.vg--shape-portrait .vg__img { aspect-ratio: 4 / 5; }
.vg--shape-square .vg__img { aspect-ratio: 1 / 1; }
.vg--shape-landscape .vg__img { aspect-ratio: 16 / 9; }
.vg__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s ease;
}
.vg__cones {
	display: none;
}

/* the text under each picture; a hidden line takes no room, so the spacing always stays even */
.vg__text {
	display: block;
	margin-top: 10px;
}
.vg__title {
	display: block;
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
}
.vg__role,
.vg__company {
	display: block;
	margin: 2px 0 0;
	font-family: var(--mono, ui-monospace, monospace);
	font-size: 12px;
	letter-spacing: .02em;
	color: var(--ink-soft, #6b6257);
}
.vg__title:first-child { margin-top: 0; }
.vg--no-title .vg__title,
.vg--no-role .vg__role,
.vg--no-company .vg__company {
	display: none;
}
.vg--no-title.vg--no-role.vg--no-company .vg__text {
	display: none;
}

/* ---------- hover effects ---------- */
/* lift: the picture rises a little and throws a soft shadow */
.vg--hover-lift .vg__item:hover .vg__img,
.vg--hover-lift .vg__item:focus-within .vg__img {
	transform: translateY(-6px);
	box-shadow: 0 16px 24px -12px rgb(0 0 0 / .45);
}
/* zoom: the picture grows inside its frame */
.vg--hover-zoom .vg__item:hover .vg__img img,
.vg--hover-zoom .vg__item:focus-within .vg__img img {
	transform: scale(1.07);
}
/* dim: everything else steps back while one poster is hovered */
.vg--hover-dim .vg__item {
	transition: opacity .4s ease;
}
.vg--hover-dim .vg__list:hover .vg__item:not(:hover):not(:focus-within) {
	opacity: .4;
}
/* outline: a thin accent frame appears */
.vg--hover-outline .vg__img {
	outline: 2px solid transparent;
	outline-offset: 4px;
}
.vg--hover-outline .vg__item:hover .vg__img,
.vg--hover-outline .vg__item:focus-within .vg__img {
	outline-color: var(--accent, #8a6f45);
}
/* fade: the picture fades towards the page colour (the title stays), like a print being picked up */
.vg--hover-fade .vg__item:hover .vg__img,
.vg--hover-fade .vg__item:focus-within .vg__img {
	filter: saturate(1.15) contrast(1.05);
}
.vg--hover-fade .vg__img {
	filter: saturate(.8) brightness(.94);
}

/* spotlights: a poster hung in a frame on the wall. On hover three separate cones of warm light fall on it from above.
   Before that it is framed and dimly lit. */
.vg--hover-spot .vg__img {
	border: 5px solid #1c1814;
	box-shadow: inset 0 0 0 1px rgb(0 0 0 / .5), 0 10px 18px -8px rgb(0 0 0 / .5);
	filter: brightness(.78) saturate(.9);
}
.vg--hover-spot .vg__cones {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
	opacity: 0;
	pointer-events: none;
	mix-blend-mode: screen;
	transition: opacity .55s ease;
	background:
		radial-gradient(ellipse 26% 95% at 15% 0, rgb(255 233 186 / .6), rgb(255 233 186 / 0) 100%),
		radial-gradient(ellipse 26% 95% at 50% 0, rgb(255 233 186 / .6), rgb(255 233 186 / 0) 100%),
		radial-gradient(ellipse 26% 95% at 85% 0, rgb(255 233 186 / .6), rgb(255 233 186 / 0) 100%);
}
.vg--hover-spot .vg__item:hover .vg__img,
.vg--hover-spot .vg__item:focus-within .vg__img {
	filter: brightness(1.08) saturate(1.05);
}
.vg--hover-spot .vg__item:hover .vg__cones,
.vg--hover-spot .vg__item:focus-within .vg__cones {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.vg__img,
	.vg__img img,
	.vg__cones {
		transition: none;
	}
}

/* in WP Admin (live preview on the grid's edit screen) */
.soulvg-preview .vg {
	margin: 0;
	padding: 18px;
	background: #cabfb2;
	color: #1e1c1a;
}
.soulvg-preview .vg__link {
	pointer-events: auto;
}
