/* =====================================================================
   Site top bar: shared by /, /events/ and /social/.
   The markup is built by /assets/site/topbar.js (one source of truth).
   Colours and fonts come from the brand tokens each page defines on
   :root (--surface, --ink, --sage, --coral, --coral-hover, --coral-deep,
   --sans). --topbar-h is also read by the home page to push its fixed
   rail and mobile progress/counter below the bar.
   ===================================================================== */
:root{ --topbar-h:64px; }
@media (max-width:560px){ :root{ --topbar-h:56px; } }

/* in-page anchors and scrollIntoView() land just below the fixed bar */
html{ scroll-padding-top:var(--topbar-h); }

.topbar{
  position:fixed; top:0; left:0; right:0; z-index:100;
  height:var(--topbar-h);
  display:flex; align-items:center; gap:.75rem;
  padding:0 1.4rem;               /* lines the logo up with the home page's left rail */
  /* Opaque on purpose: a see-through bar let dark content scrolling underneath (the dark
     schedule panel) pull the Warm Stone links below 4.5:1. On solid Soft Paper every bar
     colour sits on one fixed background (Warm Stone links 4.88:1). */
  background:var(--surface,#FCFAF5);
  border-bottom:1px solid var(--line,rgba(58,46,51,.14));
  font-family:var(--sans);
}

/* Skip link: off-screen until it receives keyboard focus */
.topbar-skip{
  position:absolute; left:.6rem; top:.6rem; z-index:2;
  padding:.6rem 1rem; border-radius:8px;
  background:var(--ink); color:var(--surface);
  font-size:.85rem; font-weight:600; line-height:1.2; text-decoration:none;
  transform:translateY(-200%);
}
.topbar-skip:focus{ transform:none; }

/* Brand: the full-colour logo, pushed left; everything else sits right */
.topbar-brand{ flex:none; display:flex; align-items:center; margin-right:auto; border-radius:6px; }
.topbar-brand img{ display:block; height:calc(var(--topbar-h) - 14px); width:auto; }

/* Page links: full bar height so the tap target is tall */
.topbar-nav ul{ list-style:none; margin:0; padding:0; display:flex; }
.topbar-nav a{
  position:relative; display:flex; align-items:center;
  height:var(--topbar-h); padding:0 .9rem;
  font-size:.74rem; font-weight:600; line-height:1; letter-spacing:.1em; text-transform:uppercase;
  color:var(--sage); text-decoration:none;
  transition:color .2s;
}
.topbar-nav a:hover{ color:var(--ink); }
.topbar-nav a[aria-current="page"]{ color:var(--ink); }
.topbar-nav a[aria-current="page"]::after{    /* terracotta underline marks the current page */
  content:""; position:absolute; left:.9rem; right:.9rem;
  bottom:calc(var(--topbar-h) / 2 - 16px); height:2px; border-radius:2px;
  background:var(--coral);
}

/* Call Stephanie: same terracotta as the site's primary buttons */
.topbar-call{
  flex:none; display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  height:40px; padding:0 1.15rem; margin-left:.35rem; border-radius:999px;
  background:var(--coral-hover); color:#fff; text-decoration:none;
  font-size:.82rem; font-weight:600; line-height:1; white-space:nowrap;
  transition:background-color .2s;
}
.topbar-call:hover{ background:var(--coral-deep); }
.topbar-call svg{ width:16px; height:16px; fill:currentColor; flex:none; }

/* Visible keyboard focus everywhere in the bar */
.topbar a:focus-visible{ outline:2px solid var(--coral); outline-offset:2px; }
.topbar-nav a:focus-visible{ outline-offset:-10px; border-radius:10px; }   /* ring drawn inside the tall link */

/* Phones: smaller logo, compact links, call becomes a round icon button (label kept for screen readers) */
@media (max-width:560px){
  .topbar{ gap:.25rem; padding:0 1rem; }
  .topbar-nav a{ padding:0 .55rem; font-size:.7rem; letter-spacing:.07em; }
  .topbar-nav a[aria-current="page"]::after{ left:.55rem; right:.55rem; }
  .topbar-call{ width:40px; padding:0; margin-left:.25rem; }
  .topbar-call-text{
    position:absolute; width:1px; height:1px; margin:-1px; padding:0; border:0;
    overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
  }
}
@media (max-width:359px){
  .topbar-nav a{ padding:0 .4rem; letter-spacing:.04em; }
  .topbar-nav a[aria-current="page"]::after{ left:.4rem; right:.4rem; }
}

/* Reduced motion: the bar never animates */
@media (prefers-reduced-motion:reduce){
  .topbar, .topbar *{ transition:none !important; animation:none !important; }
}
