/* RBlock Laboratories — research feed page. Builds on site.css tokens.
   Layout: a ranked ledger, like the numbered lines of a proof. Section filters and the
   ranking method sit in a side column; on phones the filters move above the list. */

.feed-hero-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: var(--space-3); font-stretch: 88%; font-size: var(--fs-note); color: #dcdcff; }
.feed-hero-meta b { color: var(--white); font-weight: 640; }

.feed-section { padding: var(--space-4) 0 var(--space-6); }

/* toolbar */
.feed-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 0 0 18px; border-bottom: 3px solid var(--night); }
.feed-sorts { display: flex; border: 2px solid var(--night); }
.feed-sorts button {
  font: inherit; font-size: var(--fs-note); font-weight: 620; color: var(--night); background: transparent;
  border: 0; border-right: 2px solid var(--night); padding: 9px 16px; cursor: pointer;
}
.feed-sorts button:last-of-type { border-right: 0; }
.feed-sorts button[aria-pressed="true"] { background: var(--night); color: var(--white); }
.feed-sorts button:hover:not([aria-pressed="true"]) { background: var(--mist); }
.feed-search { flex: 1 1 260px; min-width: 0; position: relative; }
.feed-search input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--night); background: var(--white);
  border: 2px solid var(--night); padding: 10px 14px 10px 40px; border-radius: 0;
}
.feed-search input::placeholder { color: var(--steel); }
.feed-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--steel); }
.feed-count { font-stretch: 88%; font-size: var(--fs-note); color: var(--steel); white-space: nowrap; }

/* layout */
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 4vw, 56px); align-items: start; }
.feed-side { display: grid; gap: var(--space-4); padding-top: 22px; }
.feed-side h2 { font-size: var(--fs-note); font-stretch: 100%; font-weight: 640; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.4; color: var(--steel); margin-bottom: 10px; }

/* sections */
.feed-sections { list-style: none; padding: 0; display: grid; gap: 2px; }
.feed-sections li { max-width: none; }
.feed-sections button {
  width: 100%; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  font: inherit; font-size: 1rem; text-align: left; color: var(--night); background: transparent; border: 0; padding: 8px 10px; cursor: pointer;
}
.feed-sections button::before { content: ""; width: 10px; height: 10px; background: var(--mist); }
.feed-sections button:hover { background: var(--mist); }
.feed-sections button[aria-pressed="true"] { background: var(--blue); color: var(--white); }
.feed-sections button[aria-pressed="true"]::before { background: var(--white); }
.feed-sections .n { font-stretch: 88%; font-size: var(--fs-note); font-variant-numeric: tabular-nums; opacity: 0.75; }

/* method */
.feed-method p, .feed-method li { font-size: var(--fs-note); color: var(--steel); }
.feed-method ol { padding-left: 20px; margin-top: 10px; display: grid; gap: 6px; }
.feed-method b { color: var(--night); font-weight: 640; }
.feed-method p + p { margin-top: 10px; }
.feed-formula { font-stretch: 88%; font-size: 0.875rem; line-height: 1.6; background: var(--white); border-left: 4px solid var(--blue); padding: 10px 12px; margin: 12px 0; color: var(--night); max-width: none; }

.feed-suggest { background: var(--mist); padding: 18px; }
.feed-suggest p { font-size: var(--fs-note); }
.feed-suggest a { font-weight: 640; }

/* items */
.feed-list { list-style: none; padding: 0; margin: 0; }
.fi { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding: 26px 0; border-bottom: 2px solid var(--mist); max-width: none; scroll-margin-top: 24px; }
.fi--votes { grid-template-columns: 56px 40px minmax(0, 1fr); }
.fi--pinned { box-shadow: inset 4px 0 0 var(--blue); padding-left: 14px; }
.fi--target { background: #ececff; }
.fi-rank { font-stretch: 125%; font-weight: 760; font-size: 1.75rem; line-height: 1; color: var(--steel); text-align: right; padding-top: 4px; font-variant-numeric: tabular-nums; }
.fi:nth-child(-n+3) .fi-rank { color: var(--blue); }
.fi-body { min-width: 0; }
.fi-kicker { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-stretch: 88%; font-size: 0.875rem; color: var(--steel); margin-bottom: 8px; max-width: none; }
.fi-sec { display: inline-flex; align-items: center; gap: 7px; color: var(--night); font-weight: 640; font-stretch: 100%; }
.fi-sec::before { content: ""; width: 10px; height: 10px; background: var(--blue); }
.fi-sec--cc::before, .fi-sec--training::before { background: var(--night); }
.fi-sec--nvidia::before { background: transparent; box-shadow: inset 0 0 0 2px var(--night); }
.fi-sec--case::before { background: var(--steel); }
.fi-sec--tee::before { background: transparent; box-shadow: inset 0 0 0 2px var(--steel); }
.fi-pin { color: var(--blue); font-weight: 640; }
.fi-title { font-size: 1.3125rem; font-stretch: 104%; font-weight: 660; line-height: 1.28; letter-spacing: -0.005em; text-wrap: pretty; max-width: 48ch; }
.fi-title a { text-decoration: none; }
.fi-title a:hover { color: var(--blue); text-decoration: underline; }
.fi-dom { font-size: 0.875rem; font-weight: 500; font-stretch: 88%; color: var(--steel); white-space: nowrap; letter-spacing: 0; }
.fi-by { font-stretch: 88%; font-size: var(--fs-note); color: var(--steel); margin-top: 4px; }
.fi-sum { margin-top: 12px; font-size: 1.0625rem; }
.fi-lim { margin-top: 8px; font-size: 1rem; color: var(--steel); }
.fi-lim strong { color: var(--night); font-weight: 640; }
.fi-acts { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; margin-top: 14px; font-size: var(--fs-note); max-width: none; }
.fi-acts a, .fi-acts button { font: inherit; font-size: var(--fs-note); color: var(--steel); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; text-decoration-color: #b4b9cc; }
.fi-acts a:hover, .fi-acts button:hover { color: var(--night); text-decoration-color: var(--blue); }
.fi-acts .fi-why { display: inline-flex; gap: 10px; align-items: center; }
.fi-score { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--night); font-variant-numeric: tabular-nums; text-decoration: none; }
.fi-score::after { content: ""; width: 8px; height: 8px; background: var(--blue); }

.fi-breakdown { margin-top: 14px; background: var(--white); border: 2px solid var(--mist); padding: 14px 16px; max-width: 560px; }
.fi-breakdown table { width: 100%; border-collapse: collapse; font-size: var(--fs-note); }
.fi-breakdown th { text-align: left; font-weight: 500; color: var(--night); padding: 4px 0; }
.fi-breakdown th span { color: var(--steel); font-stretch: 88%; }
.fi-breakdown td { text-align: right; font-weight: 640; font-variant-numeric: tabular-nums; padding: 4px 0 4px 16px; white-space: nowrap; vertical-align: top; }
.fi-breakdown .meter { display: block; height: 4px; background: var(--mist); margin-top: 4px; }
.fi-breakdown .meter b { display: block; height: 100%; background: var(--blue); }
.fi-breakdown tr.sub th { color: var(--steel); }
.fi-breakdown tr.total th, .fi-breakdown tr.total td { border-top: 2px solid var(--night); padding-top: 8px; font-weight: 700; color: var(--night); }

.fi-vote { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 2px; }
.fi-vote button { width: 34px; height: 28px; display: grid; place-items: center; background: transparent; border: 0; color: var(--steel); cursor: pointer; }
.fi-vote button:hover { background: var(--mist); color: var(--night); }
.fi-vote button.on { color: var(--blue); }
.fi-vote svg { width: 16px; height: 16px; }
.fi-net { font-weight: 700; font-variant-numeric: tabular-nums; }

.fi-empty { padding: 48px 16px; text-align: center; color: var(--steel); border: 2px dashed var(--mist); margin-top: 22px; max-width: none; display: grid; gap: 16px; justify-items: center; }

.feed-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; background: var(--night); color: var(--white); padding: 10px 16px; font-size: var(--fs-note); }

@media (max-width: 1020px) {
  .feed-layout { grid-template-columns: minmax(0, 1fr); }
  .feed-side { display: contents; }
  .feed-side > * { order: 2; }
  .feed-side > .feed-filter { order: -1; padding-top: 22px; }
  .feed-main { order: 0; }
  .feed-sections { display: flex; flex-wrap: wrap; gap: 6px; }
  .feed-sections button { width: auto; grid-template-columns: 10px auto auto; gap: 8px; padding: 6px 10px; border: 2px solid var(--mist); font-size: var(--fs-note); }
  .feed-sections button[aria-pressed="true"] { border-color: var(--blue); }
}
@media (max-width: 640px) {
  .fi, .fi--votes { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
  .fi-rank { font-size: 1.25rem; text-align: left; }
  .fi-vote { grid-column: 1; grid-row: 2; }
  .fi--votes .fi-body { grid-column: 2; grid-row: 1 / span 2; }
  .fi-title { font-size: 1.1875rem; }
  .feed-sorts { width: 100%; }
  .feed-sorts button { flex: 1; }
}

/* site.css sets display on these blocks; keep the hidden attribute authoritative */
.feed-bar[hidden], .feed-filter[hidden], .feed-sorts button[hidden] { display: none; }
