/* Announcements (inc/announcements.php): top bar + bottom-left pop-up. Brand tokens from the theme's theme.json. */
.river-ann {
  --ann-bg: var(--wp--preset--color--pine, #1d5d51);
  --ann-fg: #fff;
  --ann-btn-fg: var(--wp--preset--color--pine, #1d5d51);
  font-family: var(--wp--preset--font-family--gotham, "Gotham", system-ui, sans-serif);
  background: var(--ann-bg); color: var(--ann-fg);
  box-sizing: border-box;
}
.river-ann *, .river-ann *::before, .river-ann *::after { box-sizing: border-box; }
.river-ann[hidden] { display: none !important; }
.river-ann--deep { --ann-bg: var(--wp--preset--color--deep-water, #003333); --ann-btn-fg: var(--wp--preset--color--deep-water, #003333); }
.river-ann--urgent { --ann-bg: #a4161a; --ann-btn-fg: #a4161a; }

.river-ann__msg { min-width: 0; }
.river-ann__heading { font-weight: 700; }
.river-ann__text a, .river-ann__msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.river-ann__btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-height: 36px; padding: .4rem 1rem; border-radius: 999px;
  background: #fff; color: var(--ann-btn-fg) !important; font-weight: 700; font-size: .875rem; line-height: 1.2;
  text-decoration: none !important;
}
.river-ann__btn:hover { background: var(--wp--preset--color--foam, #b8e1d9); }
.river-ann__btn:focus-visible, .river-ann__close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(0,0,0,.45); }
.river-ann__close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer;
}
.river-ann__close:hover { background: rgba(255,255,255,.16); }
.river-ann__icon { flex: none; opacity: .95; }

/* ---- Top bar: in the normal flow above the site, so it pushes the page down once, at load (no shift later). */
.river-ann-bars { position: relative; z-index: 60; }
.river-ann--bar { width: 100%; }
.river-ann--bar .river-ann__inner {
  max-width: 1140px; margin: 0 auto; padding: .45rem .5rem .45rem 1rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem 1rem; flex-wrap: wrap;
  font-size: .95rem; line-height: 1.4;
}
.river-ann--bar .river-ann__msg { flex: 0 1 auto; text-align: center; padding-block: .3rem; }
.river-ann--bar .river-ann__close { margin-left: auto; }
.river-ann--bar:not(:has(.river-ann__close)) .river-ann__inner { padding-right: 1rem; }
.river-ann--bar.river-ann--urgent .river-ann__inner { font-size: 1rem; }

/* The overlay (hero) header is position:fixed at the top; keep it under the bar until the bar scrolls away. */
html.river-has-ann-bar .wp-site-blocks > header.wp-block-template-part:has(.river-header--overlay) {
  top: max(var(--wp-admin--admin-bar--height, 0px), var(--river-ann-bottom, 0px));
}

/* ---- Pop-up: bottom-LEFT (the chat bubble is bottom-right). Never takes focus. */
.river-ann--popup {
  position: fixed; left: 20px; bottom: 20px; z-index: 1000;
  width: min(360px, calc(100vw - 120px));
  max-height: calc(100vh - 140px); overflow: auto;
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.28);
  opacity: 0; transform: translateY(16px);
  transition: opacity .35s ease, transform .35s ease;
}
.river-ann--popup.is-in { opacity: 1; transform: none; }
.river-ann--popup .river-ann__close {
  position: absolute; top: 6px; right: 6px; z-index: 1;
  background: rgba(0,0,0,.35); color: #fff;
}
.river-ann--popup .river-ann__close:hover { background: rgba(0,0,0,.55); }
.river-ann--popup .river-ann__img {
  display: block; width: 100%; height: auto; max-height: 240px; object-fit: cover;
  background: var(--wp--preset--color--mist, #f8f8f8);
}
.river-ann--popup .river-ann__inner { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; font-size: .95rem; line-height: 1.45; }
.river-ann--popup .river-ann__heading { display: block; font-size: 1.1rem; line-height: 1.25; margin-bottom: .2rem; }
.river-ann--popup:not(:has(.river-ann__img)) .river-ann__inner { padding-right: 3.2rem; }

/* Phones: the bar wraps (button under the words); the pop-up becomes a compact sheet along the bottom,
   stopping short of the chat bubble on the right. */
@media (max-width: 600px) {
  .river-ann--bar .river-ann__inner { padding: .35rem .25rem .35rem .75rem; font-size: .875rem; gap: .35rem .6rem; justify-content: flex-start; flex-wrap: nowrap; align-items: flex-start; }
  .river-ann--bar .river-ann__icon { margin-top: .45rem; }
  .river-ann--bar .river-ann__msg { text-align: left; flex: 1 1 auto; }
  .river-ann--bar .river-ann__btn { min-height: 32px; padding: .3rem .8rem; font-size: .8rem; align-self: center; }
  .river-ann--bar .river-ann__close { margin-left: 0; }
  .river-ann--popup {
    left: 10px; bottom: 10px; width: auto; right: 92px;   /* 60px bubble + its 16–20px margin + a gap */
    max-height: 55vh; border-radius: 12px;
  }
  .river-ann--popup .river-ann__img { max-height: 150px; }
  .river-ann--popup .river-ann__inner { padding: .75rem .85rem .85rem; gap: .55rem; font-size: .875rem; }
  .river-ann--popup .river-ann__heading { font-size: 1rem; }
  .river-ann--popup .river-ann__close { width: 40px; height: 40px; top: 4px; right: 4px; }
}
@media (max-width: 600px) and (max-width: 360px) {
  .river-ann--bar .river-ann__inner { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .river-ann--popup { transition: none; transform: none; }
}
@media print { .river-ann-bars, .river-ann-popups { display: none !important; } }
