/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* Single-post reading rail: compact table of contents + sticky inquiry form. */
body.single-post .toc__absolute {
	width: clamp(15.5rem, 17vw, 19rem);
}

/* Product detail fallback: keep empty legacy fields from creating visual gaps. */
body.single-product .product-main-data__gallery-wrapper:empty {
	display: none;
}

body.single-product .product-main-data:has(.product-main-data__gallery-wrapper:empty) {
	grid-template-columns: 1fr;
}

body.single-product #brxe-jjprmt > .brxe-block:has(.brxe-text-basic:empty),
body.single-product #brxe-kxbpxd > .brxe-block:has(.brxe-text-basic:empty) {
	display: none;
}

body.single-product .darrel-product-gallery .laodeng-slider__slide img {
	aspect-ratio: 4 / 3;
	height: auto;
	object-fit: cover;
}

body.single-product .darrel-product-gallery .laodeng-slider__controls {
	margin-top: 0.75rem;
	flex-direction: row !important;
	align-items: center;
	justify-content: flex-end;
}

/* Product-category gallery: adaptive editorial gallery rather than a sparse five-column strip. */
body.tax-product-category .applications .laodeng-slider {
	max-width: 1180px;
	margin: clamp(1.5rem, 3vw, 3rem) auto 0;
}

body.tax-product-category .applications .laodeng-slider__track {
	align-items: stretch;
}

body.tax-product-category .applications .laodeng-slider__slide {
	overflow: hidden;
	border-radius: 1rem;
	box-shadow: 0 16px 38px rgb(15 29 68 / 12%);
}

body.tax-product-category .applications .laodeng-slider__slide img {
	aspect-ratio: 16 / 9;
	height: 100%;
	object-fit: cover;
}

body.tax-product-category .applications .laodeng-slider__controls {
	justify-content: center;
	margin-top: 1rem;
}

body.single-product #brxe-d42eb7 {
	height: auto !important;
	min-height: 0 !important;
}

/* Empty product records should not show headings, icons, and blank space. */
body.single-product.darrel-product--unconfigured #brxe-44145c {
	display: none;
}

body.single-post .toc__sticking {
	max-height: min(48vh, 27rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0.625rem;
	border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
	box-shadow: 0 12px 28px rgb(15 29 68 / 8%);
	scrollbar-width: thin;
}

body.single-post .help__toc .x-toc_header {
	position: sticky;
	top: -0.625rem;
	z-index: 1;
	padding: 0.625rem 0.35rem 0.5rem;
	background: var(--primary-ultra-light);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

body.single-post .help__toc .x-toc_link {
	padding: 0.4rem 0.4rem 0.4rem 0.7rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	border-radius: 0.3rem;
}

body.single-post .help__toc .x-toc_link:hover,
body.single-post .help__toc .x-toc_link.x-toc_active-link {
	background: rgb(255 255 255 / 70%);
}

/* Keep the sharing and author cards in normal flow; reserve the sticky rail for the form. */
body.single-post .blog__sticky {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
}

/* The enquiry form remains below the author card, then follows the reader. */
body.single-post .blog__sticky .blog-cta {
	order: initial;
	position: sticky;
	/* Centre the form in the reading viewport, without ever moving above its author section. */
	top: max(7rem, calc(50vh - 20rem));
	transform: none;
	max-height: calc(100vh - 8rem);
	width: 100%;
	box-sizing: border-box;
	overflow-y: auto;
	border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
	box-shadow: 0 16px 36px rgb(15 29 68 / 12%);
	scrollbar-width: thin;
}

body.single-post .blog__sticky .author-card {
	width: 100%;
	box-sizing: border-box;
}

@media (min-width: 992px) {
	/* The author stays in normal flow; only the form sticks inside the right rail. */
	body.single-post .blog-single-2__body-sidebar-right,
	body.single-post .blog__sticky,
	body.single-post .blog__sticky > #brxe-d45432 {
		align-self: stretch;
	}

	body.single-post .blog__sticky {
		height: auto;
		min-height: 100%;
		overflow: visible;
	}

	body.single-post .blog__sticky > #brxe-d45432 {
		display: flex;
		flex-direction: column;
		gap: var(--content-gap, 1.25rem);
	}

	body.single-post .blog__sticky .blog-cta {
		position: sticky !important;
		top: max(7rem, calc(50vh - 20rem));
		z-index: 2;
		margin-top: 0;
	}
}

/* Make the sidebar enquiry form use the full card width with a calmer rhythm. */
body.single-post .blog-cta {
	padding: clamp(1.35rem, 2vw, 1.8rem);
	border-radius: 1rem;
}

body.single-post .blog-cta__heading {
	margin-bottom: 1.15rem;
	font-size: clamp(1.45rem, 2vw, 1.9rem);
	line-height: 1.15;
}

body.single-post .blog-cta #brxe-c8e3c5,
body.single-post .blog-cta .fluentform_wrapper_4,
body.single-post .blog-cta #fluentform_4,
body.single-post .blog-cta .ff-field_container,
body.single-post .blog-cta .ff-t-container,
body.single-post .blog-cta .ff-t-cell,
body.single-post .blog-cta .ff-el-group,
body.single-post .blog-cta .ff-el-input--content {
	width: 100%;
	max-width: none;
}

body.single-post .blog-cta .ff-el-group {
	margin-bottom: 0.9rem;
}

body.single-post .blog-cta .ff-el-input--label {
	margin-bottom: 0.35rem;
}

body.single-post .blog-cta .ff-el-input--label label {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
}

body.single-post .blog-cta .ff-el-form-control {
	width: 100%;
	min-height: 3rem;
	padding: 0.7rem 0.85rem;
	box-sizing: border-box;
	font-size: 1rem;
	line-height: 1.35;
	border-radius: 0.6rem;
}

body.single-post .blog-cta textarea.ff-el-form-control {
	min-height: 8.5rem;
	resize: vertical;
}

body.single-post .blog-cta .ff-btn-submit {
	min-height: 3.15rem;
	padding: 0.7rem 1rem;
	font-size: 1rem;
	font-weight: 700;
	border-radius: 0.65rem;
}

/* Self-hosted inquiry form: a balanced, centred call-to-action. */
body.single-post .blog-cta .ic-form button[type="submit"] {
	display: block;
	width: auto;
	min-width: 10.25rem;
	margin: 0.45rem auto 0;
	padding: 0.78rem 1.5rem;
	border-radius: 999px;
	text-align: center;
}

/* Blog inquiry card: compact contact details and a deliberately generous message area. */
body.single-post .blog-cta .ic-form {
	gap: 0.8rem;
}

body.single-post .blog-cta .ic-form__basics {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.68rem;
}

body.single-post .blog-cta .ic-form__email {
	grid-column: 1 / -1;
}

body.single-post .blog-cta .ic-form label {
	gap: 0.38rem;
	font-size: 0.82rem;
	font-weight: 650;
	line-height: 1.25;
}

body.single-post .blog-cta .ic-form .ic-form__label {
	display: inline-flex;
	align-items: flex-start;
	width: max-content;
	gap: 0.18rem;
	line-height: 1;
	letter-spacing: 0.01em;
}

body.single-post .blog-cta .ic-form .ic-form__label b {
	color: #d64151;
	font-size: 0.9em;
	line-height: 0.8;
}

body.single-post .blog-cta .ic-form input,
body.single-post .blog-cta .ic-form textarea {
	padding: 0.66rem 0.78rem;
	border: 1px solid #cfd8e9;
	border-radius: 0.7rem;
	background: rgb(255 255 255 / 92%);
	box-shadow: inset 0 1px 0 rgb(23 44 95 / 3%);
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

body.single-post .blog-cta .ic-form input {
	min-height: 2.7rem;
}

body.single-post .blog-cta .ic-form textarea {
	min-height: clamp(10.5rem, 22vh, 12.5rem);
	line-height: 1.5;
}

body.single-post .blog-cta .ic-form input:focus,
body.single-post .blog-cta .ic-form textarea:focus {
	border-color: var(--primary, #27418d);
	box-shadow: 0 0 0 3px rgb(39 65 141 / 14%);
	outline: 0;
}

@media (max-width: 420px) {
	body.single-post .blog-cta .ic-form__basics {
		grid-template-columns: 1fr;
	}
}


@media (min-width: 992px) {
	/* Give the author card and enquiry form a more comfortable reading width. */
	body.single-post .blog__post-content-wrapper {
		grid-column: span 7;
	}

	body.single-post .blog-single-2__body-sidebar-right {
		grid-column: span 4;
		align-items: stretch;
	}
}

@media (max-width: 991px) {
	body.single-post .toc__absolute,
	body.single-post .blog__sticky .blog-cta {
		width: 100%;
		max-height: none;
		position: static;
		transform: none;
	}
}

/* Blog reading navigation: a comfortable, compact, scrollable left-side TOC. */
@media (min-width: 992px) {
	body.single-post .blog-single-2__body-sidebar-left {
		visibility: visible;
		align-items: stretch;
	}

	body.single-post .toc__absolute {
		display: block !important;
		width: clamp(250px, 18vw, 340px);
		max-width: 340px;
	}

	body.single-post .toc__sticking {
		top: 112px;
		max-height: min(46vh, 25rem);
		overflow: hidden;
		padding: 1rem 1.1rem;
	}

	body.single-post .laodeng-toc__nav {
		max-height: min(34vh, 18rem);
		overflow-y: auto;
		padding-right: 0.35rem;
		scrollbar-width: thin;
	}

	body.single-post .laodeng-toc__nav ol {
		margin-top: 0.65rem;
	}

	body.single-post .laodeng-toc__nav li + li {
		margin-top: 0.38rem;
	}

	body.single-post .laodeng-toc__nav a {
		display: block;
		font-size: 0.9rem;
		line-height: 1.35;
	}
}


/* HMaking primary navigation typography */
/* The five primary wayfinding links share one deliberate hierarchy. */
.bc-product-mega .bricks-image-caption {
	display: none;
}

#brxe-taqfwj .bricks-nav-menu > .menu-item:not(.show-popup) > a,
#brxe-taqfwj .bricks-nav-menu > .menu-item:not(.show-popup) > .brx-submenu-toggle > a {
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.25;
}

/* Dropdown destinations stay normal-weight so they remain secondary. */
#brxe-taqfwj .bricks-nav-menu .sub-menu > .menu-item > a {
  font-size: 14px !important;
  font-weight: 400 !important;
}

@media (max-width: 991px) {
  .bricks-mobile-menu-wrapper .bricks-mobile-menu > li:not(.show-popup) > a,
  .bricks-mobile-menu-wrapper .bricks-mobile-menu > li:not(.show-popup) > .brx-submenu-toggle > a {
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 1.25;
  }

  .bricks-mobile-menu-wrapper .bricks-mobile-menu .sub-menu > .menu-item > a {
    font-size: 15px !important;
    font-weight: 400 !important;
  }
}


/* HMaking mobile drawer spacing rhythm */
@media (max-width: 991px) {
  .bricks-mobile-menu-wrapper .bricks-mobile-menu {
    box-sizing: border-box;
    padding: clamp(28px, 5vw, 48px) clamp(24px, 7vw, 64px) 40px;
  }

  .bricks-mobile-menu-wrapper .bricks-mobile-menu > li:not(.show-popup) > a,
  .bricks-mobile-menu-wrapper .bricks-mobile-menu > li:not(.show-popup) > .brx-submenu-toggle {
    display: flex;
    width: 100%;
    min-height: 60px;
    align-items: center;
  }

  .bricks-mobile-menu-wrapper .bricks-mobile-menu > li:not(.show-popup) > .brx-submenu-toggle > a {
    display: flex;
    min-height: 60px;
    flex: 1 1 auto;
    align-items: center;
  }

  .bricks-mobile-menu-wrapper .bricks-mobile-menu > li.show-popup {
    width: 100% !important;
    margin: 24px 0 0 !important;
    background: #2b55b5 !important;
  }

  .bricks-mobile-menu-wrapper .bricks-mobile-menu > li.show-popup > a {
    box-sizing: border-box;
    width: 100% !important;
    min-height: 60px;
    margin: 0 !important;
    padding: 0 20px !important;
  }
}
