/* guide.html — a single Learning Center guide. Page-only composition; components come from ../system.css.
   Learning pages (learning-center, guides, guide, glossary) mark "Learn" as the current section.
   The reading rail (.gb-*) and the library row (.lib-*) repeat guides.css / learning-center.css;
   see notes/group-b.md (candidates for the system). */

/* reading progress under the header */
.read-progress { position: fixed; z-index: 51; left: 0; right: 0; top: var(--nav-h); height: 2px; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--pine-bright), var(--mint-hi)); box-shadow: 0 0 10px rgba(138, 217, 199, .6); transform: scaleX(0); transform-origin: 0 50%; }

/* header: plain hero, two-line title, meta strip; the photo rises into it from the article */
.guide-hero { padding-bottom: clamp(150px, 15vw, 230px); }
.guide-hero h1 { max-width: 19em; font-size: clamp(36px, 3.9vw, 56px); line-height: 1.02; }
.guide-hero .lede { max-width: 52ch; }
.guide-meta { --cols: 4; margin-top: 40px; max-width: 920px; }
.guide-meta dd { font-size: 19px; }
.guide-meta dd a { color: var(--mint); text-decoration: none; }
.guide-meta dd a:hover { color: var(--mint-hi); text-decoration: underline; }
.guide-noscript { margin-top: 24px; }

.guide-body { padding-top: 0; }
.gb-layout { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--split-gap); align-items: start; }
.guide-figure { grid-column: 2; grid-row: 1; position: relative; z-index: 2; margin: calc(clamp(110px, 11vw, 170px) * -1) 0 0; border-radius: var(--r-panel); overflow: hidden; aspect-ratio: 1000 / 457; background: var(--c2); box-shadow: 0 40px 90px -40px rgba(5, 15, 12, .7); }
.guide-figure img { width: 100%; height: 100%; object-fit: cover; }
.guide-figure::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); pointer-events: none; }

/* reading rail (table of contents) */
.gb-rail { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: calc(var(--nav-h) + 40px); padding-top: clamp(40px, 4vw, 56px); }
.gb-rail-title { font-size: var(--t-small); font-weight: 500; letter-spacing: 0; line-height: 1.4; color: var(--l-text); margin-bottom: 14px; }
.gb-track { position: relative; }
.gb-line { position: absolute; left: 7px; top: 20px; bottom: 20px; width: 1px; background: var(--line); overflow: hidden; }
.gb-line i { position: absolute; inset: 0; background: var(--pine-bright); transform: scaleY(0); transform-origin: 50% 0; }
.gb-steps { list-style: none; margin: 0; padding: 0; }
.gb-steps a { display: grid; grid-template-columns: 15px minmax(0, 1fr); column-gap: 20px; align-items: center; padding: 9px 0; text-decoration: none; border-radius: 8px; }
.gb-node { position: relative; width: 15px; height: 15px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.5px #B9C6BE; transition: box-shadow .4s var(--ease-out); }
.gb-node::before { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--pine-bright); transform: scale(0); transition: transform .45s var(--ease-out); }
.gb-label { font-size: 15px; line-height: 1.35; color: var(--l-muted); transition: color var(--dur-fast); }
.gb-steps a:hover .gb-label { color: var(--pine); }
.gb-steps li.is-done .gb-node { box-shadow: inset 0 0 0 1.5px var(--pine-bright); }
.gb-steps li.is-done .gb-node::before { transform: scale(1); }
.gb-steps a[aria-current="true"] .gb-label { color: var(--l-text); font-weight: 500; }
.gb-steps a[aria-current="true"] .gb-node { box-shadow: inset 0 0 0 1.5px var(--pine-bright), 0 0 0 5px rgba(20, 135, 111, .14); }
.toc-print { margin: 24px 0 0 35px; gap: 8px; }
.toc-print .i { font-size: 16px; }

/* the article */
.guide-article { grid-column: 2; grid-row: 2; min-width: 0; padding-bottom: 8px; }
.guide-article > * + * { margin-top: clamp(48px, 5vw, 72px); }
.guide-answer .callout-title { font-size: var(--t-small); font-weight: 500; letter-spacing: 0; line-height: 1.4; color: var(--mint); }
.guide-answer .callout-body { font-size: clamp(21px, 1.9vw, 27px); }
.guide-article h2:not(.callout-title) { font-size: var(--t-h3); line-height: 1.1; letter-spacing: -.035em; }
.takeaways .ticks { margin-top: 20px; max-width: 66ch; }
.takeaways .ticks li { font-size: var(--t-body); color: var(--l-text); }
.guide-copy { font-size: var(--t-body); }
.guide-copy h2 { scroll-margin-top: calc(var(--nav-h) + 24px); }
.guide-copy strong { color: var(--l-text); font-weight: 500; }
.guide-copy ul li::marker { color: var(--pine-bright); }
.guide-questions .accordion { margin-top: 24px; }
.guide-sources > p:not(.meta) { margin-top: 14px; color: var(--l-muted); font-size: var(--t-text); }
.guide-sources .source-list { margin: 22px 0; }
.guide-sources .meta + .meta { margin-top: 4px; }
.guide-sources-foot { margin-top: 18px !important; }
.guide-sources-foot a { color: var(--pine); }

/* live example: the guide's own arithmetic */
.prose .tradeoff { margin: 40px 0; max-width: none; }
.prose .tradeoff p { color: var(--d-muted); }
.tradeoff .estimate-head { flex-wrap: wrap; }
.to-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; margin-top: 22px; }
.to-months { grid-column: 1 / -1; gap: 6px; }
.to-months-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.to-months-top label { font-size: 14px; color: var(--d-muted); }
.to-months-top output { font-size: 15px; font-weight: 500; color: #fff; }
.to-bars { display: grid; gap: 14px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--d-line); }
.to-bar { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) 84px; align-items: center; gap: 16px; }
.to-bar-label { font-size: var(--t-micro); color: var(--d-muted); }
.to-track { position: relative; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.to-fill { position: absolute; inset: 0; border-radius: inherit; transform: scaleX(0); transform-origin: 0 50%; transition: transform .7s var(--ease-out); }
.to-cash { background: var(--chart-p); }
.to-paid { background: var(--brass-hi); }
.to-bar b { font-size: 16px; font-weight: 500; color: #fff; text-align: right; font-variant-numeric: tabular-nums; }
.prose .tradeoff .to-result { margin-top: 20px; font-size: var(--t-text); line-height: 1.5; color: var(--d-text); }
.prose .tradeoff .estimate-error { margin-top: 12px; }

/* related reading: library rows (see learning-center.css) */
.related .cols { align-items: start; }
.related-head p { margin-top: 20px; }
.lib-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lib-item { position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr) auto 18px; gap: 6px 24px; align-items: baseline; padding: 22px 14px; border-bottom: 1px solid var(--line); transition: background-color var(--dur-fast); }
.lib-item:hover { background: rgba(255, 255, 255, .72); }
.lib-topic { font-size: var(--t-micro); font-weight: 500; color: var(--pine); }
.lib-title { font-size: var(--t-h4); font-weight: 500; letter-spacing: -.02em; line-height: 1.25; }
.lib-title a { color: var(--l-text); text-decoration: none; transition: color var(--dur-fast); }
.lib-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 2px; }
.lib-title a:focus-visible { outline: 0; }
.lib-title a:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
.lib-item:hover .lib-title a { color: var(--pine); }
.lib-desc { margin-top: 6px; font-size: var(--t-text); line-height: 1.5; color: var(--l-muted); max-width: 54ch; }
.lib-time { font-size: var(--t-micro); color: var(--l-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lib-arrow { color: var(--pine); align-self: center; transition: transform var(--dur) var(--ease-out); }
.lib-item:hover .lib-arrow { transform: translateX(4px); }


@media (max-width: 1000px) {
  .gb-layout { grid-template-columns: minmax(0, 1fr); }
  .gb-rail, .guide-figure, .guide-article { grid-column: auto; grid-row: auto; }
  .gb-rail { position: static; padding-top: 8px; }
  .gb-line { display: none; }
  .gb-steps a { padding: 7px 0; }
  .toc-print { margin-left: 0; }
  .guide-hero { padding-bottom: clamp(110px, 18vw, 150px); }
  .guide-figure { margin-top: calc(clamp(70px, 12vw, 110px) * -1); }
}
@media (max-width: 760px) {
  .guide-meta dd { font-size: 16px; }
  .to-fields { grid-template-columns: minmax(0, 1fr); }
  .to-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .to-bar-label { grid-column: 1 / -1; }
}

@media print {
  .read-progress, .gb-rail, .related, .cta-band, .breadcrumb, .guide-noscript, [data-tradeoff] .to-fields { display: none !important; }
  .page-hero { padding: 0 0 16px !important; }
  .page-hero h1, .page-hero .lede, .page-hero .stats dt, .page-hero .stats dd, .page-hero .stats a { color: #000 !important; }
  .gb-layout { display: block; }
  .guide-figure { margin: 16px 0 0; box-shadow: none; max-height: 220px; }
  .callout, .estimate { background: #fff !important; box-shadow: inset 0 0 0 1px #bbb !important; }
  .callout *, .estimate *, .prose .tradeoff p { color: #000 !important; }
  .guide-article > * + * { margin-top: 28px; }
  .accordion .ans { display: block; }
}
.guide-article > :first-child { margin-top: clamp(40px, 4vw, 56px); }
@media (max-width: 760px) {
  .guide-hero .breadcrumb li:last-child { min-width: 0; }
  .guide-hero .breadcrumb [aria-current="page"] { display: block; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (pointer: coarse) {
  .gb-steps a { min-height: 44px; }
}
