/**
 * Eventually Work Grid
 * Uncode's theme CSS styles the tab bar (.tab-container .nav-tabs) and the tiles (.tmb ...).
 * This file only adds what Isotope used to do: the square grid layout.
 */

/* Same top spacing as the old Uncode block row. */
.ew-work {
	padding-top: 36px;
}

/* Hidden filter buttons and tiles. !important because Uncode sets display on li/.tmb. */
.ew-work .ew-filters li[hidden],
.ew-work .ew-grid .tmb.ew-hidden {
	display: none !important;
}

/* Square tiles without gaps. Columns match the old Isotope metro layout. */
.ew-work .ew-grid {
	display: grid;
	grid-template-columns: 1fr;
}

@media (min-width: 455px) {
	.ew-work .ew-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 795px) {
	.ew-work .ew-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (min-width: 1080px) {
	.ew-work .ew-grid {
		grid-template-columns: repeat(6, 1fr);
	}
}

/* Reset Isotope sizing classes (tmb-iso-w2/h2) and force square tiles. */
.ew-work .ew-grid .tmb {
	position: relative;
	width: auto;
	float: none;
	aspect-ratio: 1 / 1;
}

.ew-work .ew-grid .tmb .t-inside,
.ew-work .ew-grid .tmb .t-entry-visual,
.ew-work .ew-grid .tmb .t-entry-visual-tc,
.ew-work .ew-grid .tmb .t-entry-visual-cont {
	height: 100%;
}

/*
 * Uncode sets .t-inside to display: table. Firefox doesn't pass percentage heights
 * through a table to its children, so the tile content collapsed to 0px there.
 */
.ew-work .ew-grid .tmb .t-inside {
	display: block;
}

/* Background image fills the tile, like the metro layout. */
.ew-work .ew-grid .tmb .t-background-click,
.ew-work .ew-grid .tmb .t-background-cover {
	position: absolute;
	inset: 0;
}

.ew-work .ew-grid .tmb .t-background-cover {
	background-size: cover;
	background-position: center;
}
