/**
 * GPSA: fade-and-collapse for blocks tagged
 *
 *     gpsa-hide-after-form gpsa-hide-after-form-{FORM_ID}
 *
 * gpsa-hide-after-form.js adds gpsa-is-hiding after a successful submission.
 * Enqueued on the front end only, so none of this applies in the block editor.
 */

/* The animation only runs for visitors who haven't asked for reduced motion. */
@media (prefers-reduced-motion: no-preference) {

	.gpsa-hide-after-form {
		transition:
			opacity 0.4s ease,
			max-height 0.4s ease,
			margin 0.4s ease,
			padding 0.4s ease;
	}
}

/* overflow: hidden only while collapsing, so shadows and dropdowns aren't clipped. */
.gpsa-hide-after-form.gpsa-is-hiding {
	overflow: hidden;
	opacity: 0;
	max-height: 0 !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}
