/* ==========================================================================
   The Reading Room — Collections
   Library hub tiles, series list, folder tables and search field. Tokens only.
   ========================================================================== */

.library-filters input[type="search"] {
  min-height: var(--nav-target);
  padding: 0 var(--space-3);
  border: var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-family: var(--font-meta);
  font-size: var(--text-sm);
}
.library-filters input[type="search"]:focus-visible {
  outline: var(--border-width-thick) solid transparent;
  box-shadow: var(--focus-ring);
}
.library-filters__field--wide { flex: 2 1 18rem; }

/* Hub and series tiles */
.series-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-10);
  padding: 0;
  list-style: none;
  max-width: none;
}
.series-list__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-5);
  border: var(--border-hairline);
  border-top: var(--border-accent);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  text-decoration: none;
}
.series-list__link:hover { box-shadow: var(--shadow-hover); }
.series-list__link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.series-list__eyebrow,
.series-list__count {
  font-family: var(--font-meta);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}
.series-list__eyebrow { color: var(--color-eyebrow); }
.series-list__count { margin-top: auto; color: var(--color-text-secondary); }
.series-list__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}
.library > .series-list { max-width: none; }

/* Folder table */
.records {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--color-surface);
  border: var(--border-hairline);
}
.library > .records { max-width: none; }
.records th,
.records td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-top: var(--border-hairline);
}
.records thead th {
  border-top: 0;
  background: var(--color-surface-sunken);
  font-family: var(--font-meta);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.records tbody th { font-weight: var(--weight-bold); line-height: var(--leading-snug); }
.records td { font-family: var(--font-meta); font-size: var(--text-xs); white-space: nowrap; color: var(--color-text-secondary); }
.records a { color: var(--color-link); }
.records a:hover { color: var(--color-link-hover); }

@media (max-width: 720px) {
  .records thead { display: none; }
  .records, .records tbody, .records tr, .records th, .records td { display: block; }
  .records tr { padding: var(--space-3) var(--space-4); border-top: var(--border-hairline); }
  .records th, .records td { padding: 0; border: 0; white-space: normal; }
  .records td::before { content: attr(data-label) ": "; color: var(--color-text-muted); }
}

/* Wider tiles for the Library hub; full-width filter bar above wide tables */
.series-list--wide { grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); }
.library > form[data-table-filters] { max-width: none; }

/* Gelman folder pages: outline and page viewer */
.article__notice { margin: var(--space-3, 1rem) 0; padding: var(--space-3, 1rem); border-left: 3px solid var(--color-accent, currentColor); background: var(--color-surface-alt, rgba(0,0,0,.04)); }
.article__h3 { margin: var(--space-4, 1.5rem) 0 var(--space-2, .5rem); font-size: 1.05em; }
.folder-summary ul { padding-left: 1.25em; }
.folder-summary li { margin-bottom: .5em; }
.article__credit { margin-top: var(--space-4, 1.5rem); font-size: .9em; }
.viewer__note { margin: 0 0 var(--space-2, .5rem); }
.viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: var(--space-3, 1rem) 0; flex-wrap: wrap; }
.viewer__count { font-variant-numeric: tabular-nums; }
.viewer__slides { list-style: none; margin: 0; padding: 0; }
.viewer__slide { margin: 0 0 var(--space-4, 1.5rem); }
.viewer__slide img { display: block; width: 100%; height: auto; border: 1px solid var(--color-border, rgba(0,0,0,.2)); user-select: none; -webkit-user-drag: none; }
.viewer__withheld { padding: var(--space-5, 2rem) var(--space-4, 1.5rem); border: 1px dashed var(--color-border, rgba(0,0,0,.4)); text-align: center; }
.viewer--js .viewer__slide { margin: 0; }
