/*
 * bizbank/cards ("Сітка карток з текстом"). Values follow the text card
 * sections of the BISешка mock (section.si-section with .si-grid and
 * .si-card) as computed on that page, where the site's global heading and
 * paragraph rules add to the mock's own: the 16px padding of the section
 * title, the 12.8px padding of the card title, a 16px lead.
 *
 * One column (bb-cards--cols-1) is the intro under the first screen of the
 * mock (div.si-intro with .si-intro-box): a single white box up to 1160px
 * wide, without a border, with 18px text (16px on phones) and bold text at
 * weight 800.
 *
 * Breakpoints of the mock: at 1024px and below the section title shrinks
 * and three columns become two; at 767px and below every grid is one
 * column and the type and the cards get smaller.
 *
 * The optional card icon (bb-cards__card-icon) is a 65px square above the
 * card title; the optional note (bb-cards__note) is a small line under the
 * grid. The note looks the same in every variant; the icon differs only
 * in its bottom margin in the spacious variant.
 *
 * The variant "Великі картки без рамки" (bb-cards--spacious) follows the
 * cards of the "Факторинг" mock (section with .grid.three and .card): a
 * 34px section title, 28px padding, 22px corners, no border, 23px card
 * titles and 18px text, a 64px margin under the section. Its type, paddings
 * and margins switch at 650px, its three columns become two at 899px and
 * one at 650px. As in the mock, the last paragraph of a card keeps its 20px
 * margin. Every rule of the variant starts with .bb-cards.bb-cards--spacious,
 * which outweighs the standard rules and their media queries.
 *
 * The section margin is set on .bb.bb-cards, so it also holds in the
 * editor canvas, whose reset of block margins (css/editor-canvas.css)
 * would otherwise glue the sections together there.
 */

.bb.bb-cards {
	margin: 0 0 60px;
	padding: 0;
}

.bb-cards .bb-cards__title {
	margin: 0 0 18px;
	padding: 16px 0;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.5px;
	color: #000;
}

.bb-cards .bb-cards__lead {
	max-width: 960px;
	margin: 0 0 12px;
	padding: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	color: #000;
}

.bb-cards .bb-cards__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
}

.bb-cards.bb-cards--cols-3 .bb-cards__grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bb-cards.bb-cards--cols-1 .bb-cards__grid {
	grid-template-columns: minmax(0, 1fr);
}

.bb-cards .bb-cards__card {
	margin: 0;
	padding: 24px 26px;
	border: 1px solid #e3e9ef;
	border-radius: 20px;
	background: var(--bb-white);
	color: #000;
}

.bb-cards .bb-cards__card.bb-cards__card--accent {
	border-color: transparent;
	background: var(--bb-yellow);
}

.bb-cards.bb-cards--cols-1 .bb-cards__card {
	max-width: 1160px;
	padding: 30px 34px;
	border: 0;
	border-radius: 24px;
}

.bb-cards .bb-cards__card-title {
	margin: 0 0 10px;
	padding: 12.8px 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
	color: #000;
}

.bb-cards .bb-cards__card-body p {
	margin: 0 0 12px;
	padding: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
}

.bb-cards .bb-cards__card-body p:last-child {
	margin-bottom: 0;
}

.bb-cards.bb-cards--cols-1 .bb-cards__card-body :is(p, li) {
	font-size: 18px;
}

.bb-cards.bb-cards--cols-1 .bb-cards__card-body :is(strong, b) {
	font-weight: 800;
}

.bb-cards .bb-cards__card-body :is(ul, ol) {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.bb-cards .bb-cards__card-body li {
	position: relative;
	margin: 0 0 8px;
	padding: 0 0 0 24px;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.55;
}

.bb-cards .bb-cards__card-body ul > li::before {
	content: "";
	position: absolute;
	top: 8px;
	left: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--bb-yellow);
}

/*
 * The yellow markers of the mock would vanish on a yellow card, so its
 * markers are black.
 */
.bb-cards .bb-cards__card--accent .bb-cards__card-body ul > li::before {
	background: #000;
}

.bb-cards .bb-cards__card-body ol {
	counter-reset: bb-cards;
}

.bb-cards .bb-cards__card-body ol > li {
	counter-increment: bb-cards;
}

.bb-cards .bb-cards__card-body ol > li::before {
	content: counter(bb-cards) ".";
	position: absolute;
	top: 0;
	left: 0;
	font-weight: 700;
}

.bb-cards .bb-cards__card-body li > :is(ul, ol) {
	margin-top: 8px;
}

.bb-cards :is(.bb-cards__lead, .bb-cards__card-body) a {
	display: inline-block;
	color: var(--bb-blue);
	text-decoration: underline;
}

.bb-cards :is(.bb-cards__lead, .bb-cards__card-body) a:hover {
	text-decoration: none;
}

.bb-cards .bb-cards__card-icon {
	display: block;
	width: 65px;
	height: 65px;
	margin: 0 0 16px;
	object-fit: contain;
}

.bb-cards .bb-cards__note {
	margin: 20px 0 0;
	padding: 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.6;
	color: #000;
}

/* Editor canvas: the "+" of the section stands on a row of its own. */
.editor-styles-wrapper .bb-cards .bb-cards__grid > .block-list-appender {
	grid-column: 1 / -1;
	margin: 0;
}

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

	.bb-cards .bb-cards__title {
		font-size: 32px;
	}

	.bb-cards.bb-cards--cols-3 .bb-cards__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

	.bb.bb-cards {
		margin-bottom: 40px;
	}

	.bb-cards .bb-cards__title {
		font-size: 24px;
		line-height: 1.2;
	}

	.bb-cards .bb-cards__lead,
	.bb-cards .bb-cards__card-body p,
	.bb-cards .bb-cards__card-body li {
		font-size: 15px;
	}

	.bb-cards .bb-cards__grid,
	.bb-cards.bb-cards--cols-3 .bb-cards__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.bb-cards .bb-cards__card {
		padding: 18px;
		border-radius: 16px;
	}

	.bb-cards.bb-cards--cols-1 .bb-cards__card {
		padding: 20px 18px;
		border-radius: 16px;
	}

	.bb-cards.bb-cards--cols-1 .bb-cards__card-body :is(p, li) {
		font-size: 16px;
	}

	.bb-cards .bb-cards__card-title {
		font-size: 18px;
	}
}

.bb.bb-cards.bb-cards--spacious {
	margin: 0 0 64px;
}

.bb-cards.bb-cards--spacious .bb-cards__title {
	margin: 0 0 24px;
	padding: 0;
	font-size: 34px;
	line-height: 1.25;
	letter-spacing: normal;
}

.bb-cards.bb-cards--spacious .bb-cards__lead {
	max-width: none;
	margin: 0 0 20px;
	font-size: 18px;
	line-height: 1.5;
}

.bb-cards.bb-cards--spacious .bb-cards__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.bb-cards.bb-cards--spacious.bb-cards--cols-3 .bb-cards__grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bb-cards.bb-cards--spacious.bb-cards--cols-1 .bb-cards__grid {
	grid-template-columns: minmax(0, 1fr);
}

.bb-cards.bb-cards--spacious .bb-cards__card {
	max-width: none;
	padding: 28px;
	border: 0;
	border-radius: 22px;
}

/*
 * The mock's inline icon adds a line box of 7px below the image to its
 * 25px margin.
 */
.bb-cards.bb-cards--spacious .bb-cards__card-icon {
	margin: 0 0 32px;
}

.bb-cards.bb-cards--spacious .bb-cards__card-title,
.bb-cards.bb-cards--spacious .bb-cards__card-body {
	overflow-wrap: break-word;
}

.bb-cards.bb-cards--spacious .bb-cards__card-title {
	margin: 0 0 12px;
	padding: 0;
	font-size: 23px;
	font-weight: 800;
	line-height: 1.35;
}

.bb-cards.bb-cards--spacious .bb-cards__card-body :is(p, li) {
	font-size: 18px;
	line-height: 1.5;
}

.bb-cards.bb-cards--spacious .bb-cards__card-body p,
.bb-cards.bb-cards--spacious .bb-cards__card-body p:last-child {
	margin-bottom: 20px;
}

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

	.bb-cards.bb-cards--spacious.bb-cards--cols-3 .bb-cards__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

	.bb.bb-cards.bb-cards--spacious {
		margin-bottom: 48px;
	}

	.bb-cards.bb-cards--spacious .bb-cards__title {
		font-size: 27px;
	}

	.bb-cards.bb-cards--spacious .bb-cards__lead {
		font-size: 16px;
		line-height: 1.5;
	}

	.bb-cards.bb-cards--spacious .bb-cards__grid,
	.bb-cards.bb-cards--spacious.bb-cards--cols-3 .bb-cards__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.bb-cards.bb-cards--spacious .bb-cards__card {
		padding: 24px;
		border-radius: 18px;
	}

	.bb-cards.bb-cards--spacious .bb-cards__card-icon {
		margin-bottom: 31px;
	}

	.bb-cards.bb-cards--spacious .bb-cards__card-title {
		margin-bottom: 12px;
		font-size: 22px;
	}

	.bb-cards.bb-cards--spacious .bb-cards__card-body :is(p, li) {
		font-size: 16px;
		line-height: 24px;
	}
}
