/*
 * Additions for the network site. The palette, type and layout all come from the
 * shared expeditioner theme; this file only adds the pieces that site never
 * needed: tables, key/value blocks and a two-column policy layout.
 */

.net-intro { max-width: 46rem; }
.net-intro p { color: var(--muted, #8ab0c0); }

.net-sub {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal, #38bfbf);
  margin: 2rem 0 .75rem;
}

.net-table-wrap { overflow-x: auto; }

.net-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
}
.net-table th {
  text-align: left;
  color: var(--muted, #8ab0c0);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .45rem .7rem;
  border-bottom: 1px solid rgba(138, 176, 192, .25);
  white-space: nowrap;
}
.net-table td {
  padding: .6rem .7rem;
  border-bottom: 1px solid rgba(138, 176, 192, .12);
  vertical-align: top;
}
.net-table tr:hover td { background: rgba(56, 191, 191, .05); }

/* Key/value: the header column is a label, not a column heading. */
.net-table--kv { min-width: 0; }
.net-table--kv th {
  border-bottom: 1px solid rgba(138, 176, 192, .12);
  width: 10rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: .9rem;
}

.net-strong { font-weight: 600; }
.net-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88rem;
}

.net-list { padding-left: 1.1rem; color: var(--muted, #8ab0c0); }
.net-list li { margin-bottom: .5rem; }
.net-list strong { color: var(--frost, #ddeef5); }

.net-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.net-note {
  color: var(--dim, #4a7a90);
  font-size: .88rem;
  margin-top: 1rem;
}

.net-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}
.cta--primary {
  background: rgba(79, 201, 138, .16);
  border-color: rgba(79, 201, 138, .45);
}

@media (max-width: 46rem) {
  .net-cols { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------------------------------------------------------------------------
 * The dynamic pages: /peering/, /sessions/, /lg/.
 *
 * They are PHP, not Hugo, but they wrap themselves in the site's real chrome
 * (public/chrome.html), so everything they need is defined here rather than
 * inline in each script.
 * ------------------------------------------------------------------------ */

.pg .pg-sub { color: var(--muted, #8ab0c0); margin-top: -.4rem; }
.pg .wrap { max-width: 64rem; }

.pg .card {
  display: block;
  background: var(--navy2, #162840);
  border: 1px solid rgba(138, 176, 192, .18);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: .7rem 0;
}
.pg a.card:hover { border-color: rgba(79, 201, 138, .45); text-decoration: none; }
.pg .card .sub {
  color: var(--dim, #4a7a90);
  font-size: .85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pg .note {
  border-left: 3px solid var(--teal, #38bfbf);
  background: var(--navy2, #162840);
  padding: 1rem 1.25rem;
  border-radius: 0 4px 4px 0;
  margin: 1rem 0;
  font-size: .93rem;
}
.pg .note.err { border-left-color: var(--red, #e4572e); }
.pg .note.ok  { border-left-color: var(--green, #4fc98a); }

.pg .btn {
  display: inline-block;
  margin-top: 1.1rem;
  padding: .65rem 1.3rem;
  border-radius: 6px;
  background: rgba(79, 201, 138, .16);
  border: 1px solid rgba(79, 201, 138, .45);
  color: var(--green, #4fc98a);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.pg .btn:hover { background: rgba(79, 201, 138, .26); text-decoration: none; }
.pg .btn--danger {
  background: rgba(228, 87, 46, .16);
  border-color: rgba(228, 87, 46, .5);
  color: var(--red, #e4572e);
}
.pg .btn--danger:hover { background: rgba(228, 87, 46, .26); }

.pg .mono, .pg .sub {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .87rem;
}

.pg table { border-collapse: collapse; width: 100%; }
.pg th {
  text-align: left;
  color: var(--muted, #8ab0c0);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .4rem .6rem;
  border-bottom: 1px solid rgba(138, 176, 192, .25);
}
.pg td {
  padding: .55rem .6rem;
  border-bottom: 1px solid rgba(138, 176, 192, .12);
  vertical-align: top;
}
.pg tr:hover td { background: rgba(56, 191, 191, .05); }
.pg h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal, #38bfbf);
  margin: 2rem 0 .6rem;
}
.pg pre {
  background: var(--navy2, #162840);
  border: 1px solid rgba(138, 176, 192, .18);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: .82rem;
  color: var(--muted, #8ab0c0);
}

.pg input[type=text], .pg textarea, .pg select {
  width: 100%;
  padding: .6rem .7rem;
  border-radius: 5px;
  border: 1px solid rgba(138, 176, 192, .3);
  background: #0c1a2c;
  color: var(--frost, #ddeef5);
  font-family: inherit;
  font-size: 1rem;
}
.pg textarea { min-height: 7rem; resize: vertical; }

/* Session state: colour follows how long a session has been down, not merely
 * that it is. A peer that dropped a minute ago is not the same problem as one
 * down a week. */
.pill {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill.ok     { background: rgba(79,201,138,.16); color: var(--green,#4fc98a);  border: 1px solid rgba(79,201,138,.45) }
.pill.notice { background: rgba(240,180,41,.16); color: #f0b429;               border: 1px solid rgba(240,180,41,.45) }
.pill.warn   { background: rgba(239,139,44,.16); color: #ef8b2c;               border: 1px solid rgba(239,139,44,.45) }
.pill.failed { background: rgba(228,87,46,.18);  color: var(--red,#e4572e);    border: 1px solid rgba(228,87,46,.5) }

.pg .num { font-variant-numeric: tabular-nums; text-align: right; color: var(--muted, #8ab0c0); }

/* The session matrix: one row per network, one column per peering point. Adding
 * an exchange adds a column, so the table stays as tall as the peer count. */
.sess-filter { max-width: 26rem; margin: 0 0 1.25rem; }

.pg table.matrix { min-width: 44rem; }
.pg table.matrix th.col-transit,
.pg table.matrix td.cell.transit { background: rgba(56, 191, 191, .05); }
.pg table.matrix td.cell { white-space: nowrap; }
.pg table.matrix td.cell .pill + .pill { margin-left: .25rem; }
.pg table.matrix .absent { color: var(--dim, #4a7a90); }
.pg tr.sessionrow { cursor: pointer; }
.pg tr.sessionrow:hover td { background: rgba(56, 191, 191, .07); }

.pg table.legend {
  width: auto;
  margin-top: 1.5rem;
  font-size: .85rem;
}
.pg table.legend td {
  border: none;
  padding: .2rem .8rem .2rem 0;
  color: var(--dim, #4a7a90);
}

.bigstat-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0 2rem; }
.bigstat {
  background: var(--navy2, #162840);
  border: 1px solid rgba(138, 176, 192, .18);
  border-radius: 6px;
  padding: .9rem 1.35rem;
}
.bigstat .n { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.bigstat .l {
  color: var(--muted, #8ab0c0);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.bigstat .n.good { color: var(--green, #4fc98a); }
.bigstat .n.bad  { color: var(--red, #e4572e); }
