/*
 * NCR Custom Appearance
 *
 * Hook classes:
 *   Navigation overlay: ncr-navigation-overlay
 *   Smart viewport header: ncr-scroll-header
 *
 * Add these classes to the EXISTING elements in WordPress. Do not include
 * the leading period when entering the class name in the editor.
 */

/* -------------------------------------------------------------------------
 * Navigation overlay
 * ---------------------------------------------------------------------- */

.ncr-navigation-overlay {
	box-sizing: border-box !important;
	position: fixed !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: auto !important;

	width: 33.333333vw !important;
	max-width: 33.333333vw !important;
	height: 100vh !important;
	height: 100dvh !important;

	overflow-x: hidden !important;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;

	overscroll-behavior: auto !important;
	touch-action: pan-y !important;
}

html.ncr-navigation-scroll-enabled,
body.ncr-navigation-scroll-enabled {
	overflow-y: auto !important;
	overflow-x: hidden !important;
	height: auto !important;
	max-height: none !important;
	touch-action: pan-y !important;
	overscroll-behavior: auto !important;
}

body.ncr-navigation-scroll-enabled {
	position: static !important;
	width: auto !important;
}

/* -------------------------------------------------------------------------
 * Smart viewport-fixed header
 * ---------------------------------------------------------------------- */

/*
 * The header is fixed to the viewport, not sticky in the document.
 * Therefore it can reveal itself at the top of the visitor's CURRENT view,
 * regardless of how far down the page they have scrolled.
 */
.ncr-scroll-header {
	box-sizing: border-box !important;
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	z-index: 9990 !important;

	transform: translate3d(0, 0, 0) !important;
	will-change: transform;
	backface-visibility: hidden;

	transition-property: transform !important;
	transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

/* Placeholder inserted by JavaScript so the fixed header does not collapse layout. */
.ncr-header-spacer {
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	pointer-events: none !important;
	visibility: hidden !important;
}

/* Hide above the viewport while scrolling downward. */
.ncr-scroll-header.ncr-header-hidden {
	transform: translate3d(0, calc(-100% - 3px), 0) !important;
	transition-duration: 280ms !important;
	pointer-events: none;
}

/* Gently slide into the CURRENT viewport while scrolling upward. */
.ncr-scroll-header.ncr-header-visible {
	transform: translate3d(0, 0, 0) !important;
	transition-duration: 680ms !important;
	pointer-events: auto;
}

/* WordPress admin bar support while logged in. */
body.admin-bar .ncr-scroll-header {
	top: 32px !important;
}

@media screen and (max-width: 782px) {
	body.admin-bar .ncr-scroll-header {
		top: 46px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ncr-scroll-header,
	.ncr-scroll-header.ncr-header-hidden,
	.ncr-scroll-header.ncr-header-visible {
		transition-duration: 0.01ms !important;
	}
}

/* -------------------------------------------------------------------------
 * Responsive navigation
 * ---------------------------------------------------------------------- */

@media (max-width: 767px) {
	.ncr-navigation-overlay {
		width: 100vw !important;
		max-width: 100vw !important;
	}
}
