/* Publishing overview (studio-overview.js). Wide, because one row carries a customer's
   supplier, its status and two versions side by side. The table scrolls, not the
   dialog, so the filters stay in view. */

.overview-dialog {
  inline-size: min(1080px, calc(100vw - 32px));
  max-block-size: min(90vh, 900px);
}

.overview-dialog form {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  max-block-size: min(90vh, 900px);
}

.overview-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 14px;
}

.overview-filters label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}

.overview-counts {
  margin: 0;
  color: var(--studio-muted);
  font-size: 13px;
}

.overview-scroll {
  min-block-size: 120px;
  overflow: auto;
  border: 1px solid var(--studio-line);
  border-radius: var(--radius-sm);
}

.overview-table {
  inline-size: 100%;
  min-inline-size: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.overview-table th,
.overview-table td {
  padding: 8px 10px;
  text-align: start;
  vertical-align: top;
  border-block-end: 1px solid var(--studio-line);
}

.overview-table thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  color: var(--studio-muted);
  font-size: 12px;
  background: var(--canvas);
}

.overview-group th {
  padding-block: 10px 6px;
  color: var(--studio-ink);
  font-size: 13px;
  background: var(--surface-muted, #f8f9fb);
}

.overview-table td strong {
  color: var(--studio-ink);
}

.overview-sub {
  display: block;
  margin-block-start: 2px;
  color: var(--studio-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.overview-none {
  color: var(--studio-subtle);
}

.overview-open {
  padding: 0;
  color: var(--accent-blue, #2952cc);
  font: inherit;
  font-weight: 700;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  cursor: pointer;
}

.overview-status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--studio-line-strong);
  border-radius: 999px;
}

.overview-status[data-status="live"] {
  color: var(--success, #1d6a43);
  border-color: currentColor;
}

.overview-status[data-status="live_changes"],
.overview-status[data-status="draft"] {
  color: var(--warning, #8a4b00);
  border-color: currentColor;
}

.overview-status[data-status="unavailable"] {
  color: var(--studio-subtle);
  border-style: dashed;
}

.overview-button {
  margin-block-start: -4px;
}

/* A phone gets one card per supplier, each value labelled, instead of a table that
   scrolls sideways. The dialog scrolls as a whole, so there is one scrolling region. */
@media (max-width: 560px) {
  .overview-dialog {
    max-block-size: calc(100dvh - 20px);
    overflow-y: auto;
  }

  .overview-dialog form {
    max-block-size: none;
  }

  .overview-filters label,
  .overview-filters select {
    inline-size: 100%;
  }

  .overview-scroll {
    overflow: visible;
  }

  .overview-table {
    min-inline-size: 0;
  }

  .overview-table thead {
    display: none;
  }

  .overview-table tbody,
  .overview-table tr,
  .overview-table th,
  .overview-table td {
    display: block;
  }

  .overview-table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
    padding-block: 4px;
    border: 0;
  }

  .overview-table td::before {
    content: attr(data-label);
    color: var(--studio-muted);
    font-size: 12px;
    font-weight: 700;
  }

  .overview-table td > * {
    grid-column: 2;
  }

  .overview-table tr:not(.overview-group) {
    padding-block: 6px;
    border-block-end: 1px solid var(--studio-line);
  }
}
