/* Tools hub (/ar/tools, /en/tools), flagship 11-16 (GQC-SITE-54).
   A compact hero, then every tool on one grid: a short name you can scan, the job in one line, a category tag and a
   CSS-only filter (radio + :has, so it works in the static page and in the app's imported body alike).
   Uses the site's tokens only; the tool pages' own template lives in assets/site.css (.tl). */
.thero{padding-top:72px}
.thero h1{max-width:none;font-size:var(--gb-type-display-3-size);line-height:var(--gb-type-display-3-lh)}
.thero .sub{margin-top:14px}

.thub{position:relative;z-index:2;max-width:1200px;margin:0 auto;padding:56px var(--pad) 0;box-sizing:content-box}
.thub-h{margin:0;font-family:var(--gb-font-display);font-weight:var(--gb-weight-light);font-size:var(--gb-type-heading-1-size);line-height:var(--gb-type-heading-1-lh)}
.thub-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* the filter row */
.tf{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0 0;padding:0;border:0;min-width:0}
.tf label{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid var(--gb-border-control);border-radius:var(--gb-radius-pill);background:var(--gb-color-white);font-size:var(--gb-type-body-sm-size);color:var(--gb-text);cursor:pointer;transition:border-color var(--gb-duration-quick),background var(--gb-duration-quick)}
.tf input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.tf label span{font-variant-numeric:tabular-nums;color:var(--gb-text-muted)}
.tf label:has(input:checked){border-color:var(--gb-color-ink);background:var(--gb-color-ink);color:var(--gb-color-white)}
.tf label:has(input:checked) span{color:rgb(var(--gb-color-white-rgb) / .7)}
.tf label:has(input:focus-visible){outline:2px solid var(--gb-focus);outline-offset:2px}
@media (hover:hover){.tf label:not(:has(input:checked)):hover{border-color:var(--gb-border-strong)}}

/* the grid of tools */
.tgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:24px 0 0;padding:0;list-style:none}
.tgrid a{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto 1fr;column-gap:14px;row-gap:4px;height:100%;box-sizing:border-box;padding:20px;padding-inline-end:44px;border:1px solid var(--hair);border-radius:var(--gb-radius-md);background:var(--gb-color-white);color:var(--gb-text);text-decoration:none;transition:border-color var(--gb-duration-quick),box-shadow var(--gb-duration-quick)}
.tgrid .tg-i{grid-row:1 / span 3;width:36px;height:36px;padding:8px;box-sizing:border-box;border-radius:10px;background:rgb(var(--gb-color-indigo-mist-rgb) / .9);fill:none;stroke:var(--gb-text-brand);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.tgrid .tg-c{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:var(--gb-type-caption-size);color:var(--gb-text-muted)}
.tgrid .tg-c em{font-style:normal;padding:0 8px;border-radius:var(--gb-radius-pill);background:rgb(var(--gb-color-green-mist-rgb) / .95);color:var(--gb-color-green-deep);line-height:20px}
.tgrid b{font-family:var(--gb-font-text);font-weight:var(--gb-weight-semibold);font-size:var(--gb-type-body-size);line-height:1.5;transition:color var(--gb-duration-quick)}
.tgrid .tg-d{font-size:var(--gb-type-body-sm-size);line-height:var(--gb-type-body-sm-lh);color:var(--gb-text-muted);text-wrap:pretty}
.tgrid .ico{position:absolute;inset-inline-end:18px;top:22px;width:16px;height:16px;fill:none;stroke:var(--gb-text-muted);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;transition:transform var(--gb-motion-hover),stroke var(--gb-motion-hover)}
.tgrid a:hover{border-color:var(--gb-border-strong);box-shadow:0 18px 40px -30px rgb(var(--gb-color-night-rgb) / .35)}
.tgrid a:hover b,.tgrid a:focus-visible b{color:var(--gb-text-brand)}
.tgrid a:hover .ico{transform:translateX(-4px);stroke:var(--gb-text-brand)}
[dir=ltr] .tgrid a:hover .ico{transform:translateX(4px)}
.tgrid a:focus-visible{outline:2px solid var(--gb-focus);outline-offset:2px}

/* the filter: a category shows only its tools */
.thub:has(.tf input[value=wa]:checked) .tgrid li:not([data-c=wa]),
.thub:has(.tf input[value=calc]:checked) .tgrid li:not([data-c=calc]),
.thub:has(.tf input[value=doc]:checked) .tgrid li:not([data-c=doc]){display:none}

@media (max-width:1100px){.tgrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:860px){.thero{padding-top:48px}.thub{padding:40px var(--gutter) 0}}
@media (max-width:620px){
  .tgrid{grid-template-columns:minmax(0,1fr);gap:10px}
  .tgrid a{padding:16px;padding-inline-end:40px;column-gap:12px}
  .tgrid .tg-i{width:32px;height:32px;padding:7px}
  .tf{gap:6px}
  .tf label{padding:0 13px;gap:6px}
}
@media (prefers-reduced-motion:reduce){.tgrid a,.tgrid .ico,.tf label{transition:none}}
