/*
 * Block styles replacing Avada elements (registered in inc/block-styles.php,
 * assigned by the converter fvei-migration) and content rules from the Avada
 * child theme. Values from Avada and fusion_options.
 */

/* Links in content are underlined on hover, as in the Avada child theme. */
.wp-block-post-content a:not(.wp-element-button):hover {
	text-decoration: underline;
}

/* Long words and URLs wrap instead of widening the page, as in Avada. */
.wp-block-post-content {
	overflow-wrap: break-word;
}

/*
 * Groups converted from Fusion containers follow each other without a gap,
 * like the containers; their own margins come from the converter.
 */
.wp-block-post-content > .wp-block-group + .wp-block-group {
	margin-block-start: 0;
}

/* ---------- Headings ---------- */

/*
 * Avada title margin: 31px below (20px on mobile). Headings after other
 * content get 30px above: Avada separated sections by 28px (text elements)
 * to 40px (column ends), blocks only by the block gap.
 */
.wp-block-post-content .wp-block-heading,
.is-style-fvei-trennlinie,
.is-style-fvei-hervorhebung {
	margin-bottom: 31px;
}

.wp-block-post-content * + .wp-block-heading {
	margin-top: 30px;
}

@media (max-width: 800px) {
	.wp-block-post-content .wp-block-heading,
	.is-style-fvei-trennlinie,
	.is-style-fvei-hervorhebung {
		margin-bottom: 20px;
	}
}

/*
 * Separator: double line after the text, centred on the line (Avada title
 * style "double solid"). The line is as wide as the heading and clipped, so
 * it also follows wrapped text and inline markup.
 */
.is-style-fvei-trennlinie {
	overflow: hidden;
}

.is-style-fvei-trennlinie::after {
	content: "";
	display: inline-block;
	width: 100%;
	height: 6px;
	margin: 0 -100% 0 0.4em;
	border-block: 1px solid #e0dede;
	vertical-align: calc(0.39em - 4px);
}

/*
 * Highlight: green double underline (Avada highlight "double_underline",
 * without the drawing animation). Paths from Avada; the box is 0.75em larger
 * than the text, plus room below the view box for the round line caps.
 */
.wp-block-heading.is-style-fvei-hervorhebung {
	position: relative;
	width: fit-content;
	/* Constrained layouts centre their children with auto margins; keep the
	   shrunk heading at the start of the content column instead. */
	margin-left: max(0px, (100% - var(--wp--style--global--content-size, 1100px)) / 2) !important;
}

.wp-block-heading.is-style-fvei-hervorhebung.has-text-align-center {
	margin-inline: auto !important;
}

.is-style-fvei-hervorhebung::after {
	content: "";
	position: absolute;
	inset: -0.375em -0.375em -0.46em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 156' preserveAspectRatio='none' fill='none' stroke='%23009257' stroke-width='12' stroke-linecap='round'%3E%3Cpath d='M10.3 130.6c0 0 193.9-24.3 475.2-11.2M38.9 148.9c0 0 173.8-35.3 423.3-11.8'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	pointer-events: none;
}

/* ---------- Images ---------- */

/* Hover zoom (Avada image frame "zoomin"): the image grows inside its frame. */
.wp-block-image.is-style-fvei-zoom {
	overflow: hidden;
	width: fit-content;
	max-width: 100%;
}

.wp-block-image.is-style-fvei-zoom img {
	transition: transform 1s;
}

.wp-block-image.is-style-fvei-zoom:hover img {
	transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-image.is-style-fvei-zoom img {
		transition: none;
	}
}

/*
 * 40px below the logo slider, as below the Fusion image carousel. Specific
 * enough to beat the layout rule that removes the last child's margin.
 */
.wp-block-group .is-style-fvei-slider.fvei-slider--logos {
	margin-bottom: 40px;
}

/* Galleries: 10px between images (Avada gallery column spacing). */
.wp-block-post-content .wp-block-gallery.has-nested-images {
	--wp--style--unstable-gallery-gap: 10px;
	gap: 10px;
}

/* ---------- Lists ---------- */

/* PDF list: document icon and a line under every item (Avada checklist with PDF icons). */
.wp-block-list.is-style-fvei-pdf-liste {
	padding: 0;
	list-style: none;
	line-height: 1.7;
}

.is-style-fvei-pdf-liste > li {
	padding: 12.6px 0 12.6px 43.2px;
	border-bottom: 1px solid #e0dede;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23363839' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M5 2h9l5 5v15H5zM14 2v5h5M8 12h8M8 15h8M8 18h5'/%3E%3C/svg%3E") no-repeat 6px 18.9px / 18px 18px;
}

/* ---------- Buttons ---------- */

/* Large button (Avada size xlarge); the default size comes from theme.json. */
.wp-block-button.is-style-fvei-gross .wp-block-button__link {
	padding: 17px 40px;
	font-size: 18px;
	line-height: 1.17;
}
