/*
 * Keeps the scrollbar width so a scroll lock never shifts the page, and lands
 * anchors below the sticky header.
 */
html {
	scroll-padding-top: var(--wp--custom--size--header);
	scrollbar-gutter: stable;
	-webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {

	html {
		scroll-behavior: smooth;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Screenshot frame (latest posts, cards): tinted, ringed, anchored top left
   since screenshots carry their own frame there. */
.portfolio-thumb {
	position: relative;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--24);
	background: var(--wp--custom--color--thumb);
	transition: transform var(--wp--custom--duration--slow) var(--wp--custom--easing--out);
}

.portfolio-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top left;
}

.portfolio-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 var(--wp--custom--border--hairline) var(--wp--custom--color--thumb-line);
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {

	.portfolio-thumb {
		transition: none;
	}
}

/*
 * Entrance shared by the blocks and the theme sections, each setting its own
 * distance. `translate`, not `transform`: items keep their own transform.
 */
@keyframes portfolio-reveal {

	from {
		opacity: 0;
		translate: 0 var(--portfolio-reveal-distance, var(--wp--custom--distance--reveal));
	}

	to {
		opacity: 1;
		translate: none;
	}
}

@media (prefers-reduced-motion: reduce) {

	:root {
		--portfolio-reveal-distance: 0px;
	}
}

code:not(pre > code) {
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--6);
	border-radius: var(--wp--custom--radius--6);
	background: var(--wp--preset--color--tint);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.86em;
	color: var(--wp--preset--color--blue);
}

/* Text fields: the contact form and core's password form of protected posts. */
.portfolio-contact__field :is(input, textarea),
.post-password-form input[type="password"] {
	box-sizing: border-box;
	width: 100%;
	padding: var(--wp--preset--spacing--14) var(--wp--preset--spacing--16);
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--14);
	background: var(--wp--preset--color--white);
	font: inherit;
	font-size: var(--wp--preset--font-size--16);
	color: var(--wp--preset--color--ink);
	transition:
		border-color var(--wp--custom--duration--fast) ease,
		box-shadow var(--wp--custom--duration--fast) ease;
}

.portfolio-contact__field :is(input, textarea):focus,
.post-password-form input[type="password"]:focus {
	border-color: var(--wp--preset--color--blue);
	outline: none;
	background: var(--wp--preset--color--white);
	box-shadow: 0 0 0 var(--wp--preset--spacing--4) var(--wp--preset--color--tint);
}

@media (hover: hover) and (pointer: fine) {

	.portfolio-contact__field :is(input, textarea):hover,
	.post-password-form input[type="password"]:hover {
		border-color: var(--wp--custom--color--line-hover);
	}
}
