/**
 * Periscope Mobile Overflow Fix.
 *
 * Grid and flex items default to min-width: auto, i.e. they never shrink
 * below their widest unbreakable line. One long line (words joined by
 * non-breaking spaces, a fixed-width image) then pushes the whole column
 * past the grid's padding — up to ~55px at 360px wide (dataset list,
 * Applications cards, insight resource, CTA). min-width: 0 lets columns
 * keep their intended width; the content inside then wraps or scales.
 */

@media (max-width: 1023px) {

	.algst_wrapper .algst_grid > .algst_col,
	.algst_wrapper .algst_content-wrapper > *,
	.algst_wrapper.algst_dataset-list-wrapper .algst_dataset-list-grid .algst_dataset-list-content-col .algst_content-wrapper .algst_description-wrapper .algst_dataset-list-items > li {
		min-width: 0;
	}

	/* Dataset list: two columns stay two columns, but share the width.
	   Same selector chain as the block's own rule, so this one wins. */
	.algst_wrapper.algst_dataset-list-wrapper .algst_dataset-list-grid .algst_dataset-list-content-col .algst_content-wrapper .algst_description-wrapper .algst_dataset-list-items {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}

	/* Media never wider than its column. */
	.algst_wrapper img,
	.algst_wrapper video,
	.algst_wrapper iframe {
		max-width: 100%;
	}

	.algst_wrapper img {
		height: auto;
	}
}

@media (max-width: 480px) {

	/* Narrow phones: two dataset columns leave ~110px per item after the
	   tick indent — "Constituencies" alone barely fits. One column. */
	.algst_wrapper.algst_dataset-list-wrapper .algst_dataset-list-grid .algst_dataset-list-content-col .algst_content-wrapper .algst_description-wrapper .algst_dataset-list-items {
		grid-template-columns: minmax( 0, 1fr );
	}
}
