/* Public Resources reference pages */

.resources-shell {
  max-width: min(56rem, var(--qtube-max, 72rem));
}

.resources-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 1.25rem;
}

.resources-jumps .button {
  text-decoration: none;
}

.resources-toc {
  margin: 0 0 1.6rem;
  padding: 0.95rem 1.05rem 1.05rem;
  border: 1px solid var(--qtube-border);
  border-radius: var(--qtube-radius-card, 0.75rem);
  background: color-mix(in srgb, var(--qtube-surface, var(--qtube-bg)) 92%, transparent);
}

.resources-toc__title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--qtube-muted);
}

.resources-toc__list {
  display: grid;
  gap: 0.28rem;
  margin: 0;
  padding-left: 1.15rem;
}

.resources-toc a {
  color: inherit;
  text-underline-offset: 0.15em;
}

.resources-prose {
  min-width: 0;
}

.resources-prose h2,
.resources-prose h3,
.resources-prose h4 {
  scroll-margin-top: 5.5rem;
}

.resources-table-hint {
  margin: 0 0 0.45rem;
  color: var(--qtube-muted);
  font-size: 0.86rem;
}

.resources-table-wrap {
  margin: 0 0 1.25rem;
  border: 1px solid var(--qtube-border);
  border-radius: 0.75rem;
}

.resources-table-wrap--fit {
  overflow: visible;
}

.resources-table-wrap--scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--qtube-bg) 30%, transparent) left center / 1.4rem 100% no-repeat,
    linear-gradient(to left, var(--qtube-bg) 30%, transparent) right center / 1.4rem 100% no-repeat;
  background-attachment: local, local;
}

.resources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.45;
}

.resources-table th,
.resources-table td {
  padding: 0.8rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--qtube-border);
}

.resources-table th {
  color: var(--qtube-muted);
  font-weight: 600;
  background: color-mix(in srgb, var(--qtube-muted) 8%, transparent);
}

.resources-table tr:last-child th,
.resources-table tr:last-child td {
  border-bottom: 0;
}

.resources-table a {
  overflow-wrap: anywhere;
}

.resources-table--products td,
.resources-table--regions td {
  max-width: 16rem;
}

.resources-table--products td:first-child,
.resources-table--regions td:first-child {
  max-width: 8.5rem;
  font-weight: 650;
}

.resources-kv {
  display: block;
}

.resources-kv + .resources-kv {
  margin-top: 0.45rem;
}

.resources-kv__k {
  display: block;
  color: var(--qtube-muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.resources-kv__v {
  display: block;
  overflow-wrap: anywhere;
}

.resources-table--matrix {
  min-width: 72rem;
  font-size: 0.88rem;
}

.resources-table--matrix th,
.resources-table--matrix td {
  white-space: nowrap;
  max-width: none;
}

.resources-table--matrix th:first-child,
.resources-table--matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 7.5rem;
  background: var(--qtube-bg);
  box-shadow: 1px 0 0 var(--qtube-border);
}

.resources-table--matrix thead th:first-child {
  background: color-mix(in srgb, var(--qtube-muted) 8%, var(--qtube-bg));
}

.resources-entry {
  margin: 0 0 1rem;
  padding: 0.95rem 1.05rem 1.05rem;
  border: 1px solid var(--qtube-border);
  border-radius: var(--qtube-radius-card, 0.75rem);
  background: color-mix(in srgb, var(--qtube-surface, var(--qtube-bg)) 94%, transparent);
}

.resources-lede {
  margin: 0 0 0.85rem;
  color: var(--qtube-muted);
  line-height: 1.5;
}

.resources-entry h3,
.resources-entry h4 {
  margin: 0 0 0.7rem;
}

.resources-entry h3 a,
.resources-entry h4 a,
.resources-table--overview td:first-child a {
  font-weight: 650;
  text-decoration: none;
  text-underline-offset: 0.15em;
}

.resources-entry h3 a:hover,
.resources-entry h4 a:hover,
.resources-table--overview td:first-child a:hover {
  text-decoration: underline;
}

.resources-details {
  margin: 0 0 1.4rem;
  padding: 0.85rem 1rem 0.95rem;
  border: 1px solid var(--qtube-border);
  border-radius: var(--qtube-radius-card, 0.75rem);
  background: color-mix(in srgb, var(--qtube-surface, var(--qtube-bg)) 94%, transparent);
}

.resources-details summary {
  cursor: pointer;
  font-weight: 650;
  list-style-position: outside;
}

.resources-details[open] summary {
  margin-bottom: 0.85rem;
}

.resources-table--overview td,
.resources-table--overview th {
  max-width: 12rem;
}

.resources-entry ul {
  margin: 0;
}

.resources-entry li + li {
  margin-top: 0.4rem;
}

.resources-index-list {
  margin-top: 0.4rem;
}

@media (max-width: 40rem) {
  .resources-jumps .button {
    flex: 1 1 10rem;
  }

  .resources-table--stack,
  .resources-table--stack thead,
  .resources-table--stack tbody,
  .resources-table--stack tr,
  .resources-table--stack th,
  .resources-table--stack td {
    display: block;
    width: 100%;
    max-width: none;
  }

  .resources-table--stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .resources-table--stack tr {
    padding: 0.9rem 0.85rem;
    border-bottom: 1px solid var(--qtube-border);
  }

  .resources-table--stack tr:last-child {
    border-bottom: 0;
  }

  .resources-table--stack td {
    display: grid;
    grid-template-columns: 7.25rem minmax(0, 1fr);
    gap: 0.2rem 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 0;
  }

  .resources-table--stack td::before {
    content: attr(data-label);
    color: var(--qtube-muted);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .resources-table--stack td:first-child {
    display: block;
    margin-bottom: 0.35rem;
    padding-top: 0;
    font-size: 1.02rem;
  }

  .resources-table--stack td:first-child::before {
    content: none;
  }

  .resources-table--matrix {
    min-width: 64rem;
    font-size: 0.84rem;
  }

  .resources-entry {
    padding: 0.85rem 0.85rem 0.95rem;
  }
}
