/* catalog module. Linked from the module itself; globalBase.css keeps only shared rules. */

/************************ Catalog *************************************/

#catalogSettings {
	float: right;
}

#catalogSortForm {
	float: left;
}

#catalogTable {
	margin: 0 auto;
	text-align: center;
	clear: both;
}

/* Auto columns: flex wrapping, centered */

#catalogTable.auto-cols {
	text-align: center;
}

#catalogTable.auto-cols tr,
#catalogTable.auto-cols tbody {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
}

#catalogTable.auto-cols .thread {
	display: inline-block;
	margin: 0.5em;
}

/* Fixed columns: CSS grid */

#catalogTable.fixed-cols tr,
#catalogTable.fixed-cols tbody {
	display: grid;
	grid-template-columns: repeat(var(--cat-cols, 5), auto);
	justify-content: center;
}

#catalogTable.fixed-cols .thread {
	margin: 0.5em;
}

#catalogTable.fixed-cols .catComment {
	max-height: 100px;
	overflow: hidden;
}

#catalogTable.fixed-cols .catComment:hover {
	overflow: auto;
}

/* Full width: stretch table and distribute threads across the page */

#catalogTable.full-width {
	display: block;
	width: 100%;
}

#catalogTable.full-width tbody {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
}

#catalogTable.full-width tr {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	justify-content: space-evenly;
}

#catalogTable.full-width.fixed-cols tr {
	display: grid;
	grid-template-columns: repeat(var(--cat-cols, 5), 1fr);
	justify-items: center;
}

#catalogTable .thread {
	padding: 0 0 0.5em;
	width: 180px;
	max-height: 250px;
	max-width: 170px;
	text-align: center;
	vertical-align: top;
	overflow-y: hidden;
	overflow-wrap: break-word;
	overflow-wrap: anywhere;
}

#catalogTable .thread:hover {
	overflow-y: auto;
}

#catalogTable .thumb {
	display: block;
	margin: 0 auto 0.75em;
	width: 150px;
	height: 150px;
	object-fit: scale-down;
}

#catalogTable .catPostInfo {
	font-size: var(--font-size-small);
}

#catalogTable .catPostInfo .title {
	display: inline-block;
	font-size: inherit;
  max-width: 100%;
	vertical-align: text-bottom;
	overflow: hidden;
	text-overflow: ellipsis;
  white-space: nowrap;
}

#catalogTable .catPostInfo .Replies {
	display: inline-block;
}

.catComment {
	display: table;
  margin: 0 auto;
	text-align: left;
	font-size: var(--font-size-small);
}

@media screen and (max-width: 600px) {
	#catalogTable .thread {
		width: 140px;
		max-width: 140px;
	}

	#catalogTable .thumb {
		max-width: 135px;
	}

}
