/**
 * Core Group Block Styles
 *
 * Custom styles for WordPress core group block (core/group).
 * This file is automatically enqueued via wp_enqueue_block_style().
 *
 * @package Smartfire
 */

/*  Hide background images on mobile devices when toggle is enabled */
@media (max-width: 781px) {

	.wp-block-group.has-background-hidden-mobile {
		background-image: none !important;
	}
}

/* Group
--------------------------------------------- */

.is-style-column-box-shadow {
	box-shadow: 0 8px 40px -20px rgb(21 14 41 / 12%);
	transition: 0.25s ease;
}

.is-style-column-box-shadow:hover {
	box-shadow: 0 12px 60px -20px rgb(21 14 41 / 16%);
}

.is-style-background-blur {
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
}

@media (max-width: 600px) {

	header div.is-style-background-blur {
		backdrop-filter: none;
	}
}

.is-style-top-wave-shape {
	position: relative;
	--wave-shape-height: 105px;

	&::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: var(--wave-shape-height);
		transform: translateY(calc(-100% + 2px));
		background: inherit;
		mask-image: url(../../images/group--top-wave-shape.svg);
		mask-size: max(calc(100% + 2px), 1440px) 100%;
		mask-position: center;
		mask-repeat: no-repeat;
		pointer-events: none;
	}
}

.is-style-bottom-wave-shape,
.is-style-bottom-wave-shape + * {
	margin-block-start: 0;
}

.is-style-bottom-wave-shape {
	position: relative;
	--wave-shape-height: 122px;

	&::before {
		content: "";
		position: absolute;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		height: var(--wave-shape-height);
		transform: translateY(calc(100% - 1px));
		background: inherit;
		mask-image: url(../../images/group--bottom-wave-shape.svg);
		mask-size: max(calc(100% - 1px), 1440px) 100%;
		mask-position: center;
		mask-repeat: no-repeat;
		pointer-events: none;
	}
}

/* Improvements for row group */
@media (max-width: 781px) {

	.has-row-stack {
		flex-direction: column;
		align-items: flex-start !important;
	}

	.has-row-stack > * {
		flex-basis: 100% !important;
	}

	.has-flex-start {
		align-items: flex-start !important;
	}

	.has-justify-start {
		justify-content: flex-start !important;
	}
}

.has-row-stack > .wp-block-buttons,
.has-no-shrink {
	flex-shrink: 0;
}

.wp-block-group.has-sticky-top {
	top: calc(20px + var(--wp-admin--admin-bar--position-offset, 0px));
}

/* Helper class to swap order on mobile */
@media (max-width: 781px) {

	.has-swap-order {
		flex-direction: column-reverse;
	}

	.has-row-reverse {
		flex-direction: row-reverse;
	}
}

/* iOS Safari / WebKit-only top spacing on mobile.
   Use @supports (-webkit-touch-callout) to target iOS WebKit
   (Safari iOS + all iOS browsers, since they all use WebKit). */
@supports (-webkit-touch-callout: none) {

	@media (max-width: 781px) {

		.wp-block-group.has-mobile-safari-top-spacing {
			margin-top: 30px;
		}
	}
}

/* Card Styles */
.is-style-card-post,
.is-style-card-event,
.is-style-card-term {
	position: relative;
	overflow: hidden;

	> .wp-block-group {
		position: relative;
		z-index: 1;
		--wave-shape-height: 40px;

		&::before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			height: var(--wave-shape-height);
			transform: translateY(calc(-100% + 10px));
			background: inherit;
			mask-image: url(../../images/card--top-wave-shape.svg);
			mask-size: 100%;
			mask-position: center;
			mask-repeat: no-repeat;
			pointer-events: none;
			z-index: -1;
		}
	}

	.wp-block-post-featured-image,
	.wp-block-image {
		position: relative;

		&::before {
			content: "";
			position: absolute;
			inset: 0;
			opacity: 0;
			z-index: 1;
			transition: opacity 0.4s ease;
			background:
 linear-gradient(0deg, rgb(0 0 0), rgb(0 0 0 / 0%)) !important;
		}
	}

	.card__post-type-badge {
		position: absolute;
		top: var(--wp--preset--spacing--medium);
		left: var(--wp--preset--spacing--medium);
		z-index: 2;
		margin: 0;
		padding: 8px 16px;
	}

	&:has(a) {

		> .wp-block-group::before,
		.wp-block-post-featured-image::before,
		.wp-block-image::before,
		.wp-block-post-featured-image img,
		.wp-block-image img,
		.card__post-type-badge {
			transition:
				opacity 0.4s ease,
				transform 0.4s ease;
		}

		&:hover {

			.wp-block-group::before {
				transform: translateY(calc(-100% + 2px)) scaleY(3.5);
			}

			.wp-block-post-featured-image img,
			.wp-block-image img,
			.card__post-type-badge {
				transform: translateY(10px);
			}

			.wp-block-post-featured-image::before,
			.wp-block-image::before {
				opacity: 0.5;
			}
		}
	}
}
