/*
 * Look of the Gutenberg blocks that the converter writes (inc/blocks). Loaded on the front end and in the editor.
 * Class contract: bb-* for core block structure, bn-el-<elementor id> for per element values (stored in post meta
 * _bionika_page_css), bn-* for the markup of the bionika/ blocks (styled by components.css).
 */

:root {
	--bb-curve: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' preserveAspectRatio='none'%3E%3Cpath d='M0,0c0,0,0,6,0,6.7c0,18,240.2,93.6,615.2,92.6C989.8,98.5,1000,25,1000,6.7c0-0.7,0-6.7,0-6.7H0z'/%3E%3C/svg%3E");
	--bb-curve-neg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' preserveAspectRatio='none'%3E%3Cpath d='M615.2,96.7C240.2,97.8,0,18.9,0,0v100h1000V0C1000,19.2,989.8,96,615.2,96.7z'/%3E%3C/svg%3E");
}

/* ---------- Sections (core/group), rows (core/columns), columns (core/column) ---------- */
.wp-block-group.bn-section {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.wp-block-group.bn-section.bn-stretch {
	width: var(--bn-vw, 100vw);
	max-width: none;
	margin-left: calc(50% - var(--bn-vw, 100vw) / 2);
}

.wp-block-group.bn-section.bb-minh {
	display: flex;
	flex-direction: column;
}

.wp-block-group.bn-section.bb-minh.bb-va-center { justify-content: center; }
.wp-block-group.bn-section.bb-minh.bb-va-end { justify-content: flex-end; }

.wp-block-columns.bb-cols {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap !important;
	width: 100%;
	gap: 0;
	margin-top: 0;
	margin-bottom: 0;
	box-sizing: border-box;
}

.wp-block-column.bb-col {
	position: relative;
	display: flex;
	flex-direction: column;
	flex-grow: 0;
	min-width: 0;
	min-height: 1px;
	box-sizing: border-box;
	word-break: normal;
	overflow-wrap: normal;
}

/* Elementor stacked every column below 768 px. Zero specificity so a per column rule (.bn-el-ID) can override it. */
@media (max-width: 767px) {
	:where(.bb-cols > .bb-col) { flex-basis: 100% !important; }
}

/* Widgets inside a column: 20 px between them like Elementor. Inline margins of a block still win. */
.wp-block-column.bb-col > * { margin-top: 0; margin-bottom: 20px; }
.wp-block-column.bb-col > :last-child { margin-bottom: 0; }

/* text blocks of a column keep the 10 px of a paragraph, the last block of a text widget adds the 20 px widget gap (class bb-wend) */
.wp-block-column.bb-col > p,
.wp-block-column.bb-col > ul,
.wp-block-column.bb-col > ol { margin-bottom: 10px; }
.wp-block-column.bb-col > .bb-wend { margin-bottom: 30px; }
.wp-block-column.bb-col > .wp-block-group.bb-inner { margin-bottom: 0; }
.wp-block-column.bb-col > .bb-wend:last-child { margin-bottom: 10px; }
.wp-block-group.bb-text { display: flow-root; }
.wp-block-group.bb-text > p,
.wp-block-group.bb-text > ul,
.wp-block-group.bb-text > ol { margin-top: 0; margin-bottom: 10px; }
.wp-block-group.bb-text > :is(h1, h2, h3, h4, h5, h6) { margin: 0 0 10px; }

/* vertical alignment: a section level value centres the content of every (stretched) column */
.bn-section.bb-va-start > .bb-cols > .bb-col { justify-content: flex-start; }
.bn-section.bb-va-center > .bb-cols > .bb-col { justify-content: center; }
.bn-section.bb-va-end > .bb-cols > .bb-col { justify-content: flex-end; }
.wp-block-column.bb-col.is-vertically-aligned-top { align-self: stretch; justify-content: flex-start; }
.wp-block-column.bb-col.is-vertically-aligned-center { align-self: stretch; justify-content: center; }
.wp-block-column.bb-col.is-vertically-aligned-bottom { align-self: stretch; justify-content: flex-end; }

/* overlay layer of a section (empty group) */
.wp-block-group.bb-overlay {
	position: absolute;
	inset: 0;
	max-width: none !important;
	margin: 0 !important;
	padding: 0;
	pointer-events: none;
}

/* ---------- Shape dividers (extension "Bionika effects"): a curve drawn with a mask ---------- */
.bb-sdt, .bb-sdb { position: relative; isolation: isolate; } /* own stacking context: the divider (z-index -1) paints above the section background, below its content */
.bb-sdt { --bb-rt: 0deg; --bb-xt: 1; }
.bb-sdt--neg { --bb-rt: 180deg; }
.bb-sdt--flip { --bb-xt: -1; }
.bb-sdb { --bb-rb: 180deg; --bb-xb: 1; }
.bb-sdb--neg { --bb-rb: 0deg; }
.bb-sdb--flip { --bb-xb: -1; }

.bb-sdt::before,
.bb-sdb::after {
	content: "";
	position: absolute;
	left: 0;
	width: 100%;
	pointer-events: none;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

.bb-sdt::before {
	top: -1px;
	height: var(--bb-sdt-h, 100px);
	background-color: var(--bb-sdt-c, #fff);
	-webkit-mask-image: var(--bb-curve);
	mask-image: var(--bb-curve);
	-webkit-mask-size: calc(var(--bb-sdt-w, 100%) + 1.3px) 100%;
	mask-size: calc(var(--bb-sdt-w, 100%) + 1.3px) 100%;
	transform: rotate(var(--bb-rt)) scaleX(var(--bb-xt));
}

.bb-sdb::after {
	bottom: -1px;
	height: var(--bb-sdb-h, 100px);
	background-color: var(--bb-sdb-c, #fff);
	-webkit-mask-image: var(--bb-curve);
	mask-image: var(--bb-curve);
	-webkit-mask-size: calc(var(--bb-sdb-w, 100%) + 1.3px) 100%;
	mask-size: calc(var(--bb-sdb-w, 100%) + 1.3px) 100%;
	transform: rotate(var(--bb-rb)) scaleX(var(--bb-xb));
}

.bb-sdt--neg::before { -webkit-mask-image: var(--bb-curve-neg); mask-image: var(--bb-curve-neg); z-index: 1; }
.bb-sdb--neg::after { -webkit-mask-image: var(--bb-curve-neg); mask-image: var(--bb-curve-neg); }
.bb-sdb:not(.bb-sdb--neg)::after { z-index: 0; }
.bb-sdt.bb-sdt--above::before, .bb-sdb.bb-sdb--above::after { z-index: 2; }

[data-bn-popup] { cursor: pointer; }

/* ---------- Heading ---------- */
.wp-block-heading.bb-heading {
	padding: 0;
	font-size: 20px; /* old Elementor default on bionika (measured), widgets with their own size override it */
	line-height: 1;
	color: var(--bn-k-primary, #6ec1e4);
	font-family: var(--bn-font-heading, "Jura", sans-serif);
	font-weight: 600;
	text-transform: uppercase;
}

.bb-heading a { color: inherit; font-size: inherit; line-height: inherit; }

/* ---------- Image ---------- */
.wp-block-image.bb-image {
	margin-top: 0;
	margin-bottom: 20px;
	line-height: 0;
	text-align: center;
}

.wp-block-image.bb-image img {
	display: inline-block;
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

/* ---------- Buttons ---------- */
.wp-block-buttons.bb-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
}

.bb-btn .wp-block-button__link {
	display: inline-block;
	box-sizing: border-box;
	border: 0;
	background-color: var(--bn-k-accent, #61ce70);
	color: #fff;
	font-family: var(--bn-k-head, "Jura", sans-serif);
	font-weight: 500;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.3s;
	word-break: normal;
}

.bb-btn .wp-block-button__link:hover,
.bb-btn .wp-block-button__link:focus { color: #fff; text-decoration: none; }
.bb-hover-grow .wp-block-button__link:hover,
.bb-hover-grow .wp-block-button__link:focus { transform: scale(1.1); }

/* ---------- Spacer and divider ---------- */
.wp-block-spacer.bb-spacer { height: 50px; }

:where(.wp-block-separator.bb-divider) {
	width: 100%;
	height: 0;
	margin: 15px 0;
	border: 0;
	border-top: 1px solid var(--bn-k-secondary, #54595f);
	opacity: 1;
	background: none;
}

.wp-block-separator.bb-divider { max-width: none; }

/* ---------- Accordion (core/details, exclusive through the name attribute) ---------- */
.bb-acc { text-align: left; }

.bb-acc details.wp-block-details {
	margin: 0;
	border: 1px solid var(--bn-k-line, #d4d4d4);
	box-sizing: border-box;
}

.bb-acc details.wp-block-details + details.wp-block-details { border-top: 0; }

.bb-acc summary {
	display: block;
	margin: 0;
	padding: 15px 20px;
	color: var(--bn-k-primary, #6ec1e4);
	font-family: var(--bn-k-head, "Jura", sans-serif);
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	list-style: none;
}

.bb-acc summary::-webkit-details-marker { display: none; }
.bb-acc summary::marker { content: ""; }
.bb-acc summary::before { content: "+"; display: inline-block; width: 1.2em; font-weight: 700; }
.bb-acc--right summary::before { float: right; text-align: right; }
.bb-acc details[open] summary { color: var(--bn-k-accent, #61ce70); }
.bb-acc details[open] summary::before { content: "\2212"; }
/* accordion with an icon: the icon replaces the plus and minus (closed: bb-ic-<icon>, open: bb-icact-<icon>) */
.bb-acc[class*="bb-ic-"] summary::before,
.bb-acc[class*="bb-ic-"] details[open] summary::before {
	content: "";
	width: 1.2em;
	height: 1em;
	vertical-align: -0.1em;
	background-color: currentColor;
	-webkit-mask: var(--bb-ic) center / 0.8em no-repeat;
	mask: var(--bb-ic) center / 0.8em no-repeat;
}
.bb-acc[class*="bb-icact-"] details[open] summary::before {
	-webkit-mask-image: var(--bb-ic-open);
	mask-image: var(--bb-ic-open);
}

.bb-acc details > summary + * { margin-top: 0; padding-top: 15px; border-top: 1px solid var(--bn-k-line, #d4d4d4); }
.bb-acc details > :not(summary) { margin-bottom: 10px; padding-left: 20px; padding-right: 20px; color: var(--bn-k-text, #7a7a7a); font-family: var(--bn-k-body, "Montserrat", sans-serif); font-weight: 400; }
.bb-acc details > :last-child { margin-bottom: 0; padding-bottom: 15px; }

@media (max-width: 767px) {
	.bb-acc summary { padding: 12px 15px; }
	.bb-acc details > :not(summary) { padding-left: 15px; padding-right: 15px; }
	.bb-acc details > summary + * { padding-top: 7px; }
	.bb-acc details > :last-child { padding-bottom: 7px; }
}

/* ---------- Icon list (core/list, icon drawn from the item class, see icons.css) ---------- */
.wp-block-list.bb-iconlist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bb-iconlist li {
	position: relative;
	display: flex;
	align-items: flex-start;
	margin: 0;
	padding: 0;
	color: var(--bn-color-text);
	font-weight: 400;
}

.bb-iconlist li a { color: inherit; text-decoration: none; }

.bb-iconlist li[class*="bb-ic-"]::before {
	content: "";
	flex: 0 0 auto;
	box-sizing: content-box;
	width: calc(var(--bb-ic-size, 14px) * 1.25);
	height: var(--bb-ic-size, 14px);
	margin-right: var(--bb-ic-gap, 5px);
	background-color: var(--bb-ic-color, var(--bn-k-primary, #6ec1e4));
	-webkit-mask: var(--bb-ic) left center / contain no-repeat;
	mask: var(--bb-ic) left center / contain no-repeat;
}

/* the same icons on a button */
.bb-btn[class*="bb-ic-"] .wp-block-button__link::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 5px;
	vertical-align: -0.125em;
	background-color: currentColor;
	-webkit-mask: var(--bb-ic) center / contain no-repeat;
	mask: var(--bb-ic) center / contain no-repeat;
}

.bb-btn.bb-ic-right .wp-block-button__link::before { display: none; }
.bb-btn.bb-ic-right .wp-block-button__link::after {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-left: 5px;
	vertical-align: -0.125em;
	background-color: currentColor;
	-webkit-mask: var(--bb-ic) center / contain no-repeat;
	mask: var(--bb-ic) center / contain no-repeat;
}

/* ---------- Image box, advanced heading, info box (groups of core blocks) ---------- */
.wp-block-group.bb-imagebox { text-align: center; }
.wp-block-group.bb-imagebox--left { display: flex; flex-direction: row; text-align: left; }
.wp-block-group.bb-imagebox--right { display: flex; flex-direction: row-reverse; text-align: right; }
.bb-imagebox--va-top { align-items: flex-start; }
.bb-imagebox--va-bottom { align-items: flex-end; }
.bb-imagebox--va-middle { align-items: center; }
.bb-imagebox .bb-imagebox__img { display: inline-block; margin: 0 auto 15px; max-width: 100%; line-height: normal; }
.bb-imagebox--left .bb-imagebox__img, .bb-imagebox--right .bb-imagebox__img { margin-top: 0; margin-bottom: 0; }
.bb-imagebox .bb-imagebox__img img { width: 100%; height: auto; max-width: 100%; vertical-align: baseline; }
.bb-imagebox__content { width: 100%; }
.bb-imagebox__title { margin: 0 0 10px; font-family: var(--bn-k-head); font-weight: 600; color: var(--bn-k-primary); }
.bb-imagebox__title a { color: inherit; }
.bb-imagebox__desc { margin: 0; color: var(--bn-k-text); font-family: var(--bn-k-body); font-weight: 400; }

@media (max-width: 767px) {
	.wp-block-group.bb-imagebox--left,
	.wp-block-group.bb-imagebox--right { display: block; text-align: center; }
	.bb-imagebox--left .bb-imagebox__img,
	.bb-imagebox--right .bb-imagebox__img { display: block; margin: 0 auto !important; }
}

.bb-advh { text-align: left; }
.bb-advh .bb-advh__heading { margin: 0 0 15px; font-size: 20px; line-height: 1.5; font-weight: 600; font-family: var(--bn-k-head); }
.bb-advh .bb-advh__sub { margin: 15px 0 0; font-family: var(--bn-font-heading); font-weight: 400; color: #54595f; }
.bb-advh .bb-advh__sep { width: 20%; max-width: none; height: 0; margin: 3px 0 0; border: 0; border-top: 2px solid currentColor; opacity: 1; background: none; }
.bb-advh .bb-advh__desc { margin: 15px 0 10px; }
.bb-advh .bb-advh__desc.bb-nojustify { margin-bottom: 0; }
.bb-nojustify { text-align: inherit !important; }

.bb-infobox { display: block; }
.bb-infobox__title { margin: 0 0 10px; }
.bb-infobox .bb-infobox__sep { width: 40px; max-width: none; margin: 10px 0; border: 0; border-top: 2px solid currentColor; opacity: 1; }
.bb-infobox__desc { margin: 0 0 10px; }
.bb-infobox__link { font-weight: 700; }

/* ---------- Social links ---------- */
:where(.wp-block-social-links.bb-social) {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	gap: 0;
}

.bb-social .wp-social-link {
	margin: 0;
	border-radius: 10%;
	background-color: #818a91;
	color: #fff;
	font-size: var(--bb-icon-size, 25px);
	transition: background-color 0.3s, color 0.3s;
}

.bb-social .wp-social-link a { padding: var(--bb-icon-padding, 0.5em); color: inherit; font-size: var(--bb-icon-size, 25px); line-height: 1; }
.bb-social .wp-social-link svg { width: var(--bb-icon-size, 25px); height: var(--bb-icon-size, 25px); }

/* ---------- Map, logo, forms ---------- */
.bb-map { overflow: hidden; }
.bb-map iframe { display: block; width: 100%; height: 300px; border: 0; }
.bn-embed { position: relative; }
.bn-embed iframe { display: block; width: 100%; max-width: 100%; }
.bn-embed-gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; background: #f4f4f4; }
.bn-embed-gate p { margin: 0; max-width: 520px; font-size: 13px; line-height: 1.5; color: #333; }
.bn-embed-gate a { color: var(--bn-color-brand-darker, #246428); text-decoration: underline; }
.bn-embed-gate button { padding: 10px 24px; border: 0; border-radius: var(--bn-radius-pill, 999px); background: var(--bn-color-brand-darker, #246428); color: #fff; font: inherit; cursor: pointer; }
.bn-embed-gate button:hover, .bn-embed-gate button:focus-visible { background: var(--bn-color-brand-dark, #2b8c35); }
.bb-logo { line-height: 0; }

/* ---------- Content typography parts that the old .bn-text wrapper gave ---------- */
.bb-text { color: var(--bn-k-text, #7a7a7a); font-family: var(--bn-font-text, "Montserrat", sans-serif); font-weight: 400; }

/* ---------- bionika/cta: overlay colours come from custom properties set by the block ---------- */
.bn-cta__overlay { background-color: var(--bn-cta-ov, transparent); }
.bn-cta:hover .bn-cta__overlay { background-color: var(--bn-cta-ov-h, var(--bn-cta-ov, transparent)); }

/* A Contact Form 7 shortcode widget outside a styled form group kept the The7 body colour (#85868c) in Elementor, not the widget text colour */
.wp-block-column.bb-col > .wp-block-contact-form-7-contact-form-selector { color: var(--bn-color-text, #85868c); }

/* Plain headings typed in a text block (no class): the old Elementor text widget showed every h1 to h6 the same way (measured on the old site). */
.bn-body h1:not([class]),
.bn-body h2:not([class]),
.bn-body h3:not([class]),
.bn-body h4:not([class]),
.bn-body h5:not([class]),
.bn-body h6:not([class]) {
	font-family: var(--bn-font-heading);
	font-size: 20px;
	line-height: 30px;
	font-weight: 700;
	color: var(--bn-color-heading);
	text-transform: uppercase;
	margin-bottom: 10px; /* margin-top stays free: page CSS of a widget may set it (50px on the ADR form headings) */
}

/* Tables of the old Ultimate Addons table widget: Jura 19px bold header on white, 15px padding, #bbb borders, grey odd body rows, auto column widths. */
.wp-block-table table {
	table-layout: auto;
	border-bottom: 1px solid rgba(51, 51, 51, 0.12);
}

.wp-block-table th,
.wp-block-table td {
	padding: 15px;
	border: 1px solid #bbb;
	text-align: left;
	vertical-align: middle;
	color: var(--bn-color-text);
}

.wp-block-table thead th {
	font-family: var(--bn-font-heading);
	font-size: 19px;
	font-weight: 700;
	line-height: 22px;
	color: #7a7a7a;
}

.wp-block-table tbody tr:nth-child(odd) td {
	background-color: #eaeaea;
}

/* Two column product tables: the old table gave the first column about two thirds of the width. */
.wp-block-table table:has(tr > :nth-child(2):last-child) tr > :first-child {
	width: 68%;
}
