.ts-preview > div,
.ts-preview {
	height: 100% !important;
}

/* Grid feeds: override Voxel's inline item widths; carousel keeps them for snap. */
/* Stretch nested Elementor roots so cards fill equal-height grid rows. */
.post-feed-grid:not(.ts-feed-nowrap) {
	> div {
		width: auto !important;
		min-width: 0 !important;
	}

	> .ts-preview > div {
		display: grid;

		> .ef-card {
			height: auto;
			min-height: 100%;
		}
	}
}

/* Pagination shell lives in buttons.css; this keeps SVG + disabled behavior. */
.feed-pagination .ts-btn.ts-btn-1 svg {
	fill: currentColor;
}

.feed-pagination .ts-btn.ts-btn-1.disabled {
	opacity: 0.4;
	pointer-events: none;
}

.ts-feed-nowrap ~ .post-feed-nav {
	position: relative;
	height: auto;
	pointer-events: all;
	padding-top: var(--ef-space-m);
}

.post-feed-grid.ts-feed-masonry {
	display: block;
	columns: var(--ts-feed-columns, 3);

	> * {
		break-inside: avoid;
		margin-bottom: var(--ts-feed-gap, 20px);
	}

	&:has(.ef-card:not(.ef-card--edge-only).ef-card-edge--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) > * {
		margin-bottom: calc(var(--ts-feed-gap, 20px) * 3);
	}

	@media (min-width: 768px) and (max-width: 1023.98px) {
		&:has(.ef-card:not(.ef-card--edge-only).ef-card-edge-t--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) > * {
			margin-bottom: calc(var(--ts-feed-gap, 20px) * 3);
		}
	}

	@media (max-width: 767.98px) {
		&:has(.ef-card:not(.ef-card--edge-only).ef-card-edge-m--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) > * {
			margin-bottom: calc(var(--ts-feed-gap, 20px) * 3);
		}
	}
}

/* Extra feed gap lets active top-edge media clear row above. */
@media (min-width: 1024px) {
	.post-feed-grid:has(.ef-card:not(.ef-card--edge-only).ef-card-edge--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) {
		gap: calc(var(--ts-feed-gap, 20px) * 3);
	}

	.post-feed-grid > .ts-preview:has(.ef-card:not(.ef-card--edge-only).ef-card-edge--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { padding-block-start: calc(var(--ef-size-logo) / 2); }
	.ts-preview .ef-wrapper:has(> .ef-card:not(.ef-card--edge-only).ef-card-edge--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { padding-block-start: 0; }
	.ts-preview .ef-card.ef-card-edge--top:has(> :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { margin-top: 0; }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
	.post-feed-grid:has(.ef-card:not(.ef-card--edge-only).ef-card-edge-t--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) {
		gap: calc(var(--ts-feed-gap, 20px) * 3);
	}

	.post-feed-grid > .ts-preview:has(.ef-card:not(.ef-card--edge-only).ef-card-edge-t--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { padding-block-start: calc(var(--ef-size-logo) / 2); }
	.ts-preview .ef-wrapper:has(> .ef-card:not(.ef-card--edge-only).ef-card-edge-t--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { padding-block-start: 0; }
	.ts-preview .ef-card.ef-card-edge-t--top:has(> :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { margin-top: 0; }
}

@media (max-width: 767.98px) {
	.post-feed-grid:has(.ef-card:not(.ef-card--edge-only).ef-card-edge-m--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) {
		gap: calc(var(--ts-feed-gap, 20px) * 3);
	}

	.post-feed-grid > .ts-preview:has(.ef-card:not(.ef-card--edge-only).ef-card-edge-m--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { padding-block-start: calc(var(--ef-size-logo) / 2); }
	.ts-preview .ef-wrapper:has(> .ef-card:not(.ef-card--edge-only).ef-card-edge-m--top > :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { padding-block-start: 0; }
	.ts-preview .ef-card.ef-card-edge-m--top:has(> :is(.ef-card-edge-shell, .ef-card-edge-cluster):first-child) { margin-top: 0; }
}

/* A11y: --ts-shade-2 fails WCAG AA here; forms.css requires !important. */
:is(.ts-filter-text, .ts-shortcut) {
	color: var(--ts-shade-1) !important;
}

/* Quick-search: text absorbs slack; shortcut hint sits flush right. */
.ts-form .ts-filter > .ts-filter-text {
	flex: 1;
}

/* forms.css renders .ts-shortcut as a filled chip (background, 7px 10px
   padding, 5px radius, uppercase) that reads as a detached badge — and a
   per-instance Elementor rule (e.g. .elementor-NNN .elementor-element-XXX
   .ts-shortcut) can re-apply background/border-radius at (0,4,0), outranking
   this selector. Use !important to force the lightweight inline-hint look
   regardless of instance styling, matching the WCAG override above.
   Color/opacity are intentionally left to that WCAG rule — lightening them
   here would reintroduce the contrast failure it fixes. */
.ts-form .ts-filter > .ts-shortcut {
	right: 0;
	background: transparent !important;
	padding: 0 !important;
	border-radius: 0 !important;
	font-size: 11px !important;
	font-weight: 400 !important;
	text-transform: none !important;
}
