/**
 * Staff Relief – mobile essentials only.
 * Menu drawer: WordPress default (overlay container, all items expanded).
 * Call button: cloned to header via mobile-nav.js.
 * Compact header on scroll: header-scroll.js + body.sr-header-scrolled.
 */

/* -------------------------------------------------------------------------
   Sticky header – shrink on scroll (desktop)
   ------------------------------------------------------------------------- */

@media (min-width: 1234px) {
	.wp-block-group.is-position-sticky:has(> header) {
		transition: box-shadow 0.4s ease-in-out;
		z-index: 1000;
		/* Keep shell height fixed so page images/sections do not reflow on scroll. */
		min-height: 105px;
	}

	header .alignwide.is-layout-flex,
	header .wp-block-group.alignwide.is-layout-flex {
		align-items: center;
		min-height: 85px;
	}

	/* Logo only – first figure in the header row, not nav/drawer icons. */
	header .alignwide.is-layout-flex > figure.wp-block-image img,
	header figure.wp-block-image.wp-custom-css-37461d2a img,
	header .wp-block-site-logo img,
	header .custom-logo {
		display: block;
		width: auto;
		height: auto;
		max-height: 85px;
		transition: max-height 0.4s ease-in-out;
	}

	body.sr-header-scrolled .wp-block-group.is-position-sticky:has(> header) {
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
		min-height: 105px;
	}

	body.sr-header-scrolled header .alignwide.is-layout-flex > figure.wp-block-image img,
	body.sr-header-scrolled header figure.wp-block-image.wp-custom-css-37461d2a img,
	body.sr-header-scrolled header .wp-block-site-logo img,
	body.sr-header-scrolled header .custom-logo {
		max-height: 50px;
	}
}

@media (min-width: 1234px) and (prefers-reduced-motion: reduce) {
	header .alignwide.is-layout-flex > figure.wp-block-image img,
	header figure.wp-block-image.wp-custom-css-37461d2a img,
	header .wp-block-site-logo img,
	header .custom-logo,
	.wp-block-group.is-position-sticky:has(> header) {
		transition: none;
	}
}

@media (max-width: 1233px) {

	/* Header wrapper is sticky on desktop theme – static on mobile. */
	.wp-block-group.is-position-sticky:has(> header),
	.wp-container-2.is-position-sticky {
		position: static !important;
		top: auto !important;
	}

	/* Logo left; call + hamburger grouped in .sr-mobile-header-actions on the right. */
	header .alignwide.is-layout-flex,
	header .wp-block-group.alignwide.is-layout-flex {
		display: flex !important;
		align-items: center !important;
		justify-content: flex-start !important;
		width: 100% !important;
		flex-wrap: nowrap !important;
	}

	header figure.wp-block-image,
	header .wp-block-site-logo {
		flex: 0 0 auto;
		margin-right: auto;
	}

	.sr-mobile-header-actions {
		display: flex !important;
		align-items: center !important;
		gap: 0.5rem;
		margin-left: auto !important;
		flex: 0 0 auto;
	}

	/* Smaller site logo in header row. */
	header figure.wp-block-image.wp-custom-css-37461d2a,
	header .wp-container-content-e0b89f81 {
		flex: 0 1 150px !important;
		flex-basis: 150px !important;
		max-width: 150px;
	}

	header figure.wp-block-image.wp-custom-css-37461d2a img {
		width: auto !important;
		height: auto !important;
	}

	/* Cloned call button in header bar (outside hamburger drawer). */
	.sr-mobile-header-call {
		display: flex;
		align-items: center;
		flex: 0 0 auto;
		min-width: 0;
	}

	.sr-mobile-header-call__link,
	.sr-mobile-header-call a {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		white-space: nowrap;
		font-size: clamp(0.7rem, 2.8vw, 0.9rem) !important;
		line-height: 1.2 !important;
		padding: 0.4rem 0.65rem !important;
		border-radius: 999px !important;
		text-decoration: none !important;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* Call button: text only (hide phone icon for tighter header). */
	.sr-mobile-header-call img[src*="icon_phone"],
	header a[href^="tel:"] img[src*="icon_phone"] {
		display: none !important;
	}

	/* Hide call button inside drawer (header clone is the only call CTA). */
	.wp-block-navigation__responsive-container-content
		.wp-block-button:has(a[href^="tel:"]) {
		display: none !important;
	}

	/* Chat FAB – keep below menu overlay, hide while drawer is open. */
	.sr-engagement__fab {
		z-index: 9990 !important;
	}

	body:has(.wp-block-navigation__responsive-container.is-menu-open) .sr-engagement__fab,
	body:has(.wp-block-navigation__responsive-container.has-modal-open) .sr-engagement__fab {
		display: none !important;
	}
}

@media (min-width: 1234px) {
	.sr-mobile-header-call,
	.sr-mobile-header-actions {
		display: none !important;
	}
}

@media (max-width: 782px) {

	/* Home: FAQ intro above accordion column. */
	.wp-block-columns:has(.wp-block-accordion) {
		flex-direction: column-reverse !important;
	}

	/* Home: Join Our Team copy above photo. */
	.wp-block-group.is-style-section-2 .wp-block-columns:has(a[href*="career"]) {
		flex-direction: column-reverse !important;
	}

	footer .wp-block-columns {
		flex-direction: column !important;
		gap: 1.5rem !important;
	}

	footer .wp-block-columns .wp-block-column {
		flex-basis: 100% !important;
		width: 100% !important;
	}

	footer .wp-block-group.is-nowrap.is-layout-flex {
		flex-direction: column !important;
		flex-wrap: wrap !important;
		gap: 1.25rem !important;
	}

	footer .wp-block-group.is-nowrap .wp-block-group {
		width: 100% !important;
	}
}
