/* =====================================================================
   nav-menu.css — P1 Portal accordion jump menu
   =====================================================================
   Replaces scattered "Back to Parent HQ" / "Back to Coach HQ" pills with
   one shared role-aware accordion. Loaded by every portal page; the
   matching nav-menu.js injects the DOM, computes role, and renders the
   correct list.

   Visual contract:
     • Collapsed: pill-shaped trigger button. Gold-ringed dark, fits in
       the top-left of every page (where back-link pills used to live).
     • Expanded: dropdown panel of dark cards listing the user's
       accessible destinations. Current page is highlighted in gold.

   Scoped under .p1-nav so nothing leaks into other components.
   ===================================================================== */

/* Pre-emptively hide legacy back-link / hero-actions markup before
   nav-menu.js runs to strip them out. This kills the brief "Back to
   Parent HQ" / "Back to Coach HQ" flash Jeremy was seeing during page
   transitions. This rule only applies on pages that load nav-menu.css
   (i.e. pages that already participate in the accordion contract);
   auth/marketing pages don't load this stylesheet so their back-links
   remain visible. */
a.back-link,
[data-p1-parent-hop],
.hero-actions{ display:none !important; }

.p1-nav {
  position: relative;
  /* Flex row: Menu trigger left, home icon pinned to the right-hand
     corner (QA 2026-07-03 — every page header carries a home icon). */
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 18px;
  z-index: 90;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

/* Home icon — right-hand corner, same visual weight as the trigger pill */
.p1-nav-home {
  flex: none;
  width: 44px; height: 44px;
  margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 162, 39, 0.42);
  color: #e7c45d;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, border-color .18s ease, transform .14s ease;
  margin-top: max(0px, env(safe-area-inset-top));
}
.p1-nav-home svg { width: 20px; height: 20px; display: block; }
.p1-nav-home:hover,
.p1-nav-home:focus-visible {
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(231, 196, 93, 0.7);
  outline: none;
  transform: translateY(-1px);
}
.p1-nav-home:active { transform: scale(.95); }

/* Trigger: same visual weight as the old back-link pills */
.p1-nav-trigger {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px;
  min-width: 44px;
  padding: 0 18px 0 14px;
  -webkit-tap-highlight-color: transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 162, 39, 0.42);
  color: #fff;
  font-family: inherit;
  font-size: 13px; font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
  margin-top: max(0px, env(safe-area-inset-top));
}
.p1-nav-trigger:hover,
.p1-nav-trigger:focus-visible {
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(231, 196, 93, 0.7);
  color: #fff;
  outline: none;
}
.p1-nav-trigger-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  color: #e7c45d;
}
.p1-nav-trigger-icon svg { width: 100%; height: 100%; }
.p1-nav-trigger-chev {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  margin-left: 2px;
  color: #e7c45d;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.p1-nav.is-open .p1-nav-trigger-chev { transform: rotate(180deg); }
.p1-nav.is-open .p1-nav-trigger {
  background: rgba(201, 162, 39, 0.16);
  border-color: rgba(231, 196, 93, 0.7);
}

/* Panel — accordion drawer */
.p1-nav-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  max-width: min(360px, 92vw);
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0c0c0c 100%);
  border: 1.5px solid rgba(201, 162, 39, 0.42);
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.18),
    0 18px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
  z-index: 100;
}
.p1-nav.is-open .p1-nav-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Section group inside the panel (Parent / Coach) */
.p1-nav-section {
  display: block;
  padding: 6px 6px 10px;
}
.p1-nav-section + .p1-nav-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4px;
  padding-top: 10px;
}
.p1-nav-section-label {
  display: block;
  padding: 4px 8px 8px;
  font-size: 9.5px; font-weight: 900;
  letter-spacing: .22em; text-transform: uppercase;
  color: #e7c45d;
}

/* List items */
.p1-nav-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.p1-nav-list a {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #f5f5f5;
  text-decoration: none;
  font-size: 14px; font-weight: 700;
  letter-spacing: .005em;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.p1-nav-list a:hover,
.p1-nav-list a:focus-visible {
  background: rgba(201, 162, 39, 0.10);
  color: #fff;
  outline: none;
}
.p1-nav-list a.is-current {
  background: linear-gradient(180deg, rgba(231, 196, 93, 0.18) 0%, rgba(201, 162, 39, 0.08) 100%);
  color: var(--gold-soft, #e7c45d);
  border: 1px solid rgba(231, 196, 93, 0.45);
  padding: 9px 11px; /* compensate for the 1px border so heights align */
  min-height: 44px; /* preserve tap target after the border compensation */
}
.p1-nav-list a.is-current::after {
  content: "•";
  margin-left: auto;
  color: #e7c45d;
  font-weight: 900;
}
.p1-nav-list .p1-nav-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(201, 162, 39, 0.14);
  color: #e7c45d;
  font-size: 11px; font-weight: 900;
  flex: 0 0 auto;
}
.p1-nav-list a.is-current .p1-nav-num {
  background: #e7c45d;
  color: #0a0a0a;
}

/* Backdrop scrim (mobile clarity, optional) */
.p1-nav-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 80;
}
.p1-nav.is-open + .p1-nav-scrim,
.p1-nav.is-open ~ .p1-nav-scrim {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: full-width drawer instead of dropdown */
@media (max-width: 560px) {
  .p1-nav-panel {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top));
    left: 12px; right: 12px;
    min-width: 0;
    max-width: none;
  }
}

/* Paper look (Nov 8): outside Pop Warner the menu pill, home button and the
   dropdown are white on cream with dark text and gold accents. */
body:not(.pw-theme):not(.keep-dark) .p1-nav-home { background: #fff; border-color: #e6e1d6; color: #8a6a00; }
body:not(.pw-theme):not(.keep-dark) .p1-nav-trigger { background: #fff !important; border-color: #e6e1d6 !important; color: #141414 !important; }
body:not(.pw-theme):not(.keep-dark) .p1-nav-trigger * { color: inherit; }
body:not(.pw-theme):not(.keep-dark) .p1-nav-panel { background: #fff !important; border: 1px solid #e6e1d6 !important; box-shadow: 0 12px 34px rgba(20,20,20,.16) !important; }
body:not(.pw-theme):not(.keep-dark) .p1-nav-panel a, body:not(.pw-theme):not(.keep-dark) .p1-nav-panel button { color: #141414 !important; }
body:not(.pw-theme):not(.keep-dark) .p1-nav-panel a:hover, body:not(.pw-theme):not(.keep-dark) .p1-nav-panel a:focus-visible { background: #fbf3d6 !important; }
body:not(.pw-theme):not(.keep-dark) .p1-nav-section-label { color: #8a6a00 !important; }
body:not(.pw-theme):not(.keep-dark) .p1-nav-list a, body:not(.pw-theme):not(.keep-dark) .p1-nav-list button { color: #141414 !important; }
body:not(.pw-theme):not(.keep-dark) .p1-nav-list a.is-current { color: #8a6a00 !important; }
