/* ============================================================
   TOOL DIRECTORY — the /mcp «Tool directory» (site/src/components/ToolDirectory.astro, MAR-157, 11.2026)
   One row of tall cards, a group of tools each: the eyebrow and title at the top, the text on the card's bottom (the
   air between is the card's own height). The whole card opens the window (window.css) on its group; the dotted bar
   under the row (product-blocks.css «card-grid__bar») opens it at the top. In the window: the side menu (SideMenu,
   course.css + side-menu.css) on the left, every group with its tools as the card-grid items on the right.
   Requires: tokens.css, surface.css, patterns.css (plus-icon), product-blocks.css (card-grid parts), window.css,
   course.css, side-menu.css
   ============================================================ */

/* Each card takes three rows of the block's grid (subgrid, as the bento cards): the eyebrows, the titles and the texts
   of one row sit on shared lines whatever wraps (a two-line eyebrow does not push its title down); the text row is at
   least 12rem, so the cards stand tall and the text sits on their bottom */
.tool-dir__grid { row-gap: 0; grid-auto-rows: auto auto minmax(12rem, 1fr); }
.tool-dir__card { position: relative; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--space-xs); margin-bottom: var(--grid-gap); transition: background-color var(--duration-hover) var(--ease-hover); }
.tool-dir__card h3 { margin: 0; }
.tool-dir__text { align-self: end; padding-top: var(--space-lg); }
/* the whole card is the button: a transparent layer over it, the card's text stays plain text for search */
.tool-dir__open { position: absolute; inset: 0; z-index: 1; padding: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; }
.tool-dir__open:focus-visible { outline: var(--border-thick) solid var(--color-accent-indigo); outline-offset: var(--border-thin); }
@media (hover: hover) {
  .tool-dir__card:hover { background: color-mix(in oklab, var(--color-bg-grey), var(--color-text) 8%); }
}
.tool-dir__all { width: 100%; }

/* the plus in the card's corner: the card opens something (the .plus-icon of the FAQ and the «more» bar) */
.tool-dir__plus { position: absolute; top: var(--pad-card-fluid); right: var(--pad-card-fluid); font-size: 1.5rem; }
.tool-dir__card .tool-dir__eyebrow { padding-right: var(--space-lg); }

/* the window (.window--wide): the side menu on the left, sticky in the window's own scroll; the groups on the right */
.tool-dir__window { --nav-height: 0rem; }
.tool-dir__inner { --window-gap: var(--space); }
.tool-dir__body { display: grid; grid-template-columns: 18rem minmax(0, 1fr); gap: var(--space-md); } /* the menu's column runs as tall as the groups, so the menu sticks */
.tool-dir__window .course-menu { --menu-bg: var(--color-bg); --menu-current-bg: var(--color-text); --menu-current-ink: var(--color-text-inverted); top: var(--space-sm); } /* the page black on the grey window; the current row a white pill */
.tool-dir__groups { display: grid; gap: var(--space-lg); }
.tool-dir__group { display: flex; flex-direction: column; gap: var(--space-xs); scroll-margin-top: var(--space-md); }
.tool-dir__group h3 { margin: 0 0 var(--space-xs); }
/* the group's fuller description in the window: the lesson's text (course.css .course-text, Reading M) at a reading
   measure, the list a step below it */
.tool-dir__about { max-width: 48rem; margin-bottom: var(--space-xs); }
/* a link in it (to the product's page, e.g. Stage): the text-link colour of the page, as the FAQ answers */
.tool-dir__about a { color: var(--color-text-link); text-decoration: none; transition: color var(--duration-hover) var(--ease-hover); }
@media (hover: hover) { .tool-dir__about a:hover { color: var(--color-text); } }
/* a rule's logic line quoted in the description (Rules & logs: «IF cpc[last_3d] > 2 THEN …»): the tool name's chip
   shape (product-blocks.css .card-grid__chip) inline in the text, but grey — a control's grey on the grey window, not
   the tools' blue (Liliya, 13.11.2026); a long one wraps with its fill on every line */
.tool-dir__code { padding: 0.05em var(--space-xxs); border-radius: var(--radius-xs); background: var(--color-bg-cta-grey); color: var(--color-text); font-family: inherit; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.tool-dir__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-sm); }
.theme-dark .tool-dir__item, .tool-dir__item { background: var(--color-bg); } /* the page black on the grey window: an item reads as a card */
/* a small card standing alone in the window (no frame around it): the card radius and Layout/Padding/Card (24), as the
   use-case accordion cards — not card-grid__item's nested radius (16 − 8, for a framed panel) nor the fluid 32 (review 11.11.2026) */
.tool-dir__window .tool-dir__item { border-radius: var(--radius-lg); padding: var(--pad-card); }
.tool-dir__item p { margin: 0; }

@media (max-width: 61.9375rem) {
  .tool-dir__grid { grid-auto-rows: auto auto minmax(8rem, 1fr); }
}
@media (max-width: 47.9375rem) {
  .tool-dir__grid { grid-auto-rows: auto; }
  .tool-dir__text { padding-top: var(--space-sm); }
  .tool-dir__list { grid-template-columns: 1fr; }
  /* the side menu is the bottom bar, as on the course pages (course.css): the menu column lies over the groups in one
     cell and runs their full height, the bar sticks to its foot — so it stays at the window's bottom while it scrolls */
  .tool-dir__body { grid-template-columns: 1fr; }
  .tool-dir__body > .tool-dir__menu, .tool-dir__body > .tool-dir__groups { grid-area: 1 / 1; }
  .tool-dir__groups { padding-bottom: var(--space-xl); } /* room for the bar */
  .tool-dir__menu { display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; z-index: 2; }
  .tool-dir__window .course-menu { top: auto; bottom: var(--space-sm); pointer-events: auto; }
}
