/*
Theme Name: Barasch and McGarry
Theme URI: https://www.post911attorneys.com
Author: Escape Hatch
Author URI: https://escapehatch.com
Description: Theme designed specifically for Barasch & McGarry.
Tags: full-site-editing
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 8.2
Version: 1.0.0
Text Domain: bam
*/

:root {
	--wp--custom--top--offset: calc(var(--wp-admin--admin-bar--height, 0px) + var(--eh--alert-banner--height, 0px));
}

/* Global box-sizing */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	--wp--custom--head--dimensions--height: var(--wp--custom--head--end--dimensions--height);
	--wp--custom--scroll-padding--offset: var(--wp--preset--spacing--60);

	text-size-adjust: none;
	scroll-behavior: smooth;
	overflow-y: scroll;
	scroll-padding-top: calc(var(--wp--custom--head--dimensions--height) + var(--wp-admin--admin-bar--height, 0px) + var(--wp--custom--scroll-padding--offset));

	/* Disable utility bar height if not present */
	&:not(:has(.bam-part-head__start)) {
		--wp--custom--head--start--dimensions--height: 0px;
		--wp--custom--head--start--dimensions--desktop-height: 0px;
		--wp--custom--scroll-padding--offset: 0px;
	}
}

/* Prevent page from scrolling when modal is open */
html.has-modal-open,
html:has(dialog[open]),
html:has(.lightbox-image-container img[src ^='http']) {
	overflow: hidden;
}

.disable-transitions * {
	transition: none !important;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
	html:focus-within {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Declare custom properties that rely on inline properties */
:is(body, .is-root-container) {
	--wp--custom--root--padding-offset: calc(var(--wp--style--root--padding-left) + var(--wp--style--root--padding-left));
	--wp--custom--spacing--gutter: calc((100vw - 100%) / 2);
	--wp--custom--spacing--section--block: var(--wp--preset--spacing--resp-90-120);
	--wp--custom--spacing--section--inline: var(--wp--style--root--padding-left);
	--wp--custom--hero--border-radius: 0;
	--wp--custom--main--spacing--padding--inline: 0;

	/* Header */
	--wp--custom--head--color--background: color-mix(in sRGB, var(--wp--preset--color--base) 0%, transparent);
	--wp--custom--head--color--text: var(--wp--preset--color--base);

	/* Main container */
	--main--spacing--padding--block-start: 0;
	--main--spacing--padding--block-end: var(--wp--preset--spacing--30);
}

/* Remove bottom padding if last child has background color and is full-width */
:is(body, .is-root-container):has(.entry-content > .wp-block-group.alignfull[class*='is-style-section']:last-child) {
	--main--spacing--padding--block-end: 0;
}

@media (width >= 768px) {
	:is(body, .is-root-container) {
		--wp--custom--hero--border-radius: var(--wp--preset--border-radius--medium) var(--wp--preset--border-radius--medium) 0 0;
		--wp--custom--main--spacing--padding--inline: var(--wp--style--root--padding-left);
	}
}

@media (width >= 1024px) {
	:is(body, .is-root-container) {
		--wp--style--root--padding-right: var(--wp--preset--spacing--30);
		--wp--style--root--padding-left: var(--wp--preset--spacing--30);
		--wp--custom--head--start--dimensions--height: var(--wp--custom--head--start--dimensions--desktop-height);
		--wp--custom--head--end--dimensions--height: var(--wp--custom--head--end--dimensions--desktop-height);
	}
}

@media (width >= 1920px) {
	:is(body, .is-root-container) {
		--wp--custom--spacing--gutter: calc((var(--wp--custom--width--full) - 100%) / 2);
		--wp--custom--main--dimensions--width: var(--wp--custom--width--full);
	}
}


/**
 * Elements
 */

/* <body> */
body {
	position: relative;
	margin-inline: auto;
	border: 0;
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeSpeed;
	container: body / inline-size;
	z-index: var(--wp--custom--z-index--body);
	scrollbar-gutter: stable;

	/* Admin bar is not present */
	&:not(.admin-bar) {
		--wp-admin--admin-bar--height: 0px;
	}
}


body::before {
	display: block;
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	block-size: 100%;
	inline-size: 100%;
	background: var(--wp--custom--overlay--color);
	content: '';
	opacity: var(--wp--custom--overlay--opacity);
	visibility: hidden;
	transition: visibility 0s ease-in-out 0.25s, opacity 0.25s ease-in-out;
	z-index: calc(var(--wp--custom--z-index--head) - 1);
}

/* Add translucent background to the body when modal is open */
.has-modal-open body {
	--wp--custom--overlay--opacity: var(--wp--custom--overlay--opacity-active);

	min-block-size: 100vh;
	overflow: clip; /* Note: Changed from hidden to clip to prevent scroll to top when height is restored */
	z-index: 1;
}

.has-modal-open body::before {
	visibility: visible;
	transition-delay: 0s;
}


/* Main content area element vertical spacing */
:where(.entry-content, .is-root-container).is-layout-constrained:not(.wp-block-post-content) > * {
	margin-block-start: var(--wp--preset--spacing--resp-60-90);
}


/* Phone links */
a:where([href ^='tel:']) {
	color: inherit;
	font: inherit;
	text-decoration: none;
}

/* <iframe> */
iframe {
	--wp--style--global--content-size: 100%;
}

/* --- Block icons --- */
.eh-has-icon,
.eh-has-icon > :where(a, button, .wp-element-button) {
	--icon--spacing--inline-gap: var(--wp--preset--spacing--10);
	--icon--width: 1em;
	--icon--height: 1em;

	display: flex;
	align-items: center;
	gap: var(--icon--spacing--inline-gap);

	.icon-svg,
	> *:not([data-rich-text-placeholder])::after {
		flex-shrink: 0;
	}

	svg {
		block-size: var(--icon--height);
		inline-size: var(--icon--width);
		color: var(--icon--color, currentColor);
		fill: currentColor;
		transition: color var(--wp--custom--transition--hover), translate var(--wp--custom--transition--hover);
	}

	&.wp-block-button__link::after {
		block-size: var(--button--icon--size);
		inline-size: var(--button--icon--size);
	}
}

/* Icon on left */
.has-icon-start,
.has-icon-start > :where(a, button) {
	flex-direction: row-reverse;
}


/* --- Headings --- */

/* Remove top margin from elements following headings */
:is(h1, h2, h3, h4, h5, h6) + :is(.entry-content, [class*='wp-block']),
:root :where(.is-layout-constrained) > :is(h1, h2, h3, h4, h5, h6) + * {
	margin-block-start: 0;
}

/* 2X Large */
:is(h1, h2, h3, h4, h5, h6).has-xx-large-font-size {
	margin-block-end: var(--wp--custom--heading--xx-large--margin-bottom);
	font-family: var(--wp--custom--heading--xx-large--font-family);
	font-size: var(--wp--custom--heading--xx-large--font-size);
	font-weight: var(--wp--custom--heading--xx-large--font-weight);
	line-height: var(--wp--custom--heading--xx-large--line-height);

	&:has(+ .wp-block-heading.has-medium-font-size) {
		margin-block-end: 0;

		+ .wp-block-heading.has-medium-font-size {
			margin-block-start: var(--wp--preset--spacing--30);
		}
	}
}

/* X-Large */
:is(h1, h2, h3, h4, h5, h6).has-x-large-font-size,
h1:not([class*='font-size']) {
	margin-block-end: var(--wp--custom--heading--x-large--margin-bottom);
	font-family: var(--wp--custom--heading--x-large--font-family);
	font-size: var(--wp--custom--heading--x-large--font-size);
	font-weight: var(--wp--custom--heading--x-large--font-weight);
	line-height: var(--wp--custom--heading--x-large--line-height);
}

/* Large */
:is(h1, h2, h3, h4, h5, h6).has-large-font-size {
	margin-block-end: var(--wp--custom--heading--large--margin-bottom);
	font-family: var(--wp--custom--heading--large--font-family);
	font-size: var(--wp--custom--heading--large--font-size);
	font-weight: var(--wp--custom--heading--large--font-weight);
	line-height: var(--wp--custom--heading--large--line-height);
}

/* Medium */
:is(h1, h2, h3, h4, h5, h6).has-medium-font-size,
h2:not([class*='font-size']),
.wp-block-esc-highlights h3 {
	margin-block-end: var(--wp--custom--heading--medium--margin-bottom);
	font-family: var(--wp--custom--heading--medium--font-family);
	font-size: var(--wp--custom--heading--medium--font-size);
	font-weight: var(--wp--custom--heading--medium--font-weight);
	line-height: var(--wp--custom--heading--medium--line-height);

	* + & {
		margin-block-start: var(--wp--preset--spacing--resp-60-90);
	}
}

/* Small */
:is(h1, h2, h3, h4, h5, h6).has-small-font-size,
:is(h3, h4, h5, h6):not([class*='font-size']) {
	margin-block-end: var(--wp--custom--heading--small--margin-bottom);
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--custom--heading--small--font-size);
	font-weight: var(--wp--custom--heading--small--font-weight);
	line-height: var(--wp--custom--heading--small--line-height);
}

/* Extra Small */
:is(h1, h2, h3, h4, h5, h6).has-x-small-font-size {
	margin-block-end: var(--wp--custom--heading--x-small--margin-bottom);
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--custom--heading--x-small--font-size);
	font-weight: var(--wp--custom--heading--x-small--font-weight);
	line-height: var(--wp--custom--heading--x-small--line-height);
}

:is(.bam-single__content, .post-type-post) {
	:is(h1, h2, h3, h4, h5, h6):where(.has-x-large-font-size, .has-large-font-size),
	:is(h1, h2):not([class*='font-size']) {
		margin-block-start: revert;
	}
}

/* Space between heading and query */
:is(h1, h2, h3, h4, h5, h6):where(.has-x-large-font-size, .has-large-font-size) + .wp-block-query,
:is(h1, h2):not([class*='font-size']) + .wp-block-query {
	margin-block-start: var(--wp--preset--spacing--60);
}

/* Enables container-based responsive font sizing */
.has-container-font-size {
	container-type: inline-size;

	.wp-block-heading.has-xx-large-font-size {
		font-size: clamp(2.5rem, 16cqi, 4.5rem) !important;
	}
}


/* --- Buttons --- */
.wp-block-button .wp-element-button,
.wp-block-eh-query-load-more.wp-element-button {
	--button--color--background: var(--wp--custom--color--background, var(--wp--preset--color--primary));
	--button--color--background-hover: var(--wp--preset--color--contrast);
	--button--color--text: var(--wp--preset--color--base);
	--button--color--text-hover: var(--wp--preset--color--base);
	--button--border--color: var(--button--color--background);
	--button--icon--color: currentColor;
	--button--icon--color--hover: currentColor;
	--button--icon--scale: 1.25;
	--button--icon--size: 1em;

	display: flex;
	align-items: center;
	justify-content: center;
	border-color: var(--button--border--color);
	text-align: center;
	text-box: trim-both;
	white-space: nowrap;

	.icon-svg {
		display: flex;
		align-items: center;
		justify-content: center;
		content: '';
		transition: all var(--wp--custom--transition--button);
		aspect-ratio: 1 / 1;

		svg {
			--icon--width: var(--button--icon--size);
			--icon--height: var(--button--icon--size);

			margin: 0;
			color: var(--button--icon--color);
		}
	}

	.has-hidden-label & {
		--button--spacing--padding-inline: calc(var(--wp--preset--spacing--15) - 1px);
	}

	/* Button hover states */
	&:is(:hover, :focus-visible) {
		--button--color--background: var(--button--color--background-hover);
		--button--icon--color: var(--button--icon--color--hover);

		background-color: var(--button--color--background) !important;
		outline-offset: 4px;
		color: var(--button--color--text-hover);
	}

	/* Disabled state */
	&:disabled {
		background-color: var(--wp--preset--color--gray-dark) !important;
		border-color: var(--wp--preset--color--gray-dark) !important;
		cursor: default;
	}

	/* Disable cursor for buttons that don't have a href or type="button" */
	&:not([href], [type='button']) {
		cursor: default;
	}

	&[style*='text-transform:none'] {
		--button--typography--letter-spacing: 0;
	}

	/* If background color is not set, default to primary */
	&:not(.has-background) {
		--wp--custom--color--background: var(--wp--preset--color--primary);
	}

	/* Contrast background color */
	&.has-contrast-background-color {
		--button--color--background-hover: var(--wp--preset--color--primary);
	}

	/* Secondary background color */
	&.has-secondary-background-color {
		--button--color--background-hover: var(--wp--preset--color--secondary-dark);
	}

	/* Lightest gray background color */
	&.has-gray-lightest-background-color {
		--button--color--background-hover: var(--wp--preset--color--primary);
		--button--color--text: var(--wp--preset--color--contrast);
		--button--color--text-hover: var(--wp--preset--color--base);
	}

	/* Buttons on dark backgrounds */
	:where(.has-black-background-color, .has-contrast-background-color, .has-gradient, .is-style-billboard) & {
		--button--color--background-hover: var(--wp--preset--color--base);
		--button--color--text-hover: var(--wp--preset--color--contrast);
		--button--icon--color: var(--wp--preset--color--base);
	}

	/* Small buttons */
	.wp-block-buttons.is-small & {
		--button--spacing--padding-block: var(--wp--preset--spacing--10);
		--button--spacing--padding-inline: var(--wp--preset--spacing--10);
		--button--typography--font-size: var(--wp--preset--font-size--x-small);
	}

	/* Large buttons */
	.wp-block-buttons.is-large & {
		--button--spacing--padding-block: var(--wp--preset--spacing--30);
		--button--spacing--padding-inline: var(--wp--preset--spacing--40);
	}
}

/* Visually hide label */
.eh-has-icon.has-hidden-label .icon-label,
.eh-has-icon.has-hidden-label > .wp-element-button .icon-label {
	position: absolute !important;
	block-size: 1px !important;
	inline-size: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	clip-path: inset(50%) !important;
}

/* --- Full width button --- */
.wp-block-button.wp-block-button__width-100 {
	.wp-block-button__link {
		justify-content: space-between;
		text-align: start;
	}

	/* Icon on left */
	&.has-icon-start .wp-block-button__link {
		justify-content: start;
		text-align: start;
	}
}

/* --- Small button size --- */
.wp-block-buttons.has-small-font-size .wp-element-button:is(.wp-element-button, .wp-block-button__link) {
	--button--spacing--padding-block: var(--wp--preset--spacing--20);
	--button--spacing--padding-inline: var(--wp--preset--spacing--20);
	--button--typography--font-size: 14px;
	--button--typography--line-height: 0.75;
}

/* Adjust icon spacing */
.wp-block-buttons.has-small-font-size.eh-has-icon .wp-block-button .wp-block-button__link {
	--icon--spacing--inline-gap: var(--wp--preset--spacing--10);
}


/**
 * Vendor styles
 */

/* --- lite-youtube --- */
lite-youtube {
	--play-button--image: var(--wp--custom--icons--play-button);
	--play-button--size: 48px 48px;

	overflow: clip;

	/* Hover state */
	.wp-block-embed:is(:hover, :active) &:not(.lyt-activated) > .lty-playbtn,
	&:is(:hover, :active):not(.lyt-activated) > .lty-playbtn {
		--play-button--size: 72px 72px;

		opacity: 1;
	}
}

lite-youtube::before {
	inset-block: 0;
	block-size: 100%;
	background-color: var(--wp--preset--color--contrast);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--wp--custom--transition--button);
}

/* Play button */
lite-youtube > .lty-playbtn {
	padding: 0;
	background-image: var(--play-button--image);
	background-size: var(--play-button--size);
	opacity: 1;
	appearance: none;
	filter: none;
	transition: background-size var(--wp--custom--transition--button);
}

/* Hides poster image when activated */
lite-youtube.lyt-activated {
	background-image: none !important;
}

@media (width >= 768px) {
	lite-youtube {
		inline-size: 100%;
		max-inline-size: none;
	}
}


/**
 * Typography
 */

/* .wp-block-heading:has(+ p) {
	margin-block-end: var(--wp--preset--spacing--20);
} */

.wp-block-heading + p {
	margin-block-start: 0;
}

/* Hide empty paragraphs */
.entry-content p:empty {
	display: none;
}


/* 2X Large font size */
:is(p, li).has-xx-large-font-size,
.has-xx-large-font-size :where(p, li) {
	line-height: 1.25;
}

/* Extra Large font size */
:is(p, li).has-x-large-font-size,
.has-x-large-font-size :where(p, li) {
	line-height: 1.33;
}

/* Large font size */
:is(p, li).has-large-font-size,
.has-large-font-size :where(p, li) {
	line-height: 1.77;
}

/* Medium font size */
:is(p, li).has-medium-font-size,
.has-medium-font-size :where(p, li) {
	line-height: 1.5;
}

p.has-medium-font-size,
.has-medium-font-size p {
	margin-block: var(--wp--preset--spacing--30);
}

/* Small font size */
:is(p, li).has-small-font-size,
.has-small-font-size :where(p, li) {
	line-height: 1.5;
}

/* Extra Small font size */
:is(p, li).has-x-small-font-size,
.has-x-small-font-size :where(p, li) {
	line-height: 1;
}

/* Center aligned text */
p.has-text-align-center {
	margin-inline: auto;
}

/* If paragraph is empty, hide it */
main .entry-content p:empty {
	display: none;
}

/* Last child is an empty paragraph, remove bottom margin from previous element */
main .entry-content > *:nth-last-child(2):has(+ p:empty) {
	margin-block-end: 0;
}

:where(.entry-content, .is-root-container) {
	container-type: inline-size;

	:where(.entry-content, .is-root-container) {
		container-type: unset;
	}
}

.has-white-space-nowrap {
	white-space: nowrap;
}

/* Format: Small Caps */
.is-small-caps, .is-style-small-caps {
	display: block;
	margin-block-end: var(--wp--custom--kicker--default--margin-bottom);
	font-family: var(--wp--custom--kicker--default--font-family);
	font-size: var(--wp--custom--kicker--default--font-size);
	font-weight: var(--wp--custom--kicker--default--font-weight);
	letter-spacing: var(--wp--custom--kicker--default--letter-spacing);
	line-height: var(--wp--custom--kicker--default--line-height);
	text-transform: var(--wp--custom--kicker--default--text-transform);
}

.wp-block-post-terms.is-style-small-caps a {
	font-size: var(--wp--preset--font-size--x-small);
}

/* Read more */
.wp-block-read-more.is-style-small-caps {
	font-size: inherit;

	&.eh-has-icon {
		--icon--spacing--inline-gap: var(--wp--preset--spacing--5);
	}
}

/* Format: Underline */
.has-underline {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

/* Text wrap */
.has-balance-text-wrap:not(.has-text-align-center) {
	max-inline-size: var(--wp--custom--width--content-narrow);
	text-wrap: balance;
}

.has-balanced-text-wrap {
	text-wrap: pretty;
}

.has-pretty-text-wrap {
	text-wrap: pretty;
}

.has-nowrap-text-wrap {
	text-wrap: nowrap;
}

.has-wrap-text-wrap {
	text-wrap: wrap;
}

/* Format: Screen Reader Only, front end only */
.wp-site-blocks .has-screen-reader-text {
	position: absolute !important;
	block-size: 1px;
	inline-size: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	overflow-wrap: normal !important;
	word-break: normal !important;

	&.dashicons-before::before {
		display: none;
		content: '';
	}
}


/**
 * Blocks
 */

/**
 * Patterns
 */
.bam-callout.wp-block-group {
	inline-size: 100%;
}

/* -- Call to action lockup -- */
.bam-cta.wp-block-group {
	margin-block: var(--wp--preset--spacing--30);
	background-color: transparent !important;

	@container (width >= 768px) {
		margin-block: var(--wp--preset--spacing--50);
	}
}

.bam-cta__inner.wp-block-group {
	display: inline-flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	inline-size: 100%;
	padding: var(--wp--preset--spacing--20);
	background-color: color-mix(in sRGB, var(--wp--custom--color--background, transparent) 50%, transparent) !important;
	border-radius: var(--wp--preset--border-radius--small);


	p, .wp-block-buttons {
		margin: 0;
	}

	p, .wp-element-button {
		justify-content: center;
		text-align: center;
	}


	.wp-block-button {
		inline-size: 100%;
	}

	@container (width >= 768px) {
		flex-direction: row;
		align-items: center;
		inline-size: auto;
		padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--10) var(--wp--preset--spacing--10) var(--wp--preset--spacing--30);
	}
}


/* --- Inline CTA --- */
:has(> .bam-cta-inline) {
	container: cta / inline-size;
}

.wp-block-group.bam-cta-inline {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	background-color: var(--wp--preset--color--primary-dark);
	border-radius: var(--wp--preset--border-radius--small);

	> .wp-block-buttons {
		margin: 0;
	}

	.wp-block-group {
		padding: 0 var(--wp--preset--spacing--20);
	}

	.wp-block-button {
		inline-size: 100%;
	}

	p {
		line-height: 1.33;
	}

	@container (width < 450px) {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;

		.wp-block-group {
			padding: var(--wp--preset--spacing--15) var(--wp--preset--spacing--20);
		}

		.wp-block-button.is-style-small-caps .wp-element-button {
			--button--icon--size: 16px;

			padding: 6px 3px 6px 16px;
			border-start-start-radius: 0;
			border-start-end-radius: 0;
		}
	}
}


/* -- Card -- */
.bam-card {
	gap: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--resp-20-30);
	background-color: var(--wp--preset--color--base);

	&, .wp-block-image img {
		border-radius: var(--wp--preset--border-radius--medium);
	}

	/* Image */
	.wp-block-image {
		block-size: 300px;
		overflow: clip;

		img {
			object-fit: cover;
			block-size: 100% !important;
			inline-size: 100%;
		}

		.components-placeholder {
			block-size: 100%;
		}
	}

	/* Heading */
	.wp-block-heading {
		margin-block: var(--wp--preset--spacing--10);
	}

	/* Paragraph */
	.wp-block-paragraph {
		margin-block: var(--wp--preset--spacing--10) var(--wp--preset--spacing--20);
	}

	/* Buttons */
	.wp-block-buttons {
		margin-block-start: auto;
		padding-block-start: var(--wp--preset--spacing--10);
		justify-self: end;
	}

	> .wp-block-group {
		flex-grow: 1;
	}

	/* Editor preview */
	.is-root-container > &.wp-block {
		max-inline-size: 840px;
		border: 1px solid var(--wp--preset--color--gray-lighter);
	}

	@media (width >= 768px) {
		.wp-block-image {
			block-size: 400px;
			aspect-ratio: 792 / 420;
		}
	}
}

/* -- Contact card -- */
.bam-contact-card {
	p a {
		color: currentColor;
		text-decoration: none;
		transition: color var(--wp--custom--transition--button);

		&:hover {
			color: var(--wp--preset--color--primary);
		}
	}

	&.is-address:has(p:empty) {
		display: none;
	}
}

/* Feature / Internal hero module */
.bam-feature {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--30);
	margin-block: var(--wp--custom--spacing--section);

	> * {
		grid-column: 1;
		margin: 0;
	}

	@container body (width >= 1024px) {
		grid-template-columns: repeat(12, minmax(0, 1fr));
		grid-template-rows: minmax(max-content, 0);
		align-items: start;
		gap: var(--wp--preset--spacing--90) var(--wp--preset--spacing--60);

		> * {
			grid-column: span 4;
		}

		> .wp-block-group:last-child {
			grid-row: span 1;
		}

		> :where(.wp-block-post-featured-image, .wp-block-image) {
			grid-column: span 8;
			grid-row: span 2;
		}
	}
}



/* --- Modal --- */
.wp-block-eh-modal__dialog {
	--dialog--close--size: 24px;
	--dialog--close--padding: var(--wp--preset--spacing--20);
	--dialog--close--border-radius: 50%;
	--dialog--close--color--background: var(--wp--preset--color--gray-lightest);
	--dialog--close--color--background-hover: var(--wp--preset--color--primary);
	--dialog--close--color--text: var(--wp--preset--color--primary);
	--dialog--close--color--text-hover: var(--wp--preset--color--gray-lightest);

	@media (width >= 1024px) {
		--dialog--close--size: 48px;
		--dialog--close--padding: var(--wp--preset--spacing--20);
	}
}

/* --- Contact Modal --- */
.bam-modal-contact {
	.wp-block-eh-modal__dialog {
		--dialog--border-radius: var(--wp--preset--border-radius--small);
		--dialog--padding--block: var(--wp--preset--spacing--30);
		--dialog--padding--inline: var(--wp--preset--spacing--30);
		--dialog--inset: var(--wp--preset--spacing--20) var(--wp--preset--spacing--20) auto auto;
		--dialog--width: 536px;
		--dialog--max-width: calc(100vw - var(--wp--style--root--padding-left) * 2);
		--dialog--max-height: calc(100dvh - (var(--wp--preset--spacing--20) * 2));
		--dialog--translate--start: 100% 0;
		--dialog--translate--end: 0% 0%;
		--dialog--backdrop--color: var(--wp--custom--overlay--background, #000);
		--dialog--backdrop--opacity: var(--wp--custom--overlay--opacity-active, 0.9);
		--dialog--close--inset: var(--wp--preset--spacing--30) var(--wp--preset--spacing--30) auto auto;

		block-size: 100%;
		box-shadow: var(--wp--preset--shadow--x-small);
	}

	.wp-block-eh-modal__content {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		block-size: 100%;
	}

	@media (width <= 767px) {

	}
}

/* --- Search Modal --- */
.bam-modal-search {
	--dialog--height: 100%;

	z-index: var(--wp--custom--z-index--search);

	.wp-block-eh-modal__dialog {
		--dialog--inset: 0;
		--dialog--width: 100vw;
		--dialog--max-width: 100%;
		--dialog--translate--start: 0 -50%;
		--dialog--translate--end: 0 0;
		--dialog--close--inset: calc(100% + var(--wp--preset--spacing--10)) var(--wp--style--root--padding-right) auto auto;

		position: fixed;
	}

	form {
		max-inline-size: var(--wp--custom--width--content-narrow);
		margin-inline: auto;
		padding: var(--wp--preset--spacing--30) var(--wp--style--root--padding-left);
	}

	.wp-element-button :where(svg) {
		scale: 2 2;
	}

	@media (width >= 1024px) {
		.wp-block-eh-modal__dialog {
			--dialog--close--inset: var(--wp--preset--spacing--30) var(--wp--preset--spacing--30) auto auto;
		}

		form {
			padding-block: var(--wp--preset--spacing--60);
		}
	}
}

/* --- Story Modal --- */
.bam-modal-story {
	margin: 0;

	.wp-block-eh-modal__dialog {
		--dialog--backdrop--color: var(--wp--preset--color--base);
		--dialog--backdrop--opacity: 1;

		max-inline-size: 1024px;
		padding-block: var(--wp--preset--spacing--resp-30-60);
		overflow: visible;
	}

	.wp-block-eh-modal__content {
		overflow-y: auto ;
		block-size: 100%;
	}
}

/* --- Video Modal --- */
.bam-modal-video {
	.wp-block-eh-modal__dialog {
		border-radius: var(--wp--preset--border-radius--medium);
	}
}


/* --- Header --- */
header:has(> .bam-part-head) {
	position: sticky;
	inset-block-start: calc((var(--wp--custom--head--start--dimensions--height) - var(--wp-admin--admin-bar--height)) * -1);
	margin-block-start: 0;
	z-index: var(--wp--custom--z-index--head);

	&:has(.has-modal-open) {
		inset-block-start: calc(var(--wp-admin--admin-bar--height) * -1);
	}
}

.bam-part-head {
	--head--spacing--padding--block: var(--wp--preset--spacing--20);
	--head--spacing--padding--inline: var(--wp--style--root--padding-left);

	display: flex;
	inset-inline-start: 0;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	inline-size: 100%;
	z-index: var(--wp--custom--z-index--head);

	> * {
		margin-block: 0 !important;
	}
}

/* Add bottom border to header when pinned */
.bam-part-head__end:not(.has-contrast-background-color) {
	border-block-end: 1px solid var(--wp--preset--color--gray-lightest);

	@supports (animation-timeline: view()) {
		border-block-end-color: transparent;
		animation-fill-mode: both; /* hold the end state once past the range */
		animation-name: pinned-header;
		animation-timeline: scroll(root block);
		animation-range: var(--wp--custom--head--start--dimensions--height) var(--wp--custom--head--start--dimensions--height); /* only animate after header-start is off screen */
	}
}

@keyframes pinned-header {
	from {
		border-block-end-color: transparent;
	}

	to {
		border-block-end-color: var(--wp--preset--color--gray-lightest);
	}
}

@media (prefers-reduced-motion: reduce) {
	header:has(> .bam-part-head) {
		animation: none;
	}
}

.bam-part-head__start, .bam-part-head__end {
	padding-block: var(--wp--preset--spacing--10);
}

.bam-part-head__start {
	order: 1;

	p {
		font-size: 10px;
		line-height: 1;
	}
}

.bam-part-head__end {
	order: 2;
	gap: var(--wp--preset--spacing--10);

	> .wp-block-group.is-layout-flex {
		gap: var(--wp--preset--spacing--10);
	}
}

/* Logo */
.bam-part-head__logo {
	&, img {
		block-size: 40px;
		inline-size: auto;
	}

	a {
		block-size: 100%;
	}
}

.bam-part-head__nav-main {
	gap: var(--wp--preset--spacing--30);
}


/* Hide desktop mobile buttons and logo when overlay is open */
/* .bam-part-head__inner:has(.has-modal-open) {
	:is(& > .bam-part-head__logo, & .wp-block-navigation__responsive-container-open) {
		visibility: hidden;
		transition: visibility 0s ease 0.25s;
	}
} */

.eh-scroll-bug {
	position: absolute;
	inset-block-start: var(--wp--custom--head--dimensions--height);
	inset-inline-start: 0;
	block-size: var(--wp--custom--head--dimensions--height);
	inline-size: 5px;
	pointer-events: none;
	z-index: 9999;
}

@media (width >= 1024px) {
	.bam-part-head__contact {
		[href*='tel:'] {
			white-space: nowrap;
		}
	}
}

/* Header: Desktop */
@media (width >= 1200px) {
	.bam-part-head {
		--head--spacing--padding--block: var(--wp--preset--spacing--30);
	}

	.bam-part-head__start,	.bam-part-head__end {
		padding-block: var(--wp--preset--spacing--20);
	}

	.bam-part-head__start {
		p {
			font-size: 12px;
		}
	}

	.bam-part-head__start {
		min-block-size: var(--wp--custom--head--start--dimensions--height);
	}

	.bam-part-head__end {
		> .wp-block-group.is-layout-flex {
			gap: var(--wp--preset--spacing--30);
		}
	}

	.bam-part-head__contact {
		gap: var(--wp--preset--spacing--20);
		padding: var(--wp--preset--spacing--15) var(--wp--preset--spacing--15) var(--wp--preset--spacing--15) var(--wp--preset--spacing--20);
		background-color: var(--wp--preset--color--gray-lightest);
		border-radius: var(--wp--preset--border-radius--small);

		.bam-contact-card .wp-block-image,
		.wp-block-button.eh-has-icon:not(.has-hidden-label) .wp-element-button .icon-svg {
			display: none;
		}

		.wp-block-buttons.is-layout-flex {
			flex-wrap: nowrap;
			padding-inline-start: var(--wp--preset--spacing--20);
			border-inline-start: 1px solid var(--wp--preset--color--gray-lighter);
		}

		.wp-block-button .wp-element-button {
			white-space: nowrap;
		}

		.wp-block-button.has-icon-loupe .wp-element-button {
			--button--icon--size: 30px;

			justify-content: center;
			block-size: 48px;
			inline-size: 48px;
		}

		/* Hide phone button */
		.wp-block-button.has-icon-phone {
			display: none;
		}
	}

	.bam-part-head .bam-search--mobile {
		display: none;
	}

	.bam-part-head__logo {
		min-inline-size: 200px;

		&, img {
			block-size: auto;
		}
	}
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation-overlay-close {
	padding: var(--wp--preset--spacing--10);
	background-color: var(--wp--preset--color--gray-lightest);
	border-radius: var(--wp--preset--border-radius--small);
	transition: background-color 0.2s ease-in-out;

	svg {
		block-size: 32px;
		inline-size: 32px;
	}

	&:hover {
		--menu--icon--color: var(--wp--preset--color--base);

		background-color: var(--wp--preset--color--primary);
	}
}

/* Menu close button */
.wp-block-navigation-overlay-close {
	--menu--icon--color: var(--wp--preset--color--base);

	background-color: var(--wp--preset--color--primary);
}

@media (width < 1024px) {
	.wp-block-navigation__responsive-container-open,
	.wp-block-navigation-overlay-close {
		margin-inline-end: calc(var(--wp--style--root--padding-right) * -1) !important;
		border-start-end-radius: 0;
		border-end-end-radius: 0;
	}
}

/* Header: Mobile */
@media (width < 1200px) {
	/* If no alert banner, hide start */
	header:has(> .bam-part-head):not(:has(.wp-block-eh-alert-banner)) {
		--wp--custom--head--start--dimensions--height: 0px;
	}

	.bam-part-head__start {
		.bam-nav-util {
			display: none;
		}

		/* If no alert banner, hide start */
		&:not(:has(.wp-block-eh-alert-banner)) {
			display: none;
		}
	}

	.bam-part-head__nav-main {
		gap: 6px;
	}


	.bam-part-head__contact {
		order: -1;

		/* Hide contact card */
		.bam-contact-card {
			display: none;
		}

		/* Change buttons to icon only */
		.wp-block-buttons {
			gap: 0;
		}

		.wp-block-button .wp-element-button {
			--button--border--color: transparent;
			--button--icon--color: var(--wp--preset--color--primary);
			--button--spacing--padding-block: var(--wp--preset--spacing--10);
			--button--spacing--padding-inline: 6px;

			background-color: transparent !important;
		}

		.icon-label {
			position: absolute !important;
			block-size: 1px !important;
			inline-size: 1px !important;
			margin: -1px !important;
			padding: 0 !important;
			border: 0 !important;
			white-space: nowrap !important;
			overflow: hidden !important;
			clip-path: inset(50%) !important;
		}

		.icon-svg {
			--button--icon--size: 20px;

			scale: 1 1;
		}


		.wp-block-button.has-icon-phone .wp-element-button {
			.icon-svg {
				scale: -1 1;
			}
		}
	}

	.bam-nav-main {
		order: 1;
	}

	.bam-part-head .wp-block-navigation__responsive-container {
		inset-block: var(--wp-admin--admin-bar--height) auto;
		block-size: 100dvh;

		&:has([aria-expanded='true']) {
			overflow: hidden;
		}
	}
}

/** Override WordPress mobile navigation breakpoint */
@media (width >= 600px) and (width < 1200px) {
	.bam-nav-main .wp-block-navigation__responsive-container:not(.hidden-by-default, .is-menu-open) {
		display: none;
	}

	.bam-nav-main .wp-block-navigation__responsive-container-open:not(.always-shown),
	.bam-nav-main .wp-block-navigation__responsive-container.has-modal-open {
		display: flex;
	}
}

/* --- Mobile navigation overlay --- */
.bam-nav-overlay {
	min-block-size: 100dvh;
	background-color: var(--wp--preset--color--base);

	& > * {
		margin: 0;
	}

	&.has-global-padding {
		padding-inline: var(--wp--preset--spacing--20);
	}

	.bam-contact-cards {
		grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	}

	/* Override default social link color */
	.wp-block-social-links .wp-block-social-link.wp-social-link {
		color: var(--wp--preset--color--primary) !important;
	}
}

.bam-nav-overlay__head {
	position: sticky;
	inset-block-start: 0;
	background-color: var(--wp--preset--color--base);
	z-index: 2;

	& > .wp-block-group {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: var(--wp--preset--spacing--10);
		padding-block: var(--wp--preset--spacing--10);
	}

	.wp-block-buttons {
		flex: 1 1 auto;
		gap: var(--wp--preset--spacing--10);
		margin: 0;
	}

	.wp-block-button {
		flex: 1 1 auto;
	}

	.wp-block-button.has-icon-phone .wp-element-button {
		.icon-svg {
			scale: -1 1;
		}
	}

	.wp-block-navigation-overlay-close {
		flex: 0 0 auto;
		margin: 0;
	}
}


/* Override default transition */
/* stylelint-disable-next-line keyframes-name-pattern */
@keyframes overlay-menu__fade-in-animation {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}


/* --- Footer --- */
footer:has(> .bam-part-foot) {
	margin-block-start: 0;
}

.bam-part-foot {
	margin-block-start: 0;
	container: footer / inline-size;
}

.bam-part-foot__inner {
	padding-block: var(--foot--padding--block, var(--wp--preset--spacing--60));
}

:is(.bam-part-foot__top, .bam-part-foot__bottom, .wp-block-separator) {
	--wp--style--global--wide-size: 600px;
}

@container (width >= 1024px) {
	.bam-part-foot {
		p.has-text-align-center {
			margin-inline: 0;
			text-align: start;
		}

		.wp-block-accordion {
			.wp-block-accordion-item {
				border: 0;
			}

			.wp-block-accordion-heading__toggle {
				padding: 0 0 var(--wp--preset--spacing--20);
			}

			.wp-block-accordion-item:first-child {
				.wp-block-accordion-heading__toggle {
					padding-block-start: 0;
				}
			}
		}
	}

	.bam-part-foot__inner {
		--foot--padding--block: var(--wp--preset--spacing--90) var(--wp--preset--spacing--60);
	}

	:is(.bam-part-foot__top, .bam-part-foot__bottom, .wp-block-separator) {
		--wp--style--global--wide-size: revert;
	}

	.bam-part-foot__top {
		grid-template-columns: minmax(270px, 1fr) repeat(3, 1fr);
	}

	.bam-part-foot__bottom {
		.wp-block-social-links {
			margin-inline: revert;
		}
	}
}

@container (width < 1024px) {
	.bam-part-foot__top {
		grid-template-columns: 1fr !important;
		gap: 0 !important;

		> * {
			inline-size: 100%;
		}

		> .wp-block-group:first-child {
			padding-block-end: var(--wp--preset--spacing--30);
			border-block-end: 1px solid var(--wp--preset--color--primary-dark);
		}
	}
}



/**
 * Layout
 */

/* --- Three column sidebar layout --- */
.bam-layout-sidebars {
	--layout--sidebar--gap: var(--wp--preset--spacing--60);

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--layout--sidebar--gap) !important;
	margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--90);

	> .wp-block-group {
		margin: 0;
	}
}

/* Sidebar left */
.bam-layout-sidebars__start {
	transition: opacity 0.2s ease-in;

	&.is-overlapped {
		opacity: 0;
		transition-duration: 0.1s;
		transition-timing-function: ease-out;
	}

	body.page & {
		padding-block-end: var(--wp--preset--spacing--60);
	}
}

/* Sidebar content */
.bam-layout-sidebars__content {
	&.wp-block {
		min-block-size: 60vh;
	}
}

/* Sidebar right */
.bam-layout-sidebars__end {
	display: none;
}

@container body (width >= 1024px) {
	.bam-layout-sidebars {
		--layout--sidebar--gap: var(--wp--preset--spacing--60);
		--layout--sidebar-start--inline-size: 380px;
		--layout--sidebar-start--offset: calc(var(--layout--sidebar-start--inline-size) + var(--layout--sidebar--gap));
		--layout--sidebar-end--inline-size: 0px;
		--layout--sidebar-end--offset: calc(var(--layout--sidebar-end--inline-size) + var(--layout--sidebar--gap));

		grid-template-columns: var(--layout--sidebar-start--inline-size) minmax(0, 1fr);
		align-items: start;

		/* Page template */
		body.page & {
			--layout--sidebar-start--inline-size: 240px;
		}
	}

	/* Sidebar left */
	.bam-layout-sidebars__start {
		display: block;
		position: sticky;
		inset-block-start: calc(var(--wp--custom--top--offset) + var(--wp--custom--head--dimensions--height) + 6px);
		grid-column: 1;
		padding-block-end: 0;
	}

	/* Sidebar content */
	.bam-layout-sidebars__content {
		grid-column: 2;
		z-index: 1;

		/* Forces children of container to break out of content column */
		.is-style-force-full {
			> .wp-block-group.has-background {
				padding-inline-start: 0;

				&::before {
					display: block;
					position: absolute;
					inset-block-start: 0;
					inset-inline-start: 0;
					block-size: 100%;
					inline-size: 100%;
					background-color: var(--wp--custom--color--background);
					border-radius: var(--wp--preset--border-radius--medium);
					content: '';
					z-index: -1;
				}
			}

			> *:not(.wp-block-group.has-background),
			> .wp-block-group.has-background::before {
				max-inline-size: none !important;
				margin-inline: calc(var(--layout--sidebar-start--offset) * -1) auto !important;
			}
		}
	}
}

@container body (width >= 1440px) {
	.bam-layout-sidebars {
		grid-template-columns: var(--layout--sidebar-start--inline-size) minmax(0, 1024px);

		/* Page template */
		body.page &:has(.bam-layout-sidebars__end) {
			--layout--sidebar-end--inline-size: 368px;

			grid-template-columns: var(--layout--sidebar-start--inline-size) minmax(0, 1fr) var(--layout--sidebar-end--inline-size);
		}

		/* Holds content area to right margin when no right sidebar is present */
		body.page &:not(:has(.bam-layout-sidebars__end)) {
			grid-template-columns: var(--layout--sidebar-start--inline-size) minmax(0, calc(1024px + 140px));
		}
	}

	.bam-layout-sidebars__content {
		.is-style-force-full > .wp-block-group.has-background {
			padding-inline-end: 0;
		}

		/* Forces children of container to break out of content column */
		.is-style-force-full {
			> *:not(.wp-block-group.has-background),
			> .wp-block-group.has-background::before {
				inline-size: calc(100% + var(--layout--sidebar-start--offset) + var(--layout--sidebar-end--offset)) !important;
				max-inline-size: none !important;
				margin-inline: calc(var(--layout--sidebar-start--offset) * -1) calc(var(--layout--sidebar-end--offset) * -1) !important;
			}
		}
	}

	.bam-layout-sidebars__end {
		display: block;
		grid-column: 3;
	}
}

@container body (width >= 1824px) {
	.bam-layout-sidebars__content {
		--neg-space: calc((100dvw - 1728px) / 2);

		/* Forces children of container to break out of content column */
		.is-style-force-full {
			> *:not(.wp-block-group.has-background),
			> .wp-block-group.has-background::before {
				inline-size: calc(100dvw - var(--wp--preset--spacing--40) * 2) !important;
				margin-inline: 0 !important;
				translate: calc((var(--layout--sidebar-start--offset) + var(--neg-space) - var(--wp--preset--spacing--40)) * -1) 0 !important;
			}
		}
	}
}

@container body (width < 1024px) {
	/* Page template */
	body.page .bam-layout-sidebars__start {
		display: none;
	}
}

/* --- <main> --- */
main {
	position: relative;
	margin-block: 0 !important;
	margin-inline: auto;
	padding-block: var(--main--spacing--padding--block-start) var(--main--spacing--padding--block-end);
	z-index: var(--wp--custom--z-index--main);
	overflow-x: clip;

	&.has-global-padding {
		padding-inline: var(--wp--custom--main--spacing--padding--inline);
	}
}

/* Full template parts - stretch to full-width */
.wp-block-template-part:has(> .alignfull, > .is-style-hero) {
	max-inline-size: none;
}

.wp-block-template-part:has(.bam-modal-contact, .bam-modal-search, .wp-block-eh-sharing) {
	margin: 0;
}

/* --- Block content --- */

body.page-sample-page .entry-content {
	background-color: var(--wp--preset--color--white) !important;
}

/* Remove margins from :first-child, :last-child */
*:last-child:where(p, [class*='wp-block']) {
	margin-block-end: 0 !important;
}

*:first-child:where(p, [class*='wp-block']):not(.wp-block-navigation__responsive-dialog) {
	margin-block-start: 0 !important;
}

/**
 * Templates
 */

/* --- Add bottom padding --- */
body:is(.archive, .blog, .error404, .page, .post-type-archive, .post-type-post, .search-results) main {
	--main--spacing--padding--block-end: var(--wp--preset--spacing--resp-60-90);


	&:has(> div > .entry-content > .has-background:where(.alignwide, .alignfull):last-child) {
		--main--spacing--padding--block-end: var(--wp--preset--spacing--30);
	}
}

body.page-why-barasch-mcgarry main {
	--main--spacing--padding--block-end: 0;
}


/* --- Blog single --- */
main.bam-single,
.post-type-post {
	:is(.entry-content, .wp-block-post-content) {
		.wp-block-image:has(figcaption) img {
			inline-size: 100% !important;
		}
	}

	@container body (width < 1024px) {
		.bam-layout-sidebars__start {
			display: none;
		}
	}
}

.bam-single__featured-image {
	/* Featured image is not set, hide image */
	&:has(img[src*='blog-placeholder']) {
		display: none;

		+ .wp-block-group > .wp-block-group {
			padding-block-start: 0 !important;
		}
	}

	@container body (width >= 1024px) {
		margin-block-end: -120px !important;
	}
}


/* --- Staff single --- */
body.single-staff {
	main {
		padding-block-end: var(--wp--preset--spacing--40);
	}

	@container body (width >= 1024px) {
		.bam-layout-sidebars__start {
			position: relative;
			inset-block-start: auto;
			block-size: 100%;

			.wp-block-post-featured-image {
				inline-size: 100%;
				max-inline-size: 800px;
			}

			.bam-contact-info {
				position: sticky;
				inset-block-start: calc(var(--wp--custom--top--offset) + var(--wp--custom--head--dimensions--height) + 3px);
			}
		}
	}
}



/**
 * WordPress styles
 */

/* --- Admin bar --- */

/* stylelint-disable-next-line selector-max-id */
#wpadminbar {
	position: fixed;
	inset-block-start: 0;
	inset-inline-start: 0;
}

/* Prevent admin bar user menu from overflowing on tablet widths */
@media (width >= 782px) and (width <= 1024px) {

	/* stylelint-disable-next-line selector-max-id */
	#wpadminbar .quicklinks {
		display: flex;
		flex-wrap: nowrap;
		justify-content: space-between;
	}

	.ab-top-secondary.ab-top-menu {
		margin-inline-start: auto;
		float: none !important;
	}
}

/* --- Lightbox --- */
.wp-lightbox-overlay {
	--wp--preset--color--contrast: var(--wp--preset--color--base);
}

/* Lightbox backdrop */
.wp-lightbox-overlay .scrim {
	--wp--preset--color--base: rgb(0 0 0 / 90%);
}
