/* =====================================================================
   ERA Single Post — scoped styles (body.single-post only)
   Loaded by mu-plugin era-single-post.php (priority 130, after Avada + child CSS).
   Tokens reused from the site: navy #0e4a71, blue #236791, link #214f83,
   text #172033, accent #ff365f, sidebar card #f3f4f9, line rgba(14,74,113,.14).
   Image treatment copied from:
     child style.css ERA_ACTIVE_PAGE_FACELIFT (article alignright image:
       radius 0 0 22px 0, shadow 0 12px 30px rgba(14,74,113,.12), mobile full width)
     inline era-content-design (captions: 8px pad, 1px line border, radius 14px)
   ===================================================================== */

/* ---------- 1. Re-show meta / author / sharing on single posts ----------
   Two site-wide inline styles hide them everywhere:
     era-company-profile-inline-css : .fusion-meta-info, .about-author { display:none !important }
     era-chapter-profile-inline-css : .fusion-sharing-box, .share-box, .fusion-sharing-box .fusion-social-networks-wrapper { display:none !important }
   body.single-post + class = higher specificity, so these win without editing those plugins.
   Comments stay hidden on purpose. */
body.single-post .fusion-meta-info,
body.single-post .fusion-tb-meta,
body.single-post .awb-post-meta,
body.single-post .about-author,
body.single-post .fusion-tb-author,
body.single-post .fusion-sharing-box,
body.single-post .share-box {
	display: block !important;
}
body.single-post .fusion-sharing-box .fusion-social-networks-wrapper {
	display: flex !important;
}

/* Sharing: keep only Facebook, LinkedIn, X and email (site-wide Avada option shows 11 networks). */
body.single-post .fusion-sharing-box .fusion-social-network-icon:not(.fusion-facebook):not(.fusion-linkedin):not(.fusion-twitter):not(.fusion-mail) {
	display: none !important;
}

/* ---------- 2. Post meta line (date, categories, author ERA) ---------- */
body.single-post .fusion-meta-info,
body.single-post .fusion-tb-meta {
	font-family: "Mulish", sans-serif;
	font-size: 15px;
	color: #4b5a6b;
	margin: 0 0 18px;
}
body.single-post .fusion-meta-info a,
body.single-post .fusion-tb-meta a {
	color: #214f83;
	font-weight: 600;
}

/* ---------- 3. In-content images: wrap like the rest of the site ---------- */
body.single-post #content img.alignright,
body.single-post #content .wp-caption.alignright {
	float: right;
	width: min(42%, 420px);
	max-width: 100%;
	height: auto;
	margin: 4px 0 24px 30px;
}
body.single-post #content img.alignleft,
body.single-post #content .wp-caption.alignleft {
	float: left;
	width: min(42%, 420px);
	max-width: 100%;
	height: auto;
	margin: 4px 30px 24px 0;
}
body.single-post #content img.alignright,
body.single-post #content img.alignleft {
	border-radius: 0 0 22px 0;
	box-shadow: 0 12px 30px rgba(14, 74, 113, .12);
}
/* image inside a floated caption: fill the caption box, style the caption box */
body.single-post #content .wp-caption.alignright img,
body.single-post #content .wp-caption.alignleft img {
	display: block;
	width: 100%;
	height: auto;
}
body.single-post #content .wp-caption {
	max-width: 100%;
	padding: 8px;
	border: 1px solid rgba(14, 74, 113, .14);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 10px 30px rgba(7, 31, 52, .07);
	box-sizing: border-box;
}
body.single-post #content .wp-caption .wp-caption-text {
	padding: 9px 8px 4px;
	margin: 0;
	color: #617382;
	font-size: .88em;
	line-height: 1.45;
	text-align: center;
}
/* centred / unaligned block images */
body.single-post #content img.aligncenter,
body.single-post #content .wp-caption.aligncenter,
body.single-post #content .wp-caption.alignnone {
	display: block;
	float: none;
	margin: 26px auto;
	max-width: 100%;
	height: auto;
}
body.single-post #content img.aligncenter {
	border-radius: 14px;
	box-shadow: 0 16px 42px rgba(7, 31, 52, .09);
}
/* inline width styles on captions (e.g. style="width: 166px") are kept on desktop */

/* Mobile: no float, full width (matches child style.css @media max-width 767px) */
@media (max-width: 767px) {
	body.single-post #content img.alignright,
	body.single-post #content img.alignleft,
	body.single-post #content .wp-caption.alignright,
	body.single-post #content .wp-caption.alignleft,
	body.single-post #content .wp-caption.aligncenter,
	body.single-post #content .wp-caption.alignnone {
		float: none !important;
		display: block;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 auto 22px !important;
	}
}

/* ---------- 4. Content typography guard (Avada globals already set Mulish 17/1.7) ---------- */
body.single-post #content .fusion-text,
body.single-post #content .post-content {
	font-family: "Mulish", sans-serif;
	font-size: 17px;
	line-height: 1.7;
	color: #172033;
}
body.single-post #content h2,
body.single-post #content h3,
body.single-post #content h4 {
	font-family: "Kumbh Sans", sans-serif;
}

/* Inline #3366ff link colour from migrated content -> site link colour (display only, content untouched) */
body.single-post #content [style*="3366ff"] {
	color: #214f83 !important;
}

/* ---------- 5. Sharing box ---------- */
body.single-post .fusion-sharing-box {
	margin: 34px 0 0;
	padding: 18px 22px;
	background: #f4f6fb;
	border-radius: 0 0 22px 0;
}
body.single-post .fusion-sharing-box h4 {
	font-family: "Kumbh Sans", sans-serif;
	color: #0e4a71;
	font-size: 18px;
	margin: 0 0 10px;
}

/* ---------- 6. Author box (ERA) ---------- */
body.single-post .about-author,
body.single-post .fusion-tb-author {
	margin: 30px 0 0;
	padding: 24px 26px;
	background: #fff;
	border: 1px solid rgba(14, 74, 113, .14);
	border-radius: 0 0 22px 0;
	box-shadow: 0 10px 30px rgba(7, 31, 52, .07);
}
body.single-post .about-author .avatar img,
body.single-post .fusion-tb-author img.avatar {
	border-radius: 50%;
	background: #f4f6fb;
	object-fit: contain;
}
body.single-post .about-author h2,
body.single-post .about-author h3,
body.single-post .fusion-tb-author .fusion-title-heading {
	font-family: "Kumbh Sans", sans-serif;
	color: #0e4a71;
}

/* ---------- 7. Sidebar column: match the site's interior sidebar card ---------- */
body.single-post .era-blog-sidebar-col > .fusion-column-wrapper {
	background: #f3f4f9;
	border-radius: 28px 0 0 0;
	padding: 32px 28px;
}
body.single-post .era-blog-sidebar .widget,
body.single-post .era-blog-sidebar-col .widget {
	margin: 0 0 30px;
}
body.single-post .era-blog-sidebar .widget-title,
body.single-post .era-blog-sidebar-col .widget-title,
body.single-post .era-blog-sidebar .wp-block-heading {
	font-family: "Kumbh Sans", sans-serif;
	color: #0e4a71;
	font-size: 22px;
	line-height: 1.25;
	margin: 0 0 12px;
}
body.single-post .era-blog-sidebar ul,
body.single-post .era-blog-sidebar-col .widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
body.single-post .era-blog-sidebar ul li,
body.single-post .era-blog-sidebar-col .widget ul li {
	padding: 10px 0 10px 10px;
	border-bottom: 1px solid #dfe3ec;
	font-family: "Mulish", sans-serif;
	font-weight: 600;
	line-height: 1.35;
}
body.single-post .era-blog-sidebar ul li a,
body.single-post .era-blog-sidebar-col .widget ul li a {
	color: #214f83;
}
body.single-post .era-blog-sidebar ul li a:hover,
body.single-post .era-blog-sidebar-col .widget ul li a:hover {
	color: #ff365f;
}
body.single-post .era-blog-sidebar .widget_search input[type="search"],
body.single-post .era-blog-sidebar .wp-block-search__input {
	border: 1px solid rgba(14, 74, 113, .25);
	border-radius: 999px;
	padding: 10px 16px;
	background: #fff;
}

/* Sidebar membership CTA (Custom HTML widget), styled like the homepage "JOIN ERA TODAY" pill */
body.single-post .era-blog-cta {
	background: #0e4a71;
	color: #fff;
	border-radius: 0 0 28px 0;
	padding: 26px 24px;
	text-align: center;
}
body.single-post .era-blog-cta h3 {
	font-family: "Kumbh Sans", sans-serif;
	color: #fff;
	font-size: 22px;
	margin: 0 0 8px;
}
body.single-post .era-blog-cta p {
	color: #fff;
	font-size: 15px;
	margin: 0 0 16px;
}
body.single-post .era-blog-cta a.era-blog-cta-btn {
	display: inline-block;
	background: #ff365f;
	color: #fff !important;
	font-family: "Mulish", sans-serif;
	font-weight: 700;
	font-size: 16px;
	text-transform: uppercase;
	padding: 14px 28px;
	border-radius: 30px;
	text-decoration: none;
}
body.single-post .era-blog-cta a.era-blog-cta-btn:hover {
	background: #236791;
}

/* ---------- 8. Mobile: sidebar goes BELOW the content ----------
   The site's interior layout puts the sidebar column first in the DOM (left side on desktop).
   On small screens the flex row stacks in DOM order, so push the sidebar column after the content. */
@media (max-width: 800px) {
	body.single-post .fusion-builder-row:has(> .era-blog-sidebar-col) {
		display: flex;
		flex-wrap: wrap;
	}
	body.single-post .era-blog-sidebar-col {
		order: 2;
		margin-top: 32px;
	}
	body.single-post .era-post-content-col {
		order: 1;
	}
}

/* ---------- 9. Related Posts (Post Cards) — card treatment copied from the site's search result cards ----------
   child style.css .search .fusion-post-grid .fusion-post-wrapper: border 1px #dce5ec, radius 0 0 26px 0,
   white background, shadow; hover border #236791 + lift. Titles always visible (no hover-only rollover). */
body.single-post .fusion-post-cards .fusion-post-card,
body.single-post .awb-post-card {
	border: 1px solid #dce5ec;
	border-radius: 0 0 26px 0;
	background: #fff;
	box-shadow: 0 12px 32px rgba(14, 74, 113, .09);
	overflow: hidden;
	transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
body.single-post .fusion-post-cards .fusion-post-card:hover,
body.single-post .awb-post-card:hover {
	border-color: #236791;
	box-shadow: 0 20px 38px rgba(14, 74, 113, .14);
	transform: translateY(-4px);
}
body.single-post .fusion-post-cards .fusion-post-card-image img,
body.single-post .awb-post-card .fusion-post-card-image img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
	background: #f4f6fb;
}

/* ---------- 10. Related Posts fallback image ----------
   Posts have no featured images, so Avada's Related Posts output shows an empty .fusion-placeholder-image.
   Show the ERA oval logo (media item ERAColorLogo.png, attachment 7402) centred on the site's light card colour.
   Only when the image wrapper holds a placeholder, so real featured images are untouched. */
body.single-post .related-posts .fusion-image-wrapper:has(> .fusion-placeholder-image),
body.single-post .fusion-tb-related .fusion-image-wrapper:has(> .fusion-placeholder-image) {
	background: #f4f6fb url("https://era.org/wp-content/uploads/2024/05/ERAColorLogo.png") center center / 55% auto no-repeat;
}
body.single-post .related-posts .fusion-placeholder-image,
body.single-post .fusion-tb-related .fusion-placeholder-image {
	background-color: transparent;
}

/* ---------- 11. ERA shortcodes (sidebar / sharing / author / pagination) ----------
   Avada's Widget Area, Sharing Box, Author and Pagination elements are switched off on era.org, so the layout
   section uses [era_blog_sidebar], [era_post_sharing], [era_author_box], [era_post_pagination] from the mu-plugin.
   They reuse Avada classes; these rules only add what Avada's own classes do not cover. */
body.single-post .era-post-pagination {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin: 30px 0 0;
}
body.single-post .era-post-pagination a {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: 48%;
	color: #214f83;
	text-decoration: none;
}
body.single-post .era-post-pagination a.era-post-next {
	margin-left: auto;
	text-align: right;
}
body.single-post .era-post-pagination .era-post-nav-label {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #0e4a71;
}
body.single-post .era-post-pagination .era-post-nav-title {
	font-weight: 600;
}
@media (max-width: 640px) {
	body.single-post .era-post-pagination {
		flex-direction: column;
	}
	body.single-post .era-post-pagination a {
		max-width: 100%;
	}
}

/* ---------- 12. Related Posts via Post Cards: ERA fallback image ---------- */
body.single-post .era-related-post-cards .fusion-image-wrapper:has(> .fusion-placeholder-image),
body.single-post .fusion-post-cards .fusion-post-card-image:has(.fusion-placeholder-image) {
	background: #f4f6fb url("https://era.org/wp-content/uploads/2024/05/ERAColorLogo.png") center center / 55% auto no-repeat;
}

/* ---------- 13. FIX1: posts whose own content has a stray closing </div> (e.g. post 67144) ----------
   67144's builder content contains one extra </div> (between the Dave Norris caption and the Jeff May caption,
   present before stageAB as well). The browser therefore closes the layout's right column-wrapper before the
   sharing box / author box / pagination / Related Posts, and those blocks become direct children of
   .era-post-content-col. That column is a flex container with the default direction row, so the blocks line up
   side by side as narrow strips and squeeze the content to ~30px.
   Fix: stack the column's children vertically; the escaped blocks get the same side spacing that Avada gives
   the column-wrapper (margin = var(--awb-spacing-left/right), responsive at 1280px / 850px).
   A well-formed post (e.g. 69755) has exactly one child in the column (the wrapper), so nothing changes there.
   The real cure is removing the stray </div> from post 67144's content (separate, optional DB step). */
body.single-post .era-post-content-col.fusion-layout-column {
	flex-direction: column !important;
	flex-wrap: nowrap !important;
}
body.single-post .era-post-content-col.fusion-layout-column > .fusion-column-wrapper {
	width: auto !important;
	max-width: none !important;
	align-self: stretch !important;
	flex: 0 0 auto !important;
}
body.single-post .era-post-content-col.fusion-layout-column > :not(.fusion-column-wrapper) {
	width: auto !important;
	max-width: none !important;
	align-self: stretch !important;
	flex: 0 0 auto !important;
	margin-left: var(--awb-spacing-left, 0) !important;
	margin-right: var(--awb-spacing-right, 0) !important;
}

/* ---------- 14. FIX1: Related Posts (Post Cards, library item 407) placeholder -> ERA logo ----------
   The Post Card's image element prints the Avada "Business" demo placeholder as a real <img>
   (data-orig-src="https://avada.website/business/wp-content/uploads/sites/171/2023/11/place-holder-image-2.png"),
   not an empty .fusion-placeholder-image, so the rules in sections 10/12 never matched.
   Make that <img> invisible but keep its box (it sets the 5/4 aspect ratio), and paint the ERA oval logo
   (ERAColorLogo.png, attachment 7402) centred on the light card colour behind it. Real featured images
   (any other URL) are untouched. */
body.single-post .era-related-post-cards .fusion-imageframe:has(> a > img[data-orig-src*="place-holder-image"]),
body.single-post .era-related-post-cards .fusion-imageframe:has(> a > img[src*="place-holder-image"]),
body.single-post .era-related-post-cards .fusion-imageframe:has(> img[data-orig-src*="place-holder-image"]) {
	background: #f4f6fb url("https://era.org/wp-content/uploads/2024/05/ERAColorLogo.png") center center / 55% auto no-repeat;
}
body.single-post .era-related-post-cards img[data-orig-src*="place-holder-image"],
body.single-post .era-related-post-cards img[src*="place-holder-image"] {
	opacity: 0 !important;
}

/* ---------- 15. FIX1: Previous/Next and the "Related Posts" title stacked, full width, at every size ----------
   nav.era-post-pagination is a flex row above 640px, so Previous and Next sit side by side on tablet/desktop,
   and each link is capped at max-width:48%. Below that the Next link keeps margin-left:auto / text-align:right
   and Avada's .single-navigation { text-align:right }, so on mobile the labels sit at the right edge while the
   titles start at the left, which reads as a side-by-side layout.
   Make the nav a column at every size and give both links the full width, left aligned. The "Related Posts"
   title is the next sibling (inside the column-wrapper on a well-formed post, or a direct child of
   .era-post-content-col on 67144); it is block-level and full width already, pinned here for safety. */
body.single-post nav.era-post-pagination {
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	justify-content: flex-start !important;
	text-align: left !important;
}
body.single-post nav.era-post-pagination > a.era-post-prev,
body.single-post nav.era-post-pagination > a.era-post-next {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 auto !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	text-align: left !important;
}
body.single-post nav.era-post-pagination .era-post-nav-label,
body.single-post nav.era-post-pagination .era-post-nav-title {
	display: block !important;
	width: 100% !important;
	text-align: left !important;
}
body.single-post .era-post-pagination + .fusion-title {
	display: block !important;
	float: none !important;
	clear: both !important;
	width: auto !important;
	max-width: none !important;
}
/* Avada puts arrow icons on these links (.single-navigation a[rel=prev]:before at left:-1em,
   a[rel=next]:after at right:-1em). Once both links are left aligned and full width, the prev arrow lands
   off-screen at the left edge and the next arrow sits alone at the right edge. Drop them here. */
body.single-post nav.era-post-pagination > a[rel="prev"]::before,
body.single-post nav.era-post-pagination > a[rel="next"]::after {
	content: none !important;
	display: none !important;
}

/* ---------- 16. FIX1: Related Posts shows only the 3 cards ----------
   The Post Cards element prints its own numbered pagination (div.pagination.clearfix: "1 2 Next", links to
   /page/2/) after the card list. Hide it, plus any load-more / infinite-scroll controls Avada may add. */
body.single-post .era-related-post-cards > .pagination,
body.single-post .era-related-post-cards .pagination,
body.single-post .era-related-post-cards .fusion-loading-container,
body.single-post .era-related-post-cards .fusion-load-more-button,
body.single-post .era-related-post-cards .fusion-infinite-scroll-trigger,
body.single-post .era-related-post-cards [class*="infinite-scroll"],
body.single-post .era-related-post-cards [class*="load-more"] {
	display: none !important;
}

/* ---------- 17. FIX1: Related Posts card columns ----------
   Avada's responsive grid switches at its own breakpoints: 1 column up to 850px (so tablet portrait 768-850
   is a single full-width card), 2 columns 851-1280, 3 columns from 1281.
   Wanted: 1 column under 767px (unchanged), 2 columns on tablet (768-1280), 3 on large desktop (1281+, unchanged).
   wpautop puts empty <p> elements between the <li> cards; they get width 0 and order 1 so they cannot take a
   grid slot or split a row. */
body.single-post .era-related-post-cards > ul.fusion-grid > p {
	width: 0 !important;
	flex: 0 0 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	order: 1;
}
@media (min-width: 768px) and (max-width: 1280px) {
	body.single-post .era-related-post-cards > ul.fusion-grid > li.fusion-grid-column {
		width: 50% !important;
		max-width: 50% !important;
		flex: 0 0 50% !important;
	}
}
@media (max-width: 767px) {
	body.single-post .era-related-post-cards > ul.fusion-grid > li.fusion-grid-column {
		width: 100% !important;
		max-width: 100% !important;
		flex: 0 0 100% !important;
	}
}

/* ---------- 18. FIX1: sidebar search widget (block "Search") on single posts ----------
   The block search form carries Avada's button classes (form.fusion-button-default.fusion-button-default-size),
   so the whole form is painted as a big rounded blue pill (padding 20px 40px, radius 100px). Inside it sit the
   block's "Search" label, a squeezed input (about 55px wide) and the Search button: two "Search" texts.
   Restyle: no pill. A full-width white input with a subtle border (radius 10px, like the site's form controls),
   then a full-width ERA blue (#0e4a71) Search button underneath (radius 10px). The label is visually hidden but
   kept for screen readers (it is the input's <label for>). */
body.single-post .era-blog-sidebar-widgets form.wp-block-search {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}
body.single-post .era-blog-sidebar-widgets form.wp-block-search > .wp-block-search__label {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
body.single-post .era-blog-sidebar-widgets form.wp-block-search .wp-block-search__inside-wrapper {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 10px;
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 auto !important;
}
body.single-post .era-blog-sidebar .era-blog-sidebar-widgets form.wp-block-search input.wp-block-search__input {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	flex: 0 0 auto !important;
	min-height: 50px;
	margin: 0 !important;
	padding: 12px 16px !important;
	background: #fff !important;
	border: 1px solid rgba(14, 74, 113, .28) !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	color: #172033 !important;
	font-family: "Mulish", sans-serif !important;
	font-size: 16px !important;
	line-height: 1.4 !important;
}
body.single-post .era-blog-sidebar .era-blog-sidebar-widgets form.wp-block-search input.wp-block-search__input:focus {
	border-color: #0e4a71 !important;
	box-shadow: 0 0 0 3px rgba(14, 74, 113, .15) !important;
	outline: 0 !important;
}
body.single-post #main .era-blog-sidebar-widgets form.wp-block-search button.wp-block-search__button {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	max-width: 100% !important;
	min-height: 50px;
	margin: 0 !important;
	padding: 14px 24px !important;
	background: #0e4a71 !important;
	background-image: none !important;
	border: 2px solid #0e4a71 !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	color: #fff !important;
	font-family: "Mulish", sans-serif !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1 !important;
	cursor: pointer;
}
body.single-post #main .era-blog-sidebar-widgets form.wp-block-search button.wp-block-search__button:hover,
body.single-post #main .era-blog-sidebar-widgets form.wp-block-search button.wp-block-search__button:focus {
	background: #236791 !important;
	border-color: #236791 !important;
	color: #fff !important;
}
