/* SiS Thema: Sinterklaas menu. Everything is scoped to body.sis-menu (preview ?sis_menu=1, or everybody once switched on).
   Icons are inline SVG data URIs added by sist_icon_css(); this file only sets size, colour and motion. */

/* ---- menu button: mijter (closed) / crossed staffs (open), drawn over Salient's lines ---- */
body.sis-menu .slide-out-widget-area-toggle a {
	position: relative;
}
body.sis-menu .slide-out-widget-area-toggle a > span[aria-hidden="true"] {
	opacity: 0 !important; /* keep Salient's box (no layout shift), hide its three lines / X */
}
body.sis-menu .slide-out-widget-area-toggle a::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	pointer-events: none;
	transition: transform .25s ease;
}
/* Bigger invisible tap area (Salient's link is only about 22x20 px on phones). */
body.sis-menu .slide-out-widget-area-toggle a::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 52px;
	height: 52px;
	margin: -26px 0 0 -26px;
}
body.sis-menu .slide-out-widget-area-toggle a:hover::before {
	transform: rotate(-8deg) scale(1.08);
}
body.sis-menu .slide-out-widget-area-toggle a.open::before {
	transform: rotate(0);
}
body.sis-menu .slide-out-widget-area-toggle a:focus-visible {
	outline: 3px solid #ffc900;
	outline-offset: 14px;
	border-radius: 8px;
}

/* ---- menu items: white pills with an icon, current page red ---- */
body.sis-menu #slide-out-widget-area .off-canvas-menu-container {
	--sist-pill-w: 520px;
}
@media (max-width: 600px) {
	body.sis-menu #slide-out-widget-area .off-canvas-menu-container {
		--sist-pill-w: 340px;
	}
}
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li {
	margin: 0 0 12px !important;
	padding: 0 !important;
}
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a {
	/* Every pill the same width (Rob): fits "Spectulaas de Pietenkermis" on one line on desktop;
	   on phones the full menu width (max 340px), the long item wraps to two lines. */
	display: flex !important;
	align-items: center;
	justify-content: flex-start;
	gap: 14px;
	box-sizing: border-box;
	width: min(var(--sist-pill-w), 100%);
	min-height: 58px;
	margin: 0 auto !important;
	padding: 7px 26px 7px 7px !important;
	border-radius: 999px;
	background: #fff !important;
	color: #000034 !important;
	font-size: clamp(20px, 4.8vw, 30px) !important;
	line-height: 1.15 !important;
	font-weight: 800 !important;
	text-align: left;
	opacity: 1 !important;
	box-shadow: 0 5px 0 #b98420, 0 10px 18px rgba(0, 0, 52, .2);
	transition: transform .15s ease, box-shadow .15s ease;
}
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a::before {
	content: "";
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background-color: #fff5d6;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 34px 34px;
	box-shadow: inset 0 0 0 2px #e7b23c;
}
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a::after {
	display: none !important; /* Salient's hover underline */
}
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:hover,
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 7px 0 #b98420, 0 12px 20px rgba(0, 0, 52, .25);
}
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:hover::before,
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:focus-visible::before {
	animation: sist-roll .6s cubic-bezier(.3, 1.3, .5, 1);
}
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:focus-visible {
	outline: 4px solid #000034;
	outline-offset: 4px;
}
/* current page */
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li.current-menu-item > a {
	background: #be202e !important;
	color: #fff !important;
	box-shadow: 0 5px 0 #8e1520, 0 10px 18px rgba(0, 0, 52, .2);
}
body.sis-menu #slide-out-widget-area .off-canvas-menu-container li.current-menu-item > a::before {
	background-color: #fff;
}

/* ---- Chat met Piet vs. the open menu ----
   (a) While the fullscreen menu is open, hide the chat. Its embed (chatgpiet.nl/embed.js) appends one bare,
       empty <div> to <body> that hosts a closed shadow root; hiding that host hides bubble and panel.
       Salient marks the open menu only with #slide-out-widget-area.open, hence :has(). Browsers without :has()
       (iOS < 15.4) get body.sis-menu-open from the small inline script instead. A z-index on the host alone is not
       enough: the chat panel is fullscreen on phones and would then slide under the fixed header (z 9999). */
body.sis-menu:has(#slide-out-widget-area.open) > div:empty:not([id]):not([class]) {
	display: none !important;
}
body.sis-menu.sis-menu-open > div:empty:not([id]):not([class]) {
	display: none !important;
}
/* (b) Below Salient's header breakpoint the bubble can overlap the centred pills: room to scroll the
       last item clear of the bottom ~110px. */
@media (max-width: 999px) {
	body.sis-menu #slide-out-widget-area .off-canvas-menu-container {
		padding-bottom: 130px !important;
	}
}

/* the icon rolls in like a pepernoot */
@keyframes sist-roll {
	0% { transform: translateX(-14px) rotate(-300deg); }
	100% { transform: translateX(0) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
	body.sis-menu .slide-out-widget-area-toggle a::before,
	body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a {
		transition: none;
	}
	body.sis-menu .slide-out-widget-area-toggle a:hover::before,
	body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:hover,
	body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:focus-visible {
		transform: none;
	}
	body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:hover::before,
	body.sis-menu #slide-out-widget-area .off-canvas-menu-container li > a:focus-visible::before {
		animation: none;
	}
}
