.tptn-grid-thumbs {
	--tptn-grid-gap: 12px;
	--tptn-grid-thumb-min-size: 150px;
	--tptn-grid-card-bg: #fff;
	--tptn-grid-card-border: rgba(0, 0, 0, 0.06);
	--tptn-grid-card-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
	--tptn-grid-card-shadow-hover: 0 6px 14px rgba(0, 0, 0, 0.12);
	--tptn-grid-card-muted: #666;
	--tptn-grid-transition: 0.2s ease-in-out;
	--tptn-grid-card-radius: 8px;
	--tptn-grid-thumb-aspect-ratio: auto;
	width: 100%;
	max-width: 100%;
	margin: 0;
	container-type: inline-size;
	container-name: tptn-grid-thumbs;
}

.tptn-grid-thumbs h3 {
	margin-bottom: 20px;
}

.tptn-grid-thumbs ul {
	list-style-type: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: var(--tptn-grid-gap);
	grid-template-columns: repeat(
		auto-fit,
		minmax(var(--tptn-grid-thumb-min-size), 1fr)
	);
}

.tptn-grid-thumbs li {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	background-color: var(--tptn-grid-card-bg);
	border: 1px solid var(--tptn-grid-card-border);
	border-radius: var(--tptn-grid-card-radius);
	overflow: hidden;
	box-shadow: var(--tptn-grid-card-shadow);
	transition:
		transform var(--tptn-grid-transition),
		box-shadow var(--tptn-grid-transition);
	width: 100%;
}

.tptn-grid-thumbs li:hover {
	transform: translateY(-5px);
	box-shadow: var(--tptn-grid-card-shadow-hover);
}

.tptn-grid-thumbs a.tptn_link {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	text-decoration: none;
	color: inherit;
	width: 100%;
}

.tptn-grid-thumbs img.tptn_thumb {
	width: min(var(--tptn-grid-thumb-width, 100%), 100%) !important;
	height: auto !important;
	max-width: 100%;
	max-height: var(--tptn-grid-thumb-height, none);
	margin: auto;
	object-fit: cover;
	aspect-ratio: var(--tptn-grid-thumb-aspect-ratio, auto);
}

.tptn-grid-thumbs .tptn_after_thumb {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	width: 100%;
	padding: 0.75rem;
	box-sizing: border-box;
}

.tptn-grid-thumbs .tptn_title {
	display: block;
	font-weight: 600;
	margin-bottom: 0.625rem;
	font-size: 1em;
	text-decoration: none;
	line-height: 1.2;
}

.tptn-grid-thumbs a.tptn_link:hover .tptn_title {
	text-decoration: none;
}

.tptn-grid-thumbs .tptn_list_count {
	font-size: 0.9em;
	color: var(--tptn-grid-card-muted);
	margin-top: auto;
}

@container tptn-grid-thumbs (min-width: 480px) {
	.tptn-grid-thumbs ul {
		grid-template-columns: repeat(
			auto-fit,
			minmax(var(--tptn-grid-thumb-min-size), 1fr)
		);
	}
}

@container tptn-grid-thumbs (min-width: 768px) {
	.tptn-grid-thumbs ul {
		grid-template-columns: repeat(
			auto-fit,
			minmax(var(--tptn-grid-thumb-min-size), 1fr)
		);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tptn-grid-thumbs li {
		transition: none;
	}

	.tptn-grid-thumbs li:hover {
		transform: none;
	}
}
