/* Стилі стрічки: вкладки, картки, фільтри, сторінки. */
/* Feed: left navigation, the feed, a right panel. One column on phones (sticky tabs, folded filters), two from
   48em (feed + panel), three from 72em (navigation + feed + panel, symmetrical sides around a 640px feed).
   Rows (.feed-item) below are shared with Explore and the landing page. */

.feed-layout { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
.feed-main { min-width: 0; display: grid; gap: var(--s-4); align-content: start; }
.feed-nav { display: none; }
.feed-side { display: grid; gap: var(--s-4); align-content: start; min-width: 0; }
.feed-side .feed-side__filters { display: none; }

/* Phones: the three tabs stick to the top while the feed scrolls. */
.feed-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

/* Labels never break inside a word ("Recommen/ded" at 360px): each tab is at least as wide as its label, they share
   the rest of the row, and a row too long for the screen (long languages) scrolls sideways. */
.feed-tabs { overflow-x: auto; scrollbar-width: none; }
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tabs__list { display: flex; margin: 0; padding: 0; list-style: none; }
.feed-tabs__list li { flex: 1 0 auto; }

.feed-tabs__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding-inline: var(--s-2);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.feed-tabs__link[aria-current="page"] { color: var(--text); } /* the underline is .tab-mark (components.css) */
.feed-tabs__link .tab-mark { bottom: -2px; } /* on the link's 2px bottom border, where the underline always was */

@media (hover: hover) { .feed-tabs__link:hover { color: var(--text); } }

.feed-filters-fold > summary { list-style: none; display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; }
.feed-filters-fold > summary::-webkit-details-marker { display: none; }
.feed-filters-fold[open] > summary .icon { transform: rotate(180deg); }
.feed-filters-fold .feed-filters { margin-top: var(--s-3); padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); }

.feed-filters { display: grid; gap: var(--s-3); min-width: 0; }
.feed-filters .field { margin: 0; min-width: 0; }
.feed-filters__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.feed-side__body, .feed-side__news, .feed-side__tips { padding: var(--s-4); margin: 0; }
.feed-side__news, .feed-side__tips { list-style: none; display: grid; gap: var(--s-3); overflow-wrap: anywhere; }
.feed-side__tips li { color: var(--muted); font-size: var(--fs--1); }
.feed-side__more { margin: 0; padding: 0 var(--s-4) var(--s-4); }

.feed-nav__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }

.feed-nav__link {
  display: flex;
  align-items: center;
  min-height: var(--control-h);
  padding-inline: var(--s-3);
  border-left: 2px solid transparent;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.feed-nav__link[aria-current="page"] { color: var(--text); border-left-color: var(--text); }

@media (hover: hover) { .feed-nav__link:hover { color: var(--text); } }

.feed-nav__rule { height: 1px; margin-block: var(--s-3); background: var(--line); }
.feed-nav__new { width: 100%; margin-top: var(--s-3); }

.feed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }

/* A project card: cover, who, name, proof, the latest update, actions. A frame and a hairline, no shadow. */
.feed-card {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}

.feed-card:focus-visible { outline-offset: 2px; }

.feed-card__cover { display: block; border-bottom: 1px solid var(--line); background: var(--paper); }
.feed-card__cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }

.feed-card__body { display: grid; gap: var(--s-3); padding: var(--s-4); min-width: 0; align-content: start; }

.feed-card__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); }
.feed-card--entry .feed-card__head { grid-template-columns: auto minmax(0, 1fr); }
.feed-card__by { margin: 0; display: grid; min-width: 0; line-height: 1.3; }
/* The name and its badges stay on one line (the badge used to fall onto a row of its own). */
.feed-card__who { display: flex; align-items: center; gap: var(--s-1); min-width: 0; }
.feed-card__owner { font-weight: 500; overflow-wrap: anywhere; }
.feed-card__handle { font-size: var(--fs--1); overflow-wrap: anywhere; }
.feed-card__name { font-size: var(--fs-2); line-height: 1.2; overflow-wrap: anywhere; }
.feed-card__name a { color: inherit; text-decoration: none; }
.feed-card__name a:hover { text-decoration: underline; }
.feed-card__tagline { margin: 0; overflow-wrap: anywhere; }
/* The marks reuse the list-row class, whose column placement belongs to rows: in a card they are one more line. */
.feed-card .plate-row__marks { grid-column: auto; justify-content: flex-start; }

.feed-card__update { display: grid; gap: var(--s-1); padding-left: var(--s-3); border-left: 2px solid var(--line-strong); min-width: 0; }
.feed-card__update .label { margin: 0; color: var(--muted); }
.feed-card__update-text { overflow-wrap: anywhere; font-size: var(--fs--1); }
.feed-card__update .feed-card__update-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.feed-news { min-width: 0; }
.feed-news:focus-visible { outline-offset: 2px; }

@media (min-width: 48em) {
  .feed-layout { grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--s-6); }
  .feed-filters-fold { display: none; }
  .feed-side .feed-side__filters { display: block; }
  .feed-side { position: sticky; top: var(--s-5); align-self: start; }
}

@media (min-width: 72em) {
  /* Equal sides around a 640px feed: the navigation on the left, the panel on the right. */
  .feed-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 37.5rem) minmax(0, 1fr); gap: var(--s-6); }
  /* Both side columns are the same width and sit on the outer edges, so the feed is the centre of the page. */
  .feed-nav { display: block; position: sticky; top: var(--s-5); align-self: start; justify-self: start; width: 100%; max-width: 16rem; }
  .feed-side { justify-self: end; width: 100%; max-width: 16rem; }
  .feed-tabs { display: none; }
}

/* A row here has a cover and a body (the base .plate-row has a third column for marks). */
.feed-item {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--s-3) var(--s-4);
  padding-block: var(--s-5);
}

.feed-item:focus-visible { outline-offset: 2px; }
.feed-item__body { min-width: 0; display: grid; gap: var(--s-1); }
.feed-item__by { margin: 0; font-size: var(--fs--1); overflow-wrap: anywhere; }

.feed-item__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-3);
}

@media (min-width: 48em) {
  .feed-item { gap: var(--s-3) var(--s-5); }
  .project-thumb { width: 7rem; height: 4.5rem; }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
