/*
 * Notification bar styles.
 * Critical layout, colors and positioning are also inlined on the element in
 * PHP, so the bar still renders correctly if an optimizer strips this file.
 * What lives here is the polish: flex layout, button, close button, animations.
 */

.mgs-nb {
	box-sizing: border-box;
	width: 100%;
	line-height: 1.4;
	text-align: center;
}

.mgs-nb__inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 10px 44px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 14px;
}

.mgs-nb__message {
	display: inline;
}

/* Neutralise theme paragraph margins that would inflate the bar height. */
.mgs-nb__message p {
	margin: 0;
	padding: 0;
}

.mgs-nb a {
	color: var(--mgs-nb-link, #cfe3ff);
	text-decoration: underline;
}

.mgs-nb a:hover {
	text-decoration: none;
}

.mgs-nb__button {
	display: inline-block;
	padding: 6px 16px;
	border-radius: 4px;
	background: var(--mgs-nb-btn-bg, #fff);
	color: var(--mgs-nb-btn-text, #a83232) !important;
	text-decoration: none !important;
	font-weight: 700;
	white-space: nowrap;
}

.mgs-nb__button:hover {
	filter: brightness(0.95);
}

.mgs-nb__close {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	background: transparent;
	border: 0;
	color: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	opacity: 0.8;
}

.mgs-nb__close:hover {
	opacity: 1;
}

/*
 * Spacer used only in sticky mode. It sits in the normal flow and takes the
 * height of the fixed bar, so page content starts below it without touching
 * body padding (which breaks sticky theme headers).
 */
.mgs-nb-spacer {
	width: 100%;
	height: 0;
}

/* Keep a sticky top bar clear of the WordPress admin bar when logged in. */
body.admin-bar .mgs-nb--sticky.mgs-nb--top {
	top: 32px;
}

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

/*
 * Animations run once on render via keyframes. The resting state is visible, so
 * no JavaScript is needed to reveal the bar. If this file is stripped, the bar
 * simply appears with no animation.
 */
.mgs-nb--anim-slide.mgs-nb--top {
	animation: mgs-nb-slide-top 0.35s ease both;
}

.mgs-nb--anim-slide.mgs-nb--bottom {
	animation: mgs-nb-slide-bottom 0.35s ease both;
}

.mgs-nb--anim-fade {
	animation: mgs-nb-fade 0.4s ease both;
}

@keyframes mgs-nb-slide-top {
	from { transform: translateY(-100%); }
	to   { transform: translateY(0); }
}

@keyframes mgs-nb-slide-bottom {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}

@keyframes mgs-nb-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.mgs-nb {
		animation: none !important;
	}
}
