/* ── DEF-008 - Navbar CSS contract (do not casually revert) ─────────────────
   This section encodes three intentional patterns that have reverted before:

   .nav-link--active
     Background: rgba(93, 202, 165, 0.18) + inset 0 -2px 0 teal box-shadow.
     The prior pattern was `background: var(--wp-interactive-bg); border:
     var(--border-emphasis)` - it was wiped by the DEF-001 override block
     (`html:not(.wp-dark) nav a.nav-link--active { background: transparent }`).
     That override has been removed. Do NOT re-add any `background: transparent`
     rule targeting nav a.nav-link--active - it kills the active indicator.

   .nav-dropdown-wrapper (the "Class" athlete nav <details> element)
     Must share every .nav-more selector block so styling is identical to the
     "More" admin dropdown. Any new .nav-more rule must also list
     .nav-dropdown-wrapper. The <details> disclosure triangle is suppressed via
     the ::-webkit-details-marker rule - do not remove that block.

   .nav-more.nav-link--active > summary /
   .nav-dropdown-wrapper.nav-link--active > summary
     Forwards active-state colour, weight, and box-shadow to the <summary>
     trigger when a <details>-based nav item is the active route. Required
     because nav-link--active is set on the <details> element, not on an <a>.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Navigation ── */
nav {
  background: var(--color-surface-nav);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: var(--wp-z-topbar);
}

html:not(.wp-dark) nav {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  /* lint-ignore */
  ;
}

.nav-link {
  color: var(--wp-text-nav-muted);
  text-decoration: none;
  font-size: var(--wp-text-sm);
  transition: color var(--wp-duration-base), background var(--wp-duration-base);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-element);
}

.nav-link:hover {
  color: inherit;
  background: var(--wp-interactive-bg);
}

.nav-link.nav-link--active {
  color: var(--wp-text-nav-active);
  font-weight: var(--wp-weight-medium);
  background: rgba(93, 202, 165, 0.18);
  /* lint-ignore */
  box-shadow: inset 0 -2px 0 var(--color-primary);
  /* lint-ignore */
  border: none;
}

.nav-more,
.nav-dropdown-wrapper {
  display: inline;
  position: relative;
}

.nav-more summary,
.nav-dropdown-wrapper summary {
  color: var(--wp-text-nav-muted);
  cursor: pointer;
  font-size: var(--wp-text-sm);
  list-style: none;
  transition: color var(--wp-duration-base), background var(--wp-duration-base);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-element);
}

.nav-more summary::-webkit-details-marker,
.nav-dropdown-wrapper summary::-webkit-details-marker {
  display: none;
}

.nav-more summary:hover,
.nav-dropdown-wrapper summary:hover {
  color: var(--wp-interactive);
  background: var(--wp-interactive-bg);
}

.nav-more summary:focus-visible,
.nav-dropdown-wrapper summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-inset);
}

.nav-more.nav-link--active>summary,
.nav-dropdown-wrapper.nav-link--active>summary {
  color: var(--wp-text-nav-active);
  font-weight: var(--wp-weight-medium);
  box-shadow: inset 0 -2px 0 var(--color-primary);
  /* lint-ignore */
  ;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--color-surface-nav);
  border: var(--border-default);
  border-radius: var(--radius-container);
  padding: 0.35rem;
  min-width: 180px;
  z-index: var(--wp-z-sticky);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.nav-dropdown a {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-element);
  white-space: nowrap;
}

.nav-dropdown a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--wp-text-nav-active);
}

html:not(.wp-dark) .nav-dropdown {
  background: var(--color-surface-card);
  border-color: var(--border-default);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

html:not(.wp-dark) .nav-dropdown a:hover {
  background: rgba(29, 158, 117, 0.08);
  color: var(--color-primary);
}

.nav-brand {
  color: var(--wp-text-nav-active);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.nav-brand__accent {
  color: var(--accent);
}

.nav-brand-link {
  color: inherit;
  text-decoration: none;
  cursor: default;
}

.nav-brand-link:hover,
.nav-brand-link:focus,
.nav-brand-link:visited {
  color: inherit;
  background: none;
  text-decoration: none;
}

/* ── User pill + dropdown ────────────────────────────────────────── */
.nav-user-menu {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user-pill {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent);
  color: var(--color-surface-page);
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: var(--wp-weight-semibold);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  font-family: inherit;
}

.nav-user-pill:hover {
  opacity: 0.85;
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--color-surface-card);
  border: var(--border-default);
  border-radius: var(--radius-element);
  z-index: var(--wp-z-topbar);
  overflow: hidden;
}

.nav-user-dropdown__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.nav-user-dropdown__item:hover {
  background: var(--color-surface-muted);
}

.nav-user-dropdown__item--logout {
  color: var(--color-danger);
}

.nav-user-dropdown__item--active {
  font-weight: 500;
}

.nav-user-dropdown__divider {
  height: 1px;
  background: var(--wp-border-default);
  margin: 0.25rem 0;
}

.nav-user-dropdown__section-label {
  display: block;
  padding: 0.3rem 1rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--wp-text-nav);
  cursor: pointer;
  font-size: var(--wp-text-xl);
  padding: 0;
  line-height: var(--wp-leading-none);
  transition: color var(--wp-duration-base);
}

.nav-hamburger:hover {
  color: var(--wp-text-nav-active);
}

.nav-hamburger:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-inset);
}

.btn-nav-login {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--wp-text-nav-muted);
  text-decoration: none;
  font-size: var(--wp-text-sm);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-element);
  border: 0.5px solid var(--wp-border-default);
  background: var(--wp-interactive-bg);
  transition: color var(--wp-duration-base), background var(--wp-duration-base);
}

.btn-nav-login:hover {
  color: var(--wp-interactive);
}

@media (max-width: 640px) {
  nav {
    flex-wrap: nowrap;
    gap: var(--gap-md);
  }

  .nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    flex: none;
  }

  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gap-md);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface-nav);
    padding: 1rem 1.5rem;
    border-top: var(--border-default);
    z-index: var(--wp-z-topbar);
  }

  .nav-link.nav-link--active::after {
    display: none;
  }

  .btn-nav-login {
    margin-left: 0;
  }
}

/* ── GFS nav badge ─────────────────────────────────────────────── */
.nav-gfs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-inset);
  background: rgba(255, 255, 255, 0.08);
  color: var(--wp-text-nav-active);
  font-size: 0.78rem;
  font-weight: var(--wp-weight-semibold);
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: var(--wp-leading-none);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-gfs-badge:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--wp-text-nav-active);
}

.nav-gfs-badge:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

html:not(.wp-dark) .nav-gfs-badge {
  background: rgba(29, 158, 117, 0.10);
  color: var(--color-primary-dark);
  border: 0.5px solid rgba(29, 158, 117, 0.20);
}

html:not(.wp-dark) .nav-gfs-badge:hover {
  background: rgba(29, 158, 117, 0.16);
  color: var(--color-primary-dark);
}

.nav-gfs-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-gfs-badge__dot--t7 {
  background: #f59e0b;
}

/* lint-ignore */
.nav-gfs-badge__dot--t6 {
  background: #22c55e;
}

/* lint-ignore */
.nav-gfs-badge__dot--t5 {
  background: #84cc16;
}

/* lint-ignore */
.nav-gfs-badge__dot--t4 {
  background: #eab308;
}

/* lint-ignore */
.nav-gfs-badge__dot--t3 {
  background: #f97316;
}

/* lint-ignore */
.nav-gfs-badge__dot--t2 {
  background: #ef4444;
}

/* lint-ignore */
.nav-gfs-badge__dot--t1 {
  background: #94a3b8;
}

/* lint-ignore */

/* ── Nav pill mode badge ────────────────────────────────────────── */
.nav-pill-mode-badge {
  font-size: 0.68rem;
  font-weight: var(--wp-weight-medium);
  opacity: 0.7;
  margin-left: 0.25em;
}