/* Site Notices — front end.
 * Colours come from CSS custom properties so themes, Elementor and
 * presets can all override them:
 *   --sn-bg, --sn-text, --sn-accent, --sn-border
 */

.sn-notice {
	position: relative;
	box-sizing: border-box;
	margin: 0 0 1.5em;
	background: var(--sn-bg, transparent);
	color: var(--sn-text, inherit);
	border: 0 solid var(--sn-border, transparent);
}

.sn-notice--styled {
	padding: 1rem 1.25rem;
	border-width: 1px;
	border-radius: 8px;
}

.sn-notice:has(> .sn-notice__dismiss) {
	padding-right: 3rem;
}

.sn-notice__heading {
	margin: 0 0 0.35em;
}

.sn-notice--styled .sn-notice__heading {
	color: inherit;
	font-size: 1.15em;
	line-height: 1.3;
}

.sn-notice__body > :first-child { margin-top: 0; }
.sn-notice__body > :last-child { margin-bottom: 0; }

.sn-notice--styled .sn-notice__body a {
	color: inherit;
	text-decoration: underline;
}

/* Call to action */
.sn-notice__cta {
	display: inline-block;
	margin-top: 0.75em;
	min-height: 24px;
	padding: 0.5em 1.1em;
	border-radius: 6px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.sn-cta--solid,
.sn-cta--solid:visited {
	background: var(--sn-accent, #1d2327);
	color: #fff;
	border: 2px solid var(--sn-accent, #1d2327);
}

.sn-cta--solid:hover { filter: brightness(0.92); color: #fff; }

.sn-cta--outline,
.sn-cta--outline:visited {
	background: transparent;
	color: var(--sn-accent, inherit);
	border: 2px solid var(--sn-accent, currentColor);
}

.sn-cta--link,
.sn-cta--link:visited {
	padding: 0;
	color: var(--sn-accent, inherit);
	text-decoration: underline;
	font-weight: 600;
}

/* Visible focus (WCAG 2.4.7) */
.sn-notice a:focus-visible,
.sn-notice button:focus-visible {
	outline: 3px solid var(--sn-accent, currentColor);
	outline-offset: 2px;
}

/* Dismiss: at least 24x24px target (WCAG 2.5.8) */
.sn-notice__dismiss {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	min-width: 24px;
	min-height: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.sn-notice__dismiss:hover { background: rgba(0, 0, 0, 0.08); }

.sn-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Site-wide top bar */
.sn-topbar {
	margin: 0;
	padding: 0.6rem 3rem 0.6rem 1rem;
	border-width: 0 0 1px;
	border-radius: 0;
	background: var(--sn-bg, #f0f0f1);
	color: var(--sn-text, #1d2327);
	z-index: 9990;
	font-size: 0.95rem;
}

.sn-topbar--sticky {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
}

.sn-topbar .sn-notice__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem 1rem;
	max-width: 1200px;
	margin: 0 auto;
}

.sn-topbar .sn-notice__heading {
	margin: 0;
	font-size: 1em;
	line-height: 1.4;
}

.sn-topbar .sn-notice__body p { margin: 0; }

.sn-topbar .sn-notice__cta {
	margin-top: 0;
	padding: 0.35em 0.9em;
}

.sn-topbar__more {
	display: none;
	min-height: 24px;
	padding: 0.2rem 0.4rem;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

@media (max-width: 600px) {
	.sn-topbar--collapse .sn-notice__body { display: none; }
	.sn-topbar--collapse.is-expanded .sn-notice__body { display: block; flex-basis: 100%; text-align: center; }
	.sn-topbar--collapse .sn-topbar__more { display: inline-block; }
}

/* Gentle entrance, only for people who haven't asked for reduced motion */
@media (prefers-reduced-motion: no-preference) {
	.sn-notice.sn-is-new { animation: sn-in 0.25s ease-out; }
	@keyframes sn-in {
		from { opacity: 0; transform: translateY(-4px); }
		to { opacity: 1; transform: none; }
	}
}

/* Windows high contrast */
@media (forced-colors: active) {
	.sn-notice--styled, .sn-topbar { border: 1px solid CanvasText; }
	.sn-cta--solid { border: 2px solid ButtonText; }
}

/* Never leave empty wrappers (and their margins) on the page */
.sn-widget:not(:has(.sn-notice, .sn-preview-wrap)),
.elementor-widget-site-notice:not(:has(.sn-notice, .sn-preview-wrap)) {
	display: none !important;
}

/* Editor previews (block editor, Elementor, Customizer) */
.sn-preview-wrap {
	margin: 0 0 1em;
	padding: 0.5rem;
	outline: 2px dashed #8c8f94;
	outline-offset: 2px;
}

.sn-preview-wrap .sn-notice { margin-bottom: 0; }

.sn-preview-label {
	display: block;
	margin-bottom: 0.4rem;
	color: #50575e;
	font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sn-preview-empty .sn-preview-label { margin: 0; }
