/* Datasets and Tools & code: lists and detail pages. Mobile first (390 px
   artboards); the 900 px query adds the 1280 px layout. */

/* ---------- Shared bits ---------- */

.button-blue { background: var(--blue); color: var(--white); }
.button-blue:hover { background: var(--blue-hover); color: var(--white); }

.res-tags { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.res-tags:empty { display: none; }
.res-tag {
  padding: 3px 10px; border: 1.5px solid var(--chip-border, var(--chip-bg, var(--lavender)));
  background: var(--chip-bg, var(--lavender)); color: var(--chip-fg, var(--blue));
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .08em;
  line-height: 1.5; text-transform: uppercase; text-decoration: none;
}
a.res-tag:hover { color: var(--chip-fg, var(--blue)); filter: brightness(.95); }

/* Buttons that need JavaScript stay hidden without it. */
.copy-btn, .cite-toggle { display: none; }
.js .copy-btn, .js .cite-toggle { display: inline-flex; align-items: center; justify-content: center; }
.copy-btn { border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; }
.copy-dark { min-height: 42px; border: 0; background: var(--ink); color: var(--white); }
.copy-dark:hover { background: #2C2747; }
.copy-light { flex: none; min-height: 36px; padding: 0 12px; border: 1.5px solid var(--muted); background: transparent; color: var(--white); }
.copy-light:hover { background: #2C2747; }
.no-js-only { display: none; }
html:not(.js) .no-js-only { display: inline-flex; align-items: center; min-height: 48px; margin-top: 8px; padding: 0 20px; border: 0; border-radius: var(--radius); background: var(--ink); color: var(--white); font-weight: 600; }

.command {
  display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 14px; padding: 0 6px 0 12px;
  background: var(--ink); color: var(--white);
}
.command code { flex: 1; min-width: 0; overflow-x: auto; font-size: 13px; white-space: nowrap; }
.prompt { color: var(--amber); }

/* ---------- List pages ---------- */

.head-link {
  display: inline-flex; align-items: center; min-height: 40px; margin-top: 10px;
  color: var(--white); font-family: var(--font-display); font-size: 15px; font-weight: 600; text-decoration: none;
}
.head-link .u { padding-bottom: 2px; border-bottom: 2px solid var(--amber); }
.head-link .arrow, .all-pubs .arrow { display: inline-block; }
.head-link:hover { color: var(--amber); }

.res-filters { padding-top: 20px; }
.res-search label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.res-search .field {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px;
  border: 1.5px solid var(--ink); border-radius: var(--radius); color: var(--muted);
}
.res-search .field:focus-within { outline: var(--focus); outline-offset: 2px; }
.res-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; }
.res-search input::placeholder { color: var(--muted); opacity: 1; }

.res-topics-bar { border-bottom: 1px solid var(--line); }
.res-topics-bar .wrap { padding-bottom: 8px; }
.topic-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topic-row { display: flex; gap: 8px; padding: 12px 0; overflow-x: auto; scrollbar-width: none; }
.topic-chip {
  flex: none; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; margin: 4px 3px; padding: 0 14px;
  border: 1.5px solid var(--amber); border-radius: 999px;
  background: var(--white); color: var(--ink);
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
/* All topic options look the same: white with an amber border; the selected one is filled amber. */
.topic-chip:hover { color: var(--ink); background: var(--amber-tint); }
.topic-chip .count { display: none; }
.topic-chip[aria-current], .topic-chip[aria-current]:hover { background: var(--amber); }

.res-results { padding-bottom: 48px; }
.res-count { margin: 0; padding-top: 14px; font-size: 13px; color: var(--muted); }
.res-count strong { color: var(--ink); }
.res-empty { padding: 40px 0; text-align: center; }
.res-empty .title { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.res-empty p { margin: 6px 0 16px; color: var(--muted); }

.cite-toggle {
  min-height: 36px; margin-left: auto; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 4px;
  background: var(--white); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.cite-toggle[aria-expanded="true"] { background: var(--ink); color: var(--white); }
.cite-panel { flex-basis: 100%; margin-top: 4px; padding: 14px; background: var(--tint); }
.cite-panel[hidden] { display: none; }
.cite-panel pre { margin: 0; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.cite-panel .copy-btn { width: 100%; margin-top: 12px; font-size: 14px; min-height: 44px; }
.cite-entry + .cite-entry { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Dataset cards */

.dataset-card { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.dataset-card .cover {
  --bar: var(--v-bar); position: relative; display: block; height: 128px; overflow: hidden;
  background: var(--v-bg); border: 1.5px solid var(--v-bd);
}
.dataset-card .cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.dataset-card .cover:has(img) { background: var(--tint); border-color: var(--tint); }
.dataset-card:hover .cover img { transform: scale(1.04); }
.dataset-card:hover .vbars > span { transform: translateY(-12px); }
.dataset-card:hover .vbars > span:nth-child(2) { transform: translateY(-22px); }
.dataset-card .kind, .tool-card .kind {
  margin-top: 10px; font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.dataset-card h2 { margin: 4px 0 0; font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.dataset-card h2 a, .tool-card h2 a { color: var(--ink); text-decoration: none; }
.dataset-card h2 a:hover, .tool-card h2 a:hover { color: var(--blue); }
.dataset-card .summary { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.dataset-card .res-tags { margin-top: 10px; }
.dataset-card .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 12px; font-size: 14px; font-weight: 600; }
.dataset-card .actions .button { flex: 1 1 100%; justify-content: space-between; min-height: 48px; padding: 0 18px; font-size: 15px; }
.dataset-card .link, .tool-card .link, .tool-card .details { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; text-decoration: none; }
.dataset-card .link:hover, .tool-card .link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Tool cards */

.tool-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.tool-card { display: flex; flex-direction: column; border: 1.5px solid var(--line); background: var(--white); }
.tool-card .top { padding: 18px 16px 16px; }
.tool-card .head { display: flex; align-items: center; gap: 14px; }
.tool-card .head > div { min-width: 0; }
.tool-card .kind { margin-top: 0; }
.tool-card h2 { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.tool-card .mark {
  --bar: var(--m-bar);
  flex: none; position: relative; width: 48px; height: 48px; overflow: hidden; background: var(--v-bg); border: 1.5px solid var(--v-bd);
}
.tool-card .mark .vbars { --bw: 7px; --gap: 4px; --sink: -5px; --cap-gap: 3px; left: auto; right: 7px; transform: none; }
.tool-card .summary { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.tool-card .res-tags { margin-top: 10px; }
.platform-button { display: flex; width: 100%; min-height: 48px; margin-top: 14px; }
.tool-card .actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; margin-top: auto; padding: 4px 16px;
  border-top: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.tool-card .actions a { min-height: 44px; gap: 4px; text-decoration: none; }
.tool-card .actions .details { color: var(--ink); }
.tool-card .actions .details:hover { text-decoration: underline; text-underline-offset: 3px; }
.tool-card .cite-panel { margin: 0 0 12px; }

/* ---------- Detail pages ---------- */

.res-head { position: relative; padding-top: 14px; padding-bottom: 22px; }
.res-head .eyebrow { margin-top: 6px; color: var(--amber); font-size: 12px; font-weight: 700; }
.res-head h1 { margin: 6px 0 6px; font-size: 34px; line-height: 1.08; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.res-head .lead { margin: 0; max-width: 320px; color: #E2DCFF; font-size: 15px; }

.res-detail { display: flex; flex-direction: column; padding-bottom: 48px; }
.res-main { min-width: 0; }
.res-aside { order: -1; margin-top: 16px; padding: 16px; border: 1.5px solid var(--ink); }
.res-aside:not(:has(.aside-block, .platform-button)) { display: none; }
.res-aside .box-label { font-size: 12px; color: var(--muted); }
.res-aside > .platform-button { margin: 0 0 12px; }
.res-aside > .platform-button:last-child { margin-bottom: 0; }
.aside-block + .aside-block { margin-top: 12px; }
.aside-license { margin: -4px 0 12px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.aside-license .box-label { margin-right: 4px; font-weight: 400; }
.res-license { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.res-license + .files { margin-top: 14px; }
.glance dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin: 8px 0 0; }
.glance dl > div { display: flex; flex-direction: column; padding: 7px 0; border-bottom: 1px solid var(--line); }
.glance dt { font-size: 12px; color: var(--muted); }
.glance dd { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.aside-block.links ul { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 14px; font-weight: 600; }
.aside-block.links a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; text-decoration: none; }
.aside-block.links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.back-button { display: flex; width: 100%; min-height: 48px; margin-top: 28px; }

/* The page of its own for getting a dataset (files or access instructions). */
.res-download .res-main > :first-child { margin-top: 24px; }

.res-section { margin-top: 36px; }
.sec-head { padding-top: 12px; border-top: 2px solid var(--ink); }
.sec-head-plain { padding-top: 0; border-top: 0; }
.sec-head h2 { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }

.res-prose { font-size: 15px; }
.res-prose > :not(pre, .code-block) { max-width: 720px; }
.res-intro { margin-top: 36px; }
.res-section > .res-prose { margin-top: 0; }
.res-prose > * { margin-top: 14px; margin-bottom: 0; }
.res-prose a { overflow-wrap: anywhere; }
.res-prose h3 { margin-bottom: 0; font-size: 18px; }
.res-prose ul { padding: 0; list-style: none; }
.res-prose ul li { position: relative; padding: 6px 0 6px 20px; }
.res-prose ul li::before { content: ""; position: absolute; left: 0; top: 15px; width: 8px; height: 8px; background: var(--amber); }
.res-prose ol { padding-left: 22px; }
.res-prose ol li { padding: 3px 0; }
.res-prose strong { font-weight: 600; }
.res-prose code { padding: 1px 5px; background: var(--tint); font-size: .9em; }
.res-prose pre, .code-block {
  position: relative; max-width: none; background: var(--ink); color: var(--white);
}
.res-prose pre { margin-top: 16px; padding: 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; }
.res-prose pre code { padding: 0; background: none; font-size: inherit; }
.code-block { margin-top: 16px; }
.res-prose .code-block { margin-top: 16px; }
.code-block pre { margin: 0; padding: 16px 16px 56px; overflow-x: auto; background: none; font-size: 12.5px; line-height: 1.6; }
.code-block code { background: none; padding: 0; font-size: inherit; }
.code-block .copy-btn { position: absolute; right: 10px; bottom: 10px; min-height: 34px; padding: 0 12px; }
.single-cmd code::before { content: "$ "; color: var(--amber); }
.res-prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.res-prose th, .res-prose td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }

.files { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1.5px solid var(--ink); }
.files a {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 4px;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: background .2s ease;
}
.files a:hover { background: var(--tint); color: var(--ink); }
.files .icon { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--blue); color: var(--white); }
.files .text { flex: 1; min-width: 0; }
.files .label { display: block; font-family: var(--font-display); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.files .meta { display: block; font-size: 13px; color: var(--muted); }
.res-prose + .files { margin-top: 18px; }

.cite-intro { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.bib { position: relative; margin-top: 14px; padding: 14px 14px 60px; background: var(--tint); }
.bib pre { margin: 0; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.bib .copy-btn { position: absolute; left: 10px; right: 10px; bottom: 10px; }

.res-pubs .pub-list { margin-top: 0; }
.all-pubs { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; font-weight: 600; text-decoration: none; }
.all-pubs:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Desktop ---------- */

@media (min-width: 900px) {
  .head-link { min-height: 0; margin-top: 22px; font-size: 16px; }
  .head-link:hover { color: var(--white); }

  .res-filters { padding-top: 28px; }
  .res-search { max-width: 380px; }
  .res-search .field { height: 46px; }
  .res-topics-bar .wrap { padding-top: 20px; padding-bottom: 22px; }
  .topic-label {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none; margin-bottom: 8px;
    font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  }
  .topic-row { flex-wrap: wrap; padding: 3px; overflow: visible; }
  .topic-chip {
    margin: 0; border-radius: 0; font-family: var(--font-display); font-size: 13px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
  }
  .topic-chip .count { display: inline; font-family: var(--font-body); font-weight: 400; letter-spacing: 0; }

  .res-results { padding-bottom: 88px; }
  .res-count { padding-top: 22px; font-size: 14px; }
  .res-empty { padding: 56px 0; }
  .res-empty .title { font-size: 22px; }

  .cite-toggle { margin-left: 0; font-size: 14px; }
  .cite-panel { margin-top: 12px; padding: 16px 18px; }
  .cite-entry { position: relative; }
  .cite-panel pre { padding-right: 80px; font-size: 13px; }
  .cite-panel .copy-btn { position: absolute; top: 0; right: 0; width: auto; min-height: 32px; margin: 0; padding: 0 12px; font-size: 13px; }
  .cite-entry + .cite-entry .copy-btn { top: 16px; }

  .dataset-card { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 40px; padding: 24px 0; }
  .dataset-card .cover { height: 200px; }
  .dataset-card .vbars { --bw: 30px; --gap: 14px; --sink: -16px; --cap-gap: 10px; }
  .dataset-card .kind { margin-top: 0; font-size: 12px; }
  .dataset-card h2 { margin-top: 6px; font-size: 30px; }
  .dataset-card .summary { max-width: 680px; margin-top: 8px; font-size: 16px; }
  .dataset-card .res-tags { margin-top: 10px; }
  .dataset-card .actions { gap: 14px 22px; margin-top: 14px; font-size: 15px; }
  .dataset-card .actions .button { flex: none; gap: 10px; justify-content: center; min-height: 46px; padding: 0 20px; }
  .dataset-card .link { min-height: 0; }

  .tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 20px; align-items: stretch; }
  .tool-card .top { padding: 26px 28px 22px; }
  .tool-card .head { align-items: flex-start; gap: 18px; }
  .tool-card .kind { font-size: 12px; }
  .tool-card h2 { margin-top: 2px; font-size: 28px; }
  .tool-card .mark { width: 60px; height: 60px; }
  .tool-card .mark .vbars { --bw: 9px; --gap: 5px; --sink: -6px; --cap-gap: 4px; right: 9px; }
  .tool-card .summary { margin-top: 14px; font-size: 16px; }
  .tool-card .res-tags { margin-top: 14px; }
  .command { gap: 12px; min-height: 48px; margin-top: 18px; padding: 0 6px 0 16px; }
  .command code { overflow: hidden; font-size: 14px; text-overflow: ellipsis; }
  .platform-button { display: inline-flex; width: auto; min-height: 46px; margin-top: 18px; padding: 0 20px; gap: 10px; font-size: 15px; }
  .tool-card .actions { gap: 10px 20px; padding: 14px 28px; font-size: 15px; }
  .tool-card .actions a { min-height: 0; }
  .tool-card .cite-toggle { margin-left: auto; }
  .tool-card .cite-panel { margin: 0 0 24px; }

  .res-head { padding-top: 24px; padding-bottom: 36px; }
  .res-head .eyebrow { margin-top: 12px; font-size: 14px; letter-spacing: .12em; }
  .res-head h1 { margin: 6px 0 8px; font-size: 56px; line-height: 1.04; letter-spacing: -.03em; }
  .res-head .lead { max-width: 640px; font-size: 19px; }

  .res-detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; padding-top: 48px; padding-bottom: 88px; }
  .res-aside { order: 0; position: sticky; top: 24px; margin-top: 0; padding: 24px; }
  .res-aside:not(:has(.aside-block, .platform-button)) { display: block; }
  .res-aside > .platform-button { display: flex; width: 100%; margin: 0 0 22px; }
  .res-aside > .platform-button:last-child { margin-bottom: 0; }
  .aside-block + .aside-block { margin-top: 22px; }
  .aside-license { margin: -8px 0 22px; font-size: 15px; }
  .aside-block.topics .box-label, .aside-block.links .box-label { margin-bottom: 8px; }
  .glance dl { display: block; }
  .glance dl > div { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; }
  .glance dt { font-size: 14px; }
  .glance dd { text-align: right; }
  .aside-block.links .box-label { margin-bottom: 0; }
  .aside-block.links ul { flex-direction: column; gap: 0; margin-top: 4px; font-size: 16px; }
  .aside-block.links li a { justify-content: space-between; border-bottom: 1px solid var(--line); }
  .aside-block.links a { display: flex; }
  .back-button { margin-top: 22px; }

  .res-download { display: block; padding-top: 48px; }
  .res-download .res-main { max-width: 880px; }
  .res-download .res-main > :first-child { margin-top: 0; }
  .res-download .back-button { display: inline-flex; width: auto; margin-top: 40px; padding: 0 20px; }

  .detail-cover {
    --bar: var(--v-bar); position: relative; height: 300px; margin-bottom: 48px; overflow: hidden;
    background: var(--v-bg); border: 1.5px solid var(--v-bd);
  }
  .detail-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
  /* A picture is shown whole, as the editor cropped it (16:9), not cut to the 300px of the bars. */
  .detail-cover:has(img) { height: auto; background: var(--tint); border-color: var(--tint); }
  .detail-cover:has(img) img { height: auto; }
  .detail-cover .vbars { --bw: 44px; --gap: 20px; --sink: -20px; --cap-gap: 14px; }

  .res-section { margin-top: 56px; }
  .detail-cover + .res-section, .res-main > .res-section:first-child { margin-top: 0; }
  .res-intro { margin-top: 0; }
  .sec-head { padding-top: 16px; border-top-width: 3px; }
  .sec-head-plain { padding-top: 0; }
  .sec-head h2 { font-size: 30px; }

  .res-prose { font-size: 17px; }
  /* The text takes the whole column, beside the narrow box. */
  .res-prose > :not(pre, .code-block) { max-width: none; }
  .res-prose ul li::before { top: 17px; }
  .res-prose pre { padding: 18px 96px 18px 20px; font-size: 14px; }
  .code-block pre { padding: 18px 96px 18px 20px; font-size: 14px; }
  .code-block .copy-btn { top: 12px; right: 12px; bottom: auto; min-height: 34px; }

  .files a { gap: 16px; min-height: 64px; padding: 10px 14px; }

  .cite-intro { margin-top: 12px; font-size: 16px; }
  .bib { padding: 18px 96px 18px 20px; }
  .bib pre { font-size: 13px; }
  .bib .copy-btn { left: auto; right: 12px; top: 12px; bottom: auto; min-height: 34px; padding: 0 12px; }

  .res-pubs .pub-row { display: block; padding: 18px 12px; }
  .res-pubs .pub-row .title { margin-top: 2px; }
}
