/*
 * Pages B: the guide template and the guides hub. Loaded with `styles: pages-b, pages-c` by the
 * ten guide pages. Tokens come from site.css. The world is the home page's: white ground, navy ink,
 * tangerine on the action, square surfaces separated by tone. Interface fragments (`.gf`, data-ui)
 * keep the application's own conventions: 1px lines, 6 to 10px radii.
 */

/* Title block: the headline and its action on the left, a fragment of the product on the right. */
.guide-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--split-gap); align-items: center; max-width: var(--page); margin: 0 auto; padding: clamp(1.25rem, 2.5vw, 2rem) var(--gutter) 0; }
.guide-top__text { grid-column: 1; }
.guide-top h1 { margin: 0 0 1.25rem; font-size: var(--step-head); letter-spacing: -0.045em; line-height: 1; }
.guide-top .lead { max-width: 40ch; margin: 0 0 1.25rem; }
.guide-top__facts { margin: 0 0 1.75rem; color: var(--ink-soft); font-size: var(--step-small); }
.guide-top__actions { margin: 0; }
.guide-top__ui { grid-column: 2; margin: 0; }

/* The summary, set large on the navy band: what a skimming reader leaves with. */
.guide-essential { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: var(--split-gap); margin: var(--section-gap) 0 0; padding: clamp(3rem, 6vw, 5rem) max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter))); background: var(--ink); color: #ffffff; }
.guide-essential h2 { grid-column: 1; margin: 0; color: #ffffff; font-size: var(--step-h); }
.guide-essential a { color: #ffffff; }
.guide-essential a:focus-visible { outline-color: #ffffff; }
.guide-essential__text { grid-column: 2; max-width: none; font-size: var(--step-lead); line-height: 1.4; }
.guide-essential__text p { margin: 0 0 1rem; }
.guide-essential__text p:last-child { margin: 0; }

/* Reading layout, on a tone field like the home page's story band: a quiet sticky contents list,
   the article at about 70 characters a line, the white fragments set into it. */
.guide-layout { display: grid; grid-template-columns: minmax(15rem, 3fr) minmax(0, 9fr); column-gap: var(--split-gap); align-items: start; margin: 0; padding: var(--section-gap) max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter))); background: var(--tone-1); }
.guide-toc { grid-column: 1; position: sticky; top: calc(var(--header-height) + 1.5rem); font-size: var(--step-body); }
.guide-toc h2 { margin: 0 0 1rem; font-size: var(--step-lead); }
.guide-toc ol { margin: 0; padding: 0; list-style: none; }
.guide-toc a { display: block; text-wrap: pretty; padding: 0.55rem 0 0.55rem 1rem; border-left: 3px solid var(--tone-2); color: var(--ink-soft); line-height: 1.35; text-decoration: none; transition: color var(--t-hover) ease, border-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .guide-toc a:hover { border-color: var(--ink); color: var(--ink); }
}
.guide-body { grid-column: 2; max-width: none; }
.guide-body > :first-child { margin-top: 0; }
.guide-body h2 { scroll-margin-top: calc(var(--header-height) + 1rem); }
.guide-figure { margin: 2.5rem 0; max-width: 40rem; }

/* The closing band runs edge to edge, its content on the page grid. */
.guide > .cta-band { margin-top: 0; }

/* Guides hub. */
.hub-list { margin: var(--section-gap) 0 0; padding: clamp(3rem, 6vw, 5rem) max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter))); background: var(--tone-1); }
.hub-list h2 { margin: 0 0 2rem; font-size: var(--step-h); }
.hub-list ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--split-gap); margin: 0; padding: 0; list-style: none; }
.hub-list a { display: block; padding: 1.25rem 0; text-decoration: none; }
.hub-list strong { display: block; font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
@media (hover: hover) and (pointer: fine) {
  .hub-list a strong { transition: color var(--t-hover) ease; }
  .hub-list a:hover strong { color: var(--ink-soft); }
}
.hub-picks { max-width: var(--page); margin: var(--section-gap) auto 0; padding: 0 var(--gutter); }
.hub-picks > h2 { margin: 0 0 2.5rem; font-size: var(--step-h); }
.hub-picks > ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 4rem) var(--split-gap); margin: 0; padding: 0; list-style: none; }
.hub-picks > ul > li > figure { margin: 0 0 1.25rem; }
.hub-picks h3 { margin: 0 0 0.4rem; font-size: var(--step-lead); }
.hub-picks h3 a { text-decoration: none; }
.hub-picks li > p { max-width: none; margin: 0; }
.hub-prose { max-width: var(--page); margin: var(--section-gap) auto 0; padding: 0 var(--gutter); }
.hub-prose > * { max-width: 54ch; }

/* Interface fragments: cropped pieces of the application, drawn with its conventions. */
.gf { --ui-line: #d7d9e0; overflow: hidden; background: #ffffff; border: 1px solid var(--ui-line); border-radius: 10px; color: var(--ink); font-size: 0.9375rem; letter-spacing: 0; line-height: 1.45; }
.gf--paper { border-radius: 4px; }
.gf__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--ui-line); font-weight: 600; }
.gf__brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.gf__brand .brand__mark { width: 1.03rem; height: 0.95rem; }
.gf__brand--big { font-size: 1.125rem; letter-spacing: -0.03em; }
.gf__brand--big .brand__mark { width: 1.24rem; height: 1.15rem; }
.gf__chip { flex: none; padding: 0.2rem 0.65rem; border-radius: 999px; background: #eef0f6; font-size: 0.8125rem; font-weight: 500; }
.gf__chip--warm { background: #fff4e6; color: #8a4a00; }
main .gf table { display: table; width: 100%; margin: 0; border-collapse: collapse; font-size: 0.875rem; }
main .gf th, main .gf td { padding: 0.65rem 1.1rem; border-bottom: 1px solid var(--ui-line); background: none; color: var(--ink); font-weight: 400; text-align: left; vertical-align: top; }
main .gf thead th { background: none; color: var(--ink-soft); font-size: 0.8125rem; font-weight: 500; }
main .gf tbody tr:nth-child(even) td { background: none; }
.gf td:nth-child(n + 3), .gf th:nth-child(n + 3), .gf td:first-child { text-align: right; white-space: nowrap; }
.gf td:first-child { text-align: left; }
main .gf tfoot td { border-bottom: 0; font-weight: 600; }
.gf__table--paper td:nth-child(2) { white-space: normal; }
.gf__list { margin: 0; padding: 0.25rem 1.1rem 0.5rem; }
.gf__list div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--ui-line); }
.gf__list dt { color: var(--ink-soft); }
.gf__list dd { margin: 0; font-weight: 500; text-align: right; white-space: nowrap; }
.gf__list .gf__total { border-bottom: 0; }
.gf__total dt { color: var(--ink); font-weight: 600; }
.gf__total dd { font-size: 1.25rem; font-weight: 600; }
.gf__total--warm dd { color: #b45309; }
.gf__form { display: grid; gap: 0.6rem; padding: 1rem 1.1rem 1.1rem; }
.gf__field { display: grid; gap: 0.3rem; margin: 0; color: var(--ink-soft); font-size: 0.8125rem; }
.gf__input { display: block; padding: 0.6rem 0.75rem; border: 1px solid var(--ui-line); border-radius: 6px; background: #ffffff; color: var(--ink); font-size: 0.9375rem; }
.gf__input--pick { border-color: var(--ink); background: #eef0f6; font-weight: 600; }
.gf__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.4rem 0 0; }
.gf__button { display: inline-flex; padding: 0.6rem 1rem; border-radius: 6px; background: var(--ink); color: #ffffff; font-size: 0.875rem; font-weight: 600; }
.gf__hint { color: var(--ink-soft); font-size: 0.8125rem; }
.gf__alert { margin: 0; padding: 0.75rem 0.85rem; border-radius: 6px; background: #fff4e6; color: #7a4100; font-size: 0.875rem; }
.gf__options { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.gf__options li { margin: 0; padding: 0.5rem 0.75rem; border: 1px solid var(--ui-line); border-radius: 6px; font-size: 0.875rem; }
.gf__options li.is-on { border-color: var(--ink); background: #eef0f6; font-weight: 600; }
.gf__orgs { margin: 0; padding: 0.25rem 1.1rem; list-style: none; }
.gf__orgs li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 1rem; margin: 0; padding: 0.75rem 0; border-bottom: 1px solid var(--ui-line); }
.gf__orgs span { color: var(--ink-soft); font-size: 0.8125rem; }
.gf__orgs em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-weight: 600; }
.gf__note { margin: 0; padding: 0.75rem 1.1rem 1rem; color: var(--ink-soft); font-size: 0.8125rem; }
.gf__form .gf__note { padding: 0; }
.gf__month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 1rem 1.1rem 0.25rem; list-style: none; }
.gf__month li { display: grid; place-items: center; height: 2.25rem; margin: 0; border-radius: 6px; font-size: 0.8125rem; }
.gf__month .is-on { background: var(--ink); color: #ffffff; }
.gf__month .is-off { color: #8b91a3; }
.gf__month .is-holiday { background: #fff4e6; color: #8a4a00; font-weight: 600; }
.gf__csv { margin: 0; padding: 1rem 1.1rem; font: 500 0.8125rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.gf__paperhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.1rem 0.5rem; }
.gf__papertitle { font-size: 0.875rem; font-weight: 600; line-height: 1.3; text-align: right; }
.gf__papertitle span { display: block; color: var(--ink-soft); font-weight: 400; }
.gf__section { margin: 0.5rem 1.1rem 0; font-size: 0.8125rem; font-weight: 600; }
.gf__rule { margin: 0; padding: 0.85rem 1.1rem 1rem; color: var(--ink-soft); font-size: 0.8125rem; }

@media (max-width: 64rem) {
  .guide-top, .guide-essential, .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-top__text, .guide-top__ui { grid-column: 1 / -1; }
  .guide-top__ui { margin-top: 2.5rem; max-width: 34rem; }
  .guide-essential h2, .guide-essential__text { grid-column: 1 / -1; }
  .guide-essential h2 { margin-bottom: 1.25rem; }
  .guide-toc { position: static; grid-column: 1 / -1; margin-bottom: 2.5rem; padding: 1.25rem; background: #ffffff; }
  .guide-body { grid-column: 1 / -1; }
  .hub-list ul, .hub-picks > ul { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .guide-top h1 { font-size: 2.25rem; }
  .guide-top__actions .btn { width: 100%; }
  .gf__table--paper th:nth-child(3), .gf__table--paper td:nth-child(3) { display: none; }
}

/* Motion: site.css brings in the title block and the fragments; sections reveal as they arrive. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .guide-figure, .hub-picks > ul > li, .hub-list li, .guide-essential > * { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  }
}
