/* Group companies, set as a handscroll: four tall paper panels divided by fine
   Stone lines, each with its sector written down the edge like the title slip
   on a scroll. Without companies.js, or under reduced motion, the panels stand
   still as a four panel screen. With it they drift slowly across the full width
   of the page. Each company keeps its own logo (BRAND.md section 9). */
.companies-inner {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 5cqw, 72px);
}
.companies-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 32px;
}
.companies-title { max-width: 14em; color: var(--forest); }

.scroll-toggle { cursor: pointer; }
.scroll-toggle[hidden] { display: none; }

/* Every panel draws its left and top line and the list closes the right and
   bottom, so the lines hold as a lattice however the panels wrap. */
.companies {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  border-right: 1px solid var(--stone);
  border-bottom: 1px solid var(--stone);
}
.company {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr auto auto;
  column-gap: 20px;
  box-sizing: border-box;
  min-height: min(22cqw, 300px);
  padding: clamp(22px, 2cqw, 28px);
  border-left: 1px solid var(--stone);
  border-top: 1px solid var(--stone);
}

/* Logos sit on a shared baseline. Each height is set by eye so the four read
   at the same optical size. */
.company-logo {
  grid-area: 1 / 1;
  height: 44px;
  display: flex;
  align-items: flex-end;
}
.company-logo img { width: auto; height: auto; max-width: 100%; display: block; }
.company-logo .is-transport { max-height: 34px; }
.company-logo .is-cjr { max-height: 40px; }
.company-logo .is-lumen { max-height: 44px; }
.company-logo .is-tessera { max-height: 30px; }

.company-sector {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: start;
  margin: 0;
  writing-mode: vertical-rl;
  line-height: 1;
  color: var(--forest);
}
/* The name stays with the logo at the head of the panel and the description
   rests at the foot, so the names share one line and the paper between is left
   empty. */
.company-name {
  grid-area: 2 / 1;
  margin: 16px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(23px, 1.8cqw, 26px);
  line-height: 1.2;
}
.company-text {
  grid-area: 4 / 1;
  margin: 0;
  max-width: 24em;
  font-size: 16px;
  line-height: 1.5;
  text-wrap: pretty;
}
/* About opens the company's page on this site; the second button opens its own site. */
.company-actions { grid-area: 5 / 1; display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 22px 0 8px; }

/* Moving. The band breaks out of the column to the page edges. The list is laid
   out twice and companies.js moves the track, wrapping it every list width, so
   the loop has no seam. Four panels of 34cqw are wider than the page plus one
   panel, so no company is ever on screen twice. The row can be dragged with a
   mouse or a finger; pan-y leaves vertical page scrolling to the browser. */
.scroll.is-scroll {
  overflow-x: hidden;
  width: 100cqw;
  margin-left: calc(50% - 50cqw);
  touch-action: pan-y;
  cursor: grab;
}
.is-scroll .scroll-track { display: flex; width: max-content; will-change: transform; }
.is-scroll .companies { display: flex; flex: none; border-right: 0; }
.is-scroll .company { flex: none; width: max(280px, 34cqw); min-height: clamp(280px, 20cqw, 300px); }

.is-scroll.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.is-scroll img { -webkit-user-drag: none; }
