/* v124: grouped footer (from v123) and the hub layout: guide list first, light tables, section contents.
   Loaded after unified-v121.css; uses the v121 brass tokens only. */

/* ---------- Footer: brand + four labelled columns + legal bar ---------- */
.editorial-footer.ftr {
  padding-top: 64px;
  padding-bottom: 26px;
  border-top: 3px solid var(--b-accent);
  background: var(--b-night);
  color: var(--b-on-night);
  font-family: var(--b-ui);
}
.ftr-top {
  padding-bottom: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr));
  gap: 40px 32px;
  align-items: start;
}
.ftr-brand { min-width: 0; }
.editorial-footer .ftr-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--b-on-night);
  font: 800 21px/1.1 var(--b-ui);
  letter-spacing: -.03em;
  text-decoration: none;
}
.ftr-logo img { width: 34px; height: 34px; border-radius: 8px; }
.editorial-footer .ftr-logo:hover { color: #ffffff; }
.ftr-brand p {
  max-width: 34ch;
  margin: 16px 0 0;
  color: var(--b-on-night-2);
  font: 15px/1.6 var(--b-read);
}
.ftr-brand p.ftr-note {
  margin-top: 14px;
  color: #8f8778;
  font: 500 12.5px/1.55 var(--b-ui);
}
.ftr-col { min-width: 0; }
.ftr-h {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--b-night-line);
  color: var(--b-accent-lt);
  font: 700 11px/1.3 var(--sf-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ftr-col ul { margin: 0; padding: 0; list-style: none; }
.ftr-col li { margin: 0; }
.editorial-footer .ftr-col a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: #d9d1c2;
  font: 500 14.5px/1.3 var(--b-ui);
  text-decoration: none;
}
.editorial-footer .ftr-col a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: var(--b-accent-lt);
  text-underline-offset: 4px;
}
.ftr-bottom {
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 28px;
  border-top: 1px solid var(--b-night-line);
  color: #a49c8e;
  font: 500 12px/1.5 var(--b-ui);
}
.ftr-bottom .footer-legal { flex-wrap: wrap; gap: 0 22px; }
.editorial-footer .ftr-bottom .footer-legal a {
  min-height: 40px;
  color: #b3ab9c;
  font: 500 12.5px/1.3 var(--b-ui);
}
.editorial-footer .ftr-bottom .footer-legal a:hover { color: #ffffff; }
.editorial-footer.ftr a:focus-visible { outline: 2px solid var(--b-accent-lt); outline-offset: 3px; }

@media (max-width: 1100px) {
  .ftr-top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ftr-brand { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 36px; align-items: start; }
  .ftr-brand p { max-width: 60ch; margin-top: 4px; }
  .ftr-brand p.ftr-note { grid-column: 2; margin-top: 0; }
}
@media (max-width: 900px) {
  .editorial-footer.ftr { padding-top: 46px; }
  .ftr-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 24px; padding-bottom: 34px; }
  .ftr-brand { display: block; }
  .ftr-brand p { margin-top: 14px; }
  .ftr-brand p.ftr-note { margin-top: 12px; }
  .editorial-footer .ftr-col a { min-height: 40px; }
  .ftr-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .ftr-top { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- Hub pages (partials/hub-page.hbs) ---------- */
/* Shorter hero so the guide list starts near the top of the first screen. */
body:not(.home-template) .hub-hero-in { padding: 18px 0 36px; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 56px; }
.hub-hero h1 { margin-bottom: 14px; font-size: clamp(30px, 3.1vw, 42px); line-height: 1.08; }
.hub-lede { font-size: 17px; line-height: 1.58; }

/* Guide list: the first thing under the hub menu. */
body:not(.home-template) .hub-map { padding: 34px 0 30px; scroll-margin-top: 70px; }
.hub-map-head {
  margin-bottom: 6px;
  padding-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  border-bottom: 2px solid var(--b-ink);
}
.hub-map-head h2 {
  margin: 0;
  color: var(--b-ink);
  font: 800 clamp(24px, 2.4vw, 32px)/1.12 var(--b-ui);
  letter-spacing: -.025em;
}
.hub-map-count {
  color: var(--b-ink-3);
  font: 600 13px/1.3 var(--sf-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hub-map-list { margin: 0; padding: 0; list-style: none; }
.hub-map-item {
  position: relative;
  padding: 16px 0;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid var(--b-line);
}
.hub-map-item.no-thumb { grid-template-columns: minmax(0, 1fr); }
body:not(.home-template) .hub-map-item img {
  width: 100%;
  max-width: 132px;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--b-paper-2);
}
.hub-map-copy { min-width: 0; }
.hub-map-item h3 {
  margin: 0 0 5px;
  color: var(--b-ink);
  font: 700 17px/1.3 var(--b-ui);
  letter-spacing: -.01em;
  text-wrap: pretty;
}
.hub-map-item h3 a { color: inherit; text-decoration: none; }
.hub-map-item h3 a::after { content: ""; position: absolute; inset: 0; }
.hub-map-item:hover h3 a { color: var(--b-accent-ink); text-decoration: underline; text-underline-offset: 3px; }
body:not(.home-template) .hub-map-item h3 a:focus-visible { outline: none; }
.hub-map-item:focus-within { outline: 2px solid var(--b-accent); outline-offset: 4px; border-radius: 4px; }
.hub-map-item p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--b-ink-2);
  font: 14.5px/1.5 var(--b-ui);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
@media (min-width: 900px) {
  .hub-map-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; }
}

/* Reference text with a section contents rail (filled by assets/js/hub-toc.js). */
body:not(.home-template) .hub-shell { padding-top: 22px; border-top: 1px solid var(--b-line); }
.hub-toc {
  margin: 0 0 26px;
  border: 1px solid var(--b-line);
  border-radius: 10px;
  background: var(--b-card);
}
.hub-toc summary {
  padding: 13px 16px;
  cursor: pointer;
  color: var(--b-ink-3);
  font: 600 12.5px/1.3 var(--sf-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hub-toc summary:focus-visible { outline: 2px solid var(--b-accent); outline-offset: 2px; }
.hub-toc-list { margin: 0; padding: 0 8px 12px; list-style: none; counter-reset: htoc; }
.hub-toc-list a {
  padding: 7px 8px 7px 12px;
  display: block;
  border-left: 2px solid transparent;
  color: var(--b-ink-2);
  font: 500 14px/1.38 var(--b-ui);
  text-decoration: none;
}
.hub-toc-list a:hover { color: var(--b-ink); }
.hub-toc-list a[aria-current="true"] { border-left-color: var(--b-accent); color: var(--b-accent-ink); font-weight: 650; }
/* The site header is sticky (66px), so jumps and the rail start below it. */
.hub-content h2[id] { scroll-margin-top: 88px; }

@media (min-width: 1100px) {
  body:not(.home-template) .hub-shell.has-toc {
    display: grid;
    grid-template-columns: 220px minmax(0, 780px);
    justify-content: center;
    gap: 56px;
    align-items: start;
  }
  .hub-shell.has-toc .hub-toc {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 116px);
    margin: 30px 0 0;
    overflow: auto;
    border: 0;
    background: transparent;
  }
  .hub-shell.has-toc .hub-toc summary { padding: 0 0 10px 14px; cursor: default; pointer-events: none; list-style: none; }
  .hub-shell.has-toc .hub-toc summary::-webkit-details-marker { display: none; }
  .hub-shell.has-toc .hub-toc-list { padding: 0; }
  body.page-template .hub-shell.has-toc .hub-content { max-width: none; margin: 0 0 64px; }
}

/* Hub tables: light rows instead of black header cells. */
body.page-template .hub-content table {
  margin: 22px 0 30px;
  border-top: 2px solid var(--b-ink);
  font: 15px/1.5 var(--b-ui);
}
body.page-template .hub-content th,
body.page-template .hub-content td {
  padding: 12px 14px 12px 0;
  border: 0;
  border-bottom: 1px solid var(--b-line);
  background: transparent;
  color: var(--b-ink-2) !important;
  text-align: left;
  vertical-align: top;
}
body.page-template .hub-content thead th {
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--b-ink);
  color: var(--b-ink-3) !important;
  font: 700 11.5px/1.3 var(--b-ui);
  letter-spacing: .06em;
  text-transform: uppercase;
}
body.page-template .hub-content tbody th { color: var(--b-ink) !important; font-weight: 700; }
body.page-template .hub-content tbody tr:hover > * { background: var(--b-card); }
body.page-template .hub-content tbody tr > :first-child { padding-left: 6px; }
body.page-template .hub-content thead tr > :first-child { padding-left: 6px; }

/* The hub text opens with its answer set in one <strong>; read it as a lede rather than a block of bold. */
body.page-template .hub-content > p:first-child { color: var(--b-ink) !important; font-size: 19px; line-height: 1.6; }
body.page-template .hub-content > p:first-child > strong:only-child { font-weight: 500; }

.hub-back { margin: 36px 0 0; font: 600 14px/1.3 var(--b-ui); }
.hub-back a { color: var(--b-accent-ink); }
.hub-back a::before { content: "\2191\00a0"; }

@media (max-width: 900px) {
  body:not(.home-template) .hub-hero-in { padding: 14px 0 28px; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hub-hero h1 { font-size: clamp(28px, 7vw, 36px); }
  .hub-lede { font-size: 16px; }
}
@media (max-width: 640px) {
  body:not(.home-template) .hub-map { padding-top: 24px; }
  .hub-map-item { grid-template-columns: 96px minmax(0, 1fr); gap: 13px; padding: 14px 0; }
  body:not(.home-template) .hub-map-item img { max-width: 96px; }
  .hub-map-item h3 { font-size: 16px; }
  .hub-map-item p { font-size: 14px; }
  body.page-template .hub-content th,
  body.page-template .hub-content td { padding: 10px 12px 10px 0; font-size: 14px; }
  body.page-template .hub-content > p:first-child { font-size: 17.5px; }
  /* Tables with four or more columns become one block per row; hub-toc.js adds the labels. */
  body.page-template .hub-content table.hub-stack { display: block; overflow: visible; }
  .hub-content table.hub-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .hub-content table.hub-stack tbody,
  .hub-content table.hub-stack tr { display: block; }
  .hub-content table.hub-stack tr { padding: 12px 0 10px; border-bottom: 1px solid var(--b-line); }
  body.page-template .hub-content table.hub-stack th,
  body.page-template .hub-content table.hub-stack td { display: block; padding: 3px 0 7px; border: 0; font-size: 15px; }
  body.page-template .hub-content table.hub-stack tbody tr > :first-child { padding: 0 0 8px; color: var(--b-ink) !important; font-weight: 700; font-size: 16.5px; }
  body.page-template .hub-content table.hub-stack tbody tr:hover > * { background: transparent; }
  .hub-content table.hub-stack [data-label]:not(:first-child)::before {
    content: attr(data-label);
    margin-bottom: 2px;
    display: block;
    color: var(--b-ink-3);
    font: 700 11px/1.35 var(--b-ui);
    letter-spacing: .06em;
    text-transform: uppercase;
  }
}
