/* research.html's own parts (phinode.io/research.html). Everything else is the landing's (landing.css) and the system's
   (../ui/tokens.css, ../ui/components.css). The page is one screen: the title and a line, then the list on the home
   page's stage: a glass panel on the waves. */

/* ——— The panel's bar: the languages and the sort ——— */
.rf-bar {
  display:flex;
  align-items:center;
  gap:var(--sp-3);
  padding:var(--sp-4) var(--sp-5);
  border-bottom:1px solid color-mix(in srgb,var(--ln) 70%,transparent);
}
/* a line that scrolls clips what stands out of it: room all round, given back by the margin, so a chosen chip's glow
   (the pill's shadow falls 12 below it, 6 to the sides) and a focus ring show whole */
.rl-line {
  display:flex;
  flex:1 1 auto;
  gap:var(--sp-2);
  min-width:0;
  margin:-6px -10px -16px;
  padding:6px 10px 16px;
  overflow-x:auto;
  scrollbar-width:none;
}
.rl-line::-webkit-scrollbar {
  display:none;
}
.rl-chip {
  flex:none;
}
.rl-chip .rlogo {
  width:16px;
  height:16px;
}
.rl-chip b {
  font-weight:var(--w-semi);
  color:var(--fg);
  font-variant-numeric:tabular-nums;
}
.rl-chip[aria-pressed="true"] b {
  color:inherit;
}
.rl-chip:disabled {
  opacity:.4;
  cursor:default;
}
.rf-sort {
  display:flex;
  flex:none;
  align-items:center;
  gap:var(--sp-3);
  /* no rule between them: the languages fade out before the sort */
  padding-left:var(--sp-3);
}
.rf-sort .lb2 {
  color:var(--mu);
}
.pn-seg .pn-chev {
  width:14px;
  height:14px;
  -webkit-mask-size:14px;
  mask-size:14px;
  background:currentColor;
  transition:rotate var(--dur-state) var(--ease-out);
}
.pn-seg [data-sort]:not([aria-pressed="true"]) .pn-chev {
  display:none;
}
.pn-seg .asc .pn-chev {
  rotate:180deg;
}

/* a language's logo; the ones drawn in black take the text's colour */
.rlogo {
  flex:none;
  width:20px;
  height:20px;
  background:center / contain no-repeat;
}
.rlogo.mono {
  background:var(--fg);
  -webkit-mask:var(--src) center / contain no-repeat;
  mask:var(--src) center / contain no-repeat;
}
/* on a tile: 28 square, a hairline and a faint ground, so a dark logo shows on the dark page */
.rtile {
  display:grid;
  place-items:center;
  flex:none;
  width:28px;
  height:28px;
  border-radius:var(--r-sm);
  background:color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow:inset 0 0 0 1px var(--ln);
}
.rtile .rlogo {
  width:18px;
  height:18px;
}

/* ——— A row: one record. Its logo; its title, and under it the target, the status and the first source; the badge; the date ——— */
.rrows {
  padding:0 var(--sp-5);
}
.rrow {
  border-bottom:1px solid color-mix(in srgb,var(--ln) 65%,transparent);
}
.rrow:last-child {
  border-bottom:0;
}
.rrow-h {
  display:grid;
  grid-template-columns:28px minmax(0,1fr) 88px 96px 16px;
  align-items:center;
  gap:var(--sp-4);
  padding:var(--sp-4) 0;
  cursor:pointer;
}
.rrow-m {
  display:grid;
  gap:2px;
  min-width:0;
}
.rrow-n {
  display:block;
  min-width:0;
  padding:0;
  border:0;
  border-radius:var(--r-xs);
  background:none;
  font:var(--w-semi) var(--fs-md)/20px var(--sans);
  letter-spacing:var(--tr-snug);
  color:color-mix(in srgb,var(--fg) 88%,transparent);
  text-align:left;
  cursor:pointer;
  transition:color var(--dur-hover);
}
.rrow-n > span {
  display:block;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.rrow-n:focus-visible {
  outline:2px solid var(--g1);
  outline-offset:2px;
}
.rrow-h:hover .rrow-n,.rrow.open .rrow-n {
  color:var(--fg);
}
.rrow.open .rrow-n > span {
  white-space:normal;
}
.rrow-sub {
  display:flex;
  align-items:center;
  min-width:0;
  font:var(--w-medium) var(--fs-sm)/16px var(--mono);
  white-space:nowrap;
  color:var(--mu);
}
/* the system's dot between the line's parts, 8 from the words */
.rrow-sub .pn-sep {
  margin-inline:var(--sp-2);
}
.rrow-tg {
  overflow:hidden;
  text-overflow:ellipsis;
}
.rrow-sd {
  display:none;
}
/* the first source: quiet, in the line's words, coral under the pointer; how many more, which the row shows when it opens */
.rrow-src {
  display:inline-flex;
  align-items:center;
  min-width:0;
}
.rrow-lk {
  display:inline-flex;
  align-items:center;
  gap:var(--sp-1);
  min-width:0;
  color:inherit;
  text-decoration:none;
  transition:color var(--dur-hover);
}
.rrow-lk:hover {
  color:var(--gt);
}
.rrow-lk > span {
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.rrow-lk .ar2 {
  flex:none;
  width:12px;
  height:12px;
}
.rrow-more {
  flex:none;
  margin-left:var(--sp-2);
}
.rrow.open .rrow-more {
  display:none;
}
.rrow-h > .pn-badge {
  justify-self:start;
}
.rrow-d {
  font:var(--w-medium) var(--fs-sm)/16px var(--mono);
  text-align:right;
  white-space:nowrap;
  color:var(--mu);
  font-variant-numeric:tabular-nums;
}
.rrow-h > .pn-chev {
  transition:rotate var(--dur-state) var(--ease-out);
}
.rrow.open .rrow-h > .pn-chev {
  rotate:180deg;
}
/* opening: the row unfolds under its title; what happened in the muted reading size, so the title leads */
.rrow-b {
  display:grid;
  grid-template-rows:0fr;
  transition:grid-template-rows var(--dur-state) var(--ease-out);
}
.rrow.open .rrow-b {
  grid-template-rows:1fr;
}
.rrow-i {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:var(--sp-4);
  min-height:0;
  overflow:hidden;
  padding-left:calc(28px + var(--sp-4));
}
.rrow.open .rrow-i {
  padding-bottom:var(--sp-5);
}
.rrow-i p {
  margin:0;
  max-width:68ch;
  font-size:var(--fs-body);
  line-height:var(--lh-text);
  color:var(--mu);
}
.rlinks {
  display:flex;
  flex-wrap:wrap;
  gap:var(--sp-2);
}
/* a new order or language comes in as one: a short rise */
.rrows.swap > .rrow {
  animation:rin .35s var(--ease-out) both;
}
@keyframes rin {
  from { opacity:0; transform:translateY(6px); }
}

/* ——— The panel's foot: what the page must say about its statuses, and the count ——— */
.rf-foot {
  padding-inline:var(--sp-5);
  border-top:1px solid var(--ln);
}
.rf-foot p {
  margin:0;
  font-size:var(--fs-sm);
  color:var(--mu);
}
.rf-range {
  font:var(--w-medium) var(--fs-sm) var(--mono);
  color:var(--mu);
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

/* ——— Narrow: a row stacks; the date joins the line under the title ——— */
@media (max-width:900px) {
  .rrow-h {
    grid-template-columns:28px minmax(0,1fr) 16px;
    grid-template-areas:"t m c" ". b .";
    row-gap:var(--sp-2);
    align-items:start;
  }
  .rrow-h > .rtile { grid-area:t; }
  .rrow-m { grid-area:m; }
  /* the line wraps before the source, which takes a line of its own, so no dot hangs at a line's end */
  .rrow-sub { flex-wrap:wrap; row-gap:2px; }
  .rrow-srcdot { display:none; }
  .rrow-src { flex-basis:100%; }
  .rrow-h > .pn-badge { grid-area:b; }
  .rrow-h > .pn-chev { grid-area:c; margin-top:2px; }
  .rrow-d { display:none; }
  .rrow-sd { display:inline-flex; align-items:center; }
  /* a title over two lines at most, until the row opens */
  .rrow-n > span { display:-webkit-box; white-space:normal; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
  .rrow.open .rrow-n > span { display:block; }
}
@media (max-width:560px) {
  /* one under the other, and no wrapping: a wrapping column makes the languages' line as wide as all of them, so it
     never scrolls and never fades (it ran 1599 wide on a 358 panel) */
  .rf-bar { flex-direction:column; align-items:stretch; padding-inline:var(--sp-4); }
  .rf-sort { padding:0; border:0; }
  .rrows { padding-inline:var(--sp-4); }
  .rf-foot { padding-inline:var(--sp-4); }
  .rrow-i { padding-left:0; }
}
