/**
 * One-off content stylesheet for scraped nnpsa.com blog HTML.
 * Enqueued by rsi-blog-importer on imported posts.
 *
 * Covers Foundation-style .row / .column grids, floated images,
 * and common inline layout patterns found in Einstein richtext.
 */

.rsi-blog-content {
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.rsi-blog-content > *:first-child {
	margin-top: 0;
}

.rsi-blog-content img {
	max-width: 100%;
	height: auto;
}

.rsi-blog-content .alignleft,
.rsi-blog-content img[style*="float: left"],
.rsi-blog-content img[style*="float:left"] {
	float: left;
	margin: 0.5rem 1.25rem 1rem 0;
	max-width: min(100%, 320px);
}

.rsi-blog-content .alignright,
.rsi-blog-content img[style*="float: right"],
.rsi-blog-content img[style*="float:right"] {
	float: right;
	margin: 0.5rem 0 1rem 1.25rem;
	max-width: min(100%, 320px);
}

.rsi-blog-content .aligncenter,
.rsi-blog-content img[style*="display: block"][style*="margin"] {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* Foundation-like row / column grid preserved from source HTML */
.rsi-blog-content .row {
	display: flex;
	flex-wrap: wrap;
	margin-left: -0.75rem;
	margin-right: -0.75rem;
	clear: both;
}

.rsi-blog-content .row.collapse,
.rsi-blog-content .row.large-collapse {
	margin-left: 0;
	margin-right: 0;
}

.rsi-blog-content .row.collapse > .column,
.rsi-blog-content .row.collapse > .columns,
.rsi-blog-content .row.large-collapse > .column,
.rsi-blog-content .row.large-collapse > .columns {
	padding-left: 0;
	padding-right: 0;
}

.rsi-blog-content .column,
.rsi-blog-content .columns {
	box-sizing: border-box;
	flex: 1 1 100%;
	min-width: 0;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	margin-bottom: 1rem;
}

.rsi-blog-content .column.shrink,
.rsi-blog-content .columns.shrink {
	flex: 0 0 auto;
	width: auto;
}

.rsi-blog-content .small-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.rsi-blog-content .small-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.rsi-blog-content .small-3 { flex: 0 0 25%; max-width: 25%; }
.rsi-blog-content .small-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.rsi-blog-content .small-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.rsi-blog-content .small-6 { flex: 0 0 50%; max-width: 50%; }
.rsi-blog-content .small-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.rsi-blog-content .small-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.rsi-blog-content .small-9 { flex: 0 0 75%; max-width: 75%; }
.rsi-blog-content .small-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.rsi-blog-content .small-11 { flex: 0 0 91.666%; max-width: 91.666%; }
.rsi-blog-content .small-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 640px) {
	.rsi-blog-content .medium-1 { flex: 0 0 8.333%; max-width: 8.333%; }
	.rsi-blog-content .medium-2 { flex: 0 0 16.666%; max-width: 16.666%; }
	.rsi-blog-content .medium-3 { flex: 0 0 25%; max-width: 25%; }
	.rsi-blog-content .medium-4 { flex: 0 0 33.333%; max-width: 33.333%; }
	.rsi-blog-content .medium-5 { flex: 0 0 41.666%; max-width: 41.666%; }
	.rsi-blog-content .medium-6 { flex: 0 0 50%; max-width: 50%; }
	.rsi-blog-content .medium-7 { flex: 0 0 58.333%; max-width: 58.333%; }
	.rsi-blog-content .medium-8 { flex: 0 0 66.666%; max-width: 66.666%; }
	.rsi-blog-content .medium-9 { flex: 0 0 75%; max-width: 75%; }
	.rsi-blog-content .medium-10 { flex: 0 0 83.333%; max-width: 83.333%; }
	.rsi-blog-content .medium-11 { flex: 0 0 91.666%; max-width: 91.666%; }
	.rsi-blog-content .medium-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 1024px) {
	.rsi-blog-content .large-1 { flex: 0 0 8.333%; max-width: 8.333%; }
	.rsi-blog-content .large-2 { flex: 0 0 16.666%; max-width: 16.666%; }
	.rsi-blog-content .large-3 { flex: 0 0 25%; max-width: 25%; }
	.rsi-blog-content .large-4 { flex: 0 0 33.333%; max-width: 33.333%; }
	.rsi-blog-content .large-5 { flex: 0 0 41.666%; max-width: 41.666%; }
	.rsi-blog-content .large-6 { flex: 0 0 50%; max-width: 50%; }
	.rsi-blog-content .large-7 { flex: 0 0 58.333%; max-width: 58.333%; }
	.rsi-blog-content .large-8 { flex: 0 0 66.666%; max-width: 66.666%; }
	.rsi-blog-content .large-9 { flex: 0 0 75%; max-width: 75%; }
	.rsi-blog-content .large-10 { flex: 0 0 83.333%; max-width: 83.333%; }
	.rsi-blog-content .large-11 { flex: 0 0 91.666%; max-width: 91.666%; }
	.rsi-blog-content .large-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Generic CSS-grid / flex stacks sometimes left as inline styles */
.rsi-blog-content .rsi-content-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	margin: 1.5rem 0;
}

.rsi-blog-content .rsi-content-grid__item {
	min-width: 0;
}

.rsi-blog-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.25rem 0;
}

.rsi-blog-content table th,
.rsi-blog-content table td {
	border: 1px solid rgba(0, 0, 0, 0.12);
	padding: 0.5rem 0.75rem;
	vertical-align: top;
}

.rsi-blog-content iframe {
	max-width: 100%;
}

.rsi-blog-content::after {
	content: "";
	display: table;
	clear: both;
}

@media (max-width: 639px) {
	.rsi-blog-content .alignleft,
	.rsi-blog-content .alignright,
	.rsi-blog-content img[style*="float: left"],
	.rsi-blog-content img[style*="float:left"],
	.rsi-blog-content img[style*="float: right"],
	.rsi-blog-content img[style*="float:right"] {
		float: none;
		display: block;
		margin-left: auto;
		margin-right: auto;
		max-width: 100%;
	}

	.rsi-blog-content .small-1,
	.rsi-blog-content .small-2,
	.rsi-blog-content .small-3,
	.rsi-blog-content .small-4,
	.rsi-blog-content .small-5,
	.rsi-blog-content .small-6,
	.rsi-blog-content .small-7,
	.rsi-blog-content .small-8,
	.rsi-blog-content .small-9,
	.rsi-blog-content .small-10,
	.rsi-blog-content .small-11 {
		flex: 0 0 100%;
		max-width: 100%;
	}
}
