/*
 * TheHorse infinite scroll — thehorse.com mu-plugin (thehorse-infinite-scroll.php).
 * Loaded on single posts while the scroll customizations are active.
 */

/* "Readers' Most Popular" overhung the sidebar by 75px and made article pages 101% wide. Match the Sponsored Content bar. */
.elementor-element.elementor-element-edac02b > .elementor-widget-container {
	margin-right: -31px !important;
}

/* The Weekly Poll belongs to the first article only. scroll.js also strips it from appended HTML. */
.infinite-scroll-post .elementor-element-050143c {
	display: none !important;
}

/* Appended sidebars: Sponsored Content, ad, Readers' Most Popular, ad, Top Categories. */
.infinite-scroll-post .elementor-element-dee36ab > .elementor-widget-wrap > .elementor-element-e956248 { order: 1; }
.infinite-scroll-post .elementor-element-dee36ab > .elementor-widget-wrap > .elementor-element-d7d6029 { order: 2; }
.infinite-scroll-post .elementor-element-dee36ab > .elementor-widget-wrap > .elementor-element-f407b8d { order: 3; }
.infinite-scroll-post .elementor-element-dee36ab > .elementor-widget-wrap > .elementor-element-79f6d7e { order: 4; }
.infinite-scroll-post .elementor-element-dee36ab > .elementor-widget-wrap > .elementor-element-96fefe9 { order: 5; }
.infinite-scroll-post .elementor-element-dee36ab > .elementor-widget-wrap > .elementor-element-e6084e6 { order: 6; }

/* AP's 20px spacer is replaced by the Keep Reading divider. */
.infinite-scroll-posts-container > .infinite-scroll-post-separator {
	display: none !important;
}

/*
 * Keep Reading: the home page "Topics" divider (Elementor divider d3e57b9), centered.
 * scroll.js copies the article section's side padding and content width into the custom properties.
 */
.th-keep-reading {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--th-article-max, 1440px) + var(--th-article-pad-left, 60px) + var(--th-article-pad-right, 60px));
	margin: 40px auto 0;
	padding: 0 var(--th-article-pad-right, 60px) 0 var(--th-article-pad-left, 60px);
}

.th-keep-reading__line {
	display: flex;
	align-items: center;
	padding: 15px 0;
}

.th-keep-reading__line::before,
.th-keep-reading__line::after {
	content: "";
	flex: 1 1 auto;
	border-top: 1px solid #B3B7BC;
}

.th-keep-reading__text {
	flex: 0 0 auto;
	margin: 0 10px;
	font-family: "Noto Serif", serif;
	font-size: 25px;
	font-weight: 700;
	line-height: 1;
	color: #000;
}

@media (max-width: 767px) {
	.th-keep-reading {
		margin-top: 24px;
	}

	.th-keep-reading__text {
		font-size: 20px;
	}
}

/* Headlines link to their own article while the scroll is on. They keep the heading's look until hovered. */
.elementor-widget-theme-post-title .elementor-heading-title a.th-article-link,
.elementor-widget-theme-post-title .elementor-heading-title a.th-article-link:visited {
	color: inherit;
	text-decoration: none;
}

.elementor-widget-theme-post-title .elementor-heading-title a.th-article-link:hover,
.elementor-widget-theme-post-title .elementor-heading-title a.th-article-link:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.12em;
}

/* Per-article ad wrappers created by scroll.js. Device limits mirror the size mappings in header.php. */
.infinite-scroll-post .th-scroll-ad--in-article {
	margin: 0 auto 20px;
}

/* GAM returned no ad for this article's slot: give the space back. */
.infinite-scroll-post .th-scroll-ad--empty {
	display: none !important;
}

@media (max-width: 1024px) {
	.infinite-scroll-post .th-scroll-ad--desktop {
		display: none !important;
	}
}

@media (min-width: 1025px) {
	.infinite-scroll-post .th-scroll-ad--below-desktop {
		display: none !important;
	}
}

/* Gated teasers: the inline login form is toggled by a script that never runs in appended HTML. Login opens the LOGIN popup. */
.infinite-scroll-post .block-content-login {
	display: none;
}

/* Print button in an appended article prints that article only. */
@media print {
	body.th-printing .th-landing-article,
	body.th-printing .infinite-scroll-post-wrapper:not(.th-print-target),
	body.th-printing .ap-feed-ad,
	body.th-printing .th-keep-reading {
		display: none !important;
	}
}
