/*!
 * Kode Menu Styles
 * Over, Push and Reveal off-canvas menu panels.
 *
 * Everything in this file is prefixed with "kode--" and there are no bare element
 * selectors (html, body, main, a, h3, button...), so it is safe to load on any
 * WordPress theme. Demo-page styles live in demo.css and are NOT needed by the plugin.
 *
 * Naming (style = over-left | over-right | over-top | over-bottom | push-left |
 *         push-right | push-top | push-bottom | reveal-left | reveal-right):
 *
 *   .kode--{style}-btn          trigger button (also a .kode--hamburger)
 *   .kode--panel.kode--{style}  the menu panel
 *   body.kode--{style}-active   added by the script while that panel is open
 *   body.kode--scroll-lock      added by the script while any panel is open
 *   .kode--content-wrapper      the page content that Push / Reveal slide aside
 *   .kode--content-overlay      optional dimmer inside the content wrapper
 *   .kode--active               open state on the overlay and the trigger button
 *
 * The {style} values match the Custom Header plugin's "Menu Style" setting values.
 */

/* ------------------------------------------------------------
	Variables
------------------------------------------------------------ */

:root {
	--kode-animation: all .3s ease-in-out;
	--kode-delay-in: .25s;
	--kode-delay-out: .2s;
	--kode-scroll: scroll;
	--kode-panel-size: 320px;     /* width of L/R panels, height of T/B panels */
	--kode-header-offset: 80px;   /* Top panels start below a fixed header this tall */
	--kode-panel-offset: 100px;   /* space above the content of L/R panels */
	--kode-panel-z: 1000;         /* stacking level of Over / Push panels */
	--kode-panel-bg: #379ed0;
	--kode-content-bg: #fff;      /* wrapper background -- Reveal needs it opaque */
	--kode-overlay-bg: #23282d;
	--kode-overlay-opacity: .8;
	--kode-admin-bar: 0px;        /* WordPress toolbar height (set below) */
}

/* WordPress toolbar: matches core (32px desktop, 46px tablet, not fixed on phones) */
body.admin-bar { --kode-admin-bar: 32px; }

@media screen and (max-width: 782px) {
	body.admin-bar { --kode-admin-bar: 46px; }
}

@media screen and (max-width: 600px) {
	body.admin-bar { --kode-admin-bar: 0px; }
}


/* ------------------------------------------------------------
	Scroll Lock
------------------------------------------------------------ */

/* Locked on <html> too: themes that set overflow on <html> (e.g. overflow-x:hidden)
   stop a body-only lock from reaching the page scroll. */
html.kode--scroll-lock,
body.kode--scroll-lock {
	overflow: hidden !important;
}

body.kode--scroll-lock {
	pointer-events: auto; /* fix scroll lock on iOS 12.2 */
}

/* Scrolling inside a panel never "leaks" through to the page behind it
   (the main cause of the page still scrolling on iOS / Android). */
.kode--panel {
	overscroll-behavior: contain;
}


/* ------------------------------------------------------------
	Content Wrapper (the part of the page Push / Reveal move)
------------------------------------------------------------ */

/* position: relative (was absolute) keeps the wrapper in normal page flow, so a
   theme/plugin header above it doesn't get overlapped. Renders identically. */
.kode--content-wrapper {
	z-index: 2;
	display: block;
	position: relative;
	margin: 0;
	width: 100%;
	background: var(--kode-content-bg);
	transition: var(--kode-animation);
	transition-delay: var(--kode-delay-out);
}


/* ------------------------------------------------------------
	Content Overlay
------------------------------------------------------------ */

.kode--content-overlay {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	background: var(--kode-overlay-bg);
	opacity: 0;
	visibility: hidden;
	z-index: 1000;
	transition: var(--kode-animation);
	transition-delay: .3s;
}

.kode--content-overlay.kode--active {
	visibility: visible;
	opacity: var(--kode-overlay-opacity);
	height: 101%;
	transition-delay: .1s;
}


/* ------------------------------------------------------------
	Panels
------------------------------------------------------------ */

.kode--panel {
	display: block;
	background: var(--kode-panel-bg);
	width: var(--kode-panel-size);
	color: #fff;
	font: 300 50px 'open sans', sans-serif;
	line-height: normal;     /* themes often set 1.5+ on body */
	letter-spacing: normal;
	text-transform: none;
	box-sizing: content-box; /* themes usually set border-box on everything */
	transition: var(--kode-animation);
	transition-delay: var(--kode-delay-out);
}

.kode--panel-inner {
	margin-top: var(--kode-panel-offset);
	margin-bottom: 100px;
	padding: 0;
	height: auto;
	text-align: left;
	font-size: 20px;
	display: block;
	overflow-y: var(--kode-scroll);
}

/* Panel Title -------- */

.kode--panel-title {
	display: block;
	margin: 20px 0 0;
	padding: 0 0 0 20px;
	font-family: inherit;
	color: inherit;
	text-transform: none;
	font-size: 24px;
	font-weight: 500;
	text-align: left;
	letter-spacing: -.02em;
	line-height: 1.5 !important;
}

.kode--panel-title span {
	background: rgba(255,255,255,0.2);
	width: 20px;
	height: 20px;
	font-size: 14px;
	padding: 8px 0 4px 11px;
	border-radius: 5px;
	line-height: 1.0 !important;
	box-sizing: content-box;
	float: right;
	margin-right: 30px;
}

/* Close Button -------- */

.kode--panel-close {
	cursor: pointer;
	position: relative;
	display: inline-block;
	margin: 0;
	padding: 5px 15px;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	border: 0;
	box-shadow: none;
	color: #fff;
	font: 500 15px 'Open Sans', sans-serif;
	letter-spacing: normal;
	text-transform: none;
	background: rgba(52,59,66,0.4);
	left: 20px;
	top: 0;
	border-radius: 5px;
	transition: var(--kode-animation);
}

/* Beat theme "button:focus / :active" styles */
.kode--panel-close:focus,
.kode--panel-close:active {
	color: #fff;
	background: rgba(52,59,66,0.4);
	box-shadow: none;
}

.kode--panel-close:hover {
	background: rgba(52,59,66,0.2);
}

/* Panel Nav Menu -------- */

.kode--panel-inner .kode--panel-nav ul {
	margin: 1em 0;
	padding: 0;
}

.kode--panel-inner .kode--panel-nav ul li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kode--panel-inner .kode--panel-nav ul li a {
	color: #fff;
	text-decoration: none;
	background: rgba(52,59,66,0.1);
	display: block;
	padding: 5px 20px;
	margin-bottom: 2px;
	border: 0;
	box-shadow: none;
	font-weight: inherit;
}

/* Panel Widget Area -------- */

.kode--panel-widget-area-bottom {
	margin: 25px 30px 25px 25px;
	padding: 25px;
	color: #fff;
	background: rgba(52,59,66,0.1);
	font-size: 15px !important;
	border-radius: 5px;
}


/* ------------------------------------------------------------
	Over Menu
------------------------------------------------------------ */

/* Over Menus Left / Right - Global -------- */

.kode--over-left,
.kode--over-right {
	position: fixed;
	visibility: hidden;
	transition: all .8s;
	top: var(--kode-admin-bar);
	bottom: 0;
	z-index: var(--kode-panel-z);
	min-height: calc(100% - var(--kode-admin-bar));
}

.kode--over-left-active .kode--over-left,
.kode--over-right-active .kode--over-right {
	visibility: visible;
	transition: all .5s;
	box-shadow: 0 0 10px rgba(0,0,0,0.4);
	overflow-y: var(--kode-scroll);
	transition-delay: var(--kode-delay-in);
}

/* Left - Over Menu -------- */

.kode--over-left {
	margin-left: calc(-1 * var(--kode-panel-size));
	transform: translate3d(calc(-1 * var(--kode-panel-size)), 0, 0);
}

.kode--over-left-active .kode--over-left {
	transform: translate3d(var(--kode-panel-size), 0, 0);
	border-right: 1px solid rgba(0,0,0,0.3);
}

/* Right - Over Menu -------- */

.kode--over-right {
	right: 0;
	margin-right: calc(-1 * var(--kode-panel-size));
	transition: all .4s;
	transform: translate3d(0, 0, 0);
}

.kode--over-right-active .kode--over-right {
	transform: translate3d(calc(-1 * var(--kode-panel-size)), 0, 0);
	border-left: 1px solid rgba(0,0,0,0.3);
}

/* Over Menus Top / Bottom - Global -------- */

.kode--over-top,
.kode--over-bottom {
	position: fixed;
	visibility: hidden;
	transition: all .8s;
	width: 100%;
	height: var(--kode-panel-size);
	z-index: var(--kode-panel-z);
	left: 0;
	right: 0;
	text-align: left;
}

.kode--over-top-active .kode--over-top,
.kode--over-bottom-active .kode--over-bottom {
	visibility: visible;
	transition: all .5s;
	box-shadow: 0 0 2px rgba(0,0,0,0.0);
	overflow-y: var(--kode-scroll);
	transition-delay: var(--kode-delay-in);
}

.kode--over-top .kode--panel-close,
.kode--over-bottom .kode--panel-close {
	position: absolute;
	left: 20px;
	top: 20px;
}

.kode--over-top .kode--panel-inner,
.kode--over-bottom .kode--panel-inner {
	margin-top: 70px;
}

.kode--over-top .kode--panel-title,
.kode--over-bottom .kode--panel-title {
	margin-top: 0;
}

/* Top - Over Menu -------- */

.kode--over-top {
	top: calc(var(--kode-header-offset) + var(--kode-admin-bar));
	margin-top: calc(-1 * var(--kode-panel-size));
	transform: translate3d(0, calc(-1 * var(--kode-panel-size)), 0);
}

.kode--over-top-active .kode--over-top {
	transform: translate3d(0, var(--kode-panel-size), 0);
}

/* Bottom - Over Menu -------- */

.kode--over-bottom {
	bottom: 0;
	margin-bottom: calc(-1 * var(--kode-panel-size));
	transform: translate3d(0, var(--kode-panel-size), 0);
}

.kode--over-bottom-active .kode--over-bottom {
	transform: translate3d(0, calc(-1 * var(--kode-panel-size)), 0);
}


/* ------------------------------------------------------------
	Push Menu
------------------------------------------------------------ */

/* Push Menus Left / Right - Global -------- */

.kode--push-left,
.kode--push-right {
	position: fixed;
	visibility: hidden;
	top: var(--kode-admin-bar);
	bottom: 0;
	z-index: var(--kode-panel-z);
	min-height: calc(100% - var(--kode-admin-bar));
}

/* NOTE: the second selector below was ".push-left-active .pushPanel--Right" in the
   original and is kept as-is so timing doesn't change. It was probably meant to be
   ".kode--push-right-active .kode--push-right" -- see the review notes. */
.kode--push-left-active .kode--push-left,
.kode--push-left-active .kode--push-right {
	visibility: visible;
	transition: all .4s;
	overflow-y: var(--kode-scroll);
	transition-delay: var(--kode-delay-in);
}

.kode--push-left-active .kode--content-wrapper,
.kode--push-right-active .kode--content-wrapper,
.kode--push-top-active .kode--content-wrapper,
.kode--push-bottom-active .kode--content-wrapper {
	transition-delay: var(--kode-delay-in);
}

/* Left - Push Menu -------- */

.kode--push-left {
	margin-left: calc(-1 * var(--kode-panel-size));
	transform: translate3d(0, 0, 0);
	transition-delay: var(--kode-delay-out);
}

.kode--push-left-active .kode--push-left {
	transform: translate3d(var(--kode-panel-size), 0, 0);
	border-right: 1px solid rgba(0,0,0,0.3);
}

.kode--push-left-active .kode--content-wrapper {
	margin-right: calc(-1 * var(--kode-panel-size));
	transition: transform .5s;
	transform: translate3d(var(--kode-panel-size), 0, 0);
	transition-delay: var(--kode-delay-in);
}

.kode--push-left-active .kode--push-right,
.kode--push-left-active .kode--push-top,
.kode--push-left-active .kode--push-bottom,
.kode--push-left-active .kode--reveal-left,
.kode--push-left-active .kode--reveal-right {
	display: none;
}

/* Right - Push Menu -------- */

.kode--push-right {
	right: 0;
	margin-right: calc(-1 * var(--kode-panel-size));
	transform: translate3d(0, 0, 0);
}

.kode--push-right-active .kode--push-right {
	transform: translate3d(calc(-1 * var(--kode-panel-size)), 0, 0);
	border-left: 1px solid rgba(0,0,0,0.3);
}

.kode--push-right-active .kode--content-wrapper {
	transition: transform .45s;
	transform: translate3d(calc(-1 * var(--kode-panel-size)), 0, 0);
	transition-delay: var(--kode-delay-in);
}

.kode--push-right-active .kode--push-left,
.kode--push-right-active .kode--push-top,
.kode--push-right-active .kode--push-bottom,
.kode--push-right-active .kode--reveal-left,
.kode--push-right-active .kode--reveal-right {
	display: none;
}

/* Push Menus Top / Bottom - Global -------- */

.kode--push-top,
.kode--push-bottom {
	position: fixed;
	visibility: hidden;
	transition: all .8s;
	width: 100%;
	height: var(--kode-panel-size);
	z-index: var(--kode-panel-z);
	left: 0;
	right: 0;
	text-align: left;
}

.kode--push-top-active .kode--push-top,
.kode--push-bottom-active .kode--push-bottom {
	visibility: visible;
	transition: all .4s;
	box-shadow: 0 0 2px rgba(0,0,0,0.0);
	overflow-y: var(--kode-scroll);
	transition-delay: var(--kode-delay-in);
}

.kode--push-top .kode--panel-close,
.kode--push-bottom .kode--panel-close {
	position: absolute;
	left: 20px;
	top: 20px;
}

.kode--push-top .kode--panel-inner,
.kode--push-bottom .kode--panel-inner {
	margin-top: 70px;
}

.kode--push-top .kode--panel-title,
.kode--push-bottom .kode--panel-title {
	margin-top: 0;
}

.kode--push-top-active .kode--content-wrapper,
.kode--push-bottom-active .kode--content-wrapper {
	transition: all .5s;
	transition-delay: var(--kode-delay-in);
}

/* Top - Push Menu -------- */

.kode--push-top {
	top: calc(var(--kode-header-offset) + var(--kode-admin-bar));
	margin-top: calc(-1 * var(--kode-panel-size));
	transform: translate3d(0, calc(-1 * var(--kode-panel-size)), 0);
}

.kode--push-top-active .kode--push-top {
	transform: translate3d(0, var(--kode-panel-size), 0);
}

.kode--push-top-active .kode--push-top .kode--panel-inner {
	margin-top: 80px;
}

.kode--push-top-active .kode--content-wrapper {
	transform: translate3d(0, var(--kode-panel-size), 0);
}

/* Bottom - Push Menu -------- */

.kode--push-bottom {
	bottom: 0;
	margin-bottom: calc(-1 * var(--kode-panel-size));
	transform: translate3d(0, var(--kode-panel-size), 0);
}

.kode--push-bottom-active .kode--push-bottom {
	transform: translate3d(0, calc(-1 * var(--kode-panel-size)), 0);
}

.kode--push-bottom-active .kode--content-wrapper {
	margin-top: calc(-1 * var(--kode-panel-size));
	transform: translate3d(0, calc(-1 * var(--kode-panel-size)), 0);
}


/* ------------------------------------------------------------
	Reveal Menu
------------------------------------------------------------ */

/* Reveal Menus Left / Right - Global -------- */

.kode--reveal-left,
.kode--reveal-right {
	position: fixed;
	top: var(--kode-admin-bar);
	bottom: 0;
	z-index: -1;
	min-height: calc(100% - var(--kode-admin-bar));
	opacity: 0;
	visibility: hidden; /* keeps a closed panel's links out of the Tab order */
	transition-delay: .6s;
}

.kode--reveal-left-active .kode--reveal-left,
.kode--reveal-right-active .kode--reveal-right {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	overflow-y: var(--kode-scroll);
	transition-delay: var(--kode-delay-in);
}

/* Left - Reveal Menu -------- */

.kode--reveal-left {
	left: 0;
	margin-left: 0;
}

.kode--reveal-left-active .kode--reveal-left {
	box-shadow: inset -4px 0 6px -4px rgba(0,0,0,0.9);
}

.kode--reveal-left-active .kode--content-wrapper {
	margin-right: calc(-1 * var(--kode-panel-size));
	transition: transform .55s;
	transform: translate3d(var(--kode-panel-size), 0, 0);
	transition-delay: var(--kode-delay-in);
}

.kode--reveal-left-active .kode--reveal-right {
	display: none;
}

/* Right - Reveal Menu -------- */

.kode--reveal-right {
	right: 0;
	margin-right: 0;
}

.kode--reveal-right-active .kode--reveal-right {
	box-shadow: inset 4px 0 6px -4px rgba(0,0,0,0.9);
}

.kode--reveal-right-active .kode--content-wrapper {
	transition: transform .45s;
	transform: translate3d(calc(-1 * var(--kode-panel-size)), 0, 0);
	transition-delay: var(--kode-delay-out);
}

.kode--reveal-right-active .kode--reveal-left {
	display: none;
}


/* ------------------------------------------------------------
	Panel Inactive Visibility
------------------------------------------------------------ */

.kode--over-left, .kode--over-right, .kode--over-top, .kode--over-bottom,
.kode--push-left, .kode--push-right, .kode--push-top, .kode--push-bottom {
	visibility: hidden !important;
	background-color: transparent;
}

.kode--over-left-active .kode--over-left, .kode--over-right-active .kode--over-right,
.kode--over-top-active .kode--over-top, .kode--over-bottom-active .kode--over-bottom,
.kode--push-left-active .kode--push-left, .kode--push-right-active .kode--push-right,
.kode--push-top-active .kode--push-top, .kode--push-bottom-active .kode--push-bottom {
	visibility: visible !important;
	background: var(--kode-panel-bg);
}
