/* Category hub pages — pages/<cat>-tools.html

   These pages used to be the tool workspaces: a tab bar over nine stacked
   panels. The panels now live on their own pages (pages/tools/<slug>.html)
   and the hubs are editorial, so none of the old .img-panel/.qr-tab chrome
   is needed here. This file styles prose, a chooser table and a tool grid.

   Loaded alongside design-system.css, which supplies the tokens. */

.ch-hero {
  padding: 60px 0 44px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.ch-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 60% at 72% 45%, rgba(124, 108, 255, 0.09), transparent 70%);
  pointer-events: none;
}
.ch-hero > .container { position: relative; }
.ch-crumb { font-size: 13px; color: var(--text3); margin-bottom: 16px; }
.ch-crumb a { color: var(--text3); }
.ch-crumb a:hover { color: var(--text2); }
.ch-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 12px;
}
.ch-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}
.ch-hero .ch-lede {
  font-size: 16.5px;
  color: var(--text2);
  line-height: 1.75;
  max-width: 660px;
}
.ch-facts {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text2);
}

/* ── layout ── */
.ch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 44px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
  align-items: start;
}
/* A grid item's default min-width is auto, i.e. its min-content width — so
   .ch-table's min-width:520px propagated up and forced the whole column to
   520px at a 360px viewport, pushing the page sideways instead of letting
   the table scroll inside .ch-table-wrap. min-width:0 lets the column
   shrink and hands the overflow back to the wrapper that handles it. */
.ch-layout > * { min-width: 0; }

/* ── prose ── */
.ch-main h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 44px 0 14px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.ch-main > h2:first-child { margin-top: 0; }
.ch-main h3 { font-size: 17.5px; font-weight: 700; margin: 26px 0 8px; }
.ch-main p { font-size: 15.5px; color: var(--text2); line-height: 1.8; margin-bottom: 15px; }
.ch-main ul, .ch-main ol { margin: 0 0 17px 21px; }
.ch-main li { font-size: 15.5px; color: var(--text2); line-height: 1.78; margin-bottom: 9px; }
.ch-main a { color: var(--accent2); }
.ch-main code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--text);
}
.ch-lead { font-size: 17px; color: var(--text); line-height: 1.75; margin-bottom: 18px; }

/* ── chooser table ── */
.ch-table-wrap { overflow-x: auto; margin: 18px 0 10px; }
.ch-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.ch-table th, .ch-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
  color: var(--text2);
  vertical-align: top;
}
.ch-table th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  font-weight: 700;
  white-space: nowrap;
}
.ch-table td:first-child { color: var(--text); }
.ch-table tbody tr:hover { background: var(--surface); }
.ch-table a { font-weight: 600; white-space: nowrap; }

/* ── tool grid ── */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
}
.ch-tool {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: all var(--t);
}
.ch-tool:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 108, 255, 0.14);
}
.ch-tool-top { display: flex; align-items: center; gap: 10px; }
.ch-tool-icon { font-size: 21px; line-height: 1; }
.ch-tool-name { font-size: 14.5px; font-weight: 700; color: var(--text); }
.ch-tool-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }

/* ── faq ── */
.ch-faq details {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--surface);
}
.ch-faq summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--text); }
.ch-faq details p { margin: 11px 0 0; font-size: 14.5px; }

/* ── aside ── */
.ch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 16px;
}
.ch-card h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 800; margin-bottom: 13px; }
.ch-card ul { margin: 0; padding: 0; list-style: none; }
.ch-card li { margin-bottom: 10px; font-size: 13.5px; line-height: 1.55; }
.ch-card li:last-child { margin-bottom: 0; }
.ch-card a { color: var(--accent2); text-decoration: none; }
.ch-card a:hover { text-decoration: underline; }
.ch-card p { font-size: 13.5px; color: var(--text2); line-height: 1.7; margin: 0 0 10px; }
.ch-jump a { display: block; padding: 4px 0; }

.ch-cta {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all var(--t);
}
.ch-cta:hover { background: var(--accent2); color: #fff; box-shadow: var(--shadow-accent); }

@media (max-width: 900px) {
  .ch-layout { grid-template-columns: minmax(0, 1fr); gap: 34px; padding: 36px 20px 64px; }
  .hide-mobile { display: none; }
}

@media (max-width: 560px) {
  /* The chooser table has three columns of prose and cannot usefully
     collapse, so it scrolls inside its wrapper. Narrowing its min-width
     here keeps the amount of sideways travel reasonable on a phone. */
  .ch-table { min-width: 460px; }
  .ch-grid { grid-template-columns: 1fr; }
}
