/*
 * Posts of the 2008–2013 archive: neutralise the presentational HTML of the old editor
 * (<font>, <center>, style="", fixed widths) so the text follows the theme's own type.
 * Only inside .entry-content--legacy. The stored content is never touched.
 */

.entry-content--legacy font {
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

.entry-content--legacy center {
	display: block;
	text-align: left;
}

.entry-content--legacy center img {
	display: block;
	margin-inline: auto;
}

/* Inline sizes, colours and backgrounds give way to the theme (alignment and emphasis stay) */
.entry-content--legacy [style] {
	color: inherit !important;
	font-family: inherit !important;
	font-size: inherit !important;
	line-height: inherit !important;
	background: none !important;
	letter-spacing: normal !important;
	text-indent: 0 !important;
}

.entry-content--legacy [style*="width"],
.entry-content--legacy [style*="min-width"] {
	min-width: 0 !important;
	max-width: 100% !important;
}

.entry-content--legacy a[style] {
	color: inherit !important;
}

.entry-content--legacy [style*="position"] {
	position: static !important;
}

/* Images: never wider than the column, with their proportions, aligned by class or attribute */
.entry-content--legacy img {
	max-width: 100% !important;
	height: auto !important;
}

.entry-content--legacy img[align="left"],
.entry-content--legacy img[style*="float: left"],
.entry-content--legacy img[style*="float:left"] {
	float: left;
	margin: 4px 28px 16px 0;
}

.entry-content--legacy img[align="right"],
.entry-content--legacy img[style*="float: right"],
.entry-content--legacy img[style*="float:right"] {
	float: right;
	margin: 4px 0 16px 28px;
}

.entry-content--legacy img[align="middle"],
.entry-content--legacy img[align="center"] {
	display: block;
	margin-inline: auto;
}

.entry-content--legacy img[hspace],
.entry-content--legacy img[vspace] {
	margin: 4px 28px 16px;
}

.entry-content--legacy .wp-caption {
	width: auto !important;
	max-width: 100%;
}

/* A floated figure keeps the text readable: at most 45 % of the column */
.entry-content--legacy .wp-caption.alignleft,
.entry-content--legacy .wp-caption.alignright {
	max-width: 45%;
}

/* Tables (inside the scroll region added by the theme) */
.entry-content--legacy table {
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	table-layout: auto;
}

.entry-content--legacy table[border] th,
.entry-content--legacy table[border] td {
	border: 1px solid var(--cm-line);
}

.entry-content--legacy td,
.entry-content--legacy th {
	width: auto !important;
	height: auto !important;
	min-width: 0;
}

.entry-content--legacy td[style],
.entry-content--legacy th[style] {
	padding: 10px 16px !important;
}

/* Old text: lists and quotes in the theme's own form */
.entry-content--legacy ul,
.entry-content--legacy ol {
	margin-inline-start: 0;
}

.entry-content--legacy blockquote {
	margin-inline: 0;
}

.entry-content--legacy p,
.entry-content--legacy div {
	max-width: 100%;
}

/* Replaces <object>/<embed> of Flash (the cultivame-core plugin prints the notice) */
.legacy-flash {
	margin: 1.6em 0;
	padding: 16px 20px;
	border-radius: 10px;
	background: var(--wp--preset--color--tint-start);
	color: var(--cm-ink);
	font-size: 1rem;
	line-height: 1.5;
}

.entry-content .legacy-flash p {
	margin: 0;
}

.entry-content .legacy-flash .legacy-flash__link {
	margin-top: 4px;
}

.legacy-flash a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
}

@media (max-width: 559px) {
	.entry-content--legacy img[align="left"],
	.entry-content--legacy img[align="right"],
	.entry-content--legacy img[style*="float"] {
		float: none;
		display: block;
		margin: 1.2em auto;
	}

	.entry-content--legacy .wp-caption.alignleft,
	.entry-content--legacy .wp-caption.alignright {
		max-width: 100%;
	}
}
