/**
 * QBA Sticky Header
 *
 * - Header sticks to the top while scrolling.
 * - At the top of the page the cover photo stays visible, with a slightly
 *   deeper dim so white text always reads.
 * - Once scrolled, the bar tightens and the translucent dim deepens a
 *   touch — the photo itself always stays visible.
 */

header.wp-block-template-part {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 200;
	transition: box-shadow 0.25s ease;
}

/* Leave room for the WordPress admin bar when logged in. */
body.admin-bar header.wp-block-template-part {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar header.wp-block-template-part {
		top: 46px;
	}
}

/* Smooth transitions on the cover layers. */
header.wp-block-template-part .wp-block-cover,
header.wp-block-template-part .wp-block-cover__image-background,
header.wp-block-template-part .wp-block-cover__background {
	transition:
		background-color 0.25s ease,
		opacity 0.25s ease,
		min-height 0.25s ease;
}

/* --- Top of page: deepen the photo dim for readability -------------------- */
header.wp-block-template-part .wp-block-cover__background.has-background-dim {
	background-color: #1c1c1c !important;
	opacity: 0.5;
}

/* --- Scrolled state: same photo, slightly deeper translucent dim ----------- */
header.wp-block-template-part.qba-header--scrolled {
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.25);
}

header.wp-block-template-part.qba-header--scrolled .wp-block-cover {
	min-height: 52px !important;
}

/* Photo stays fully visible; only the translucent dark dim deepens a bit. */
header.wp-block-template-part.qba-header--scrolled .wp-block-cover__background.has-background-dim {
	background-color: #161616 !important;
	opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
	header.wp-block-template-part,
	header.wp-block-template-part .wp-block-cover,
	header.wp-block-template-part .wp-block-cover__image-background,
	header.wp-block-template-part .wp-block-cover__background {
		transition: none;
	}
}
