/* Site header shared by every page: logo (home), section links, account.
   The markup is static in each page (so the links are crawlable); the account
   slot and the mobile menu toggle are driven by /js/site-header.js. */

.site-nav {
  --site-nav-bg: #ffffff;
  --site-nav-line: #e5e7eb;
  --site-nav-text: #334155;
  --site-nav-accent: #0f766e;
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 0 24px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.4;
  /* Paint the background edge to edge even on pages whose <body> has side
     padding. Border-image outset doesn't affect layout or cause scrolling. */
  border-image: linear-gradient(var(--site-nav-bg) calc(100% - 1px), var(--site-nav-line) 0) fill 0 / / 0 100vw;
}

/* Pages that pad their body would otherwise leave a gap above the header. */
body:has(> .site-nav) { padding-top: 0; }

/* Home and the hub pages open with a full-width masthead right under it. */
.site-nav:has(+ .site-header) { margin-bottom: 0; }

.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1120px;
  height: 60px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: #0f172a;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.site-nav-brand img { width: 26px; height: 26px; }

.site-nav-links { display: flex; align-items: center; gap: 4px; }
.site-nav-links a {
  position: relative;
  padding: 8px 12px;
  color: var(--site-nav-text);
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}
.site-nav-links a:hover { color: var(--site-nav-accent); background: #f0fdfa; }
.site-nav-links a.active,
.site-nav-links a[aria-current="page"] { color: var(--site-nav-accent); }
.site-nav-links a.active::after,
.site-nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -11px;
  height: 2px;
  border-radius: 2px;
  background: var(--site-nav-accent);
}

.site-nav-account { display: flex; align-items: center; margin-left: 12px; }

.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 4px;
  padding: 0;
  color: #0f172a;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.site-nav-toggle:hover { background: #f1f5f9; }
.site-nav-toggle svg { width: 22px; height: 22px; }

/* ---- Phones: links fold into the menu toggle --------------------------- */

@media (max-width: 720px) {
  .site-nav { margin-bottom: 16px; }
  .site-nav-inner { height: 56px; }
  .site-nav-toggle { display: inline-flex; }
  .site-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 16px 12px;
    border-image: linear-gradient(var(--site-nav-bg) calc(100% - 1px), var(--site-nav-line) 0) fill 0 / / 0 100vw;
    box-shadow: 0 12px 20px -12px rgba(15, 23, 42, 0.25);
  }
  .site-nav.open .site-nav-links { display: flex; }
  .site-nav-links a { padding: 12px; font-size: 1rem; }
  .site-nav-links a.active,
  .site-nav-links a[aria-current="page"] { background: #f0fdfa; }
  .site-nav-links a.active::after,
  .site-nav-links a[aria-current="page"]::after { display: none; }
  .site-nav-account { margin-left: 0; }
}

/* ---- Account slot -------------------------------------------------------- */

.pfb-acct { position: relative; display: flex; align-items: center; }
.pfb-acct-signin {
  padding: 7px 14px;
  color: #ffffff;
  background: var(--site-nav-accent);
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.pfb-acct-signin:hover { background: #0b5c56; }
.pfb-acct-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 3px;
  color: #475569;
  background: none;
  border: 1px solid var(--site-nav-line);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}
.pfb-acct-btn:hover,
.pfb-acct-btn[aria-expanded="true"] { background: #f1f5f9; }
.pfb-acct-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  color: #0b5c56;
  background: #e6f4f1;
  font-size: 0.85rem;
  font-weight: 800;
}
.pfb-acct-caret { font-size: 0.7rem; }
.pfb-acct-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  min-width: 230px;
  padding: 6px;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--site-nav-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
.pfb-acct-menu[hidden] { display: none; }
.pfb-acct-who { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid #eef0f2; }
.pfb-acct-who strong { display: block; color: #0f172a; font-size: 0.9rem; }
.pfb-acct-who span {
  display: block;
  max-width: 240px;
  overflow: hidden;
  color: #6b7280;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pfb-acct-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  color: #1f2937;
  background: none;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.pfb-acct-item:hover,
.pfb-acct-item:focus-visible { color: #0b5c56; background: #f3fbf9; outline: none; }
.pfb-acct-item[aria-current="page"] { color: var(--site-nav-accent); }
.pfb-acct-count {
  margin-left: auto;
  padding: 1px 8px;
  color: #0b5c56;
  background: #e6f4f1;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.pfb-acct-sep { height: 1px; margin: 4px 0; background: #eef0f2; }
