/* Ainscough Notices – front end.
 * Brand variables are printed inline from Popups & Bars > Settings:
 * --ain-black, --ain-on-black, --ain-yellow, --ain-on-yellow,
 * --ain-popup-bg, --ain-popup-text, --ain-font, --ain-radius, --ain-overlay
 * The JS also sets --ain-bars-h (height of visible top bars) on <html>,
 * so a theme with a fixed header can use: top: var(--ain-bars-h, 0px);
 */

.ain-bars,
.ain-popup {
	font-family: var(--ain-font, inherit);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}
.ain-bars *,
.ain-popup * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.ain-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.ain-btn,
.ain-btn:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 22px;
	border: 2px solid var(--ain-yellow);
	border-radius: var(--ain-radius, 0);
	background: var(--ain-yellow);
	color: var(--ain-on-yellow);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ain-btn:hover,
.ain-btn:focus-visible {
	background: var(--ain-black);
	border-color: var(--ain-black);
	color: var(--ain-yellow);
	text-decoration: none;
}

.ain-btn--secondary,
.ain-btn--secondary:visited {
	background: transparent;
	border-color: var(--ain-black);
	color: var(--ain-black);
}
.ain-btn--secondary:hover,
.ain-btn--secondary:focus-visible {
	background: var(--ain-black);
	border-color: var(--ain-black);
	color: var(--ain-on-black);
}

.ain-btn:focus-visible,
.ain-close:focus-visible {
	outline: 3px solid var(--ain-yellow);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Close (X) button                                                    */
/* ------------------------------------------------------------------ */

.ain-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--ain-radius, 0);
	background: transparent;
	color: var(--ain-on-black);
	cursor: pointer;
	line-height: 1;
	box-shadow: none;
	transition: background-color .15s ease, color .15s ease;
}
.ain-close:hover {
	background: var(--ain-yellow);
	color: var(--ain-on-yellow);
}
.ain-close svg {
	display: block;
}

/* ------------------------------------------------------------------ */
/* Sticky top bar                                                      */
/* ------------------------------------------------------------------ */

.ain-bars {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99990;
}
.admin-bar .ain-bars {
	top: 32px;
}
@media screen and (max-width: 782px) {
	.admin-bar .ain-bars { top: 46px; }
}
@media screen and (max-width: 600px) {
	/* The WP admin bar scrolls away on small screens. */
	.admin-bar .ain-bars { top: 0; }
}

.ain-bar {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--ain-black);
	color: var(--ain-on-black);
	border-bottom: 4px solid var(--ain-yellow);
	font-size: 15px;
	line-height: 1.4;
}
.ain-bar[hidden] {
	display: none;
}
.ain-bar__inner {
	flex: 1 1 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 20px;
	max-width: 1280px;
	margin: 0 auto;
	padding: 10px 20px;
	text-align: center;
}
.ain-bar__text {
	font-weight: 600;
}
.ain-bar__text a {
	color: var(--ain-yellow);
	text-decoration: underline;
}
.ain-bar__text strong,
.ain-bar__text b {
	color: var(--ain-yellow);
}
.ain-bar .ain-btn {
	min-height: 36px;
	padding: 6px 16px;
	font-size: 13px;
}
.ain-bar .ain-btn:hover,
.ain-bar .ain-btn:focus-visible {
	background: var(--ain-on-black);
	border-color: var(--ain-on-black);
	color: var(--ain-black);
}
.ain-bar .ain-btn--secondary,
.ain-bar .ain-btn--secondary:visited {
	border-color: var(--ain-on-black);
	color: var(--ain-on-black);
	background: transparent;
}
.ain-bar .ain-close {
	align-self: center;
	margin-right: 6px;
}

/* Body padding and fixed-header offsets are applied by frontend.js. */

/* ------------------------------------------------------------------ */
/* Popup                                                               */
/* ------------------------------------------------------------------ */

.ain-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity .2s ease;
}
.ain-popup[hidden] {
	display: none;
}
.ain-popup.is-open {
	opacity: 1;
}

.ain-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--ain-overlay, .7));
}

.ain-popup__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--ain-popup-bg);
	color: var(--ain-popup-text);
	border-radius: var(--ain-radius, 0);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
	transform: translateY(12px);
	transition: transform .2s ease;
	outline: none;
}
.ain-popup.is-open .ain-popup__dialog {
	transform: none;
}

.ain-popup__header {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 64px;
	padding: 16px 64px 16px 28px; /* Right padding leaves room for the X. */
	background: var(--ain-black);
	color: var(--ain-on-black);
	border-bottom: 5px solid var(--ain-yellow);
}
.ain-popup__title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: .02em;
	text-transform: uppercase;
}
.ain-popup__header .ain-close {
	position: absolute;
	top: 10px;
	right: 10px;
}

.ain-popup__body {
	padding: 24px 28px;
	overflow-y: auto;
	font-size: 16px;
	line-height: 1.6;
}
.ain-popup__body > :first-child { margin-top: 0; }
.ain-popup__body > :last-child { margin-bottom: 0; }
.ain-popup__body a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--ain-yellow);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
.ain-popup__body img {
	max-width: 100%;
	height: auto;
}

.ain-popup__footer {
	padding: 0 28px 28px;
}

html.ain-popup-open,
html.ain-popup-open body {
	overflow: hidden;
}

@media (max-width: 480px) {
	.ain-popup { padding: 12px; }
	.ain-popup__header { padding: 14px 60px 14px 20px; }
	.ain-popup__title { font-size: 19px; }
	.ain-popup__body { padding: 20px; }
	.ain-popup__footer { padding: 0 20px 20px; }
	.ain-popup__footer .ain-btn { flex: 1 1 100%; }
	.ain-bar__inner { padding: 8px 12px; }
	.ain-bar { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.ain-popup,
	.ain-popup__dialog,
	.ain-btn,
	.ain-close { transition: none; }
}

@media print {
	.ain-bars,
	.ain-popup { display: none !important; }
	body.ain-has-bars { padding-top: 0; }
}