/**
 * NCB Sticky Header — front-end styles.
 *
 * Every value that depends on the page (heights, offsets, widths) is set by
 * the script from measurements; nothing here is a fixed pixel size.
 *
 * @package NCBSH\StickyHeader
 * @author  NCB Software
 */

:root {
	--ncbsh-header-height: 0px;
	--ncbsh-overlay-height: 0px;
	--ncbsh-top-offset: 0px;
	--ncbsh-scroll-offset: 0px;
}

/* Space kept in place of the header while it is fixed. */
.ncbsh-spacer {
	display: none;
	height: var(--ncbsh-header-height, 0px);
	padding: 0;
	border: 0;
	overflow-anchor: none;
	pointer-events: none;
}

.ncbsh-spacer.ncbsh-spacer-active {
	display: block;
}

/* Fixed state: same left edge and width as the header had in the page. */
.ncbsh-header.ncbsh-is-fixed {
	position: fixed !important;
	top: var(--ncbsh-top-offset, 0px) !important;
	right: auto !important;
	bottom: auto !important;
	left: var(--ncbsh-fixed-left, 0px) !important;
	width: var(--ncbsh-fixed-width, 100%) !important;
	margin: 0 !important;
	z-index: var(--ncbsh-z-index, 999) !important;
}

.ncbsh-header.ncbsh-opt-shadow.ncbsh-is-scrolled {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

.ncbsh-header.ncbsh-opt-bg.ncbsh-is-scrolled {
	background-color: var(--ncbsh-bg, transparent) !important;
}

/* Shrinking: padding values are computed from the measured header. */
.ncbsh-header.ncbsh-is-shrunk.ncbsh-shrink-target,
.ncbsh-header.ncbsh-is-shrunk .ncbsh-shrink-target {
	padding-top: var(--ncbsh-shrink-pt, 0px) !important;
	padding-bottom: var(--ncbsh-shrink-pb, 0px) !important;
}

.ncbsh-header.ncbsh-is-shrunk {
	--ncbsh-logo-scale: var(--ncbsh-logo-shrink-scale, 1);
}

/* Logo: pinned to its measured size, scaled proportionally when shrunk. */
.ncbsh-header.ncbsh-logo-sized .ncbsh-logo {
	height: calc(var(--ncbsh-logo-h) * var(--ncbsh-logo-scale, 1)) !important;
	width: calc(var(--ncbsh-logo-w) * var(--ncbsh-logo-scale, 1)) !important;
	max-height: none !important;
	max-width: none !important;
}

/* "Only after scrolling" mode: the header slides in from above. */
@keyframes ncbsh-slide-in {
	from {
		transform: translate3d(0, -100%, 0);
	}

	to {
		transform: translate3d(0, 0, 0);
	}
}

.ncbsh-header.ncbsh-is-entering {
	animation: ncbsh-slide-in var(--ncbsh-duration, 300ms) ease-out;
}

/* Links to #sections stop below the header. */
html.ncbsh-anchor-offset {
	scroll-padding-top: var(--ncbsh-scroll-offset, 0px);
}

@media (prefers-reduced-motion: reduce) {
	.ncbsh-header.ncbsh-is-entering {
		animation: none;
	}
}

/* Check mode (administrators only, ?ncbsh_debug=1). */
html.ncbsh-debug .ncbsh-header {
	outline: 2px dashed #d63638 !important;
	outline-offset: -2px !important;
}

html.ncbsh-debug .ncbsh-spacer.ncbsh-spacer-active {
	background: repeating-linear-gradient(45deg, rgba(34, 113, 177, 0.12) 0 10px, rgba(34, 113, 177, 0.28) 10px 20px) !important;
	outline: 1px solid #2271b1 !important;
	outline-offset: -1px !important;
}

.ncbsh-debug-badge {
	position: fixed;
	right: 12px;
	bottom: 12px;
	z-index: 2147483647;
	max-width: calc(100vw - 24px);
	padding: 10px 12px;
	border-radius: 4px;
	background: #1d2327;
	color: #f0f0f1;
	font: 12px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	white-space: pre-line;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
