/*
 * Hover effect "Slide panel": the caption group (the group right after the featured image) is a panel in the overlay
 * colour at the bottom of the image, revealed upwards on hover and keyboard focus (a clip, so it never covers the blocks
 * below the image). Touch screens show it all the time; reduced motion only fades it.
 * Texts inside take the overlay text colour unless a block sets its own colour.
 */
.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post:has(> .wp-block-post-featured-image + .wp-block-group),
.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post > :has(> .wp-block-post-featured-image + .wp-block-group) {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr);
}

.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post-featured-image:has(+ .wp-block-group) {
	grid-area: 1 / 1;
	margin-block: 0;
}

.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post-featured-image + .wp-block-group {
	z-index: 1;
	grid-area: 1 / 1;
	align-self: end;
	margin-block: 0;
	color: var(--rtthemes-post-gallery-overlay-text, var(--wp--preset--color--contrast, #000));
	background-color: var(--rtthemes-post-gallery-overlay, var(--wp--preset--color--base, #fff));
	clip-path: inset(100% 0 0);
	translate: 0 0.75rem;
	transition: clip-path 0.4s cubic-bezier(0.2, 0, 0, 1), translate 0.4s cubic-bezier(0.2, 0, 0, 1);
}

:where(.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post-featured-image) + .wp-block-group :is(a, h1, h2, h3, h4, h5, h6) {
	color: inherit;
}

.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post:is(:hover, :focus-within) .wp-block-post-featured-image + .wp-block-group {
	clip-path: inset(0);
	translate: 0 0;
}

@media (hover: none) {
	.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post-featured-image + .wp-block-group {
		clip-path: none;
		translate: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post-featured-image + .wp-block-group {
		clip-path: none;
		opacity: 0;
		translate: none;
		transition: opacity 0.2s ease;
	}

	.wp-block-rtthemes-post-gallery.has-hover-slide-panel .wp-block-post:is(:hover, :focus-within) .wp-block-post-featured-image + .wp-block-group {
		opacity: 1;
	}
}
