/* ==========================================================================
   ProWebBuilder — parts built in Appearance → Site builder (ProWebBuilder Core):
   header and hero built with blocks or custom code, and block layouts for
   the 404 page, blog & archives and single posts.
   Loaded on the site and in the block editor.
   ========================================================================== */

/* Header built with blocks or code ---------------------------------------- */
.site-header--built {
	height: auto;
	background: transparent;
	border-bottom: 0;
}

.site-header--built > *,
.site-header--built .wp-block-group__inner-container > * {
	margin-block: 0;
}

.hb-row {
	--pl-pad: max(var(--gutter, 24px), calc((100% - var(--container, 1280px)) / 2));
	margin: 0 !important;
	padding: 0 var(--pl-pad);
}

@media (max-width: 600px) {
	.hb-bar:has(.nav-icon) {
		flex-wrap: nowrap;
		gap: 10px;
	}

	.hb-bar:has(.nav-icon) .pl-flogo {
		flex: 0 1 auto;
		min-width: 0;
	}
}

/* Full width: logo and icons reach the screen edges. */
.hb-row.pl-full {
	--pl-pad: clamp(16px, 2.5vw, 40px);
}

.hb-row.is-style-pl-row-dark {
	background: var(--ink, #0b0a10);
}

.hb-row + .hb-row,
.hb-row--line {
	border-top: 1px solid var(--line-dark, rgba(255, 255, 255, 0.1));
}

.hb-row.is-style-pl-row-light + .hb-row,
.hb-row.is-style-pl-row-tint + .hb-row {
	border-top-color: var(--line, #e6e2f2);
}

.hb-row:last-child {
	border-bottom: 1px solid var(--line-dark, rgba(255, 255, 255, 0.1));
}

.hb-row.is-style-pl-row-light:last-child,
.hb-row.is-style-pl-row-tint:last-child {
	border-bottom-color: var(--line, #e6e2f2);
}

.hb-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	min-height: 75px;
	margin: 0 !important;
}

.hb-bar > .wp-block-group__inner-container {
	display: contents;
}

.hb-bar > *,
.hb-bar > .wp-block-group__inner-container > * {
	margin: 0 !important;
}

.hb-bar--slim {
	min-height: 40px;
	font-size: 14px;
}

.hb-bar--slim p {
	margin: 0;
}

.hb-row p a:not(.btn) {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hb-row.is-style-pl-row-dark p,
.hb-row.is-style-pl-row-deep p,
.hb-row.is-style-pl-row-brand p {
	color: #fff;
}

.hb-bar--center {
	flex-direction: column;
	justify-content: center;
	padding-block: 14px;
}

.hb-bar .pl-flogo img {
	width: var(--w, 150px);
}

.hb-bar .pl-socials {
	gap: 8px;
}

/* Phones: keep the top bar to one tidy line — the message only, centred;
   social icons stay in the menu and the footer. */
@media (max-width: 781px) {
	.hb-bar--slim {
		justify-content: center;
		min-height: 36px;
		padding-block: 6px;
		text-align: center;
		font-size: 13px;
	}

	.hb-bar--slim .pl-socials,
	.hb-bar--slim .wp-block-social-links {
		display: none !important;
	}

	.hb-bar--slim p {
		line-height: 1.35;
	}
}

.hb-menu {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: flex-end;
	gap: 28px;
}

.hb-menu--left {
	justify-content: flex-start;
}

.hb-menu--center {
	justify-content: center;
}

.hb-bar--center .hb-menu {
	flex: 0 1 auto;
}

/* Menu in the true centre, button, switch and cart on the right: the bar
   becomes three columns (logo | menu | tools). */
.nav__cta--side {
	display: none;
}

@media (min-width: 961px) {
	.hb-bar:has(> .hb-menu--split),
	.hb-bar:has(> .wp-block-group__inner-container > .hb-menu--split) {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	}

	.hb-menu--split {
		display: contents;
	}

	.hb-menu--split > .nav {
		justify-self: center;
	}

	.hb-menu--split > .site-header__tools {
		justify-self: end;
	}

	.hb-menu--split > .nav .nav__cta {
		display: none;
	}

	.hb-menu--split .nav__cta--side {
		display: inline-flex;
	}
}

/* Menu links on a light row (desktop; the phone menu stays dark). */
@media (min-width: 961px) {
	.is-style-pl-row-light .nav__list a,
	.is-style-pl-row-tint .nav__list a {
		color: var(--muted, #57526b);
	}

	.is-style-pl-row-light .nav__list a:hover,
	.is-style-pl-row-tint .nav__list a:hover,
	.is-style-pl-row-light .nav__list .current-menu-item > a,
	.is-style-pl-row-tint .nav__list .current-menu-item > a {
		color: var(--ink, #0b0a10);
	}
}

.is-style-pl-row-light .nav-toggle,
.is-style-pl-row-tint .nav-toggle,
.is-style-pl-row-light .scheme-toggle,
.is-style-pl-row-tint .scheme-toggle,
.is-style-pl-row-light .nav-cart,
.is-style-pl-row-tint .nav-cart,
.is-style-pl-row-light .nav-icon,
.is-style-pl-row-tint .nav-icon {
	border-color: var(--line, #e6e2f2);
	color: var(--ink, #0b0a10);
}

/* Built parts: hero, 404, blog & archives, single posts ------------------- */

/* Theme parts (blog listing, post heading, post text…) span the full width
   and bring their own container. */
.entry-blocks.part-built > :is(section, article, nav.pl-crumbs) {
	width: auto;
	margin: 0;
}

/* Navigation and comments after the post text: no extra gap above. */
.part-built .entry-after {
	padding-top: 0;
}

.part-built .entry-after + .entry-after {
	margin-top: -24px;
}

/* The first section sits under the fixed header. */
.part-built > .pl-section:first-child {
	padding-top: calc(var(--header-h, 76px) + calc(clamp(64px, 9vw, 112px) * var(--space, 1)));
}

.part-built:not(:has(> .pl-section:first-child, > section:first-child, > .hx:first-child, > .wp-block-prowebbuilder-workflow:first-child)) {
	padding-top: var(--header-h, 76px);
}

.part-built > :last-child {
	margin-bottom: 0;
}

.hero-code {
	padding-top: var(--header-h, 76px);
}

/* Placeholder shown in the editor for blocks filled in on the live page. */
.pl-part-ph {
	display: grid;
	place-items: center;
	min-height: 120px;
	padding: 24px;
	border: 1.5px dashed var(--line, #e6e2f2);
	border-radius: var(--radius-sm, 12px);
	background: var(--tint, #f6f4fe);
	color: var(--muted, #57526b);
	font-size: 15px;
	text-align: center;
}

/* Block editor: lay header rows out as on the site (the editor wraps blocks
   in its own containers and doesn't load the main stylesheet). */
.editor-styles-wrapper .hb-bar > .block-editor-inner-blocks > .block-editor-block-list__layout {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	min-height: 75px;
}

.editor-styles-wrapper .hb-bar--slim > .block-editor-inner-blocks > .block-editor-block-list__layout {
	min-height: 40px;
}

.editor-styles-wrapper .hb-bar--center > .block-editor-inner-blocks > .block-editor-block-list__layout {
	flex-direction: column;
	justify-content: center;
	padding-block: 14px;
}

.editor-styles-wrapper .hb-bar .block-editor-block-list__layout > * {
	margin: 0;
}

.editor-styles-wrapper .hb-bar > .block-editor-inner-blocks,
.editor-styles-wrapper .hb-bar > .block-editor-inner-blocks > .block-editor-block-list__layout {
	display: contents;
}

.editor-styles-wrapper .hb-bar > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block {
	width: auto;
	max-width: none;
	margin: 0;
}

.editor-styles-wrapper .wp-block-prowebbuilder-header-menu {
	flex: 1 1 auto;
}

/* Editor: menu centred, tools right (same three columns as on the site). */
.editor-styles-wrapper .hb-bar:has(.hb-menu--split) {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.editor-styles-wrapper .wp-block-prowebbuilder-header-menu:has(.hb-menu--split),
.editor-styles-wrapper .wp-block-prowebbuilder-header-menu :has(.hb-menu--split),
.editor-styles-wrapper .hb-menu--split {
	display: contents;
}

.editor-styles-wrapper .hb-menu--split > .nav {
	justify-self: center;
}

.editor-styles-wrapper .hb-menu--split > .site-header__tools {
	justify-self: end;
}

.editor-styles-wrapper .hb-menu--split > .nav .nav__cta {
	display: none;
}

.editor-styles-wrapper .hb-menu--split .nav__cta--side {
	display: inline-flex;
}

.editor-styles-wrapper .hb-menu .nav {
	display: flex;
	align-items: center;
	gap: 28px;
}

.editor-styles-wrapper .hb-menu .nav__list {
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.editor-styles-wrapper .hb-menu .nav__list .sub-menu,
.editor-styles-wrapper .hb-menu .nav-toggle,
.editor-styles-wrapper .hb-menu .screen-reader-text {
	display: none;
}

.editor-styles-wrapper .hb-menu .nav__list a {
	color: rgba(255, 255, 255, 0.82);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.editor-styles-wrapper :is(.is-style-pl-row-light, .is-style-pl-row-tint) .hb-menu .nav__list a {
	color: var(--muted, #57526b);
}

.editor-styles-wrapper .hb-menu .nav__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 18px;
	border-radius: var(--btn-radius, 999px);
	background: var(--purple, #6d28d9);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
}

.editor-styles-wrapper .hb-menu .nav__cta svg {
	width: 16px;
	height: 16px;
}

.editor-styles-wrapper .hb-menu .site-header__tools {
	display: flex;
	align-items: center;
	gap: 12px;
}

.editor-styles-wrapper .hb-menu :is(.scheme-toggle, .nav-cart, .nav-icon) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	background: transparent;
	color: #fff;
}

.editor-styles-wrapper .hb-menu :is(.scheme-toggle, .nav-cart, .nav-icon) svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.editor-styles-wrapper .hb-menu .scheme-toggle__sun {
	display: none;
}

/* Logo block: show the logo for light backgrounds on white and tinted rows. */
.pl-flogo .brand__img--dark + .brand__img--light {
	display: none;
}

:is(.is-style-pl-row-light, .is-style-pl-row-tint) .pl-flogo .brand__img--dark:has(+ .brand__img--light) {
	display: none;
}

:is(.is-style-pl-row-light, .is-style-pl-row-tint) .pl-flogo .brand__img--dark + .brand__img--light {
	display: inline-block;
}
