/* =========================================================
   MatricCast — shared site navigation
   Loaded by /_resources/_includes/head.php on every page.
   Scoped to .mcsite-* so page stylesheets can't change it,
   and resets the old site-wide nav{} rules where they'd leak in.
   ========================================================= */

.mcsite-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink, #1B2430);
  color: var(--paper, #FAF8F3);
  font: 500 0.9rem/1.2 'Inter', system-ui, sans-serif;
  text-decoration: none;
  border-radius: 2px;
}
.mcsite-skip:focus { top: 12px; }
#mcsite-content { display: block; height: 0; outline: none; }

.mcsite-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(237, 234, 225, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--ledger-line, #D8D3C6);
  font-family: 'Inter', system-ui, sans-serif;
}

/* Undo page-level nav{} rules (sticky, background, border) inside the header. */
.mcsite-header .mcsite-nav,
.mcsite-header .mcsite-subnav {
  position: static;
  top: auto;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  margin: 0;
  padding: 0;
  box-shadow: none;
}
.mcsite-header ul { list-style: none; margin: 0; padding: 0; }
.mcsite-header li { margin: 0; padding: 0; }
.mcsite-header li::before,
.mcsite-header li::marker { content: none; }

.mcsite-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 32px;
}

.mcsite-brand {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}
.mcsite-brand-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink, #1B2430);
  text-decoration: none;
}
.mcsite-crumb {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--muted, #6B6558);
  white-space: nowrap;
}
.mcsite-crumb > span { margin-right: 6px; }
.mcsite-crumb a { color: inherit; text-decoration: none; }
.mcsite-crumb a:hover { color: var(--ink, #1B2430); text-decoration: underline; text-underline-offset: 3px; }

.mcsite-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}
.mcsite-menu a {
  display: inline-block;
  padding: 6px 0;
  color: var(--ink, #1B2430);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  opacity: 0.72;
  border-bottom: 2px solid transparent;
}
.mcsite-menu a:hover { opacity: 1; }
.mcsite-menu a[aria-current] {
  opacity: 1;
  border-bottom-color: var(--brass, #A8834F);
}
.mcsite-menu a.mcsite-cta {
  padding: 9px 18px;
  background: var(--ink, #1B2430);
  color: var(--paper, #FAF8F3);
  opacity: 1;
  border: 0;
  border-radius: 2px;
  font-size: 0.85rem;
}
.mcsite-menu a.mcsite-cta:hover { background: #2A3646; }

.mcsite-header a:focus-visible,
.mcsite-menu-btn:focus-visible {
  outline: 2px solid var(--steel, #3E5A7D);
  outline-offset: 2px;
}

.mcsite-menu-btn {
  display: none;
  padding: 8px 14px;
  border: 1px solid var(--ledger-line, #D8D3C6);
  border-radius: 2px;
  background: var(--paper, #FAF8F3);
  color: var(--ink, #1B2430);
  font: 500 0.88rem/1.2 'Inter', system-ui, sans-serif;
  cursor: pointer;
}
.mcsite-menu-btn[hidden] { display: none !important; }

/* "On this page" row */
.mcsite-subnav { border-top: 1px solid var(--ledger-line, #D8D3C6) !important; }
.mcsite-subnav-inner {
  display: flex;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto !important;
  padding: 0 32px !important;
  overflow-x: auto;
  scrollbar-width: none;
}
.mcsite-subnav-inner::-webkit-scrollbar { display: none; }
.mcsite-subnav a {
  display: inline-block;
  padding: 9px 0;
  color: var(--muted, #6B6558);
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
}
.mcsite-subnav a:hover { color: var(--ink, #1B2430); text-decoration: underline; text-underline-offset: 3px; }

/* Keep jump-link targets clear of the sticky header. */
:target, section[id] { scroll-margin-top: 120px; }

/* Small screens: brand + Menu button; links open as a panel. */
@media (max-width: 860px) {
  .mcsite-nav-inner { padding: 12px 16px; flex-wrap: wrap; }
  .mcsite-subnav-inner { padding: 0 16px !important; }
  .mcsite-js .mcsite-menu-btn { display: inline-block; margin-left: auto; }
  .mcsite-crumb { display: none; }
  .mcsite-js .mcsite-menu { display: none; }
  .mcsite-js.mcsite-open .mcsite-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding-top: 8px;
  }
  .mcsite-js.mcsite-open .mcsite-menu a {
    display: block;
    padding: 12px 2px;
    border-bottom: 1px solid var(--ledger-line, #D8D3C6);
  }
  .mcsite-js.mcsite-open .mcsite-menu a[aria-current] {
    border-bottom-color: var(--ledger-line, #D8D3C6);
    box-shadow: inset 3px 0 0 var(--brass, #A8834F);
    padding-left: 12px;
  }
  .mcsite-js.mcsite-open .mcsite-cta-item { padding-top: 12px; }
  .mcsite-js.mcsite-open .mcsite-menu a.mcsite-cta { text-align: center; border-bottom: 0; }
  /* Without JavaScript, the links simply wrap below the brand. */
  .mcsite-nav:not(.mcsite-js) .mcsite-menu { flex-wrap: wrap; gap: 4px 18px; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
