/* ==================================================================
   BUILD LOG — page-scoped styles
   All classes prefixed `.bl-` so nothing leaks into other pages.
   ================================================================== */

/* ------------------------------------------------------------------
   1. PAGE-LOCAL TOKENS — severity colors and a category palette
   ------------------------------------------------------------------ */
:root {
  --bl-sev-minor:  #6b7280;          /* slate-500 */
  --bl-sev-major:  var(--gold);
  --bl-sev-prod:   #ef4444;          /* red-500 */
  --bl-row-active: rgba(212, 168, 75, 0.08);
  --bl-row-hover:  rgba(255, 255, 255, 0.03);
}

/* ------------------------------------------------------------------
   2. TOOLBAR — filter chips + counts
   ------------------------------------------------------------------ */
.bl-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.bl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.bl-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.bl-chip:hover { border-color: var(--gold-dim); }
.bl-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bl-chip-count {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--text-faint);
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.bl-chip.is-active {
  background: rgba(212, 168, 75, 0.12);
  border-color: var(--gold);
  color: var(--gold-hot);
}
.bl-chip.is-active .bl-chip-count {
  color: var(--gold-hot);
  background: rgba(212, 168, 75, 0.18);
}

.bl-counts {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--text-faint);
  letter-spacing: 0.08em;
  margin: 0;
  align-self: center;
}

/* ------------------------------------------------------------------
   3. TWO-PANE LAYOUT — list (left) + detail (right)
   On mobile the panes stack: list on top, detail below.
   ------------------------------------------------------------------ */
.bl-panes {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: var(--s-5);
  align-items: start;
}

@media (max-width: 900px) {
  .bl-panes {
    grid-template-columns: 1fr;
  }
}

/* ——— List pane ——— */
.bl-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--s-2);
  /* On desktop, sticky so the list stays put as the user reads a long
     detail panel. Top offset accounts for the sticky site header. */
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
@media (max-width: 900px) {
  .bl-list {
    position: static;
    max-height: none;
  }
}

.bl-list-inner {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.bl-row {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: var(--s-3);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.bl-row:hover { background: var(--bl-row-hover); }
.bl-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.bl-row.is-active {
  background: var(--bl-row-active);
  border-color: var(--gold-dim);
}

.bl-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: 4px;
}
.bl-row-date {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--text-faint);
  letter-spacing: 0.05em;
}
.bl-row-title {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.bl-row.is-active .bl-row-title { color: var(--gold); }

.bl-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ——— Category + severity pills (used in row + detail) ——— */
.bl-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bl-sev {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bl-sev::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.bl-sev[data-sev="minor"] { color: var(--bl-sev-minor); border: 1px solid currentColor; }
.bl-sev[data-sev="major"] { color: var(--bl-sev-major); border: 1px solid currentColor; }
.bl-sev[data-sev="production"] { color: var(--bl-sev-prod); border: 1px solid currentColor; }

/* ——— Detail pane ——— */
.bl-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--s-6);
  min-height: 400px;
}

.bl-detail h2 {
  margin: 0 0 var(--s-3);
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1.25;
}

.bl-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
}
.bl-detail-meta .bl-row-date {
  align-self: center;
  letter-spacing: 0.1em;
}

.bl-section {
  margin-bottom: var(--s-5);
}
.bl-section:last-child { margin-bottom: 0; }
.bl-section h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 var(--s-3);
}
.bl-section p {
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 var(--s-3);
  max-width: 70ch;
}
.bl-section p:last-child { margin-bottom: 0; }
.bl-section code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--text);
}

/* The Lesson section is the gold — give it a left rail to draw the eye. */
.bl-section--lesson {
  background: rgba(212, 168, 75, 0.05);
  border-left: 2px solid var(--gold-dim);
  padding: var(--s-4) var(--s-5);
  border-radius: 0 8px 8px 0;
}
.bl-section--lesson p { color: var(--text); }

/* Empty state — shown if there are no entries matching the filter */
.bl-empty {
  padding: var(--s-7);
  text-align: center;
  color: var(--text-muted);
}
.bl-empty p { margin: 0; }

/* ------------------------------------------------------------------
   4. EXPLAINER  (long-form prose under the app)
   ------------------------------------------------------------------ */
.bl-explainer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--s-5) var(--s-6);
  margin-top: var(--s-7);
}
.bl-explainer > * { max-width: 72ch; }
.bl-explainer h2 {
  font-size: 1.5rem;
  margin: 0 0 var(--s-4);
  color: var(--text);
}
.bl-explainer h3 {
  font-size: 1rem;
  margin: var(--s-5) 0 var(--s-2);
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--s-2);
}
.bl-explainer p {
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 var(--s-3);
}
.bl-explainer ul {
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 1.25rem;
}
.bl-explainer li { margin-bottom: var(--s-2); }
.bl-explainer code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--text);
}

/* ------------------------------------------------------------------
   5. REDUCED MOTION
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .bl-chip, .bl-row { transition: none !important; }
}
