/* ============================================================
   Topic entry hubs (remaining-168 T01, owner review 2026-09-15; LOCAL PILOT).
   Pilots: /dc/how-claims-work and /dc/pay. Loaded after guide-reading.css and
   condition-hubs.css on those pages only; every selector sits under
   body.th-hub, so no other page moves.

   - Compact opening: the reading-shell hero with a smaller illustration and
     the Share row and Guide Advisor stacked tightly.
   - Journey cards (.th-card): the primary choices, a square contained
     thumbnail beside the title, full description, gold card border.
   - Reference cards (.th-ref-card): supporting destinations inside a gold
     group boundary (a reading-shell disclosure on long hubs, a static panel
     on short ones). One quiet neutral outline per card; the gold stays on the
     group. PROPOSED page-scoped exception to THE BUTTON LAW, pending the
     owner's visual review; not a sitewide rule.
   ============================================================ */

/* ---------- compact opening ---------- */
body.th-hub:not(.th-keep-opening) #main-content .gr-hero { grid-template-columns: minmax(0, 1fr) 160px; gap: 32px; margin: 6px 0 14px; }
body.th-hub:not(.th-keep-opening) #main-content .gr-hero h1 { margin-bottom: 12px; }
body.th-hub:not(.th-keep-opening) .gr-utility-bar { margin: 0 0 12px; padding: 8px 0; border-bottom: 0; }
body.th-hub:not(.th-keep-opening) #ask-guide-mount .ask-guide { margin: 0 0 26px; }

body.th-hub section.chub-section { margin-bottom: 30px; }

/* ---------- numbered journey stages ---------- */
body.th-hub .th-steps { counter-reset: th-step; }
body.th-hub .th-stage { margin: 0 0 34px; }
body.th-hub .th-stage .chub-section-head { margin-bottom: 14px; }
body.th-hub .th-stage .chub-section-head h2 { font-size: 30px; margin: 0; }
body.th-hub .chub-section-head > p { margin: 6px 0 0; max-width: none; text-align: left; }
/* The number is decorative: the empty alt text keeps it out of the heading's
   accessible name, so "Before you file" is announced once. */
body.th-hub .th-stage .chub-section-head h2::before {
  counter-increment: th-step;
  content: counter(th-step) / "";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: 12px;
  vertical-align: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #1a1a1a;
  font: 700 17px/1 var(--font-sans);
}

/* ---------- journey cards ---------- */
body.th-hub .th-journey-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; } /* cards in one row share a height; rows stay independent */
body.th-hub .th-journey-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* A featured first card across the top, then even rows (calculators). */
@media (min-width: 761px) { body.th-hub .th-journey-grid--feature { grid-template-rows: auto; grid-auto-rows: 1fr; } }
body.th-hub .th-journey-grid--feature > .th-card:first-child { grid-column: 1 / -1; }
body.th-hub .th-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 16px 18px;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: 12px;
}
body.th-hub .th-card:hover { background: var(--chub-hover); border-color: var(--color-primary); }
body.th-hub .th-card:focus-visible,
body.th-hub .th-ref-card:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
body.th-hub .th-card-thumb {
  flex: none;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 8px;
  background: #f5efe3;                              /* the illustrations' own ivory, both themes */
}
body.th-hub .th-card-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
body.th-hub .th-card-copy { flex: 1; min-width: 0; }
body.th-hub .th-card h3 {
  margin: 2px 0 6px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.22;
  color: var(--chub-ink);
  text-align: left;
  overflow-wrap: anywhere;
}
body.th-hub .th-card--lead h3 { font-weight: 700; }
body.th-hub .th-card-desc { display: block; font: 400 15px/1.5 var(--font-sans); color: var(--color-text-muted); }

/* ---------- reference groups ---------- */
body.th-hub .th-ref .guide-details > summary h2 { flex: 1 1 auto; }
body.th-hub .th-ref .guide-details > summary .th-count {
  margin-left: auto;
  font: 500 13px/1.4 var(--font-sans);
  color: var(--color-text-muted);
  white-space: nowrap;
}
body.th-hub .th-ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
body.th-hub .th-ref-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.th-hub .th-ref-card {
  display: block;
  min-width: 0;
  padding: 14px 16px;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
body.th-hub .th-ref-card:hover { border-color: var(--color-primary); background: var(--chub-hover); }
body.th-hub .th-ref-card h3 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--chub-ink);
  text-align: left;
  overflow-wrap: anywhere;
}
body.th-hub .th-ref-desc { display: block; font: 400 14.5px/1.5 var(--font-sans); color: var(--color-text-muted); }
/* Compact card with a small contained thumbnail (benefits); rows share a height. */
body.th-hub .th-ref-grid:has(.th-ref-card--thumb) { align-items: stretch; }
body.th-hub .th-ref-card--thumb { display: flex; align-items: flex-start; gap: 12px; }
body.th-hub .th-ref-thumb { flex: none; width: 72px; height: 72px; overflow: hidden; border-radius: 6px; background: #f5efe3; }
body.th-hub .th-ref-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
body.th-hub .th-ref-copy { flex: 1; min-width: 0; }
/* A short hub's supporting groups: the same cards inside a static gold panel. */
body.th-hub .th-ref-panel {
  margin: 0 0 18px;
  padding: 20px 24px 22px;
  border: 1px solid var(--color-accent);
  border-radius: 11px;
  background: var(--color-surface);
}
body.th-hub .th-ref-panel > .th-ref-intro { margin: -6px 0 14px; max-width: none; font: 400 15px/1.55 var(--font-sans); color: var(--color-text-muted); text-align: left; }
body.th-hub .th-ref-panel > h2 { margin: 0 0 14px; font-size: 24px; line-height: 1.25; color: var(--chub-ink); text-align: left; }
body.th-hub .th-ref-panel .th-ref-card { background: var(--color-bg); }

@media (max-width: 1000px) {
  body.th-hub .th-journey-grid--three, body.th-hub .th-ref-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body.th-hub:not(.th-keep-opening) #main-content .gr-hero .gr-hero-art { max-width: 150px; margin-top: 12px; }
  body.th-hub .th-journey-grid, body.th-hub .th-journey-grid--three,
  body.th-hub .th-ref-grid, body.th-hub .th-ref-grid--three { grid-template-columns: minmax(0, 1fr); }
  body.th-hub .th-card { padding: 14px; }
  body.th-hub .th-card-thumb { width: 76px; height: 76px; }
  body.th-hub .th-card h3 { font-size: 18px; }
  body.th-hub .th-card-desc { font-size: 14px; }
  body.th-hub .th-ref-card h3 { font-size: 18px; }
  body.th-hub .th-ref-desc { font-size: 14px; }
  body.th-hub .th-stage .chub-section-head h2 { font-size: 25px; }
  body.th-hub .th-stage .chub-section-head h2::before { width: 30px; height: 30px; font-size: 15px; vertical-align: 3px; }
  body.th-hub .th-ref-panel { padding: 16px; }
  body.th-hub .th-ref-thumb { width: 64px; height: 64px; }
}
