.wp-block-heading[id] {
	position: relative;
}

/* Fallback in case the active theme doesn't define WP's standard helper. */
.wpds-heading-anchor .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wp-block-heading .wpds-heading-anchor {
	margin-left: 0.4em;
	color: currentColor;
	opacity: 0;
	text-decoration: none;
	transition: opacity 120ms ease-in-out;
}

.wp-block-heading:hover .wpds-heading-anchor,
.wp-block-heading:focus-within .wpds-heading-anchor {
	opacity: 0.75;
}

.wpds-heading-anchor:hover,
.wpds-heading-anchor:focus {
	opacity: 1;
	text-decoration: underline;
}

/* Always reveal on touch / no-hover devices — :hover never fires there. */
@media (hover: none) {
	.wp-block-heading .wpds-heading-anchor {
		opacity: 0.75;
	}
}
