/* The Species and Measurements finders (assets/finder.js; Betty 2026-11-15). The band, tabs, list
   card and preview shell are Browse datasets' own (assets/browse.css); this adds what differs. */

/* the three catalogs as one quiet line (option d, Betty 2026-11-16): the open one dark and bold, the
   others lighter, dots between, no underline. The page's own views sit under it on a light strip, the
   open view raised. Also on Browse datasets. */
/* the row wraps: its three words and their counts are about 368 px at their narrowest, so at 375 px it fitted with
   under 8 px to spare on a Mac and ran 2 to 4 px over wherever the mono face of the counts is wider (Linux; seen
   as a sideways scroll of all three catalog pages in the PR workflow, 2026-11-17) */
/* the three catalogs as a tab bar (Betty 2026-11-19, mockup "The three catalogs", option 1): the one you are on bold
   with a slate bar under it, the others in link blue with a light bar on hover, all on one rule */
.cf-crumb { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 32px; margin: 0 0 6px; border-bottom: 1px solid color-mix(in srgb, var(--fg) 16%, var(--bg)); }
.cf-crumb a { display: flex; align-items: baseline; gap: 8px; padding: 10px 2px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--accent); text-decoration: none; }
.cf-crumb b { font-size: 19px; font-weight: 600; }
.cf-crumb span { font: 600 13.5px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.cf-crumb a:hover { border-bottom-color: color-mix(in srgb, var(--accent) 30%, var(--bg)); }
.cf-crumb a:hover b { color: var(--accent); }
.cf-crumb a[aria-current="page"] { color: var(--fg); border-bottom-color: #3a4b64; }
[data-theme="dark"] .cf-crumb a[aria-current="page"] { border-bottom-color: var(--fg); }
.cf-crumb a[aria-current="page"] b { font-weight: 700; color: var(--fg); }
.cf-crumb a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.bd-views > .tabrow { gap: 4px; align-items: center; margin: 0 0 16px; padding: 4px; border: 0; border-radius: 8px;
  background: color-mix(in srgb, var(--fg) 6%, var(--bg)); }
.bd-views > .tabrow button { padding: 5px 14px; border: 0; border-radius: 6px; font-size: 14.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.bd-views > .tabrow button:hover { color: var(--fg); }
.bd-views > .tabrow button[aria-selected="true"] { color: var(--fg); font-weight: 700; background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.12); border-bottom: 0; }
.bd-views > .tabrow .bd-count { font-size: 13px; padding-right: 10px; }
@media (max-width: 640px) {
  .cf-crumb { gap: 0 20px; } .cf-crumb b { font-size: 16px; }
  .bd-views > .tabrow .bd-count { display: none; }
}

.cf-find { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.cf-lists, .cf-pv { min-width: 0; }
.ys { display: block; width: 100%; height: 5px; border-radius: 3px; overflow: hidden; }
.ys .bg { fill: color-mix(in srgb, var(--border) 60%, var(--bg)); }
.ys .on { fill: var(--accent); }

/* column heads and rows */
.cf-colh { position: sticky; top: var(--header-h, 72px); z-index: 3; display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px 150px; gap: 16px;
  padding: 9px 18px 8px; margin-bottom: 10px; background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cf-colh.cf-m { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 150px; }
.cf-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.cf-r { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px 150px; gap: 16px; align-items: center; padding: 10px 18px;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); color: var(--fg); text-decoration: none; }
.cf-r.cf-m { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 150px; padding: 12px 18px; }
.cf-r:first-child { border-top: 0; }
.cf-r:hover { background: color-mix(in srgb, var(--panel) 70%, var(--bg)); }
.cf-r.on { background: var(--accent-bg); }
.cf-r.on .cf-nm b { color: var(--accent); }
.cf-r:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cf-r, .cf-r:hover, .cf-r * { text-decoration: none; }
.cf-th { width: 44px; height: 30px; display: grid; place-items: center; }
.cf-si { display: block; width: 44px; height: 28px; color: var(--fg); fill: currentColor; opacity: .75; }
.cf-nm { min-width: 0; }
.cf-nm b { display: block; font-size: 15.5px; line-height: 1.3; }
.cf-nm > span { font-size: 12.5px; color: var(--muted); }
.cf-ds { font-size: 13px; line-height: 1.35; color: color-mix(in srgb, var(--fg) 80%, var(--bg)); }
.cf-ds small { display: block; color: var(--muted); font-size: 12px; }
.cf-yr > span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.cf-sci { font-weight: 400; color: var(--muted); font-size: .86em; }

/* species groups */
.cf-gg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cf-gc { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--bg); box-shadow: 0 2px 10px rgba(0, 0, 0, .04); transition: border-color .15s, transform .15s; }
.cf-gc:hover { border-color: var(--accent); transform: translateY(-2px); }
.cf-gc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-gs { height: 56px; display: flex; align-items: center; margin-bottom: 10px; }
.cf-gs .cf-si { width: 110px; height: 56px; opacity: .85; }
.cf-gc b { font-size: 17px; }
.cf-gc b .cf-sci { font-size: 13.5px; }
.cf-gl { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cf-gt { font-size: 13px; margin-top: 8px; color: color-mix(in srgb, var(--fg) 80%, var(--bg)); }
.cf-chip { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-weight: 600; }

/* measurement categories (issue #30 D8): each a closed group — a button saying its name, what is inside
   and how many — that a press opens. `hidden` is the state; a display rule must not undo it. */
.cf-gbody[hidden] { display: none; }
.cf-grp { scroll-margin-top: calc(var(--header-h, 72px) + 56px); }
.cf-grp + .cf-grp { margin-top: 10px; }
.cf-gh { margin: 0; font: inherit; }
.cf-gb { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg); box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
.cf-gb:hover { border-color: var(--accent); }
.cf-gb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-gb[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.cf-gb[aria-expanded="true"] .cf-chev { transform: rotate(180deg); }
.cf-gbody { margin-top: 6px; }
.cf-gbody .cf-colh { margin-bottom: 8px; }
.cf-gi { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-bg); }
.cf-gi .cc-i { font-size: 18px; color: var(--accent); }
.cf-gx { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.cf-gname { font-size: 16px; font-weight: 700; line-height: 1.3; }
.cf-gtop { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-gn { flex: none; margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cf-chev { flex: none; font-size: 16px; color: var(--muted); transition: transform .15s; }
@media (prefers-reduced-motion: reduce) { .cf-chev { transition: none; } }
/* without JavaScript the list is main's own, in <noscript>: no preview beside it, so it takes the row */
.cf-find:has(.cf-nojs) { grid-template-columns: minmax(0, 1fr); }
/* with nothing chosen (every category closed) the preview says what to do */
.cf-none h2 { font-size: 19px; }
.cf-none .cf-d { display: block; -webkit-line-clamp: none; overflow: visible; }

/* species, a search: the taxa that are not species rows (a genus, a family …), apart from the list */
.cf-hi { margin-top: 26px; scroll-margin-top: calc(var(--header-h, 72px) + 16px); }
.cf-hih { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cf-hih span { margin-left: 6px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.cf-hin { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.cf-r.cf-h { grid-template-columns: minmax(0, 1fr) 150px 150px; }
.cf-open { display: block; font-size: 12.5px; color: var(--accent); font-weight: 700; }
.cf-hij { font-weight: 400; }
.cf-more, .cf-empty { color: var(--muted); font-size: 14px; padding: 14px 4px; margin: 0; }
.cf-lnk { all: unset; cursor: pointer; color: var(--accent); font-weight: 700; }
.cf-lnk:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* the preview */
.cf-pv { position: sticky; top: calc(var(--header-h, 72px) + 14px); border: 1px solid var(--border); border-radius: 14px; background: var(--bg); box-shadow: 0 8px 30px rgba(0, 0, 0, .08); }
.cf-pic { position: relative; height: 190px; background: var(--panel); display: grid; place-items: center; border-bottom: 1px solid var(--border); border-radius: 14px 14px 0 0; overflow: hidden; }
.cf-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cf-pvsi { display: block; width: 70%; height: 70%; color: var(--fg); fill: currentColor; opacity: .7; }
.cf-pic.nophoto .cf-lic { display: none; }
.cf-lic { position: absolute; right: 8px; bottom: 8px; font-size: 11px; background: color-mix(in srgb, var(--bg) 85%, transparent); color: var(--muted); padding: 2px 6px; border-radius: 5px; }
.cf-pb { padding: 14px 18px 16px; }
.cf-k { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.cf-pv h2 { margin: 6px 0 0; font-size: 22px; line-height: 1.2; }
.cf-sub { margin: 2px 0 0; font-size: 14px; color: color-mix(in srgb, var(--fg) 75%, var(--bg)); }
.cf-d { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: color-mix(in srgb, var(--fg) 82%, var(--bg));
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cf-src { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
/* a link inside a sentence is not told apart by colour alone (WCAG 1.4.1) */
.cf-src a { color: var(--accent); text-decoration: underline; }
.cf-def { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.cf-def b { display: block; color: var(--fg); font-size: 12.5px; margin-bottom: 2px; }
.cf-f { display: flex; gap: 24px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.cf-f dt { font-size: 12.5px; color: var(--muted); }
.cf-f dd { margin: 1px 0 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cf-y { margin-top: 12px; }
.cf-y > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.cf-y b, .cf-dsl > b, .cf-dlh { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.cf-y span { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.ys.big { height: 9px; margin-top: 6px; }
.cf-ax { position: relative; height: 14px; margin-top: 3px; font-size: 11px; color: var(--muted); }
.cf-ax span { position: absolute; top: 0; transform: translateX(-50%); }
.cf-ax span:first-child, .cf-ax span:last-child { transform: none; }

/* the datasets it is in: one compact line each */
.cf-dsl { margin-top: 10px; }
.cf-dsl ul { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 45%, var(--bg)); overflow: hidden; }
.cf-dsl li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 11px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.cf-dsl li:first-child { border-top: 0; }
.cf-dsl li b { font-size: 14px; min-width: 0; }
.cf-dsl li:has(> a) { padding: 0; }
.cf-dsl li > a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex: 1; padding: 7px 11px; color: inherit; text-decoration: none; }
.cf-dsl li > a:hover { background: color-mix(in srgb, var(--accent-bg) 70%, var(--bg)); }
.cf-dsl li > a:hover b { color: var(--accent); }
.cf-dsl li > a > span { margin-left: auto; }
.cf-go { font-style: normal; color: var(--muted); font-size: 16px; line-height: 1; }
.cf-dsl li > a:hover .cf-go { color: var(--accent); }
.cf-dsl li span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cf-dsl li em { font-style: normal; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }

/* View on map · Full page */
.cf-act { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.cf-b1 { height: 38px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 8px; background: var(--cta-bg); color: var(--cta-fg);
  font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.cf-b1:hover { filter: brightness(.95); }
.cf-b3 { margin-left: auto; color: var(--accent); font-weight: 700; font-size: 13.5px; text-decoration: none; white-space: nowrap; }

@media (max-width: 1000px) {
  .cf-find { grid-template-columns: 1fr; }
  /* one column: a row opens its own page (as under 700 px before; the stacked preview pushed the list off a tablet's screen too) */
  .cf-pv { display: none !important; }
  .cf-gg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  /* on a phone a row opens its own page; the preview would push the list off the screen */
  .cf-pv { display: none !important; }
  .cf-colh { display: none; }
  .cf-r, .cf-r.cf-m { grid-template-columns: 44px minmax(0, 1fr); }
  .cf-r.cf-m, .cf-r.cf-h { grid-template-columns: 1fr; }
  .cf-gb { padding: 10px 12px; gap: 10px; }
  .cf-gn { font-size: 12.5px; }
  .cf-r .cf-ds { display: none; }
  /* a taxon that is not a species still says what it holds: that is what tells a genus from a family */
  .cf-r.cf-h .cf-ds { display: block; }
  .cf-r .cf-yr { grid-column: 1 / -1; }
  .cf-gg { grid-template-columns: 1fr; }
}
