/* Copyright Ayers Electronics Inc. All rights reserved. */
/* the networks page list. */
/* The NETWORKS page at the standard page margin, the Settings page's frame: the page itself never
   scrolls. Its card gives up height to the screen, and what stands under the card's head - the list,
   or a network's sections - scrolls inside the card and ends on the safe line at the foot. */
#serversPage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: var(--page-margin-vertical) var(--page-margin);
}
/* The card at the page's own width rather than the gate's 620px or the desk browser's 860px: its
   groups left where a page reads them, and nothing of it under the preview frame at the right. */
#serversPage .networks-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: none;
  text-align: left;
}
/* The everyday page wears the app's plain look, the Settings page's: no card frame around it. The
   bordered setup card, its wordmark heading and its bird are the first run's step alone
   (css/layout/networks-setup.css). */
body:not(.networks-setup) #serversPage .gate-card {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0;
}
body:not(.networks-setup) #serversPage .setup-mark,
body:not(.networks-setup) #networksHeading {
  display: none;
}
/* What scrolls inside the card: the line, the bar and the list, or a network's sections under its head.
   Its padding holds the rings of the stops at its edges, the margin keeps its words on the card's own
   line, and a revealed row keeps the same room from the top and the foot (js/networks-scroll.js reads
   the scroll padding). */
.networks-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: var(--focus-ring-width);
  margin: 0 calc(-1 * var(--focus-ring-width));
  scroll-padding: var(--focus-ring-width) 0;
}
.networks-heading {
  margin: 0 0 2px;
}
.networks-card .gate-lead {
  text-align: left;
}
.networks-card .networks-title {
  font-size: var(--type-heading);
  color: var(--text);
  margin-bottom: 2px;
}
.networks-bar {
  flex-wrap: wrap;
}
.networks-list {
  display: flex;
  flex-direction: column;
}
.networks-list > * + * {
  margin-top: 6px;
}
.networks-list:empty {
  display: none;
}
.networks-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
}
.networks-row .name {
  font-size: var(--type-body);
  color: var(--text);
  line-height: 1.15;
}
.networks-row .sub {
  font-size: var(--type-label);
  color: var(--muted);
}
.networks-row.current .name::after {
  content: " \00b7\00a0watching now";
  color: var(--muted);
  font-size: var(--type-label);
} /* the escape eats a following space, so a no-break space carries it */
.networks-row.forget {
  padding: 6px 12px;
}
.networks-row.forget .name {
  font-size: var(--type-label);
  color: var(--muted);
}
/* A client with no server of its own: the list's first row is one plain line on a row's plate, and
   the hosting note follows the list. */
.networks-row.networks-none {
  justify-content: center;
  min-height: 74px;
  padding: 8px 14px;
  background: var(--elevated);
  border-radius: var(--radius-card);
  box-sizing: border-box;
  font-size: var(--type-body);
  color: var(--muted);
}
.networks-host-note {
  font-size: var(--type-label);
  color: var(--text);
  margin: 6px 8px 8px;
  line-height: 1.4;
}
.networks-field {
  width: 100%;
  background: var(--elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  font-size: var(--type-body);
}
.networks-actions {
  display: flex;
}
.networks-actions button {
  flex: 1;
}
.networks-hint {
  font-size: var(--type-label);
  color: var(--muted);
  margin: 6px 0 0;
}
.networks-error {
  color: var(--error);
  font-size: var(--type-label);
  min-height: 18px;
  margin: 4px 0 8px;
}
.networks-error:empty {
  display: none;
}
/* The Network Catalog's listing: the logo on the channel logos' canvas at 0.4, the name and the
   host's line, the facts, the one action word at the right; the posture badge on the admin's row. */
/* The one list's row: the Add / Remove button, the small image, the name with one
   line, Learn more - a quiet card, no rule lines, no uppercase, the buttons the bar's own pills. */
.networks-row.market {
  display: grid;
  grid-template-columns: 100px 128px minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 88px;
  padding: 8px 14px;
  background: var(--elevated);
  border-radius: var(--radius-card);
  box-sizing: border-box;
}
/* Each part keeps its own column, so a row with no button (a curated Network only the administrator may
   add) leaves that column empty rather than sliding the picture and the words into it. */
.networks-row.market .row-act,
.networks-row.market .row-art,
.networks-row.market .row-body,
.networks-row.market .row-more {
  grid-row: 1;
}
.networks-row.market .row-act {
  grid-column: 1;
}
.networks-row.market .row-art {
  grid-column: 2;
}
.networks-row.market .row-body {
  grid-column: 3;
}
.networks-row.market .row-more {
  grid-column: 4;
}
.networks-row.market .row-act,
.networks-row.market .row-more {
  font-size: var(--type-label);
  padding: 7px 14px;
}
.networks-row.market .row-act {
  justify-self: start;
  min-width: 96px;
  text-align: center;
}
.networks-row.market .row-act[aria-disabled="true"],
.networks-row.market .row-more[aria-disabled="true"] {
  opacity: 0.45;
}
/* The network's picture fills its slot edge to edge, so the art sits right beside the name. */
.networks-row.market .row-art {
  width: 128px;
  height: 72px;
  border-radius: var(--radius-card);
  background: var(--track);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}
.networks-row.market .row-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.networks-row.market .row-art img.mark {
  width: 48px;
  height: 48px;
}
/* A network with no logo of its own wears the base card: its name in the theme's accent read as words,
   on the tile ground every picture sits on, so it never reads as a lit control. */
.networks-row.market .row-art.base {
  background: var(--track);
  color: var(--accent-text);
  padding: 0 8px;
}
.networks-row.market .row-art.base .row-art-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: var(--type-body);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: break-word;
}
.networks-row.market .row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
}
.networks-row.market .row-body > * + * {
  margin-top: 3px;
}
/* The name wraps to a second line before it is cut. */
.networks-row.market .row-body .name {
  font-size: var(--type-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
}
/* Under the name: the short description, wrapping to a second line before it is cut, then the
   channels it carries on one line. Each line sets its own line height, so a fallback face's metrics
   never change a card's height. */
.networks-row.market .row-body .sub {
  font-size: var(--type-body);
  line-height: 1.35;
  color: var(--muted);
}
/* It holds both lines' room, so a one-line description and a two-line one stand as tall. */
.networks-row.market .row-body .row-description {
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
}
.networks-row.market .row-body .row-count {
  line-height: 1.35;
  min-height: 1.35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* What a network is doing right now: its own chip on the line under the description, drawn only
   where a person has something to do about it. Not answering is the warmer of the two. */
.networks-row.market .row-body .row-state {
  align-self: flex-start;
  font-size: var(--type-micro);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small);
  padding: 1px 6px;
  color: var(--muted);
}
.networks-row.market .row-body .row-state.away {
  color: var(--accent-warm);
  border-color: var(--accent-warm);
}

/* A phone's width: the button, a smaller picture and the words, with Learn more under the words. */
@media (max-width: 767px) {
  .networks-row.market {
    grid-template-columns: 88px 72px minmax(0, 1fr);
    row-gap: 6px;
  }
  .networks-row.market .row-art {
    width: 72px;
    height: 40px;
  }
  .networks-row.market .row-art img.mark {
    width: 32px;
    height: 32px;
  }
  .networks-row.market .row-body .name {
    font-size: var(--type-body);
  }
  .networks-row.market .row-body .sub {
    font-size: var(--type-label);
  }
  .networks-row.market .row-more {
    grid-row: 2;
    grid-column: 3;
    justify-self: start;
  }
}

/* The networks step of a first run: CONTINUE under the list, with the one line that says what it
   does. Every other visit to the page paints an empty foot and this never draws. */
.networks-setup-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 10px;
}
.networks-setup-foot .networks-hint {
  margin: 4px 0 0;
}
