/* ==========================================================================
   RESOURCES — a supporting layer in the house shell.

   No new identity. Every colour, face and step here is a house token, because
   in this product the visual languages are the artwork and a tool directory
   is not one of them. What this sheet adds is density: Resources is the one
   surface that legitimately renders 181 items, so it needs a card and a chip
   the reference pages do not.
   ========================================================================== */

/* --- category grid on the home page -------------------------------------- */
.rcats { margin-block: var(--s9) var(--s8); }
.rcats > h2 { margin-block-end: var(--s6); }
.rcatgrid { list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: var(--s6) var(--s7); }
.rcat { min-width: 0; border-block-start: 2px solid var(--ink); padding-block-start: var(--s4); }
.rcat__link { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  text-decoration: none; color: inherit; }
.rcat__link:hover .rcat__name { color: var(--brand); }
.rcat__name { font-size: var(--t-md); margin: 0; line-height: 1.15; }
.rcat__n { font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; }
.rcat__def { margin: var(--s3) 0 0; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.5; }
.rcat__subs { margin: var(--s2) 0 0; color: var(--ink-3); font-size: var(--t-xs); line-height: 1.5; }

/* --- the resource card ---------------------------------------------------- */
.rgrid { list-style: none; margin: var(--s6) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); gap: var(--s5); }
.rcard { min-width: 0; border: 1px solid var(--rule); padding: var(--s5);
  display: flex; flex-direction: column; gap: var(--s3); background: var(--paper); }
.rcard[hidden] { display: none; }
/* `display: grid` outranks the user-agent `[hidden] { display: none }`, so the
   home page's results list has to opt back out explicitly or it renders all
   181 cards before anyone has searched. */
.rgrid[hidden] { display: none; }
.rcard__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.rcard__name { margin: 0; font-size: var(--t-base); line-height: 1.25; }
.rcard__name a { color: inherit; text-decoration: none; }
.rcard__name a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: .18em; }
.rcard__type { margin: 0; font-size: var(--t-xs); color: var(--ink-3); text-align: end; }
.rcard__desc { margin: 0; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55; }
.rcard__best, .rcard__why, .rcard__less { margin: 0; font-size: var(--t-sm); line-height: 1.5; color: var(--ink-2); }
.rcard__best span, .rcard__why span, .rcard__less span {
  display: block; font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.rcard__more { margin-block-start: auto; }
.rcard__more summary { cursor: pointer; font-size: var(--t-xs); color: var(--ink-3); padding-block: var(--s2); }
.rcard__more summary:hover { color: var(--brand); }
.rcard__more[open] summary { margin-block-end: var(--s3); }
.rcard__more > * + * { margin-block-start: var(--s3); }
.rcard__go { margin: 0; }
.rcard__go a { font-size: var(--t-sm); color: var(--brand); text-underline-offset: .18em;
  /* The card's own link is the primary action, so it gets a real tap target. */
  display: inline-block; padding-block: var(--s2); }

/* --- chips: facts, never scolding ----------------------------------------- */
.rchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.rchips--trust { margin-block-start: auto; }
.rchip { font-size: var(--t-xs); line-height: 1.4; padding: .18em .5em; border: 1px solid var(--rule-firm); color: var(--ink-2); }
.rchip--access { border-color: var(--brand-edge); background: var(--brand-wash); color: var(--brand); }
/* A caution is a prompt to check something, not an error state. It borrows the
   ink, not a red — nothing here is broken. */
.rchip--caution { border-style: dashed; color: var(--ink-3); }
.rvoid { color: var(--ink-3); }

/* --- subcategory chips ---------------------------------------------------- */
.rsubs { list-style: none; margin: var(--s5) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.rsub { font: inherit; font-size: var(--t-sm); background: none; cursor: pointer;
  border: 1px solid var(--rule-firm); color: var(--ink-2); padding: var(--s2) var(--s3); }
.rsub span { color: var(--ink-3); font-size: var(--t-xs); }
.rsub:hover { border-color: var(--ink); color: var(--ink); }
.rsub[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rsub[aria-pressed="true"] span { color: var(--paper); }

/* --- comparisons ---------------------------------------------------------- */
.cmps { margin-block: var(--s9) var(--s8); }
.cmps > h2 { margin-block-end: var(--s5); }
.cmp { border-block-start: 1px solid var(--rule); }
.cmp__sum { cursor: pointer; padding-block: var(--s4); font-size: var(--t-md); line-height: 1.3; }
.cmp__sum:hover { color: var(--brand); }
.cmp__n { font-size: var(--t-xs); color: var(--ink-3); margin-inline-start: var(--s3); white-space: nowrap; }
/* A wide table scrolls inside its own box. The page never scrolls sideways. */
.cmp__scroll { overflow-x: auto; margin-block-end: var(--s6); }
.cmp__table { border-collapse: collapse; width: 100%; min-width: 44rem; font-size: var(--t-sm); }
.cmp__table caption { text-align: start; font-size: var(--t-xs); color: var(--ink-3); padding-block-end: var(--s3); }
.cmp__table th, .cmp__table td { text-align: start; vertical-align: top; padding: var(--s3) var(--s4) var(--s3) 0;
  border-block-end: 1px solid var(--rule); line-height: 1.5; }
.cmp__table thead th { font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
  border-block-end-color: var(--rule-firm); }
.cmp__table tbody th { font-weight: 600; white-space: nowrap; padding-inline-end: var(--s5); }
.cmp__table td { color: var(--ink-2); }

/* --- breadcrumb + onward ---------------------------------------------------- */
.crumb { font-size: var(--t-xs); color: var(--ink-3); margin-block-end: var(--s4); }
.crumb a { color: var(--ink-2); }
.crumb span { margin-inline: .4em; }
.rmore { margin-block: var(--s8); border-block-start: 1px solid var(--rule); padding-block-start: var(--s5); }
.rmore > h2 { font-size: var(--t-md); margin-block-end: var(--s4); }
.rmore__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); }
.rmore__list span { color: var(--ink-3); font-size: var(--t-xs); }

.field--grow { flex: 1 1 18rem; min-width: 0; }

@media (max-width: 40rem) {
  .rcard { padding: var(--s4); }
  .rcard__type { text-align: start; }
}
