/*
 * Shared WordPress editor-content alignment.
 *
 * This file is loaded on the front end and in both Classic Editor/TinyMCE and
 * Gutenberg so the alignment controls have the same result everywhere.
 */

img[class*="wp-image-"],
.wp-caption img,
.wp-block-image img {
	max-width: 100%;
	height: auto;
}

.wp-caption,
figure.wp-block-image {
	max-width: 100%;
}

.aligncenter,
.wp-block-image.aligncenter,
.wp-block-image .aligncenter {
	clear: both;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

figure.aligncenter,
.wp-block-image.aligncenter {
	text-align: center;
}

.alignleft,
.wp-block-image.alignleft,
.wp-block-image .alignleft {
	float: left;
	margin: 0.5em 1.5em 1em 0;
}

.alignright,
.wp-block-image.alignright,
.wp-block-image .alignright {
	float: right;
	margin: 0.5em 0 1em 1.5em;
}

.alignwide,
.alignfull {
	clear: both;
	display: block;
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
}

.alignwide img,
.alignfull img,
.wp-block-image.alignwide img,
.wp-block-image.alignfull img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

@media (max-width: 600px) {
	.alignleft,
	.alignright,
	.wp-block-image.alignleft,
	.wp-block-image.alignright,
	.wp-block-image .alignleft,
	.wp-block-image .alignright {
		float: none;
		display: block;
		max-width: 100%;
		margin-left: auto;
		margin-right: auto;
	}
}

/* A formatted CTA is still an anchor in post/page HTML. Give its visual box a
 * real place in line layout so vertical padding cannot escape a paragraph's
 * line box and overlap neighbouring content. CTA formatting also owns layout,
 * so stale WordPress alignleft/alignright classes must not float it. */
a.button-red-shadowed.btn-cta-standard {
	display: inline-flex;
	float: none;
	clear: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	max-width: 100%;
	vertical-align: middle;
}

/* Generic post/page paragraphs already provide their own vertical rhythm. The
 * component CTA's large card/hero margin would otherwise be counted inside the
 * paragraph after converting the link to inline-flex. */
#generic-post a.button-red-shadowed.btn-cta-standard,
#generic-post-light a.button-red-shadowed.btn-cta-standard,
#generic-page a.button-red-shadowed.btn-cta-standard,
#generic-page-light a.button-red-shadowed.btn-cta-standard {
	margin-bottom: 0;
}

/* TinyMCE-only preview for the shared frontend Red CTA Button format. Scoping
 * these rules to the editor body avoids importing the theme's global page/body
 * styles (including its black site canvas) into new posts and pages. */
body#tinymce a.button-red-shadowed {
	display: inline-block;
	box-sizing: border-box;
	border: 2px solid transparent;
	border-radius: 8px;
	margin: 0;
	padding: 0.75rem 4rem;
	background-color: #d90500;
	box-shadow: 0 8px 18px rgba(3, 3, 3, 0.18);
	color: #fff;
	font-family: "Montserrat-Bold", Helvetica, Arial, sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.03em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
}

body#tinymce a.button-red-shadowed.btn-cta-standard {
	font-size: 1.05rem;
	font-weight: 500;
	letter-spacing: normal;
	text-transform: none;
}

body#tinymce a.button-red-shadowed:hover,
body#tinymce a.button-red-shadowed:focus {
	border-color: #d90500;
	background-color: #fff;
	color: #d90500;
}
