/*
 * Base styles of the theme blocks (library/blocks), on the front end and in
 * the editor canvas.
 *
 * The blocks are self-contained: nothing here relies on the theme's
 * stylesheets, and nothing here reaches outside bb- classes. Values repeat the
 * site's design (colours, Mulish type scale, 1440px container, pill buttons)
 * so blocks look like the rest of the site. The theme's global element rules
 * (app.css resets h1-h5, p, ul, a, button) still apply on the front, so every
 * element a block uses gets explicit values here or in css/<slug>.css.
 *
 * Breakpoint: 991px and below is mobile, as in the site's CSS.
 */

.bb {
	--bb-body: #e8eff4;
	--bb-white: #fff;
	--bb-black: #000;
	--bb-yellow: #ffed70;
	--bb-yellow-strong: #ffcf00;
	--bb-blue: #3e66f4;
	--bb-green: #5fcf62;
	--bb-muted: rgba(0, 0, 0, 0.3);
	--bb-font: "Mulish", sans-serif;
	--bb-radius: 20px;

	font-family: var(--bb-font);
	font-size: 24px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--bb-black);
}

.bb,
.bb *,
.bb *::before,
.bb *::after {
	box-sizing: border-box;
}

.bb :where(h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote, dl, dt, dd, table) {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.bb :where(ul, ol) {
	list-style: none;
}

.bb :where(strong, b) {
	font-weight: 700;
}

.bb :where(mark) {
	background: var(--bb-yellow);
	color: inherit;
}

.bb :where(a) {
	color: inherit;
}

.bb :where(img) {
	max-width: 100%;
	height: auto;
}

.bb :where(button) {
	font-family: inherit;
}

.bb-page {
	display: block;
	background: var(--bb-body);
}

.bb-container {
	width: 100%;
	max-width: 1440px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
}

.bb-page > .bb-container .bb-breadcrumbs {
	padding: 7px 20px 5px;
	font-family: Mulish, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: rgba(0, 0, 0, 0.3);
}

.bb-page > .bb-container .bb-breadcrumbs a {
	color: rgba(0, 0, 0, 0.3);
	text-decoration: none;
}

.bb-page > .bb-container .bb-breadcrumbs a:hover {
	color: #000;
}

/* Type scale of the site's headings. */
.bb .bb-h1 {
	font-size: 56px;
	font-weight: 800;
	line-height: 1.2;
}

.bb .bb-h2 {
	font-size: 40px;
	font-weight: 800;
	line-height: 1.2;
}

.bb .bb-h3 {
	font-size: 32px;
	font-weight: 600;
	line-height: 1.5;
}

.bb .bb-h4 {
	font-size: 24px;
	font-weight: 700;
	line-height: 1.5;
}

.bb .bb-h5 {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.5;
}

/* Pill button of the site: black, yellow on hover. */
.bb .bb-btn {
	display: inline-block;
	margin: 0;
	padding: 14px 60px 13px;
	border: 0;
	border-radius: 100px;
	background: var(--bb-black);
	color: var(--bb-white);
	font-family: var(--bb-font);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.5;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
}

.bb .bb-btn:hover,
.bb .bb-btn:focus-visible {
	background: var(--bb-yellow);
	color: var(--bb-black);
}

.bb .bb-btn--white {
	background: var(--bb-white);
	color: var(--bb-black);
}

/*
 * Free text edited with core blocks inside a theme block (paragraphs, lists,
 * tables, headings, images).
 */
.bb .bb-richtext {
	font-weight: 300;
}

.bb .bb-richtext a {
	color: var(--bb-blue);
	text-decoration: underline;
}

.bb .bb-richtext a:hover {
	text-decoration: none;
}

.bb .bb-richtext p {
	padding: 16px 0;
}

.bb .bb-richtext > p:first-child {
	padding-top: 0;
}

.bb .bb-richtext > p:last-child {
	padding-bottom: 0;
}

.bb .bb-richtext ul li {
	position: relative;
	padding-left: 25px;
}

.bb .bb-richtext ul li:not(:last-child) {
	padding-bottom: 16px;
}

.bb .bb-richtext ul li::before {
	content: "";
	display: block;
	position: absolute;
	top: 14px;
	left: 0;
	width: 9px;
	height: 9px;
	border-radius: 100%;
	background: var(--bb-black);
}

.bb .bb-richtext ol {
	list-style: decimal;
	list-style-position: inside;
}

.bb .bb-richtext h2 {
	padding: 16px 0;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.2;
}

.bb .bb-richtext h3 {
	padding: 0.8rem 0;
	font-size: 32px;
	font-weight: 600;
	line-height: 1.5;
}

.bb .bb-richtext h4 {
	padding: 0.5rem 0;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.5;
}

.bb .bb-richtext table {
	width: 100%;
	border-collapse: collapse;
}

.bb .bb-richtext :is(td, th) {
	padding: 29px 20px;
	text-align: left;
	vertical-align: top;
}

.bb .bb-richtext :is(td, th):first-child {
	padding-left: 0;
}

.bb .bb-richtext :is(td, th):last-child {
	padding-right: 0;
}

.bb .bb-richtext th {
	font-weight: 700;
}

.bb .bb-richtext td {
	border-top: 1px solid rgba(0, 0, 0, 0.3);
	font-weight: 300;
}

.bb .bb-scroll-x {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/*
 * Collapsible part (js/accordion.js): a toggle button controls a panel.
 * The panel animates its height through grid rows; without the script the
 * panel stays open.
 */
.bb .bb-toggle {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.bb .bb-collapse {
	display: grid;
	grid-template-rows: 1fr;
}

.bb .bb-collapse.is-animated {
	transition: grid-template-rows 0.3s ease;
}

.bb .bb-collapse > .bb-collapse__inner {
	min-height: 0;
	overflow: hidden;
}

.bb-js .bb .bb-collapse:not(.is-open) {
	grid-template-rows: 0fr;
}

/*
 * Modal with a contact form (js/modal.js, views/_partials/modal.php). The
 * z-index is the largest one browsers keep: the SendPulse live chat of the
 * site puts its button at 2147483646, and the modal has to cover it.
 */
.bb-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: grid;
	align-items: center;
	padding: 20px;
	overflow: auto;
}

.bb-modal[hidden] {
	display: none;
}

.bb-modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.bb-modal__dialog {
	position: relative;
	width: 100%;
	min-width: 0;
	max-width: 810px;
	margin: 0 auto;
	padding: 20px;
	border-radius: 20px;
	background: var(--bb-white);
}

.bb-modal__close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: url(../assets/img/close.svg) center / 32px 32px no-repeat;
	cursor: pointer;
}

.bb-modal__title {
	max-width: 685px;
	overflow-wrap: break-word;
	margin: 0 auto;
	padding: 16px 40px;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
}

html.bb-modal-open {
	overflow: hidden;
}

.bb-modal__body {
	margin-bottom: 30px;
}

.bb.bb-modal .wpcf7-form {
	text-align: center;
}

.bb.bb-modal .wpcf7-form .col {
	text-align: left;
}

/*
 * Contact Form 7 forms inside blocks and form modals. The form body (fields,
 * .grid_2 > .col, .phone-mask, label.acceptance) is the markup stored with
 * each form in the database; these rules give it the site's field look.
 */
.bb .wpcf7-form {
	padding-top: 30px;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--bb-black);
	text-align: left;
}

.bb .wpcf7-form label {
	display: inline;
	margin: 0;
	font-size: inherit;
	font-weight: 400;
	vertical-align: baseline;
}

.bb .wpcf7-form :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="submit"], [type="file"]), select, textarea) {
	width: 100%;
	max-width: 100%;
	min-height: 60px;
	margin: 7px 0;
	padding: 5px 10px;
	border: 0;
	border-radius: 100px;
	outline: 0;
	background: var(--bb-body);
	box-shadow: none;
	font-family: var(--bb-font);
	font-size: 16px;
	line-height: 1.25;
	color: var(--bb-black);
}

.bb .wpcf7-form :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="submit"], [type="file"]), select, textarea):focus {
	box-shadow: inset 0 0 0 1px var(--bb-muted);
}

.bb .wpcf7-form textarea {
	max-height: 200px;
	border-radius: 20px;
	resize: none;
}

.bb .wpcf7-form select:not([multiple]) {
	padding: 19px 20px;
	background: var(--bb-body) url(../assets/img/select-arrow.svg) 95% center / 20px auto no-repeat;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

.bb .wpcf7-form select > * {
	padding: 10px;
	font-size: 16px;
}

.bb .wpcf7-form .phone-mask {
	display: block;
	position: relative;
}

.bb .wpcf7-form .phone-mask::before {
	content: "+38";
	position: absolute;
	top: 25px;
	left: 15px;
	z-index: 1;
	font-size: 16px;
	line-height: 1.5;
}

.bb .wpcf7-form .phone-mask .wpcf7-form-control {
	padding-left: 52px;
}

.bb .wpcf7-form input[type="submit"] {
	display: inline-block;
	width: auto;
	min-height: 0;
	margin: 20px 0 0;
	padding: 16px 60px 15px;
	border: 0;
	border-radius: 100px;
	background: var(--bb-black);
	color: var(--bb-white);
	font-family: var(--bb-font);
	font-size: 18px;
	font-weight: 400;
	line-height: normal;
	text-align: center;
	vertical-align: baseline;
	box-shadow: none;
	cursor: pointer;
	transition: all 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.bb .wpcf7-form input[type="submit"]:is(:hover, :focus-visible) {
	outline: 0;
	background: var(--bb-yellow);
	color: var(--bb-black);
}

.bb .wpcf7-form .wpcf7-acceptance {
	display: inline-block;
	padding-top: 11px;
	vertical-align: baseline;
}

.bb .wpcf7-form .wpcf7-list-item {
	display: inline-block;
	margin: 0;
}

.bb .wpcf7-form input[type="checkbox"] {
	display: grid;
	place-content: center;
	width: 24px;
	height: 24px;
	margin: 0 12px 0 0;
	padding: 0;
	border: 2px solid var(--bb-black);
	border-radius: 0;
	background: var(--bb-white);
	font-size: 16px;
	vertical-align: baseline;
	transform: translateY(-0.075em);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.bb .wpcf7-form input[type="checkbox"]::before {
	content: "";
	width: 12px;
	height: 12px;
	box-shadow: inset 1em 1em var(--bb-yellow);
	transform: scale(0);
	transition: transform 120ms ease-in-out;
}

.bb .wpcf7-form input[type="checkbox"]:checked::before {
	transform: scale(1);
}

.bb .wpcf7-form input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--bb-blue);
	outline-offset: 2px;
}

.bb .wpcf7-form p a {
	display: inline-block;
	color: var(--bb-black);
	text-decoration: underline;
	transition: 0.3s;
}

.bb .wpcf7-form p a:hover {
	text-decoration: none;
}

@media screen and (min-width: 992px) {

	.bb .wpcf7-form .grid_2 {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
}

@media screen and (max-width: 991px) {

	.bb {
		font-size: 20px;
	}

	.bb-container {
		padding-left: 16px;
		padding-right: 16px;
	}

	.bb-page > .bb-container .bb-breadcrumbs {
		padding: 7px 0 19px;
	}

	.bb .bb-h1 {
		font-size: 32px;
	}

	.bb .bb-h2 {
		font-size: 28px;
	}

	.bb .bb-h3 {
		font-size: 24px;
	}

	.bb .bb-h4 {
		font-size: 20px;
	}

	.bb .bb-h5 {
		font-size: 16px;
	}

	.bb .bb-btn {
		padding-left: 20px;
		padding-right: 20px;
	}

	.bb .bb-richtext :is(td, th) {
		padding: 18px 10px;
		font-size: 16px;
	}

	.bb .bb-richtext h2 {
		font-size: 28px;
	}

	.bb .bb-richtext h3 {
		font-size: 24px;
	}

	.bb .bb-richtext h4 {
		font-size: 20px;
	}

	.bb-modal__close {
		top: 15px;
		right: 15px;
	}

	.bb-modal__title {
		padding: 16px 32px;
		font-size: 28px;
	}


	.bb .wpcf7-form label {
		font-size: 14px;
	}

	.bb .wpcf7-form :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="submit"], [type="file"]), select, textarea) {
		min-height: 48px;
	}

	.bb .wpcf7-form select:not([multiple]) {
		padding: 5px 10px;
		background-size: 16px auto;
	}

	.bb .wpcf7-form .phone-mask::before {
		top: 19px;
	}

	.bb .wpcf7-form input[type="submit"] {
		display: block;
		padding: 12px 30px;
		font-size: 16px;
		line-height: 1.1;
	}

	.bb .wpcf7-form .wpcf7-spinner {
		position: absolute;
		left: 0;
		right: 0;
	}

	.bb .wpcf7-form .wpcf7-spinner + br {
		display: none;
	}
}

/*
 * Section spacing set on the page ("Відступи" panel): the block root gets a
 * class and a custom property per side and screen
 * (Bizbank_Blocks::section_support()). "d" applies from 992px, "m" below.
 * !important: a value set on the page wins over the block's own rules,
 * whatever their specificity.
 */
@media screen and (min-width: 992px) {

	.bb.bb-d-pt {
		padding-top: var(--bb-d-pt) !important;
	}

	.bb.bb-d-pb {
		padding-bottom: var(--bb-d-pb) !important;
	}

	.bb.bb-d-mt {
		margin-top: var(--bb-d-mt) !important;
	}

	.bb.bb-d-mb {
		margin-bottom: var(--bb-d-mb) !important;
	}
}

@media screen and (max-width: 991px) {

	.bb.bb-m-pt {
		padding-top: var(--bb-m-pt) !important;
	}

	.bb.bb-m-pb {
		padding-bottom: var(--bb-m-pb) !important;
	}

	.bb.bb-m-mt {
		margin-top: var(--bb-m-mt) !important;
	}

	.bb.bb-m-mb {
		margin-bottom: var(--bb-m-mb) !important;
	}
}
