/* ==========================================================================
   Announcement modal
   --------------------------------------------------------------------------
   A separate stylesheet, loaded only on pages where an announcement is
   actually live.

   site.css is frozen — all 71 public pages are diffed against their static
   originals, and adding one declaration there fails that check. Keeping this
   apart also means a page with no announcement downloads none of it.

   Brand values are copied from site.css rather than imported, so the two files
   cannot break each other.
   ========================================================================== */

.anc {
  --anc-brand:      #2E3192;
  --anc-brand-dark: #23256F;
  --anc-indigo:     #4E5AC8;
  --anc-sky:        #089DDD;
  --anc-ink:        #1B1E42;
  --anc-muted:      #5C628A;
  --anc-line:       #DCE1F7;
  --anc-gray:       #EEF1FF;
  --anc-head: "Poppins", system-ui, sans-serif;
  --anc-body: "Inter", system-ui, sans-serif;

  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  padding: 20px;
}

.anc[hidden] { display: none; }

/* Strong enough to isolate the foreground; a weak scrim leaves the page
   competing with the message. */
.anc-scrim {
  position: absolute; inset: 0;
  background: rgba(20, 22, 55, .62);
  backdrop-filter: blur(3px);
  animation: anc-fade 180ms ease-out;
}

.anc-box {
  position: relative;
  width: 100%; max-width: 620px;
  max-height: calc(100dvh - 40px); overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(20, 22, 55, .38);
  font-family: var(--anc-body);
  color: var(--anc-ink);
  /* Scales from the centre so it reads as arriving, not just appearing. */
  animation: anc-in 220ms cubic-bezier(.2, .9, .3, 1);
}

@keyframes anc-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes anc-in {
  from { opacity: 0; transform: translateY(14px) scale(.97) }
  to   { opacity: 1; transform: none }
}

.anc-x {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: var(--anc-ink);
  box-shadow: 0 2px 10px rgba(20, 22, 55, .18);
  transition: background 160ms, transform 160ms;
}
.anc-x:hover { background: #fff; transform: rotate(90deg); }
.anc-x svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }
.anc-x:focus-visible { outline: 3px solid var(--anc-sky); outline-offset: 2px; }

.anc-media { height: 190px; overflow: hidden; border-radius: 22px 22px 0 0; }
.anc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.anc-body { padding: 30px 34px 34px; }

/* The header variants. Only the top band changes; the body stays readable. */
.anc-brand  .anc-eyebrow { color: var(--anc-brand); }
.anc-accent .anc-eyebrow { color: #0A7CAE; }
.anc-plain  .anc-eyebrow { color: var(--anc-muted); }

.anc-brand::before, .anc-accent::before {
  content: ""; display: block; height: 6px; border-radius: 22px 22px 0 0;
}
.anc-brand::before  { background: linear-gradient(90deg, var(--anc-brand-dark), var(--anc-indigo)); }
.anc-accent::before { background: linear-gradient(90deg, var(--anc-sky), #0A7CAE); }
.anc-box:has(.anc-media)::before { display: none; }

.anc-eyebrow {
  font-family: var(--anc-head); font-weight: 600; font-size: 12.5px;
  letter-spacing: .09em; text-transform: uppercase; margin: 0 0 8px;
}
.anc-title {
  font-family: var(--anc-head); font-weight: 600; font-size: 27px;
  line-height: 1.22; letter-spacing: -.02em; margin: 0 0 10px;
  color: var(--anc-brand-dark);
}
.anc-desc { font-size: 15.5px; line-height: 1.62; color: var(--anc-muted); margin: 0; }

.anc-cards { display: grid; gap: 10px; margin-top: 22px; }
.anc-card {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: 14px;
  background: var(--anc-gray); border: 1px solid var(--anc-line);
  text-decoration: none; color: inherit;
  transition: transform 160ms, box-shadow 160ms, border-color 160ms;
}
a.anc-card:hover {
  transform: translateY(-2px); border-color: var(--anc-indigo);
  box-shadow: 0 8px 20px rgba(35, 37, 111, .12);
}
.anc-card-img {
  width: 46px; height: 46px; flex: none; border-radius: 11px;
  background-size: cover; background-position: center;
}
.anc-card-icon {
  width: 46px; height: 46px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: #fff; color: var(--anc-brand);
}
.anc-card-icon .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.anc-card-txt b { display: block; font-family: var(--anc-head); font-size: 14.8px; font-weight: 600; }
.anc-card-txt span { display: block; font-size: 13px; color: var(--anc-muted); margin-top: 1px; }

.anc-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 26px; }
.anc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 12px 24px; border-radius: 13px;
  font-family: var(--anc-head); font-weight: 600; font-size: 15px;
  background: var(--anc-brand); color: #fff; text-decoration: none;
  transition: background 160ms, transform 160ms;
}
.anc-btn:hover { background: var(--anc-brand-dark); }
.anc-btn:active { transform: translateY(1px); }
.anc-btn:focus-visible { outline: 3px solid var(--anc-sky); outline-offset: 2px; }
.anc-btn-ghost { background: #fff; color: var(--anc-ink); border: 1px solid var(--anc-line); }
.anc-btn-ghost:hover { background: var(--anc-gray); }

@media (max-width: 560px) {
  .anc { padding: 12px; }
  .anc-body { padding: 24px 20px 26px; }
  .anc-title { font-size: 23px; }
  .anc-media { height: 150px; }
  /* Full-width buttons: on a phone a 46px target beside another is fiddly. */
  .anc-actions .anc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .anc-scrim, .anc-box { animation: none; }
  .anc-x:hover, a.anc-card:hover { transform: none; }
}
