/* Block Group
 * Only style which cannot be handled by the theme.json file.
--------------------------------------------- */

/* First level groups */
.entry-content > .wp-block-group:not(.has-background),
.is-root-container > .wp-block-group:not(.has-background) {
	margin-top: var(--wp--preset--spacing--xxxxxxx-large);
	margin-bottom: var(--wp--preset--spacing--xxxxxxx-large);
}

.entry-content > .wp-block-group.has-background,
.is-root-container > .wp-block-group.has-background,
main > .wp-block-group.has-background {
	padding-top:var(--wp--preset--spacing--xxxxxxx-large);
	padding-bottom: var(--wp--preset--spacing--xxxxxxx-large);
	margin-top: 0;
	margin-bottom: 0;
}

.is-style-background-blur {
	position: relative;
	backdrop-filter: none;
	z-index: 1;
}

.is-style-background-blur::before {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	z-index: -1;
	border-radius: 16px;
	overflow: hidden;
}

.is-style-background-blur .wp-block-social-links,
.is-style-background-blur .wp-block-post-terms,
.is-style-background-blur .wp-block-buttons,
.is-style-card .wp-block-social-links,
.is-style-card .wp-block-post-terms,
.is-style-card .wp-block-buttons {
	margin-top: auto;
}

/* extend link */
main {
	.wp-block-group:is(.is-style-background-blur, .is-style-card) {
		&:has(.seo-target) {
			position: relative;
			z-index: 1;
			overflow: hidden;
			transition: background-color 0.3s, box-shadow 0.3s, border-color 0.3s;
	
			&:has(a:is(:hover,:focus,:active)) {
				color: #fff;
				background-color: var(--wp--preset--color--primary);
				box-shadow: none;
				border-color: var(--wp--preset--color--primary);

				&::before {
					backdrop-filter: none;
				}
		
				*:not(.wp-block-post-terms a, .wp-pattern-event-card__dates *) {
					color: inherit !important;
				}
	
				& .is-style-fake-arrow-button::after {
					transform: translateX(4px);
				}
			}
		}
	}

	.wp-block-group:is(.wp-pattern-post-card--big, .wp-pattern-post-card--horizontal, .wp-pattern-event-card) {
		.wp-block-image {
			position: relative;
			z-index: 1;
			overflow: hidden;
			border-radius: var(--wp--preset--spacing--medium);

			&::before {
				content: '';
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				background: var(--wp--preset--gradient--radial-blue);
				opacity: 0;
				transition: opacity 0.3s;
			}
		}

		&:has(a:is(:hover,:focus,:active)) {
			& .wp-block-image::before {
				opacity: 1;
			}
		}
	}
}

/* Handle sticky position with header */
.entry-content,
.is-root-container {
	& .is-position-sticky {
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 160px);
	}
}
