@use "../mixins/breakpoints";
@use "../typography";
@use "../variables/colors";

// ==========================================================================
// Global Shared Jetpack Styles
// ==========================================================================

// Utilities
// TODO Extract into other files
@use "../functions/rem";
@use "sass:color";

.jp-hidden-on-mobile {

	@include breakpoints.breakpoint( "<660px" ) {
		display: none;
	}
}

// General Elements

.wp-admin.toplevel_page_jetpack {
	background-color: colors.$gray-light;
	line-height: 1.4; // fixes core bug that sets an em unit on body
	height: auto;
}

.jetpack-pagestyles #wpcontent {
	padding-left: 0;
}

.jetpack-pagestyles {
	font-size: typography.$font-body-small;
}

.jetpack-pagestyles a {
	text-decoration: none;

	&.components-external-link .components-external-link__icon {
		margin-left: 5px;
	}
}

// Hello Dolly positioning overwrite
.jetpack-pagestyles #dolly {
	float: none;
	position: relative;
	right: 0;
	left: 0;
	top: 0;
	padding: rem.convert(10px);
	text-align: right;
	background: colors.$white;
	font-size: rem.convert(12px);
	font-style: italic;
	color: colors.$gray;
	border-bottom: 1px color.adjust(colors.$gray, $lightness: 30%) solid;

	@include breakpoints.breakpoint( "<660px" ) {
		display: none;
	}
}

.dops-notice__text a {
	text-decoration: underline;
}

// restyled the arrow to match our gray
.toplevel_page_jetpack ul#adminmenu a.wp-has-current-submenu::after {
	border-right-color: colors.$gray-light;
}

.jp-top {
	background: #fff;
	width: 100%;

	.jp-top-inside {
		max-width: rem.convert(1040px);
		margin: 0 auto;

		@media (max-width: 1360px) {
			max-width: 95%;
		}

		.jitm-banner.jitm-card {
			margin: 0 0 24px;
		}

		.dops-section-nav {
			margin-bottom: 0;
		}
	}
}

.jp-lower {
	margin: 32px auto 0;
	text-align: left;
	max-width: rem.convert(1040px);

	&.jp-licensing-screen {
		max-width: rem.convert(1128px);
	}

	&.jp-main-connect-screen,
	&.jp-user-connect-screen, {
		max-width: rem.convert(1128px);
		box-sizing: content-box;
	}

	@media (max-width: 1250px) {
		max-width: 95%;
	}

}

#contextual-help-link-wrap {
	display: none;
}

.is-placeholder {
	animation: pulse-light 0.8s ease-in-out infinite;
	background: color.adjust(colors.$gray, $lightness: 20%);
}

@keyframes pulse-light {

	50% {
		background-color: color.adjust(colors.$gray, $lightness: 30%);
	}
}

.blur {
	-webkit-filter: blur(5px);
	-moz-filter: blur(5px);
	-o-filter: blur(5px);
	-ms-filter: blur(5px);
	filter: blur(5px);
}
