/* FILE: editor/_accessibility.scss */
// Do not style `.screen-reader-text` as of WP6.8 (@see Social Icon block)!

.wp-block.is-style-screen-reader-text,
.wp-block > .is-style-screen-reader-text {
	position: relative !important;
	clip: auto !important;
	clip-path: none !important;
	width: auto !important;
	height: auto !important;
	padding: .5em !important;
	margin-block: 0 !important;
	font-family: inherit !important;
	font-weight: 500 !important;
	font-size: .8em !important;
	line-height: 1 !important;
	background: none !important;
	color: inherit !important;
	border: 0 !important;
	border-inline-start: .25em solid !important;
	border-radius: .25em !important;
	box-shadow: none !important;

	&:not(:hover, :focus, :focus-within) {
		background: repeating-linear-gradient(
			-45deg,
			rgba( #000, .1 ),
			rgba( #000, .1 ) 5px,
			rgba( #fff, .1 ) 5px,
			rgba( #fff, .1 ) 10px
		) !important;
		opacity: .5;
		white-space: nowrap !important;

		* {
			white-space: inherit !important;
		}

		.is-layout-flex:not(.is-vertical) & {
			max-width: 3rem !important;
			text-overflow: ellipsis;
			overflow: hidden;
		}
	}
}

.wp-block:hover > .is-style-screen-reader-text,
.is-selected > .is-style-screen-reader-text {
	@extend %a11y_hover_focus;
}

.is-style-screen-reader-text {

	&:hover,
	&:focus,
	&:focus-within {
		@extend %a11y_hover_focus;
	}
}

%a11y_hover_focus {
	opacity: 1 !important;
}
