/* Scoped to resource ListBlocks detected by download-resource-table.js. */
.downloads-resource-list {
  --resource-table-columns: 2rem 3.25rem minmax(10rem, 1fr) 8rem 7rem 9.5rem;
  margin-block: 1rem 1.5rem;
}

.downloads-resource-table-head {
  align-items: center;
  background: #f4f5f7;
  border: 1px solid #d8dadd;
  border-bottom-color: #c7c9cd;
  border-radius: 0.45rem 0.45rem 0 0;
  color: #35383d;
  display: grid;
  font-size: 0.75rem;
  font-weight: 700;
  gap: 0.75rem;
  grid-template-columns: var(--resource-table-columns);
  letter-spacing: 0.03em;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  text-transform: uppercase;
}

.downloads-resource-table-head__resource {
  grid-column: 2 / 4;
  grid-row: 1;
}

.downloads-resource-table-head > :nth-child(2) {
  grid-column: 4;
  grid-row: 1;
}

.downloads-resource-table-head > :nth-child(3) {
  grid-column: 5;
  grid-row: 1;
}

.downloads-resource-table-head > :nth-child(4) {
  grid-column: 6;
  grid-row: 1;
  text-align: end;
}

.downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-child] {
  background: #fff;
  border: 1px solid #d8dadd;
  border-top: 0;
  margin: 0;
}

.downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-child] > .w-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-child] .w-panel__header {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: var(--resource-table-columns);
  margin: 0;
  min-height: 4.5rem;
  padding: 0.55rem 0.85rem;
  transform: none;
  transition: background-color 140ms ease;
}

.downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-child] .w-panel__header:hover {
  background: #f8fbfb;
}

.downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-child] .w-panel__header:has(.w-panel__toggle[aria-expanded="true"]) {
  background: #f2f8f8;
}

.downloads-resource-list .w-panel__header > .w-panel__anchor,
.downloads-resource-list .w-panel__header > .w-panel__divider {
  display: none;
}

.downloads-resource-list .w-panel__header > .w-panel__toggle {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}

.downloads-resource-list .w-panel__header > .w-panel__heading {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

.downloads-resource-list .w-panel__heading .c-sf-block__type {
  display: none;
}

.downloads-resource-list .w-panel__heading .c-sf-block__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.downloads-resource-summary {
  display: contents;
}

.downloads-resource-summary__preview {
  align-items: center;
  background: var(--w-color-surface-menus, #f4f4f5);
  border: 1px solid var(--w-color-border-furniture, #d9d9d9);
  border-radius: 0.35rem;
  display: flex;
  grid-column: 2;
  grid-row: 1;
  height: 3rem;
  justify-content: center;
  overflow: hidden;
  width: 3rem;
}

.downloads-resource-summary__preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.downloads-resource-summary__placeholder {
  color: var(--w-color-text-meta, #6b7280);
  font-size: 1.25rem;
}

.downloads-resource-summary__collection {
  font-size: 0.8rem;
  grid-column: 4;
  grid-row: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.downloads-resource-summary__color {
  align-items: center;
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  gap: 0.4rem;
  grid-column: 5;
  grid-row: 1;
}

.downloads-resource-summary__swatch {
  border: 1px solid rgb(0 0 0 / 18%);
  border-radius: 50%;
  flex: 0 0 auto;
  height: 1.1rem;
  width: 1.1rem;
}

.downloads-resource-list .w-panel__header > .w-panel__controls {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  grid-column: 6;
  grid-row: 1;
  justify-self: end;
  white-space: nowrap;
}

.downloads-resource-list .w-panel__controls .button {
  margin: 0;
}

.downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-list-add] {
  display: none;
}

.downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-list-add]:last-child {
  align-items: center;
  background: #f8fbfb;
  border: 1px dashed #007d7e;
  border-radius: 0 0 0.5rem 0.5rem;
  color: #006f70;
  display: flex;
  font-weight: 600;
  gap: 0.45rem;
  height: auto;
  justify-content: center;
  padding: 0.8rem;
  width: 100%;
}

.downloads-resource-list .w-panel__content {
  background: #fbfbfc;
  border-top: 1px solid #e2e3e5;
  padding: 1.25rem;
}

@media (max-width: 800px) {
  .downloads-resource-table-head {
    display: none;
  }

  .downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-child] {
    border-top: 1px solid var(--w-color-border-furniture, #d9d9d9);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .downloads-resource-list > [data-streamfield-list-container] > [data-streamfield-child] .w-panel__header {
    grid-template-columns: 2rem 3rem minmax(8rem, 1fr) auto;
  }

  .downloads-resource-summary__preview {
    grid-column: 2;
  }

  .downloads-resource-list .w-panel__header > .w-panel__heading {
    grid-column: 3;
  }

  .downloads-resource-summary__collection {
    grid-column: 3;
    grid-row: 2;
  }

  .downloads-resource-summary__color {
    display: none;
  }

  .downloads-resource-list .w-panel__header > .w-panel__controls {
    grid-column: 4;
    grid-row: 1 / 3;
  }
}
