/* Capsule Tools — the ONE app-card style. Single source of truth for the card used on
   category hubs, /search/, /tags/*, and each help page's "Related tools" section. The React
   in-app counterpart (packages/ui/OutputExtras.module.css) is a documented mirror of this
   file (like SideDrawer.tsx ↔ the static drawer). Depends on the design tokens that every
   page already defines in :root (--accent, --rule, --surface, --ink, --ink-soft) + light-dark().
   EDIT THE CARD HERE — nowhere else. */

.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 1rem = the column gap (center) AND the row gap (below each card), so cards are evenly
     spaced horizontally + vertically; also matches the 1rem left/right screen padding. */
  gap: 1rem;
  margin-top: 0.85rem;
}

/* Card = a grid: title spans the full width on top, then icon | desc below; the help "?"
   is absolutely tucked into the top-right corner. */
.tool-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "title title"
    "icon  desc";
  column-gap: 0.5rem;
  row-gap: 0.25rem;
  align-items: center;
  background: linear-gradient(rgba(22,163,74,0.06), rgba(22,163,74,0.06)), var(--surface);
  border: 2px solid light-dark(rgba(22,163,74,0.30), rgba(74,222,128,0.28));
  border-radius: 15px;   /* = help icon radius (30px ÷ 2), so the corner merges with the icon */
  /* top padding 0 so the title's centered text lines up with the corner help icon's center
     (the 30px title min-height supplies the top breathing room). */
  padding: 0 0.7rem 0.55rem;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tool-row:active { border-color: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.tool-card-thumb {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid light-dark(rgba(22,163,74,0.30), rgba(74,222,128,0.28));
}

.tool-card-title {
  grid-area: title;
  min-width: 0;
  min-height: 30px;        /* accommodate the corner help icon's diameter */
  display: flex;
  align-items: center;
  padding-right: 2rem;     /* keep the title clear of the corner help icon */
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}

/* Whole-card tap → the tool: the tool name is the anchor text (internal-link SEO),
   and its ::after stretches over the entire card so any tap navigates to the tool. */
.tool-card-link { color: inherit; text-decoration: none; }
.tool-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 15px;
}

.tool-card-desc {
  grid-area: desc;
  min-width: 0;
  font-size: 0.65rem;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0;
}

/* Help "?" tucked into the top-right corner: its top-right quadrant arc coincides exactly
   with the card's corner (both radius 15px). The -2px offsets align its border-box with the
   card's border-box corner (the card has a 2px border), so the two curves merge into one. */
.tool-card-help {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: transparent;
  border: 2px solid light-dark(rgba(22,163,74,0.30), rgba(74,222,128,0.28));
  color: light-dark(rgba(22,163,74,0.7), rgba(74,222,128,0.72));
  font-family: system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.tool-card-help:active {
  background: var(--rule);
  transform: scale(0.92);
}
