/* ============================================================================
   HireJuno — css/notify.css                                   (wave 4, N2)
   The header bell + its panel, and the "Turn on booking updates" card.
   Paired with js/notify.js; nothing renders until that script mounts it, so
   loading this on a page for a signed-out visitor costs one small stylesheet.

   Tokens: brand.css (--juno-*, --ink*, --paper, --line, --sand, --r-*,
   --shadow-*), with literal fallbacks so the bell still looks right on a page
   that loads this file without them. Small text uses #5F6B7F (tokens.css
   --hj-fg-subtle, 5.39:1) instead of --ink-faint, which fails AA.
   Motion: 150–240ms, transform/opacity only, off under reduced motion.
   ========================================================================== */

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

/* ---------- placement in the header --------------------------------------
   The bell is a direct child of .navbar__inner (NOT inside #navLinks), so it
   stays in the bar on mobile where the nav list collapses behind the menu
   button. The nav takes the free space so brand stays left and nav + bell
   sit together on the right. */
.navbar__inner.hjn-has-bell > nav { margin-left: auto; }
.hjn {
  position: relative; flex: none;
  display: flex; align-items: center;
  margin-left: calc(var(--s-3, 12px) - var(--s-5, 24px));
  opacity: 0; transition: opacity .2s ease;
}
.hjn.is-in { opacity: 1; }

.hjn-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--ink, #1B2A41);
  cursor: pointer; text-decoration: none !important;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.hjn-bell svg { width: 22px; height: 22px; }
.hjn-bell:hover { background: var(--sand, #F3EFE6); }
.hjn-bell:active { transform: scale(.94); }
.hjn-bell:focus-visible { outline: 3px solid var(--juno-green, #2E8B44); outline-offset: 2px; }
.hjn-bell[aria-expanded="true"], .hjn-bell[aria-current="page"] {
  background: var(--juno-green-tint, #E9F5EC); color: var(--juno-green-dark, #1F6B33);
}
.hjn-bell__badge {
  position: absolute; top: 3px; right: 1px;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--juno-green-dark, #1F6B33); color: #fff;
  box-shadow: 0 0 0 2px var(--cream, #FAF8F3);
  font: 700 .7rem/1 var(--font-display, 'Outfit', system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  transform-origin: center; animation: hjnPop .24s cubic-bezier(.34, 1.56, .64, 1);
}
.hjn-bell__badge[hidden] { display: none; }
@keyframes hjnPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- panel -------------------------------------------------------- */
.hjn-panel {
  position: absolute; top: calc(100% + 14px); right: -6px; z-index: 5;
  width: 384px; max-width: calc(100vw - 24px);
  background: var(--paper, #fff); color: var(--ink, #1B2A41);
  border: 1px solid var(--line, #E7E4DC); border-radius: var(--r-lg, 16px);
  box-shadow: 0 4px 8px -2px rgba(27, 42, 65, .08), 0 24px 48px -12px rgba(27, 42, 65, .22);
  overflow: hidden; text-align: left;
  transform-origin: top right; animation: hjnDrop .18s cubic-bezier(.22, .61, .36, 1);
}
.hjn-panel[hidden] { display: none; }
@keyframes hjnDrop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

.hjn-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line, #E7E4DC);
}
.hjn-panel__title {
  margin: 0; font: 700 1.02rem/1.2 var(--font-display, 'Outfit', system-ui, sans-serif);
  color: var(--ink, #1B2A41); letter-spacing: -.01em;
}
.hjn-textbtn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
  border-radius: 10px; color: var(--juno-green-dark, #1F6B33);
  font: 600 .86rem/1 var(--font-display, 'Outfit', system-ui, sans-serif);
}
.hjn-textbtn svg { width: 17px; height: 17px; }
.hjn-textbtn:hover:not(:disabled) { background: var(--juno-green-tint, #E9F5EC); }
.hjn-textbtn:focus-visible { outline: 3px solid var(--juno-green, #2E8B44); outline-offset: -3px; }
.hjn-textbtn:disabled { color: #5F6B7F; opacity: .6; cursor: default; }

.hjn-panel__body { max-height: min(60vh, 452px); overflow-y: auto; overscroll-behavior: contain; }
.hjn-list { list-style: none; margin: 0; padding: 6px; }
.hjn-item + .hjn-item { margin-top: 2px; }
.hjn-item__main {
  display: grid; grid-template-columns: 38px 1fr 10px; gap: 12px; align-items: start;
  width: 100%; padding: 11px 10px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; text-align: left; font: inherit;
  text-decoration: none !important; cursor: pointer;
  transition: background .15s ease;
}
div.hjn-item__main { cursor: default; }
a.hjn-item__main:hover, button.hjn-item__main:hover { background: var(--sand, #F3EFE6); }
.hjn-item__main:focus-visible { outline: 3px solid var(--juno-green, #2E8B44); outline-offset: -3px; }
.hjn-item.is-unread .hjn-item__main { background: rgba(233, 245, 236, .55); }
.hjn-item.is-unread a.hjn-item__main:hover, .hjn-item.is-unread button.hjn-item__main:hover { background: var(--juno-green-tint, #E9F5EC); }
.hjn-item__icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--juno-green-tint, #E9F5EC); color: var(--juno-green-dark, #1F6B33);
}
.hjn-item__icon svg { width: 19px; height: 19px; }
.hjn-item__text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.hjn-item__title {
  font: 600 .93rem/1.3 var(--font-display, 'Outfit', system-ui, sans-serif); color: var(--ink, #1B2A41);
}
.hjn-item.is-unread .hjn-item__title { font-weight: 700; }
.hjn-item__body {
  font-size: .86rem; line-height: 1.4; color: var(--ink-soft, #4A5568); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hjn-item__time { font-size: .76rem; color: #5F6B7F; margin-top: 2px; }
.hjn-item__dot {
  width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--juno-green, #2E8B44);
  box-shadow: 0 0 0 3px rgba(46, 139, 68, .16);
}

.hjn-panel__state { padding: 30px 24px 32px; text-align: center; color: var(--ink-soft, #4A5568); }
.hjn-panel__state > svg {
  width: 44px; height: 44px; padding: 11px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--juno-green-tint, #E9F5EC); color: var(--juno-green-dark, #1F6B33);
}
.hjn-panel__state p { margin: 0 auto 4px; max-width: 280px; font-size: .9rem; color: var(--ink-soft, #4A5568); }
.hjn-panel__state .hjn-panel__strong { font: 700 1rem/1.3 var(--font-display, 'Outfit', system-ui, sans-serif); color: var(--ink, #1B2A41); }

.hjn-skel { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 11px 10px; }
.hjn-skel span { display: block; border-radius: 10px; background: linear-gradient(90deg, #F3EFE6 0%, #FAF8F3 50%, #F3EFE6 100%); background-size: 300% 100%; animation: hjnShimmer 1.3s ease-in-out infinite; }
.hjn-skel span:first-child { height: 38px; border-radius: 50%; }
.hjn-skel span:last-child { height: 38px; }
@keyframes hjnShimmer { from { background-position: 120% 0; } to { background-position: -20% 0; } }

.hjn-panel__foot {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px;
  border-top: 1px solid var(--line, #E7E4DC); background: var(--cream, #FAF8F3);
  color: var(--juno-green-dark, #1F6B33) !important; text-decoration: none !important;
  font: 600 .9rem/1 var(--font-display, 'Outfit', system-ui, sans-serif);
  transition: background .15s ease;
}
.hjn-panel__foot svg { width: 16px; height: 16px; transition: transform .15s ease; }
.hjn-panel__foot:hover { background: var(--sand, #F3EFE6); }
.hjn-panel__foot:hover svg { transform: translateX(2px); }
.hjn-panel__foot:focus-visible { outline: 3px solid var(--juno-green, #2E8B44); outline-offset: -3px; }

/* Phones: the panel spans the screen under the header (the navbar's
   backdrop-filter makes it the containing block for position:fixed). */
@media (max-width: 560px) {
  .hjn-panel {
    position: fixed; top: 80px; left: 12px; right: 12px; width: auto; max-width: none;
    transform-origin: top center;
  }
  .hjn-panel__body { max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); }
}

/* ---------- the "Turn on booking updates" card ---------------------------- */
.hjn-prompt {
  position: fixed; right: 20px; bottom: 20px; z-index: 250;
  width: 400px; max-width: calc(100vw - 24px);
  display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start;
  padding: 18px 18px 16px;
  background: var(--paper, #fff); color: var(--ink, #1B2A41);
  border: 1px solid var(--line, #E7E4DC); border-radius: 20px;
  box-shadow: 0 4px 8px -2px rgba(27, 42, 65, .08), 0 24px 48px -12px rgba(27, 42, 65, .24);
  opacity: 0; transform: translateY(16px);
  transition: opacity .24s cubic-bezier(.22, .61, .36, 1), transform .24s cubic-bezier(.22, .61, .36, 1);
}
.hjn-prompt.is-in { opacity: 1; transform: none; }
.hjn-prompt__icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--juno-green-tint, #E9F5EC); color: var(--juno-green-dark, #1F6B33);
}
.hjn-prompt__icon svg { width: 23px; height: 23px; }
.hjn-prompt.is-in .hjn-prompt__icon svg { animation: hjnRing .9s .35s ease-in-out 1; transform-origin: 50% 12%; }
.hjn-prompt.is-done .hjn-prompt__icon { background: var(--juno-green-dark, #1F6B33); color: #fff; }
.hjn-prompt.is-done .hjn-prompt__icon svg { animation: none; }
@keyframes hjnRing {
  0%, 100% { transform: rotate(0); } 20% { transform: rotate(12deg); } 40% { transform: rotate(-10deg); }
  60% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); }
}
.hjn-prompt__main { min-width: 0; }
.hjn-prompt__title {
  margin: 2px 0 4px; font: 700 1.05rem/1.25 var(--font-display, 'Outfit', system-ui, sans-serif);
  color: var(--ink, #1B2A41); letter-spacing: -.01em;
}
.hjn-prompt__text { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--ink-soft, #4A5568); }
.hjn-prompt__text a { color: var(--juno-green-dark, #1F6B33); text-decoration: underline; }
.hjn-prompt__msg { margin: 8px 0 0; font-size: .86rem; color: #B93030; }
.hjn-prompt__msg:empty { display: none; }
.hjn-prompt__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hjn-prompt__actions .btn { min-height: 44px; }

@media (max-width: 560px) {
  .hjn-prompt {
    left: 12px; right: 12px; width: auto; bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 16px 14px;
  }
  .hjn-prompt__icon { width: 40px; height: 40px; border-radius: 12px; }
  .hjn-prompt__actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hjn, .hjn-bell, .hjn-prompt, .hjn-panel__foot svg { transition: none; }
  .hjn-panel, .hjn-bell__badge, .hjn-skel span, .hjn-prompt.is-in .hjn-prompt__icon svg { animation: none; }
  .hjn-prompt { transform: none; }
}
@media print { .hjn, .hjn-prompt { display: none !important; } }
