/*
 * DNS and Maps (work package P7). Built from the tokens of the design system; the components are the ui-* ones.
 * Two families: dns- for the DNS screen, maps- for the Maps screens.
 */

/* DNS */

.dns__panel {
  gap: var(--ui-space-5);
}

.dns__toolbar,
.maps__toolbar {
  padding: var(--ui-space-4) var(--ui-space-5) 0;
}

.dns__stack,
.maps__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

/* In a row that became a card (a phone) the value stands at the right, under its label's line. */
@container (max-width: 34rem) {
  .ui-table__cell:not(:first-child) .dns__stack,
  .ui-table__cell:not(:first-child) .maps__stack {
    align-items: flex-end;
    text-align: right;
  }
}

/* A column that holds a sentence or a long name keeps room for it while the table is a table. */
@container (min-width: 34.01rem) {
  .dns__wide,
  .maps__wide {
    min-width: 15rem;
  }
}

.dns__name,
.maps__name {
  color: var(--ui-text);
  font-weight: var(--ui-weight-semibold);
  overflow-wrap: anywhere;
}

.dns__name {
  font-family: var(--ui-font-mono);
  font-size: var(--ui-text-sm);
}

.dns__sub,
.maps__sub {
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
}

.dns__what {
  color: var(--ui-text);
  font-weight: var(--ui-weight-medium);
}

.dns__package {
  display: inline-flex;
  align-items: center;
  gap: var(--ui-space-1);
}

.dns__package .ui-btn {
  margin-left: calc(-1 * var(--ui-space-2));
}

.dns__state {
  gap: var(--ui-space-1);
  max-width: 26rem;
}

/* Why a record is not right: always in sight, never only on hover. */
.dns__reason,
.maps__reason {
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dns__reason--problem,
.maps__reason--problem {
  color: var(--ui-critical-text);
}

.dns__pages {
  flex: 1;
}

.dns__drawer-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2) var(--ui-space-3);
}

.dns__records {
  display: grid;
  gap: var(--ui-space-2);
}

.dns__record-list {
  display: grid;
  gap: var(--ui-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.dns__record {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
  border: 1px solid var(--ui-border);
  border-left-width: 3px;
  border-radius: var(--ui-radius-sm);
  padding: var(--ui-space-2) var(--ui-space-3);
  background: var(--ui-surface-sunken);
  color: var(--ui-text);
  font-size: var(--ui-text-sm);
}

.dns__record--added {
  border-left-color: var(--ui-good-solid);
}

.dns__record--added .ui-icon {
  color: var(--ui-good-text);
}

.dns__record--removed {
  border-left-color: var(--ui-critical-solid);
}

.dns__record--removed .ui-icon {
  color: var(--ui-critical-text);
}

.dns__ttl {
  margin-left: auto;
  color: var(--ui-text-muted);
  font-size: var(--ui-text-xs);
  white-space: nowrap;
}

/* Why the button of a panel cannot be pressed, or is not there, in words beside it. */
.dns__blocked,
.maps__blocked {
  margin-right: auto;
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
}

/* What went wrong with an answer to a question, under the question. */
.dns__ask-problem,
.maps__ask-problem {
  margin-top: var(--ui-space-3);
}

/* Maps */

.maps__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-1) var(--ui-space-2);
}

.maps__strong {
  color: var(--ui-text);
  font-weight: var(--ui-weight-medium);
}

.maps__state {
  gap: var(--ui-space-1);
  max-width: 30rem;
}

.maps__back {
  margin: calc(-1 * var(--ui-space-2)) 0 var(--ui-space-3) calc(-1 * var(--ui-space-2));
}

/* A build that runs: what the build machine does right now, in the tone of work going on. */
.maps__build {
  border-color: var(--ui-info-border);
}

.maps__stage {
  margin: 0;
  color: var(--ui-text);
  font-weight: var(--ui-weight-medium);
}

.maps__extracts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: var(--ui-weight-regular);
}

.maps__drawer-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2) var(--ui-space-3);
}

/* A field of the map form that takes the whole width of its two columns. */
.maps__form-wide {
  grid-column: 1 / -1;
}

.maps__address {
  max-width: 22rem;
}

.maps__revoked {
  flex: 1;
  min-width: 0;
}

.maps__revoked-list {
  display: grid;
  gap: var(--ui-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.maps__revoked-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--ui-space-1) var(--ui-space-3);
}

/* Why the main button of the page waits, in words beside it. */
.maps__waits {
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
}
