/*
 * sidebar.css — left navigation. Stripe / Vercel-style:
 *   - Tight, uppercase, tracked-out group titles (the "section header"
 *     reads as different from the items below it, not just a heavier
 *     link)
 *   - Items sit on a left rail with a 2px accent strip when active
 *   - Group descriptions live on landing cards, not the sidebar — the
 *     rail stays scannable
 *   - Modest indent ties items to their group visually
 */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
  min-width: 0;
  padding: var(--space-6) 0;
  font-size: var(--text-sm);
}

/* Group header — small uppercase section label. Drop description from
   the sidebar entirely (template still renders the .sidebar-group-
   description span; this rule hides it). */
.sidebar-group-header {
  margin-bottom: var(--space-1_5);
  padding: 0 var(--space-2);
}
.sidebar-group-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}
.sidebar-group-description {
  display: none;
}

/* Items live on a 1px left rail; active items gain a 2px accent strip
   that visually replaces the rail in that slot. */
.sidebar-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid hsl(var(--border));
  margin-left: var(--space-2);
  min-width: 0;
}

.sidebar-item {
  display: block;
  padding: var(--space-1_5) var(--space-3);
  margin-left: -1px;                /* sit on top of the group rail */
  border-left: 2px solid transparent;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
  transition: color 150ms ease, border-color 150ms ease;
  line-height: var(--leading-snug);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}
.sidebar-item:hover {
  color: hsl(var(--foreground));
}
.sidebar-item.is-active {
  color: hsl(var(--foreground));
  font-weight: 500;
  border-left-color: hsl(var(--foreground));
  background: transparent;
}

/* Temporary read marks (js/read-marks.js): a quiet box before each item,
   a per-group count and a clear link. The box sits in the item's padding so
   the rail and the active strip stay where they are. */
.has-read-marks .sidebar-items > li {
  position: relative;
}
.has-read-marks .sidebar-item {
  padding-left: calc(var(--space-3) + 20px);
}
.read-mark {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: calc(var(--space-1_5) + 0.15em);
  left: var(--space-3);
  width: 13px;
  height: 13px;
  margin: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  outline: none;
}
.read-mark:hover {
  border-color: hsl(var(--muted-foreground));
}
.read-mark:checked {
  border-color: hsl(var(--muted-foreground));
  background: hsl(var(--muted-foreground))
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 11px no-repeat;
}
.is-read > .sidebar-item:not(.is-active) {
  color: hsl(var(--muted-foreground) / 0.6);
}
.has-read-marks .sidebar-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.read-count {
  white-space: nowrap;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.75;
}
.read-clear {
  align-self: flex-start;
  margin: 0 var(--space-2);
  padding: 0;
  border: 0;
  background: none;
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  outline: none;
}
.read-clear:hover {
  color: hsl(var(--foreground));
  text-decoration: underline;
}
