/* Notices & pop-ups – bars, pop-ups, slide-ins and corner messages. Colours come in as --alrn-bg / --alrn-fg /
   --alrn-accent (set by the script); "brand" uses the site's own accent variable when it has one. */
.alrn { --alrn-bg: #1e3a8a; --alrn-fg: #fff; --alrn-accent: #93c5fd; --alrn-pad: 14px 18px; --alrn-fs: 15px;
  position: fixed; z-index: 2147482000; box-sizing: border-box; color: var(--alrn-fg); font-size: var(--alrn-fs); line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-align: left; }
.alrn *, .alrn *::before, .alrn *::after { box-sizing: border-box; }
.alrn--brand { --alrn-bg: var(--accent, var(--brand, var(--primary, #1e3a8a))); --alrn-fg: #fff; --alrn-accent: #fff; }
.alrn--sm { --alrn-pad: 9px 14px; --alrn-fs: 13.5px; }
.alrn--lg { --alrn-pad: 20px 24px; --alrn-fs: 17px; }
.alrn--font-sans { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.alrn--font-serif { font-family: ui-serif, Georgia, "Times New Roman", serif; }
.alrn--font-rounded { font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; }
.alrn--font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.alrn--font-inherit { font-family: inherit; }

.alrn__box { position: relative; background: var(--alrn-bg); color: var(--alrn-fg); overflow: hidden; }
.alrn__inner { display: flex; align-items: flex-start; gap: 12px; padding: var(--alrn-pad); }
.alrn__icon { flex: none; display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; background: color-mix(in srgb, var(--alrn-accent) 22%, transparent); color: var(--alrn-accent); margin-top: -.15em; }
.alrn__ii { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.alrn__text { flex: 1; min-width: 0; }
.alrn__title { display: block; font-weight: 700; font-size: 1.04em; margin: 0 0 2px; }
.alrn__body p { margin: 0 0 .45em; }
.alrn__body p:last-child { margin-bottom: 0; }
.alrn__body a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--alrn-accent); }
.alrn__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: none; }
.alrn__btn, .alrn__dismiss { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 16px; border-radius: 999px;
  font: inherit; font-weight: 650; font-size: .93em; text-decoration: none; cursor: pointer; white-space: nowrap; border: 1.5px solid transparent; }
.alrn__btn { background: var(--alrn-accent); color: var(--alrn-bg); }
.alrn__btn:hover { filter: brightness(1.08); }
.alrn__dismiss { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--alrn-fg) 45%, transparent); }
.alrn__x { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin: -5px -8px -5px 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer; opacity: .8; }
.alrn__x:hover { opacity: 1; background: color-mix(in srgb, var(--alrn-fg) 14%, transparent); }
.alrn__xi { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.alrn :focus-visible { outline: 2px solid var(--alrn-accent); outline-offset: 2px; }
.alrn__img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.alrn__timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--alrn-accent); transform-origin: left; animation: alrn-timer linear forwards; opacity: .85; }
@keyframes alrn-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.alrn--align-center .alrn__inner { justify-content: center; text-align: center; }
.alrn--align-center .alrn__text { flex: 0 1 auto; }

/* corners */
.alrn--r-none .alrn__box { border-radius: 0; }
.alrn--r-md .alrn__box { border-radius: 12px; }
.alrn--r-lg .alrn__box { border-radius: 20px; }
.alrn--r-pill .alrn__box { border-radius: 28px; }
.alrn--shadow .alrn__box { box-shadow: 0 12px 40px rgb(0 0 0 / .28), 0 2px 8px rgb(0 0 0 / .14); }

/* bar: full width at the top or bottom */
.alrn--bar { left: 0; right: 0; }
.alrn--bar.alrn--top { top: 0; }
.alrn--bar.alrn--bottom { bottom: 0; }
.alrn--bar .alrn__box { border-radius: 0; box-shadow: none; }
.alrn--bar.alrn--shadow .alrn__box { box-shadow: 0 2px 14px rgb(0 0 0 / .18); }
.alrn--bar .alrn__inner { align-items: center; max-width: 1240px; margin: 0 auto; }
.alrn--bar.alrn--static, .alrn--bar.alrn--push { position: relative; }
.alrn--bar.alrn--bottom.alrn--static { position: fixed; }
.alrn--bar.alrn--bottom .alrn__box { padding-bottom: env(safe-area-inset-bottom, 0px); }
.alrn--bar.alrn--top:not(.alrn--push):not(.alrn--static) .alrn__box { padding-top: env(safe-area-inset-top, 0px); }

/* pop-up: centred, optional dimmed page */
.alrn--popup { inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.alrn--popup .alrn__box { pointer-events: auto; width: min(100%, 460px); max-height: calc(100vh - 32px); overflow: auto; }
.alrn--popup.alrn--w-sm .alrn__box { width: min(100%, 360px); }
.alrn--popup.alrn--w-lg .alrn__box { width: min(100%, 640px); }
.alrn--popup .alrn__inner { flex-wrap: wrap; padding: calc(var(--alrn-fs) * 1.6); }
.alrn--popup .alrn__title { font-size: 1.3em; margin-bottom: 6px; }
.alrn--popup .alrn__actions { width: 100%; margin-top: 6px; }
.alrn--popup.alrn--align-center .alrn__actions { justify-content: center; }
.alrn--popup .alrn__x { position: absolute; top: 10px; right: 10px; margin: 0; background: color-mix(in srgb, var(--alrn-bg) 70%, transparent); }
.alrn--popup .alrn__icon { width: 2.6em; height: 2.6em; }
.alrn--popup .alrn__ii { width: 1.5em; height: 1.5em; }
.alrn__dim { position: absolute; inset: 0; background: rgb(0 0 0 / .55); pointer-events: auto; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

/* slide-in panel from an edge */
.alrn--slide { bottom: 16px; width: min(380px, calc(100vw - 32px)); }
.alrn--slide.alrn--right { right: 16px; }
.alrn--slide.alrn--left { left: 16px; }
.alrn--slide.alrn--bottom { left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); }
.alrn--slide .alrn__inner { flex-wrap: wrap; }
.alrn--slide .alrn__actions { width: 100%; }

/* corner message (toast) */
.alrn--corner { width: min(340px, calc(100vw - 32px)); }
.alrn--corner.alrn--bottom-right { right: 16px; bottom: 16px; }
.alrn--corner.alrn--bottom-left { left: 16px; bottom: 16px; }
.alrn--corner.alrn--top-right { right: 16px; top: 16px; }
.alrn--corner.alrn--top-left { left: 16px; top: 16px; }
.alrn--corner .alrn__inner { flex-wrap: wrap; }
.alrn--corner .alrn__actions { width: 100%; }
.alrn--corner .alrn__x, .alrn--slide .alrn__x { position: absolute; top: 8px; right: 8px; margin: 0; }
.alrn--corner .alrn__text, .alrn--slide .alrn__text { padding-right: 24px; }

/* coming and going */
.alrn { transition: opacity .3s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
.alrn--anim-fade, .alrn--anim-slide { opacity: 0; }
.alrn.is-in { opacity: 1; }
.alrn.is-out { opacity: 0; }
.alrn--anim-slide.alrn--bar.alrn--top:not(.is-in) { transform: translateY(-100%); }
.alrn--anim-slide.alrn--bar.alrn--bottom:not(.is-in) { transform: translateY(100%); }
.alrn--anim-slide.alrn--slide.alrn--right:not(.is-in) { transform: translateX(110%); }
.alrn--anim-slide.alrn--slide.alrn--left:not(.is-in) { transform: translateX(-110%); }
.alrn--anim-slide.alrn--slide.alrn--bottom:not(.is-in) { transform: translate(-50%, 120%); }
.alrn--anim-slide.alrn--corner:not(.is-in) { transform: translateY(14px) scale(.98); }
.alrn--anim-slide.alrn--popup:not(.is-in) .alrn__box { transform: translateY(18px) scale(.97); }
.alrn--popup .alrn__box { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.alrn--anim-none { transition: none; opacity: 1; }

@media (max-width: 760px) {
  .alrn--bar .alrn__inner { flex-wrap: wrap; }
  .alrn--bar .alrn__actions { width: 100%; }
  .alrn--bar .alrn__x { position: absolute; top: 8px; right: 12px; margin: 0; }
  .alrn--bar .alrn__text { padding-right: 26px; }
  .alrn--slide, .alrn--corner { left: 12px !important; right: 12px !important; width: auto; transform: none; }
  .alrn--slide.alrn--bottom, .alrn--corner.alrn--bottom-right, .alrn--corner.alrn--bottom-left { bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .alrn, .alrn--popup .alrn__box { transition: none; } .alrn__timer { animation: none; } }
@media print { .alrn { display: none !important; } }

/* inside the admin preview: drawn in its frame instead of the window */
.alrn--in-preview { position: absolute; z-index: 5; }
.alrn--in-preview.alrn--popup { position: absolute; }
.alrn--in-preview.alrn--bar.alrn--push, .alrn--in-preview.alrn--bar.alrn--static { position: absolute; }
/* a poll or survey (Polls & surveys) inside the notice – the notice's colours, scrolls when it is long */
.alrn__survey { margin-top: 10px; max-height: min(62vh, 560px); overflow: auto; overscroll-behavior: contain; }
.alrn__survey .svy { --svy-accent: var(--alrn-accent); --svy-line: color-mix(in srgb, currentColor 30%, transparent); margin: 0; padding: 0; border: 0; }
.alrn__survey .svy__title { display: none; }
.alrn__survey-ph { margin: 0; padding: 14px; border: 1px dashed currentColor; border-radius: 10px; opacity: .7; text-align: center; }

/* 1.2.0 – a portrait beside the text (a person's photo in an alert): whole, never cropped from the top */
.alrn__portrait { flex: none; width: 64px; aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: center top; border-radius: 6px; background: #fff; box-shadow: 0 0 0 2px color-mix(in srgb, var(--alrn-fg) 35%, transparent); }
.alrn--bar .alrn__portrait { width: 58px; }
.alrn--popup .alrn__portrait, .alrn--slide .alrn__portrait { width: 96px; }
@media (max-width: 600px) { .alrn--bar .alrn__portrait { width: 52px; } }
