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

   The 240px left rail used in the dashboard shell.

   Structure:
     <aside class="sidebar">
       <div class="sidebar-brand"><!-- .brand.brand-sm --></div>
       <button class="btn-sidebar-primary">+ New post <kbd>N</kbd></button>
       <nav class="sidebar-nav">
         <div class="sidebar-label">Feed</div>
         <a class="sidebar-link is-active">Home <span class="sidebar-count">all</span></a>
         ...
       </nav>
       <div class="sidebar-account"><!-- avatar + name --></div>
     </aside>

   The active-link card pops off the --bg-soft sidebar onto --bg (white).
============================================================================= */

.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;
}

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

/* ─── New-post button (primary action in the sidebar) ─────────────── */

.sidebar-primary {
  margin: 0 0.25rem var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0.75rem;
  background: var(--ink);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.78125rem;         /* 12.5px */
  font-weight: var(--font-medium);
  cursor: pointer;
  width: calc(100% - 0.5rem);
  transition: opacity var(--duration-fast) var(--ease-out);
}
.sidebar-primary:hover { opacity: 0.9; }

.sidebar-primary .kbd {
  font-family: var(--font-mono);
  font-size: 0.625rem;           /* 10px */
  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);
}

/* ─── Nav list ────────────────────────────────────────────────────── */

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

.sidebar-label {
  font-family: var(--font-mono);
  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);
}
.sidebar-label:first-child { margin-top: 0; }

.sidebar-link {
  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-mono);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  margin-bottom: 1px;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  text-decoration: none;
}
.sidebar-link:hover {
  background: var(--bg);
  color: var(--ink);
}
.sidebar-link.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);
}

.sidebar-count {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-dim);
  font-weight: var(--font-regular);
}

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

.sidebar-flag {
  font-family: var(--font-mono);
  font-size: 0.5625rem;         /* 9px */
  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 ─────────────────────────────────────────────── */

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

.sidebar-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-mono);
  font-weight: var(--font-medium);
  font-size: 0.6875rem;
  flex-shrink: 0;
}

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

.sidebar-chevron {
  color: var(--ink-faint);
  font-size: var(--text-xs);
  padding: var(--space-1) 2px;
  cursor: pointer;
  background: none;
  border: none;
}
.sidebar-chevron:hover { color: var(--ink); }

/* ─── 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; }
}
