/* Header quick links as a control panel: one recessed console strip of segmented channels, each with an LED.
   The LED lights red on the current page (aria-current, set in header.php); Live keeps a pulsing red light and
   Ranks stays green. Loads after header-board.css and header-signal-flavor.css and replaces their tile look. */
body.ev-theme .ev-headernav {
  gap: 2px;
  padding: 3px;
  border: 1px solid #252a30;
  border-radius: 12px;
  background: linear-gradient(180deg, #13171b 0%, #0b0e11 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), inset 0 -1px 0 rgba(0,0,0,.65), 0 8px 22px rgba(0,0,0,.32);
}
body.ev-theme .ev-headernav::before { display: none; }

body.ev-theme .ev-header .ev-headernav .ev-headernav__item {
  position: relative;
  gap: 4px;
  min-height: 46px;
  padding: 6px 12px;
  border-radius: 9px;
  color: #a9b0b7;
  background: none;
  box-shadow: none;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
body.ev-theme .ev-headernav__item .ev-icon { width: 19px; height: 19px; }
body.ev-theme .ev-headernav__label { font-size: 9.5px; font-weight: 750; letter-spacing: .07em; }

/* Channel separators. */
body.ev-theme .ev-header .ev-headernav .ev-headernav__item + .ev-headernav__item { box-shadow: -1px 0 0 #1b2025; }

/* LED indicator (replaces the old ::before slash/arrow decorations and the ::after underline). */
body.ev-theme .ev-headernav__item::after { display: none; }
body.ev-theme .ev-header .ev-headernav .ev-headernav__item::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 7px;
  left: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #262c33;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.45);
  opacity: 1;
  filter: none;
  font-size: 0;
}
body.ev-theme .ev-header .ev-headernav .ev-headernav__item--signal::before {
  background: #e12635;
  box-shadow: 0 0 7px rgba(225,38,53,.85);
  animation: ev-control-led 1.8s ease-in-out infinite;
}
body.ev-theme .ev-header .ev-headernav .ev-headernav__item--charts::before { background: #1f8f66; }

body.ev-theme .ev-header .ev-headernav .ev-headernav__item:hover,
body.ev-theme .ev-header .ev-headernav .ev-headernav__item:focus-visible {
  color: #fff;
  background: rgba(255,255,255,.045);
  text-decoration: none;
}
body.ev-theme .ev-header .ev-headernav .ev-headernav__item[aria-current="page"] {
  color: #fff;
  background: linear-gradient(180deg, #1e242a 0%, #161b20 100%);
  box-shadow: inset 0 0 0 1px #343b44, inset 0 1px 0 rgba(255,255,255,.05);
}
body.ev-theme .ev-header .ev-headernav .ev-headernav__item[aria-current="page"]::before {
  background: #ff3344;
  box-shadow: 0 0 9px rgba(255,51,68,.95);
}
body.ev-theme .ev-header .ev-headernav .ev-headernav__item--charts[aria-current="page"]::before {
  background: #34d399;
  box-shadow: 0 0 9px rgba(52,211,153,.9);
}
body.ev-theme .ev-headernav__item--signal,
body.ev-theme .ev-headernav__item--signal:hover { color: #ff5361; }
body.ev-theme .ev-headernav__item--charts .ev-icon { color: #34d399; }

@keyframes ev-control-led { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  body.ev-theme .ev-header .ev-headernav .ev-headernav__item--signal::before { animation: none; }
}

/* Under the search (the stacked header): a full-width console with icon and label side by side. */
@media (max-width: 1360px) {
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav { padding: 3px; gap: 2px; }
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav .ev-headernav__item {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 10px;
  }
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav .ev-headernav__label { font-size: 10.5px; }
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav .ev-headernav__item::before { top: 50%; right: auto; left: 8px; margin-top: -2.5px; }
}
/* Phones: icon-only channels, LED on top. */
@media (max-width: 700px) {
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav .ev-headernav__item { min-height: 42px; padding: 0 2px; gap: 0; }
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav .ev-headernav__item::before { top: 5px; left: 50%; margin: 0 0 0 -2.5px; }
}

/* The header Upload button duplicates the rail's Upload (>=1024px) and the bottom bar's (<1024px). */
body.ev-theme .ev-header .ev-btn--upload { display: none !important; }

/* Signed in (Following + bell + avatar) or out (Sign in + Join EV), one header row runs past the viewport just
   above 1200px: keep the stacked header (header-board.css <=1200px rules) up to 1360px for everyone. */
@media (min-width: 1201px) and (max-width: 1360px) {
  body.ev-theme .ev-header__bar--app { flex-wrap: wrap; gap: 8px; padding-block: 8px; }
  body.ev-theme .ev-header__actions { display: contents; }
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav {
    order: 3; flex: 0 0 100%; width: 100%; min-width: 0; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); justify-content: stretch; overflow: visible;
  }
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav .ev-headernav__item { display: flex; width: 100%; min-width: 0; }
  body.ev-theme .ev-header .ev-header__bar--app .ev-headernav .ev-headernav__label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
body.ev-theme .ev-search--header { min-width: 0; }

/* Keep the header pinned. header-signal-flavor.css set .ev-header { position: relative } (Oct 4), which unpinned
   it while the profile tabs, rails and other sticky panels still left a header-sized gap above themselves.
   --ev-sticky-top is the header's real height, measured by the script after the header in header.php (it varies:
   the quick links wrap under the search below 1360px). --ev-header-h stays the bar's design height. */
body.ev-theme .ev-header { position: sticky; top: 0; z-index: 100; }
body.ev-theme .ev-subnav,
body.ev-theme .ev-chips,
body.ev-theme .ev-editor__toolbar { top: var(--ev-sticky-top, var(--ev-header-h)); }
body.ev-theme .ev-profile__side { top: calc(var(--ev-sticky-top, var(--ev-header-h)) + 64px); }
body.ev-theme .ev-editor__side { top: calc(var(--ev-sticky-top, var(--ev-header-h)) + 24px); }
body.ev-theme .ev-signal-rail,
body.ev-theme .ev-home__aside { top: calc(var(--ev-sticky-top, var(--ev-header-h)) + var(--s4)); }
body.ev-theme .ev-info__toc { top: calc(var(--ev-sticky-top, var(--ev-header-h)) + var(--s5)); }
@media (min-width: 1024px) {
  body.ev-theme .ev-rail { top: var(--ev-sticky-top, var(--ev-header-h)); height: calc(100vh - var(--ev-sticky-top, var(--ev-header-h))); }
  body.ev-theme .ev-with-rail .ev-funnel-rail { top: calc(var(--ev-sticky-top, var(--ev-header-h)) + var(--s4)); max-height: calc(100vh - var(--ev-sticky-top, var(--ev-header-h)) - var(--s5)); }
}

/* Profile sidebar Signal list scrolls vertically only; a wide child must never add a sideways scrollbar. */
body.ev-theme .ev-profile__side .ev-signal__list { overflow-x: hidden; grid-template-columns: minmax(0, 1fr); }
body.ev-theme .ev-profile__side .ev-signal__list > .ev-sig { min-width: 0; }

/* Profile page balance. The main column is a 2-up grid (>=680px) where only the story and contact blocks were
   half width, but full-width sections sat between them, so each ended up alone beside an empty half. */
@media (min-width: 680px) {
  body.ev-theme .ev-profile__main > #ev-about,
  body.ev-theme .ev-profile__main > #ev-contact { grid-column: 1 / -1; }
}
/* Story: a readable text column with the professional footprint as its sidebar. */
body.ev-theme .ev-profile__main > #ev-about .ev-prose { max-width: 72ch; }
@media (min-width: 1000px) {
  body.ev-theme .ev-profile__main > #ev-about:has(> .ev-footprint) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    column-gap: 32px;
    align-items: start;
  }
  body.ev-theme .ev-profile__main > #ev-about > h2 { grid-column: 1 / -1; }
  body.ev-theme .ev-profile__main > #ev-about > .ev-prose { grid-column: 1; }
  body.ev-theme .ev-profile__main > #ev-about > .ev-footprint { grid-column: 2; grid-row: 2; margin-top: 0; }
}
/* Contact: one compact row of link chips. */
body.ev-theme .ev-profile__main > #ev-contact .ev-links { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; }
/* The banner already shows the latest release wherever it is visible (>=1100px, see ev.css), so don't repeat it. */
@media (min-width: 1100px) {
  body.ev-theme .ev-profile:has(.ev-profile__spotlight) .ev-profile__main > #ev-featured-release { display: none; }
}
/* WPCode #158046's "Media / Videos" library repeats the profile's own Videos section (and its thumbnails can fail). */
body.ev-theme:has(.ev-profile__main > #ev-videos) #ev-profile-videos { display: none; }

/* A profile with nothing in its sidebar yet (no Signal posts, e.g. a new claim profile) uses the full width. */
body.ev-theme .ev-profile__grid:not(:has(> .ev-profile__side *)) { grid-template-columns: minmax(0, 1fr); }
body.ev-theme .ev-profile__side:not(:has(*)) { display: none; }
