/* ----------------------------------------------------------------
	Mola site script styles (WO-0020), used with js/mola-site.js

	Everything is under html.mola-site, which the script adds only while the
	theme's own JS is missing (docs/brain/architecture/empty-js-files.md).
-----------------------------------------------------------------*/

/* Desktop menu: open the dropdown on keyboard focus too, as Canvas does on hover. */
@media (min-width: 992px) {
	html.mola-site .primary-menu:not(.on-click) .menu-item:focus-within > .sub-menu-container {
		opacity: 1;
		visibility: visible;
		margin-top: 0;
		z-index: 399;
		pointer-events: auto;
	}
	html.mola-site .primary-menu:not(.on-click) .menu-item:focus-within > .sub-menu-container > * {
		display: block;
	}
}

/* Phone menu: a white panel behind the open menu, so it reads over the hero photo.
   (The script also shows a dark header as a light one while the menu is open.) */
@media (max-width: 991.98px) {
	html.mola-site body.primary-menu-open #header-wrap {
		background-color: #FFF;
	}
}

#primary-menu-trigger:focus-visible {
	outline: 2px solid #1ABC9C;
	outline-offset: 2px;
}

/* Go-to-top (WO-0021): Canvas hides #gotoTop until its JS shows it; the script adds .mola-visible. */
html.mola-site #gotoTop.mola-visible {
	display: block;
	animation: mola-fade-in .3s ease-out;
}

html.mola-site #gotoTop:focus-visible {
	outline: 2px solid #FFF;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px #333;
}

@keyframes mola-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Slider: stack the slides and cross-fade the active one. */
html.mola-site .fslider.mola-slider .slider-wrap > .slide {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition-property: opacity;
	transition-timing-function: ease-in-out;
}

html.mola-site .fslider.mola-slider .slider-wrap > .slide.is-active {
	opacity: 1;
	z-index: 1;
}

/* Forms: the server's message keeps its line breaks. */
.mola-form-message {
	white-space: pre-line;
	margin-bottom: 15px;
}

html.mola-site .form-widget form {
	position: relative;
}

@media (prefers-reduced-motion: reduce) {
	html.mola-site .fslider.mola-slider .slider-wrap > .slide {
		transition: none;
	}
	html.mola-site #gotoTop.mola-visible {
		animation: none;
	}
}
