/* ============================================================
   Vaxa Idea Flow, 2.0 Idea Listing
   Visual spec: docs/frontend-build-brief.md section 3D, Figma file
   DOpr9xrC1IHjShxiuDxVKr, page Components: List frame 238:5511, List
   row set 238:5310, List section divider set 238:5768, Add idea
   trigger set 265:1278. Extracted 2026-09-17.
   Behaviour: R-2.0-1 to R-2.0-15, R-PRI-1 to R-PRI-6 in
   docs/functionality-v3.md (amended 2026-09-17, see that file).

   Every value below is cited to its source, per CLAUDE.md. Tokens new
   to this step live in css/tokens.css's "section 3D" block, added
   alongside the existing type tokens.
   ============================================================ */

/* ---------- Header / nav (FLOW / LIST / LOGOUT) ----------
   Node 238:5516 "FlowNav". Written as a standalone, parameterised
   function (js/list.js renderHeader) shared by both real views
   (session 2 step 7) and the sibling test pages. */
.app-header {
  box-sizing: border-box;
  width: 100%;
  /* Own width, step 7 fixes (Cam, 2026-09-17): matches the Figma List
     frame width, --app-header-width (1100px), no longer tied to
     --list-page-width (900px), which the list content column keeps on
     its own. Side padding --space-xl (32px, Figma FlowNav); vertical
     padding stays --space-lg (238:5516, py-24). */
  max-width: var(--app-header-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Figma's FlowNav has no mobile variant; this wrap is a defensive
     minimum (not a design value) so the header still fits rather than
     clipping on a real phone, since R-1.0-32 makes 2.0 the mandatory
     landing route below 768px. */
  flex-wrap: wrap;
  row-gap: var(--space-sm);
}

.app-header-wordmark {
  display: flex;
  align-items: center;
  gap: 12px; /* 238:5518, literal in Figma */
}

/* R-1.0-24, built session 2 step 7 (both views, one shared header):
   a slow, continuous breathing fade, not a blink. pulse_seconds
   (Constants table, functionality-v3.md; 1.8s as of Cam's decision,
   step 7 fixes round 2, amended 2026-09-18, was 2.5s) is the only
   value the rule gives; it doesn't name a dim level, so 40% is Cam's
   decision, recorded here and in the brief. */
@keyframes app-header-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.app-header-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-brand-accnet-B); /* 238:5519, corrected from raw #57cda8 */
  animation: app-header-dot-pulse 1.8s ease-in-out infinite; /* pulse_seconds, Constants table, amended 2026-09-18 */
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .app-header-dot {
    animation: none;
    opacity: 1; /* "dot stays at full opacity" */
  }
}

.app-header-title {
  font-family: var(--type-nav-label-family);
  font-size: var(--type-nav-label-size);
  font-weight: var(--type-nav-label-weight);
  letter-spacing: var(--type-nav-label-tracking);
  text-transform: uppercase;
  color: var(--color-text-warm); /* 238:5521, corrected from raw #f5f2ed */
  white-space: nowrap;
}

.app-header-nav {
  display: flex;
  align-items: center;
  gap: 24px; /* 238:5524, literal in Figma */
}

.app-header-nav-item {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--type-nav-label-family);
  font-size: var(--type-nav-label-size);
  font-weight: var(--type-nav-label-weight);
  letter-spacing: var(--type-nav-label-tracking);
  text-transform: uppercase;
  color: var(--color-text-warm); /* inactive tab colour, e.g. node 67:6585 */
  text-decoration: none;
  transition: color 120ms; /* Cam's decision, step 7 fixes: nav hover, not designed before */
}

.app-header-nav-item[data-active='true'] {
  font-weight: var(--type-nav-label-weight-active); /* active tab is Geist Mono Black, node 49:6562 */
  color: var(--color-brand-accnet-B); /* active tab colour */
  cursor: default;
}

/* Cam's decision, step 7 fixes: not designed before. Active tab keeps
   its own colour above, unaffected (":not" excludes it). */
.app-header-nav-item:hover:not([data-active='true']) {
  color: color-mix(in srgb, var(--color-brand-accnet-B) 70%, transparent);
}

.app-header-nav-item:focus-visible {
  outline: 2px solid var(--color-brand-accent); /* 1B, focus ring, all buttons */
  outline-offset: 3px; /* 1B */
}

/* R-1.0-20/21, session 2 step 7: below 768px, 1.0 is never served, so
   its tab has nothing to navigate to. A media query rather than a
   resize listener keeps this in sync with the viewport on its own. */
@media (max-width: 767px) {
  .app-header-nav-item[data-tab='flow'] {
    display: none;
  }
}

/* ---------- Page content column ----------
   Node 238:5607 is 700px in Figma; widened to --list-page-width (900px,
   Cam's decision 2026-09-17) and shared with the header. A page-level side gutter
   (--space-lg, matching the header's own horizontal padding above) is
   added so nothing touches the viewport edge below 700px + gutters;
   Figma's own frame is a fixed 700px canvas and doesn't specify this,
   so it's a translation choice, not a lifted value, flagged as such
   in the end-of-step report. */
.list-page {
  box-sizing: border-box;
  max-width: calc(var(--list-page-width) + 2 * var(--space-lg)); /* content = --list-page-width, gutter --space-lg each side */
  margin: 0 auto;
  /* top: Cam's decision, step 7 fixes (was --space-md/16px) */
  padding: var(--space-lg) var(--space-lg) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl); /* Cam's decision, step 7 fixes round 2 (was --space-lg/24px, round 1's own change from --space-md/16px): top block (Add an idea) to first section */
}

/* Between the priority and everything-else groups. Figma 238:5607 is
   gap-16; raised to --space-xl (32) by Cam 2026-09-17 so the two groups
   scan as separate blocks. */
.list-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* 238:5565 container: heading and count line stacked, gap 0 */
.list-heading-group {
  display: flex;
  flex-direction: column;
}

.list-top-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg); /* Cam's decision, step 7 fixes round 2 (was --space-md/16px, round 1's own change from --space-sm/8px, 263:6019's own gap-8): count line to Add idea trigger */
}

.list-heading {
  margin: 0;
  font-family: var(--type-page-heading-family);
  font-size: var(--type-page-heading-size);
  font-weight: var(--type-page-heading-weight);
  line-height: 1.1; /* 238:5565, 39.6/36 */
  letter-spacing: var(--type-page-heading-tracking);
  color: var(--color-text-warm); /* corrected from raw #f5f2ed */
}

.list-count-line {
  margin: 4px 0 0; /* 238:5566, pt-4 (--space-xs) */
  font-family: var(--type-count-line-family);
  font-size: var(--type-count-line-size);
  font-weight: var(--type-count-line-weight);
  line-height: 1.5; /* 257:5786, 18/12 */
  letter-spacing: var(--type-count-line-tracking);
  text-transform: uppercase;
  color: var(--text-muted); /* group A #a8c4b7, Figma var color/text-muted */
}

/* ---------- Add idea trigger, 265:1278 ---------- */

.list-add-idea-slot {
  min-height: 36px; /* trigger's own rendered height, keeps layout stable across the trigger/bar swap */
}

.list-add-trigger {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm); /* 8px */
  padding: var(--space-sm) var(--space-3) var(--space-sm) var(--space-sm); /* 8/12/8/8 */
  border: none;
  border-radius: var(--radius-md); /* 8px */
  background: transparent;
  cursor: pointer;
  transition: background 120ms; /* matches the capture bar's own tool-hover timing */
}

.list-add-trigger:hover,
.list-add-trigger:focus-visible {
  background: var(--mint-subtle); /* 265:1274 hover fill */
}

.list-add-trigger:focus-visible {
  outline: 2px solid var(--color-brand-accent); /* 1B focus ring */
  outline-offset: 3px;
}

.list-add-trigger-icon {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--text-muted); /* default: group A #a8c4b7 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--type-trigger-label-family);
  font-size: var(--type-trigger-label-size);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: border-color 120ms, color 120ms;
}

.list-add-trigger-label {
  font-family: var(--type-trigger-label-family);
  font-size: var(--type-trigger-label-size);
  font-weight: var(--type-trigger-label-weight);
  color: var(--text-muted);
  transition: color 120ms;
}

.list-add-trigger:hover .list-add-trigger-icon,
.list-add-trigger:focus-visible .list-add-trigger-icon {
  border-color: var(--text-primary); /* hover: group A #e6f4ec */
  color: var(--text-primary);
}

.list-add-trigger:hover .list-add-trigger-label,
.list-add-trigger:focus-visible .list-add-trigger-label {
  color: var(--text-primary);
}

/* Trigger -> CaptureBar swap: "short fade, use the capture bar's
   existing expand timing" (180ms ease-out, css/capture-bar.css
   .capture-expand-wrap). Applies to the capture bar's own outer wrap
   once mounted into the slot. */
@keyframes list-bar-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.list-add-idea-slot .capture-bar-wrap {
  animation: list-bar-fade-in 180ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .list-add-idea-slot .capture-bar-wrap {
    animation: none;
  }
}

/* ---------- Sections ---------- */

.list-section {
  display: flex;
  flex-direction: column;
}

.list-section[hidden] {
  display: none;
}

.list-section-divider {
  box-sizing: border-box;
  min-height: 32px; /* 238:5768, literal; min so the larger label (2026-09-17) never clips */
  display: flex;
  align-items: center;
  padding: var(--space-sm); /* 8px */
  border-bottom: 1px solid var(--border-default);
}

.list-section-divider-label {
  margin: 0;
  font-family: var(--type-divider-label-family);
  font-weight: var(--type-divider-label-weight);
  font-size: var(--type-divider-label-size);
  line-height: 1.4; /* 14/10 */
  letter-spacing: var(--type-divider-label-tracking);
  text-transform: uppercase;
}

.list-section-divider-label[data-priority='true'] {
  color: var(--color-brand-accnet-B); /* 134:712 */
}

.list-section-divider-label[data-priority='false'] {
  color: var(--text-muted); /* 238:5771, group A #a8c4b7 */
}

/* R-2.0-3/"Priority group side line": a 1px accent line down the left
   edge of the priority rows only, not the divider, via box-shadow
   (never a border) so rows in both sections stay aligned. Literal CSS
   given directly by this step's brief. */
.list-section-rows[data-priority='true'] {
  box-shadow: inset 1px 0 0 var(--color-brand-accnet-B);
}

/* ---------- Row, 238:5310 ---------- */

.list-row {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md); /* 16px, both default and hover states */
  padding: var(--space-3) var(--space-lg); /* 12px vertical, 24px horizontal */
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
  background: transparent;
  transition: background 1400ms ease-out; /* R-2.0-11 flash decay; also covers the plain hover fill */
}

.list-row:hover {
  background: var(--mint-subtle);
}

.list-row:focus-visible {
  outline: 2px solid var(--color-brand-accent); /* 1B focus ring */
  outline-offset: -2px; /* inset, so it doesn't clip against the row above/below */
}

/* R-2.0-11: flash tint on insert or a star-triggered move. Class added
   with no transition (instant), removed a frame later so the 1400ms
   rule above eases it back to whatever the row's resolved background
   now is, transparent or the hover fill if the pointer is on it. */
.list-row.is-flash {
  transition: none;
  background: color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

.list-row-star {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: inline-flex;
}

.list-row-star svg {
  width: 100%;
  height: 100%;
}

/* Same three-variant treatment as the floating card's star
   (css/floating-card.css) and the capture bar's (css/capture-bar.css):
   same component, node 132:1223, same colours. */
.list-row-star-outline {
  fill: var(--color-text-muted); /* default */
  transition: fill 120ms;
}

.list-row-star-fill {
  fill: var(--color-brand-accnet-B); /* selected */
  opacity: 0;
  transition: opacity 120ms;
}

.list-row-star:hover .list-row-star-outline {
  fill: var(--color-brand-accnet-B); /* hover */
}

.list-row[data-priority='true'] .list-row-star-fill {
  opacity: 1;
}

.list-row[data-priority='true'] .list-row-star-outline {
  fill: var(--color-brand-accnet-B);
}

.list-row-title {
  flex: 1 1 0%;
  min-width: 0;
  margin: 0;
  font-family: var(--type-list-row-title-family);
  font-size: var(--type-list-row-title-size);
  font-weight: var(--type-list-row-title-weight);
  line-height: 24px; /* Cam's decision, step 7 fixes (was 20px, 238:5464's own 20/14) */
  color: var(--text-primary); /* Figma var color/text-primary, group A #e6f4ec */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row-seedetails {
  flex-shrink: 0;
  font-family: var(--type-list-meta-family);
  font-size: var(--type-list-meta-size);
  font-weight: var(--type-list-meta-weight);
  line-height: 17px; /* 17/12 */
  color: var(--text-muted); /* group A #a8c4b7 */
  text-decoration: underline;
  white-space: nowrap;
  visibility: hidden; /* space always reserved, per Figma's own placeholder-box technique */
}

.list-row:hover .list-row-seedetails,
.list-row:focus-within .list-row-seedetails {
  visibility: visible;
}

.list-row-author,
.list-row-date {
  flex-shrink: 0;
  font-family: var(--type-list-meta-family);
  font-size: var(--type-list-meta-size);
  font-weight: var(--type-list-meta-weight);
  line-height: 17px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* R-2.0-14: below 768px, date and "See details" drop; star, title,
   author stay. */
@media (max-width: 767px) {
  .list-row-date,
  .list-row-seedetails {
    display: none;
  }
}
