/*
 * Keep italics true: fonts without an italic stay upright instead of a slanted fake.
 */
body {
	font-synthesis-style: none;
}

/* Font smoothing */
body {
	text-rendering: geometricprecision;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: 0.1em;
}

/*
 * Make sure footers have no margin.
 * https://github.com/WordPress/gutenberg/issues/47637
 */
footer.wp-block-template-part {
	margin-block-start: 0 !important;
}

/*
 * Hover invert: rows flip to black, the row title link covers the whole row.
 * Not possible with block supports alone.
 */
.is-style-hover-invert {
	position: relative;
	transition: background-color 0.2s, color 0.2s;
}

.is-style-hover-invert:hover {
	background-color: var(--wp--preset--color--theme-2);
	color: var(--wp--preset--color--theme-1);
}

.is-style-hover-invert :is(h1, h2, h3, h4) a::after {
	content: "";
	inset: 0;
	position: absolute;
}

.is-style-hover-invert .wp-block-post-terms a {
	position: relative;
	z-index: 1;
}

/*
 * Halftone: a dot screen over the image, keeps the original colours.
 * Works with any image, so a replaced image keeps the effect.
 */
.is-style-halftone {
	overflow: hidden;
	position: relative;
}

.is-style-halftone img {
	filter: contrast(1.18) saturate(1.35);
}

.is-style-halftone::after {
	background-image: radial-gradient(circle, var(--wp--preset--color--theme-1) 0 38%, transparent 44%);
	background-size: 4px 4px;
	content: "";
	inset: 0;
	opacity: 0.7;
	pointer-events: none;
	position: absolute;
}

.wp-block-post-featured-image img,
.wp-block-image a img {
	display: block;
	transition: opacity 0.2s;
}

.wp-block-post-featured-image a,
.wp-block-image a {
	background-color: var(--wp--preset--color--theme-1);
	display: block;
	height: auto;
	position: relative;
	z-index: 1;
}

.wp-block-post-featured-image a:hover img,
.wp-block-image a:hover img {
	opacity: 0.7;
}

/*
 * Jetpack Sharing Buttons: give the text styles the Button colors, so they
 * read on the dark style variations. Icon-only buttons keep their brand colors.
 * https://github.com/Automattic/jetpack/issues/55253
 */
.jetpack-sharing-button__button:not(.style-icon) {
	background-color: var(--wp--preset--color--theme-2);
	color: var(--wp--preset--color--theme-1);
}
