@use "../mixins/utilities";
@use "../variables-site/structure";

/* Infinite scroll */

/* Globally hidden elements when Infinite Scroll is supported and in use. */
.infinite-scroll .pagination,
.infinite-scroll .posts-navigation,
.infinite-scroll.neverending .site-footer {
	/* Theme Footer (when set to scrolling) */
	display: none;
}

/* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before. */
.infinity-end.neverending .site-footer {
	display: block;
}

.infinite-loader {
	margin: calc(3 * 1rem) auto;
}

.infinite-loader .spinner {
	margin: 0 auto;
	left: inherit !important;
}

.site-main #infinite-handle {
	margin: calc(2 * 1rem) auto;
}

.site-main #infinite-handle span {
	background: transparent;
	display: block;
	font-size: var(--newspack-theme-font-size-sm);
	text-align: center;
}

.site-main #infinite-handle span button,
.site-main #infinite-handle span button:hover,
.site-main #infinite-handle span button:focus {
	@include utilities.button-transition;

	background: var(--newspack-theme-color-secondary);
	color: var(--newspack-theme-color-bg-body);
	font-family: var(--newspack-theme-font-heading);
	font-weight: 700;
	line-height: var(--newspack-theme-font-line-height-heading);
	padding: ( structure.$size__spacing-unit * 0.76 ) structure.$size__spacing-unit;

	&:hover {
		background: var(--newspack-theme-color-bg-button-hover);
		cursor: pointer;
	}

	&:focus {
		background: var(--newspack-theme-color-bg-button-hover);
		outline: thin dotted;
		outline-offset: -4px;
	}
}
