/**
 * Revita: core/image block styles.
 * Rounded card, hexagon (points left and right, like the logo) and cut-out shadow.
 */

/* Rounded card: the figure is the card, so a caption becomes its footer and hover zoom stays inside. */
.wp-block-image.is-style-rounded-card {
	overflow: hidden;
	isolation: isolate;
	border-radius: var(--wp--custom--radius--lg);
	background-color: var(--wp--custom--color--surface);
	box-shadow: var(--wp--preset--shadow--card);
}

.wp-block-image.is-style-rounded-card img {
	display: block;
	inline-size: 100%;
	border-radius: 0;
}

.wp-block-image.is-style-rounded-card figcaption {
	margin: 0;
	padding: 0.75em 1em;
}

/* Hexagon: a regular hexagon clipped from a cover-fitted image, with a soft shadow on the figure. */
.wp-block-image.is-style-hexagon {
	filter: drop-shadow(0 14px 22px rgb(58 20 66 / 0.16));
}

.wp-block-image.is-style-hexagon img {
	inline-size: 100%;
	aspect-ratio: 1.085;
	border-radius: 0;
	object-fit: cover;
	clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
}

/* A linked hexagon: core makes the link inline-block (shrink to fit), so the image's 100%
 * width would resolve to 0 until its file arrives and the section below would jump (CLS).
 * As a block the link takes the figure's width at once; loaded sizes are unchanged. */
.wp-block-image.is-style-hexagon a {
	display: block;
}

/* Where shape() is supported, round the corners like the logo hexagon. */
@supports (clip-path: shape(from 0 0, line to 100% 0)) {
	.wp-block-image.is-style-hexagon img {
		clip-path: shape(
			from 33% 3%,
			line to 67% 3%,
			curve to 79% 10.52% with 75% 3%,
			line to 96% 42.48%,
			curve to 96% 57.52% with 100% 50%,
			line to 79% 89.48%,
			curve to 67% 97% with 75% 97%,
			line to 33% 97%,
			curve to 21% 89.48% with 25% 97%,
			line to 4% 57.52%,
			curve to 4% 42.48% with 0 50%,
			line to 21% 10.52%,
			curve to 33% 3% with 25% 3%,
			close
		);
	}
}

/* Cut-out shadow: for product photos with a transparent background. */
.wp-block-image.is-style-cutout-shadow img {
	border-radius: 0;
	filter: drop-shadow(0 22px 22px rgb(58 20 66 / 0.18)) drop-shadow(0 4px 6px rgb(58 20 66 / 0.12));
}
