/* [bi_template] cards, [bi_cta] boxes, the preview popup and the template page extras. Neutral enough for any theme. */

.bi-tpl {
	--bi-brand: #05b0ff;
	--bi-ink: #03263a;
	max-width: 440px;
	margin: 1.25em auto 1.5em;
}

.bi-tpl__frame {
	position: relative;
	border: 1px solid #dbe4ea;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 6px 24px rgba(3, 38, 58, 0.08);
}

.bi-tpl__frame a {
	display: block;
}

.bi-tpl__img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

.bi-tpl__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 3px 10px;
	border-radius: 999px;
	background: #e7f8ee;
	color: #11643a;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.02em;
}

.bi-tpl__badge--pro {
	background: var(--bi-ink, #03263a);
	color: #fff;
}

.bi-tpl__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}

.bi-btn {
	display: inline-flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid #c9d6de;
	border-radius: 8px;
	background: #fff;
	color: #03263a;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.bi-btn:hover,
.bi-btn:focus-visible {
	border-color: #03263a;
	color: #03263a;
	text-decoration: none;
}

.bi-btn--primary,
a.bi-btn--primary:visited {
	border-color: #05b0ff;
	background: #05b0ff;
	color: #fff;
}

.bi-btn--primary:hover,
.bi-btn--primary:focus-visible {
	border-color: #0498dc;
	background: #0498dc;
	color: #fff;
}

/* Preview popup */

.bi-modal {
	width: min(820px, calc(100vw - 24px));
	max-height: calc(100vh - 24px);
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 12px;
	background: #fff;
	color: #03263a;
	box-shadow: 0 20px 60px rgba(3, 38, 58, 0.35);
}

.bi-modal::backdrop {
	background: rgba(3, 38, 58, 0.6);
}

/* Only the picture scrolls: the colours and the button stay in view */
.bi-modal__box {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: calc(100vh - 24px);
	padding: 16px;
	box-sizing: border-box;
}

.bi-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.bi-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.bi-modal__close {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 8px;
	background: #eef3f6;
	color: #03263a;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.bi-modal__colors {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bi-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 6px 12px;
	border: 1px solid #c9d6de;
	border-radius: 999px;
	background: #fff;
	color: #03263a;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.bi-chip[aria-pressed='true'] {
	border-color: #03263a;
	box-shadow: inset 0 0 0 1px #03263a;
}

.bi-chip__swatch {
	width: 14px;
	height: 14px;
	border-radius: 50%;
}

.bi-chip__swatch--original {
	background: conic-gradient(#05b0ff, #0f766e, #b91c1c, #6d28d9, #05b0ff);
}

/* Custom colour: a ring until a colour is chosen */
.bi-chip__swatch--custom {
	box-sizing: border-box;
	border: 2px dashed #8aa1b1;
}

.bi-chip__swatch--custom[style] {
	border: 0;
}

/* The colour picker opens from the Custom chip; the input itself stays out of sight */
.bi-modal__colors {
	position: relative;
}

.bi-modal__color-input {
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 1px;
	height: 1px;
	padding: 0;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

.bi-modal__picture {
	position: relative;
	flex: 1 1 auto;
	min-height: 120px;
	overflow: auto;
	border: 1px solid #dbe4ea;
	border-radius: 8px;
	background: #f4f8fa;
}

.bi-modal__picture img {
	display: block;
	width: auto;
	max-width: 100%;
	height: 65vh;
	margin: 0 auto;
	object-fit: contain;
	transition: opacity 0.15s;
}

.bi-modal__loading {
	display: none;
	position: absolute;
	top: 16px;
	left: 50%;
	padding: 4px 12px;
	border-radius: 999px;
	background: #03263a;
	color: #fff;
	font-size: 13px;
	transform: translateX(-50%);
}

.bi-modal.is-loading .bi-modal__loading {
	display: block;
}

.bi-modal.is-loading .bi-modal__picture img {
	opacity: 0.4;
}

.bi-modal__cta {
	flex: 0 0 auto;
}

/* Template page: posts it's featured in */

.bi-tags a {
	white-space: nowrap;
}

/* [bi_cta]: a box with a button to the invoice maker, in guides */

.bi-cta {
	margin: 1.75em 0;
	padding: 20px 22px;
	border: 1px solid #b9e6fb;
	border-left: 4px solid #05b0ff;
	border-radius: 10px;
	background: #e6f6fe;
	color: #03263a;
}

.bi-cta__title {
	margin: 0 0 6px;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
}

.bi-cta__text {
	margin: 0 0 14px;
}

.bi-cta .bi-btn {
	flex: none;
}

/* Template page hero (the layout and look come from the theme's hero classes) */

.bi-hero__picture {
	display: block;
}

.bi-hero__picture img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	transition: transform 0.2s;
}

.bi-hero__picture:hover img,
.bi-hero__picture:focus-visible img {
	transform: scale(1.015);
}

.bi-hero .bi-tpl__badge {
	position: static;
	display: inline-block;
	margin-bottom: 16px;
	padding: 4px 12px;
	font-size: 13px;
}

/* Template page: similar templates */

.bi-similar {
	margin-top: 3em;
}

/* Section headings and the post list (the page body has no typography styles of its own) */
.bi-featured h2,
.bi-similar h2 {
	margin: 0 0 0.6em;
	color: #03263a;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.bi-featured {
	margin-top: 2em;
}

.bi-featured ul {
	margin: 0;
	padding-left: 1.25em;
	list-style: disc;
}

.bi-featured li {
	margin: 0.3em 0;
}

.bi-featured a,
.bi-tags a {
	color: #0498dc;
}

.bi-tags {
	margin-top: 1em;
}

.bi-similar__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px 20px;
	margin: 1em 0 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.bi-similar__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 40px 32px;
	}
}

.bi-similar__grid li {
	margin: 0;
	padding: 0;
}

.bi-similar__link {
	display: block;
	color: #03263a;
	text-decoration: none;
}

.bi-similar__frame {
	position: relative;
	display: block;
	overflow: hidden;
	border: 1px solid #dbe4ea;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 6px 24px rgba(3, 38, 58, 0.08);
}

.bi-similar__img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	transition: transform 0.2s;
}

.bi-similar__link:hover .bi-similar__img,
.bi-similar__link:focus-visible .bi-similar__img {
	transform: scale(1.03);
}

.bi-similar__name {
	display: block;
	margin-top: 14px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.bi-similar__text {
	display: block;
	margin-top: 6px;
	color: #52606d;
	font-size: 15px;
	line-height: 1.55;
}

.bi-similar__link:hover .bi-similar__name {
	color: #0498dc;
}

/* Generated posts (templates/single-post.php) */

.bi-hero__eyebrow {
	display: inline-block;
	margin-bottom: 16px;
	padding: 4px 12px;
	border-radius: 999px;
	background: #e6f6fe;
	color: #0379b0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.02em;
}

.bi-hero__meta {
	margin: 14px 0 0;
	color: #64748b;
	font-size: 15px;
}

/* Hero: three template pictures fanned out */
.bi-stack {
	position: relative;
	display: block;
	width: 100%;
	max-width: 34rem;
	margin: 0 auto;
	aspect-ratio: 1 / 1;
}

.bi-stack__item {
	position: absolute;
	top: 4%;
	left: 23%;
	width: 54%;
	overflow: hidden;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 18px 50px rgba(3, 38, 58, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.05);
	transition: transform 0.3s;
}

.bi-stack__item img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

.bi-stack__item--left {
	transform: translateX(-38%) rotate(-7deg) scale(0.9);
}

.bi-stack__item--right {
	transform: translateX(38%) rotate(7deg) scale(0.9);
}

.bi-stack__item--front {
	z-index: 1;
}

.bi-stack:hover .bi-stack__item--left,
.bi-stack:focus-visible .bi-stack__item--left {
	transform: translateX(-44%) rotate(-9deg) scale(0.9);
}

.bi-stack:hover .bi-stack__item--right,
.bi-stack:focus-visible .bi-stack__item--right {
	transform: translateX(44%) rotate(9deg) scale(0.9);
}

.bi-stack:hover .bi-stack__item--front,
.bi-stack:focus-visible .bi-stack__item--front {
	transform: translateY(-6px);
}

.bi-post .bi-post__body {
	max-width: none;
}

/* A template in a post: a card with the picture on a tinted panel, swapping sides from card to card */
.bi-row {
	display: grid;
	margin: 2.5rem 0;
	overflow: hidden;
	border: 1px solid #e2e8f0;
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 40px -20px rgba(15, 23, 42, 0.18);
	scroll-margin-top: 6rem;
}

@media (min-width: 900px) {
	.bi-row {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		margin: 3rem 0;
	}

	.bi-row--flip {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	}

	.bi-row--flip .bi-row__media {
		order: 2;
	}
}

.bi-row__media {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 36px 24px;
	overflow: hidden;
	background: radial-gradient(circle at 50% 40%, rgba(5, 176, 255, 0.18), transparent 70%), #f3f9fd;
}

/* The home page hero's grid lines, faded at the edges */
.bi-row__media::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: linear-gradient(90deg, #e2edf4 1px, transparent 0), linear-gradient(180deg, #e2edf4 1px, transparent 0);
	background-size: 44px 44px;
	-webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 30%, transparent 100%);
	mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 30%, transparent 100%);
}

@media (min-width: 900px) {
	.bi-row__media {
		padding: 48px 40px;
	}
}

.bi-row__frame {
	display: block;
	width: min(100%, 280px);
	overflow: hidden;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 28px 50px -18px rgba(3, 38, 58, 0.4), 0 0 0 1px rgba(15, 23, 42, 0.06);
	transition: transform 0.25s, box-shadow 0.25s;
}

@media (min-width: 900px) {
	.bi-row__frame {
		width: min(100%, 320px);
	}
}

a.bi-row__frame:hover,
a.bi-row__frame:focus-visible {
	transform: translateY(-6px);
	box-shadow: 0 36px 60px -20px rgba(3, 38, 58, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.bi-row__img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

.bi-row__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 28px 22px 32px;
}

@media (min-width: 640px) {
	.bi-row__body {
		padding: 40px 44px;
	}
}

@media (min-width: 1100px) {
	.bi-row__body {
		padding: 48px 64px;
	}
}

.bi-row__top {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}

.bi-row__num {
	color: #05b0ff;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.04em;
}

.bi-row__num span {
	color: #94a3b8;
	font-weight: 600;
}

.bi-row__plan {
	padding: 3px 10px;
	border-radius: 999px;
	background: #e7f8ee;
	color: #11643a;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.bi-row__plan--pro {
	background: #03263a;
	color: #fff;
}

.bi-row__title {
	margin: 0;
	color: #0f172a;
	font-size: 1.6rem;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

@media (min-width: 1100px) {
	.bi-row__title {
		font-size: 1.9rem;
	}
}

.bi-row__text p {
	margin: 14px 0 0;
	color: #475569;
	font-size: 17px;
	line-height: 1.7;
}

.bi-row__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}

.bi-row__tags li {
	margin: 0;
	padding: 5px 12px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #475569;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.bi-row__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 28px;
}

@media (min-width: 640px) {
	.bi-row__actions {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

.bi-row__actions .btn {
	text-decoration: none;
}

.bi-row__icon {
	width: 16px;
	height: 16px;
	color: #05b0ff;
}

.bi-row__more {
	align-self: flex-start;
	margin-top: 20px;
	color: #0498dc;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.bi-row__more:hover,
.bi-row__more:focus-visible {
	text-decoration: underline;
}

/* FAQs in a box */
.bi-post__body .bi-faqs {
	margin-top: 4rem;
	padding: 8px 28px 20px;
	border-radius: 20px;
	background: #f4f8fa;
}

.bi-faqs h3 {
	padding-top: 1em;
	border-top: 1px solid #dbe4ea;
}

.bi-faqs h2 + h3 {
	padding-top: 0;
	border-top: 0;
}

/* Under a guide: templates to start with */
.bi-start {
	scroll-margin-top: 6rem;
}

.bi-start__lead {
	margin: 0;
	color: #52606d;
	font-size: 17px;
}

/* [bi_templates]: the templates page */

.bi-gallery {
	margin: 2rem 0;
	color: #334155;
}

/* As wide as the site's container, even inside a narrower page column */
.bi-gallery--wide {
	position: relative;
	left: 50%;
	width: min(1216px, calc(100vw - 32px));
	transform: translateX(-50%);
}

.bi-gallery__tools {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin-bottom: 28px;
}

.bi-gallery__row {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

@media (min-width: 768px) {
	.bi-gallery__row {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

.bi-gallery__search {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 8px;
	max-width: 560px;
	padding: 6px 6px 6px 46px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.bi-gallery__search:focus-within {
	border-color: #7fd6ff;
	box-shadow: 0 0 0 4px rgba(5, 176, 255, 0.15);
}

.bi-gallery__search-icon {
	position: absolute;
	left: 18px;
	width: 18px;
	height: 18px;
	color: #94a3b8;
}

.bi-gallery__search input {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #0f172a;
	font: inherit;
	font-size: 15px;
	outline: none;
	box-shadow: none;
}

.bi-gallery__search input::placeholder {
	color: #94a3b8;
}

.bi-gallery__search .btn {
	flex: 0 0 auto;
}

/* All / Free / Pro */
.bi-gallery__plans {
	display: inline-flex;
	flex: 0 0 auto;
	align-self: flex-start;
	padding: 4px;
	border-radius: 999px;
	background: #f1f5f9;
	box-shadow: inset 0 0 0 1px #e2e8f0;
}

@media (min-width: 768px) {
	.bi-gallery__plans {
		align-self: auto;
	}
}

.bi-gallery__plan {
	padding: 8px 18px;
	border-radius: 999px;
	color: #475569;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s;
}

.bi-gallery__plan:hover {
	color: #0f172a;
}

.bi-gallery__plan.is-active {
	background: #fff;
	color: #0f172a;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* Kinds of business */
.bi-gallery__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bi-gallery__chip {
	padding: 7px 14px;
	border-radius: 999px;
	background: #fff;
	color: #475569;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: inset 0 0 0 1px #e2e8f0;
	transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.bi-gallery__chip:hover {
	color: #0f172a;
	box-shadow: inset 0 0 0 1px #cbd5e1;
}

.bi-gallery__chip.is-active {
	background: #05b0ff;
	color: #fff;
	box-shadow: none;
}

.bi-gallery__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}

.bi-gallery__count {
	margin: 0;
	color: #64748b;
	font-size: 14px;
	font-weight: 600;
}

.bi-gallery__sort {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: #64748b;
	font-size: 14px;
	font-weight: 600;
}

.bi-gallery__sort select {
	height: 40px;
	margin: 0;
	padding: 0 36px 0 14px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
	color: #0f172a;
	font: inherit;
	font-size: 14px;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.bi-gallery__grid {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bi-gallery__item {
	margin: 0;
}

.bi-gallery__picture {
	cursor: zoom-in;
}

.bi-gallery__picture img {
	margin: 0;
}

.bi-gallery__name {
	text-decoration: none;
}

.bi-gallery__name:hover,
.bi-gallery__name:focus-visible {
	color: #0498dc;
}

/* Page numbers */
.bi-gallery__pages {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 40px;
}

.bi-gallery__pages .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	border-radius: 999px;
	background: #fff;
	color: #334155;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: inset 0 0 0 1px #e2e8f0;
}

.bi-gallery__pages a.page-numbers:hover {
	color: #0f172a;
	box-shadow: inset 0 0 0 1px #cbd5e1;
}

.bi-gallery__pages .page-numbers.current {
	background: #05b0ff;
	color: #fff;
	box-shadow: none;
}

.bi-gallery__pages .page-numbers.dots {
	background: transparent;
	box-shadow: none;
}

.bi-gallery__empty {
	padding: 56px 24px;
	border-radius: 24px;
	background: #f8fafc;
	text-align: center;
	box-shadow: inset 0 0 0 1px #e2e8f0;
}

.bi-gallery__empty p {
	margin: 0 0 16px;
	color: #64748b;
}

.bi-gallery__empty .bi-gallery__empty-title {
	margin-bottom: 6px;
	color: #0f172a;
	font-size: 20px;
	font-weight: 800;
}

@media (max-width: 767px) {
	/* One row that scrolls sideways on phones */
	.bi-gallery__chips {
		flex-wrap: nowrap;
		margin-right: -16px;
		padding-right: 16px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.bi-gallery__chip {
		flex: 0 0 auto;
	}
}

/* Card text: the buttons sit at the bottom, so they line up across a row */
.bi-gallery__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
}

.bi-gallery__body > :first-child {
	width: 100%;
}

.bi-gallery__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	width: 100%;
	margin-top: auto;
	padding-top: 20px;
}

.bi-gallery__actions .btn {
	width: 100%;
	text-decoration: none;
}
