/**
 * Hook Resources — research-dossier skin.
 *
 * Loaded alongside gw-hook-dossier.css, which supplies the tokens, page header,
 * and type scale.
 *
 * IMPORTANT — everything here is scoped to .gw-resources-page. The
 * .gw-resources-* classes are shared with the resource list embedded in
 * manufacturer pages (.gw-mfr-resources-section in gw-content-resources.css),
 * which keeps its own look; restyling the bare classes would change that
 * surface too.
 *
 * @since 1.8.1
 */

/* The dossier header reserves a column for a hook silhouette; this page has
   none, so the header runs full width. */
html body .gw-entry.gw-dossier.gw-resources-page > .gw-page-header {
  grid-template-columns: minmax(0, 1fr) !important;
  min-height: 0 !important;
  padding-bottom: 16px !important;
}
html body .gw-entry.gw-dossier.gw-resources-page .gw-section {
  padding: 26px 0 !important;
}
html body .gw-entry.gw-dossier.gw-resources-page .gw-section:first-of-type {
  padding-top: 0 !important;
  /* The fact strip closes with its own bottom rule; the section's would sit
     immediately above the first heading and read as a stray line. */
  border-bottom: 0 !important;
}
html body .gw-entry.gw-dossier.gw-resources-page .gw-section:last-of-type {
  border-bottom: 0 !important;
}

/* [hidden] is only a UA default of display:none, and ANY rule that sets display
   outranks it — .gw-resources-mfr-group is display:flex in
   gw-content-resources.css, so filtering left empty maker headings standing.
   One rule covers every element the filter script toggles. */
.gw-resources-page [hidden] { display: none !important; }

/* ── Fact strip ────────────────────────────────────────────────────────────── */
.gw-resources-page .res-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 2px solid var(--gwd-rule);
  border-bottom: 1px solid var(--gwd-line);
}
.gw-resources-page .res-facts > div {
  padding: 13px 18px 15px;
  border-right: 1px solid var(--gwd-line);
}
.gw-resources-page .res-facts > div:last-child { border-right: 0; }
.gw-resources-page .res-facts dt {
  margin: 0 0 6px;
  color: var(--gwd-faint);
  font: 850 8px/1 var(--gwd-sans);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.gw-resources-page .res-facts dd {
  margin: 0;
  color: var(--gwd-ink);
  font: 700 24px/1 var(--gwd-serif);
}
.gw-resources-page .res-facts dd small {
  display: block;
  margin-top: 5px;
  color: var(--gwd-faint);
  font: 400 10px/1.3 var(--gwd-sans);
}

/* ── Index and sections ────────────────────────────────────────────────────── */
.gw-resources-page .gw-resources-index { display: block; }
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-section-title {
  margin: 0 0 18px !important;
  color: var(--gwd-ink) !important;
  font: 750 clamp(26px, 3vw, 35px)/1.1 var(--gwd-sans) !important;
  letter-spacing: -.035em !important;
  text-transform: none !important;
}
.gw-resources-page .gw-resources-mfr-group { margin: 0 0 22px; }
.gw-resources-page .gw-resources-mfr-group:last-of-type { margin-bottom: 0; }
/* Full prefix: the base sheet's `.gw-entry .gw-section h3` outranks the bare
   class and left these at 17px Georgia in the theme's brown. */
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-mfr-heading {
  margin: 0 0 8px !important;
  padding-bottom: 5px !important;
  color: var(--gwd-faint) !important;
  border-bottom: 1px solid var(--gwd-line) !important;
  font: 850 9px/1 var(--gwd-sans) !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
}

/* ── Toolbar ───────────────────────────────────────────────────────────────── */
/* Hidden until the script runs — controls that do nothing are worse than none. */
.gw-resources-page .res-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 22px;
  padding: 14px 16px;
  background: var(--gwd-light);
  border: 1px solid var(--gwd-line);
}
.gw-resources-page .res-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gw-resources-page .res-field--search { flex: 1 1 260px; }
.gw-resources-page .res-label {
  color: var(--gwd-faint);
  font: 850 8px/1 var(--gwd-sans);
  letter-spacing: .09em;
  text-transform: uppercase;
}
html body .gw-entry.gw-dossier.gw-resources-page .res-toolbar input[type="search"],
html body .gw-entry.gw-dossier.gw-resources-page .res-toolbar select {
  width: auto !important;
  min-width: 0;
  min-height: 34px;
  max-width: none;
  padding: 0 10px;
  color: var(--gwd-ink);
  background: var(--gwd-surface);
  border: 1px solid var(--gwd-line-strong);
  border-radius: 0;
  box-shadow: none;
  font: 12px/1 var(--gwd-sans);
}
html body .gw-entry.gw-dossier.gw-resources-page .res-toolbar input[type="search"] {
  width: 100% !important;
  font-family: var(--gwd-serif);
  font-size: 13px;
}
.gw-resources-page .res-toolbar input[type="search"]:focus-visible,
.gw-resources-page .res-toolbar select:focus-visible {
  outline: 2px solid var(--gwd-orange);
  outline-offset: 1px;
}
.gw-resources-page .res-field--check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-bottom: 9px;
  color: var(--gwd-text2);
  font: 11px/1.2 var(--gwd-sans);
}
.gw-resources-page .res-field--check input { accent-color: var(--gwd-orange); }
html body .gw-entry.gw-dossier.gw-resources-page .res-clear {
  padding: 9px 13px;
  color: var(--gwd-ink);
  background: var(--gwd-surface);
  border: 1px solid var(--gwd-line-strong);
  border-radius: 0;
  font: 850 9px/1.2 var(--gwd-sans);
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
}
html body .gw-entry.gw-dossier.gw-resources-page .res-clear:hover { background: var(--gwd-light); }
.gw-resources-page .res-count {
  margin: 0 0 9px auto;
  color: var(--gwd-faint);
  font: 10px/1.3 var(--gwd-sans);
  white-space: nowrap;
}
.gw-resources-page .res-empty {
  margin: 0;
  padding: 20px 0;
  color: var(--gwd-faint);
  font: 13px/1.6 var(--gwd-serif);
}

/* ── Items ─────────────────────────────────────────────────────────────────── */
.gw-resources-page .gw-resources-list { margin: 0; padding: 0; list-style: none; }
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-item {
  margin: 0;
  padding: 11px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--gwd-line-soft);
}
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-item:last-child { border-bottom: 0; }
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-item:hover { background: none; }
.gw-resources-page .gw-resources-item-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
/* Stated explicitly: the theme's link colour would otherwise win. */
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-item-title,
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-item-title:visited {
  color: var(--gwd-ink) !important;
  font: 600 15px/1.35 var(--gwd-sans) !important;
  text-decoration: none;
}
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-item-title:hover {
  color: var(--gwd-orange) !important;
}
.gw-resources-page .gw-resources-item-meta {
  margin-top: 3px;
  color: var(--gwd-faint);
  font: 10px/1.4 var(--gwd-sans);
  letter-spacing: .02em;
}
.gw-resources-page .gw-resources-item-desc {
  margin-top: 5px;
  max-width: 74ch;
  color: var(--gwd-text2);
  font: 12px/1.6 var(--gwd-serif);
}
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-badge {
  padding: 2px 7px;
  color: var(--gwd-green-text);
  background: var(--gwd-green-soft);
  border-radius: 0;
  font: 850 8px/1.5 var(--gwd-sans);
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* Not every theme defines this, and the expand buttons depend on it for their
   accessible names. */
.gw-resources-page .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Catalog ledger ────────────────────────────────────────────────────────── */
/* The catalogs are a table because they are compared: years, extent of
   documentation, and how much of the hook catalog rests on each. Every other
   resource type stays a list — a website has nothing to line up. */
.gw-resources-page .res-scroll { overflow-x: auto; }
.gw-resources-page .res-table { width: 100%; border-collapse: collapse; }
.gw-resources-page .res-table thead th {
  padding: 0 10px 7px;
  color: var(--gwd-faint);
  text-align: left;
  border-bottom: 2px solid var(--gwd-rule);
  font: 850 8px/1.3 var(--gwd-sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}
.gw-resources-page .res-table thead th:first-child,
.gw-resources-page .res-table tbody td:first-child { padding-left: 0; }
.gw-resources-page .res-col-x  { width: 30px; }
.gw-resources-page .res-col-yr { width: 130px; white-space: nowrap; }
.gw-resources-page .res-col-n  { width: 74px; text-align: right; }
.gw-resources-page .res-col-mk { width: 170px; font: 12px/1.4 var(--gwd-sans); color: var(--gwd-text2); }
/* ── Sortable headers ──────────────────────────────────────────────────────── */
/* The affordance is added by the script, so a header only looks clickable when
   it is. */
.gw-resources-page .res-table thead th.is-sortable {
  cursor: pointer;
  user-select: none;
}
.gw-resources-page .res-table thead th.is-sortable:hover { color: var(--gwd-ink); }
.gw-resources-page .res-table thead th.is-sortable:focus-visible {
  outline: 2px solid var(--gwd-orange);
  outline-offset: -2px;
}
.gw-resources-page .res-table thead th.is-sortable::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  opacity: .25;
}
.gw-resources-page .res-table thead th[aria-sort="ascending"]::after {
  border-top: 0;
  border-bottom: 4px solid var(--gwd-orange);
  opacity: 1;
}
.gw-resources-page .res-table thead th[aria-sort="descending"]::after {
  border-top: 4px solid var(--gwd-orange);
  opacity: 1;
}
.gw-resources-page .res-table thead th[aria-sort]:not([aria-sort="none"]) { color: var(--gwd-ink); }

html body .gw-entry.gw-dossier.gw-resources-page .res-table tbody td {
  padding: 10px;
  vertical-align: top;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--gwd-line-soft);
  font: 13px/1.45 var(--gwd-serif);
}
.gw-resources-page .res-row:hover td { background: var(--gwd-light); }
html body .gw-entry.gw-dossier.gw-resources-page a.res-title,
html body .gw-entry.gw-dossier.gw-resources-page a.res-title:visited {
  color: var(--gwd-ink) !important;
  font: 600 14px/1.35 var(--gwd-sans) !important;
  text-decoration: none;
}
html body .gw-entry.gw-dossier.gw-resources-page a.res-title:hover { color: var(--gwd-orange) !important; }
.gw-resources-page .res-desc { margin-top: 3px; max-width: 70ch; color: var(--gwd-faint); font: 12px/1.5 var(--gwd-serif); }
.gw-resources-page .res-n { font: 600 13px/1.4 var(--gwd-sans); }
.gw-resources-page .res-n.is-zero { color: #a8ada9; } /* theme: fixed */


html body .gw-entry.gw-dossier.gw-resources-page .res-x {
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--gwd-text2);
  background: var(--gwd-surface);
  border: 1px solid var(--gwd-line-strong);
  border-radius: 0;
  font: 700 12px/1 var(--gwd-sans);
  cursor: pointer;
}
html body .gw-entry.gw-dossier.gw-resources-page .res-x:hover { background: var(--gwd-light); }
.gw-resources-page .res-x:focus-visible { outline: 2px solid var(--gwd-orange); outline-offset: 1px; }

/* ── Detail panel ──────────────────────────────────────────────────────────── */
html body .gw-entry.gw-dossier.gw-resources-page .res-detail td {
  padding: 0 10px 18px;
  background: var(--gwd-light);
}
.gw-resources-page .res-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  padding-top: 14px;
}
html body .gw-entry.gw-dossier.gw-resources-page .res-detail h4 {
  margin: 0 0 8px !important;
  color: var(--gwd-faint) !important;
  font: 850 8px/1 var(--gwd-sans) !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
}
html body .gw-entry.gw-dossier.gw-resources-page .res-detail h4 ~ h4 { margin-top: 16px !important; }
.gw-resources-page .res-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}
html body .gw-entry.gw-dossier.gw-resources-page .res-pages li {
  margin: 0;
  padding: 3px 8px;
  color: var(--gwd-text2);
  background: var(--gwd-surface);
  border: 1px solid var(--gwd-line);
  font: 10px/1.4 var(--gwd-sans);
}
/* A page whose folder holds scans is marked; the rest are placeholders that
   exist so a citation can point at them before photography. */
.gw-resources-page .res-pages li.has-img { border-color: var(--gwd-green-text); }
.gw-resources-page .res-pages li span { color: var(--gwd-faint); }
.gw-resources-page .res-note { margin: 0 0 7px; max-width: 74ch; color: var(--gwd-text2); font: 12px/1.6 var(--gwd-serif); }
.gw-resources-page .res-note b { color: var(--gwd-ink); }
.gw-resources-page .res-more { color: var(--gwd-faint); }
.gw-resources-page .res-cites { margin: 0; padding: 0; list-style: none; }
html body .gw-entry.gw-dossier.gw-resources-page .res-cites li {
  margin: 0;
  padding: 5px 0;
  border-bottom: 1px solid var(--gwd-line-soft);
  font: 12px/1.45 var(--gwd-serif);
}
html body .gw-entry.gw-dossier.gw-resources-page .res-cites li:last-child { border-bottom: 0; }
html body .gw-entry.gw-dossier.gw-resources-page .res-cites a,
html body .gw-entry.gw-dossier.gw-resources-page .res-cites a:visited {
  color: var(--gwd-ink) !important;
  font: 600 12px/1.4 var(--gwd-sans) !important;
  text-decoration: none;
}
html body .gw-entry.gw-dossier.gw-resources-page .res-cites a:hover { color: var(--gwd-orange) !important; }
.gw-resources-page .res-cites span { color: var(--gwd-faint); font: 10px/1.4 var(--gwd-sans); }
.gw-resources-page .res-cites span::before { content: "· "; }

@media (max-width: 860px) {
  .gw-resources-page .res-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .gw-resources-page .res-table { min-width: 720px; }
}

/* ── Documented pages ──────────────────────────────────────────────────────── */
.gw-resources-page .gw-resources-pages-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
html body .gw-entry.gw-dossier.gw-resources-page .gw-resources-page-item {
  margin: 0;
  padding: 3px 8px;
  color: var(--gwd-text2);
  background: var(--gwd-wash);
  border: 1px solid var(--gwd-line);
  font: 10px/1.4 var(--gwd-sans);
}
.gw-resources-page .gw-resources-page-citations { color: var(--gwd-faint); }

/* ── Narrow ────────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .gw-resources-page .res-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gw-resources-page .res-facts > div:nth-child(2) { border-right: 0; }
  .gw-resources-page .res-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--gwd-line); }
}
@media (max-width: 600px) {
  .gw-resources-page .res-toolbar { flex-direction: column; align-items: stretch; }
  .gw-resources-page .res-count { margin: 0; }
}
