/**
 * PROM work grid. Scoped to Semplice Portfolio Grid modules with the class `prom-work-grid`.
 * Semplice takes each tile's width from the project's own thumbnail setting; this grid
 * always uses the Figma layout instead, without touching the projects.
 */

/* Columns: 3 desktop, 2 tablet, 1 mobile (Semplice breakpoints).
   Semplice sizes tiles with `[data-breakpoint=xl] [data-xl-width="6"]` (two attribute selectors);
   three classes are more specific, so no !important is needed. */
.prom-work-grid .masonry .masonry-item {
	width: 33.3333%;
	max-width: 33.3333%;
	flex-basis: 33.3333%;
}
@media screen and (max-width: 991.98px) {
	.prom-work-grid .masonry .masonry-item { width: 50%; max-width: 50%; flex-basis: 50%; }
}
@media screen and (max-width: 543.98px) {
	.prom-work-grid .masonry .masonry-item { width: 100%; max-width: 100%; flex-basis: 100%; }
}

/* 16:9 tiles; image or video thumbnail fills the tile. */
.prom-work-grid .thumb-inner {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}
.prom-work-grid .thumb-inner > img,
.prom-work-grid .thumb-inner > video.masonry-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Semplice's hover layer: keep only its video (the preview). No dark overlay, no hover text.
   Beats `.thumb .thumb-inner .thumb-hover` (Customize › thumbnail hover colour) by one class. */
.prom-work-grid .thumb .thumb-inner .thumb-hover {
	opacity: 1;
	background: none;
	transition: none;
	pointer-events: none;
}
.prom-work-grid .thumb-hover .thumb-hover-meta { display: none; }
.prom-work-grid .thumb-hover smp-bg-video {
	opacity: 0; /* faded in by work-grid.js once the video is playing */
}
.prom-work-grid .thumb-hover smp-bg-video video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Title centred over the image, project type near the bottom. Always visible.
   Semplice centres overlay titles with `[data-module=portfoliogrid] .middle-center .post-title`
   { top:50%; transform:translateY(-50%) }; this selector is one class more specific. */
.prom-work-grid .thumb .thumb-inner .post-title {
	position: absolute;
	inset: 0;
	transform: none;
	width: 100%;
	height: 100%;
	z-index: 11;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	pointer-events: none;
}
/* Side padding goes on .pt-title: the module styles .post-title's padding with two IDs. */
.prom-work-grid .post-title .pt-title {
	padding: 0 6%;
	line-height: 1.05;
	text-wrap: balance; /* even lines: "FROM TIMES SQUARE / TO THE WORLD", not a lone last word */
}
.prom-work-grid .post-title .pt-category {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8.5%;
}

/* Title and project type sizes, per breakpoint, are set in the Portfolio Grid module
   (Title › font size for each breakpoint), not here. */

/* PLAY cursor (created by work-grid.js). Outer element follows the pointer, inner one scales. */
.prom-play-cursor {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 9999;
	pointer-events: none;
	will-change: transform;
}
.prom-play-cursor__dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px; /* centre on the pointer */
	border-radius: 50%;
	background: #E8D475;
	color: #474038;
	font-family: "NeulisAlt-Medium-1", sans-serif;
	font-size: 13px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	opacity: 0;
	transform: scale(0.5);
}

/* Hide the system cursor over a tile's picture (not its gutter or caption), only once the custom cursor works. */
@media (hover: hover) and (pointer: fine) {
	html.prom-cursor-ready .prom-work-grid .masonry-item .thumb-inner,
	html.prom-cursor-ready .prom-work-grid .masonry-item .thumb-inner * {
		cursor: none;
	}
}
