/* =============================================================================
   @elements/style — sidebar

   The 240px left rail used in the dashboard shell. Generic scoped
   children — no `.sidebar-*` compound classes.

     <aside class="sidebar">
       <div class="brand-wrap"><a class="brand is-sm">…</a></div>
       <button class="is-primary">+ New post <kbd>N</kbd></button>
       <nav>
         <div class="label">Feed</div>
         <a class="is-active">Home <span class="count">all</span></a>
         <a>Issues <span class="flag">NEW</span></a>
       </nav>
       <div class="account">
         <div class="avatar">CM</div>
         <div class="info">
           <div class="name">Chris</div>
           <div class="plan">Pro</div>
         </div>
         <button class="chevron">⌃</button>
       </div>
     </aside>
============================================================================= */

.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--rule);
  padding: var(--space-6) var(--space-4) var(--space-5);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  width: 240px;
  flex-shrink: 0;
}

:where(.sidebar > .brand-wrap) {
  margin-bottom: var(--space-7);
  padding: 0 0.625rem;
}

/* Primary action button (new post). Combines with .is-primary skin but
   tightens to the sidebar's narrower density. */
:where(.sidebar > button.is-primary) {
  margin: 0 0.25rem var(--space-5);
  height: auto;
  padding: var(--space-2) 0.75rem;
  font-size: 0.78125rem;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  width: calc(100% - 0.5rem);
}

:where(.sidebar > button.is-primary kbd) {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.02em;
  font-weight: var(--font-regular);
  border: none;
}

:where(.sidebar > nav) {
  flex: 1;
  overflow-y: auto;
}

:where(.sidebar > nav > .label) {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--ink-dim);
  padding: 0 0.625rem;
  margin: var(--space-4) 0 var(--space-1-5);
  font-weight: var(--font-medium);
}
:where(.sidebar > nav > .label:first-child) { margin-top: 0; }

:where(.sidebar > nav > a) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-1-5) 0.625rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  margin-bottom: 1px;
  text-decoration: none;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}
:where(.sidebar > nav > a:hover) {
  background: var(--bg);
  color: var(--ink);
}
:where(.sidebar > nav > a.is-active) {
  background: var(--bg);
  color: var(--ink);
  font-weight: var(--font-medium);
  box-shadow: 0 0 0 1px var(--rule), 0 1px 2px rgba(0, 0, 0, 0.02);
}

:where(.sidebar > nav > a > .count) {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: var(--ink-dim);
  font-weight: var(--font-regular);
}

:where(.sidebar > nav > a > .dot) {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

:where(.sidebar > nav > a > .flag) {
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  background: var(--accent);
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: var(--font-semibold);
}

/* ─── Account footer ─────────────────────────────────────────── */

:where(.sidebar > .account) {
  border-top: 1px solid var(--rule);
  padding-top: 0.875rem;
  margin-top: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--space-2-5);
  padding-left: 0.625rem;
  padding-right: 0.375rem;
}

:where(.sidebar > .account > .avatar) {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a574, #8b5a3c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  font-size: 0.6875rem;
  flex-shrink: 0;
}

:where(.sidebar > .account > .info) {
  font-size: var(--text-xs);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
:where(.sidebar > .account > .info > .name) {
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:where(.sidebar > .account > .info > .plan) {
  font-family: var(--font-sans);
  color: var(--ink-dim);
  font-size: 0.65625rem;
}

:where(.sidebar > .account > button.chevron) {
  color: var(--ink-faint);
  font-size: var(--text-xs);
  padding: var(--space-1) 2px;
  height: auto;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 0;
}
:where(.sidebar > .account > button.chevron:hover) {
  color: var(--ink);
  background: none;
  border: none;
}

/* ─── Pulse (live indicator) ──────────────────────────────────── */

.pulse {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--green);
  border-radius: 50%;
  vertical-align: 1px;
  margin-right: 0.375rem;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
