/* estimating.css -- long-form content-cluster components for tx1.synthetik.au
 *
 * Loaded AFTER css/style.css. Inherits every token from style.css :root and
 * [data-theme="dark"]; defines no colour of its own except the product accent,
 * so light and dark both work with no extra rules.
 *
 * The cenex.au guide clusters use an equivalent component set from a DIFFERENT
 * stylesheet. These are rebuilt on Synthetik tokens so the pages read as
 * Synthetik, not as a ported Cenex page.
 */

.tx1-page {
  --product-accent: #10b981;          /* Trinity emerald, per style.css:697 */
  --product-accent-dark: #0d9668;
  --product-accent-soft: rgba(16,185,129,.09);
  --measure: 68ch;
}
[data-theme="dark"] .tx1-page { --product-accent-soft: rgba(16,185,129,.14); }

/* ---------- section rhythm ----------
   grey -> white -> grey -> white -> DARK -> grey -> white -> ACCENT
   Dark bands are reserved for the single most important idea and the product
   pitch. The accent band is always last. Never use more than two darks. */
.es-section { padding: clamp(3rem,7vw,5.5rem) 0; background: var(--bg-primary); }
.es-section--alt { background: var(--bg-secondary); }
.es-section--dark { background: #1d1d1f; color: #f5f5f7; }
[data-theme="dark"] .es-section--dark { background: #161618; }
.es-section--dark .es-sec-title,
.es-section--dark .es-h3 { color: #fff; }
.es-section--dark .es-lede,
.es-section--dark p { color: #c7c7cc; }
.es-section--dark .es-eyebrow { color: var(--product-accent); }

.es-wrap { width: min(100% - 2.5rem, 1120px); margin-inline: auto; }
.es-col  { max-width: var(--measure); }

/* ---------- headings ---------- */
.es-eyebrow {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--product-accent); display: block; margin-bottom: .6rem;
}
.es-sec-title {
  font-family: var(--font-display); font-size: clamp(1.5rem,3.2vw,2.1rem);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  text-wrap: balance; color: var(--text-primary); margin-bottom: .9rem;
}
.es-h3 {
  font-family: var(--font-display); font-size: 1.12rem; font-weight: 600;
  letter-spacing: -.01em; color: var(--text-primary); margin-bottom: .4rem;
}
.es-lede { font-size: 1.08rem; color: var(--text-secondary); line-height: 1.65; max-width: 62ch; }
.es-col p { color: var(--text-secondary); line-height: 1.75; font-size: 1rem; }
.es-col p + p { margin-top: 1em; }
.es-col strong { color: var(--text-primary); font-weight: 600; }

/* ---------- hero ---------- */
.es-hero { padding: clamp(3.5rem,8vw,6rem) 0 clamp(2rem,4vw,3rem); background: var(--bg-secondary); }
.es-crumb { font-size: .8rem; color: var(--text-muted); margin-bottom: 1.1rem; }
.es-crumb a { color: var(--text-muted); text-decoration: none; }
.es-crumb a:hover { color: var(--product-accent); }
.es-hero h1 {
  font-family: var(--font-display); font-size: clamp(2rem,5vw,3.1rem);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.08;
  text-wrap: balance; color: var(--text-primary); margin-bottom: 1rem;
}

/* ---------- chapter rail ---------- */
.es-rail { border-block: 1px solid var(--border-color); background: var(--bg-primary); overflow-x: auto; }
.es-rail ol { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; min-width: max-content; }
.es-rail li { flex: none; }
.es-rail a {
  display: flex; gap: .55rem; align-items: baseline; padding: .85rem 1.1rem;
  font-size: .82rem; color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.es-rail a:hover { color: var(--text-primary); }
.es-rail .n { font-family: var(--font-mono); font-size: .7rem; font-weight: 600; opacity: .65; }
.es-rail [aria-current="page"] {
  color: var(--text-primary); font-weight: 600; border-bottom-color: var(--product-accent);
}

/* ---------- ABOVE-FOLD CTA ----------
   Median scroll depth on the equivalent cenex.au guide pages is 18%, so roughly
   3% of readers ever reach a bottom-of-page CTA. This block is MANDATORY on
   every content page, placed immediately after the first explainer section. */
.es-inline-cta {
  border: 1px solid var(--border-color); border-left: 3px solid var(--product-accent);
  background: var(--product-accent-soft); border-radius: 12px;
  padding: 1.35rem 1.5rem; margin: 2rem 0; max-width: var(--measure);
}
.es-inline-cta h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin-bottom: .4rem; }
.es-inline-cta p { font-size: .94rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: .9rem; }
.es-inline-cta a {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 600;
  color: #fff; background: var(--product-accent); padding: .6rem 1.15rem;
  border-radius: 980px; text-decoration: none; transition: background var(--transition-fast);
}
.es-inline-cta a:hover { background: var(--product-accent-dark); }

/* ---------- definition triad ---------- */
.es-triad { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 1.5rem; margin-top: 2rem; }
.es-triad > div { border-top: 2px solid var(--product-accent); padding-top: 1rem; }
.es-triad h4 { font-family: var(--font-display); font-size: .98rem; font-weight: 600; color: var(--text-primary); margin-bottom: .35rem; }
.es-triad p { font-size: .92rem; color: var(--text-secondary); line-height: 1.6; }

/* ---------- prose panels ---------- */
.es-panel {
  border-left: 3px solid var(--border-color); padding: .2rem 0 .2rem 1.25rem;
  margin: 1.6rem 0; max-width: var(--measure);
}
.es-panel--note { border-left-color: var(--product-accent); background: var(--product-accent-soft); border-radius: 0 10px 10px 0; padding: 1rem 1.25rem; }
.es-panel--note strong { color: var(--text-primary); }

/* ---------- data table ---------- */
.es-tablewrap { overflow-x: auto; margin: 1.8rem 0; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-primary); }
.es-table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: .9rem; }
.es-table th, .es-table td { text-align: left; padding: .7rem .95rem; border-bottom: 1px solid var(--border-color); vertical-align: top; color: var(--text-secondary); }
.es-table thead th {
  font-family: var(--font-mono); font-size: .69rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600; background: var(--bg-tertiary);
}
.es-table tbody tr:last-child td { border-bottom: 0; }
.es-table td:first-child, .es-table th:first-child { color: var(--text-primary); font-weight: 500; }
.es-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- stats band (use inside .es-section--dark) ---------- */
.es-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 2rem; margin-top: 1rem; }
.es-stats .n { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; color: var(--product-accent); font-variant-numeric: tabular-nums; display: block; line-height: 1.05; }
.es-stats .k { font-size: .88rem; color: #c7c7cc; margin-top: .4rem; display: block; line-height: 1.4; }

/* ---------- FAQ ---------- */
.es-faq { max-width: var(--measure); margin-top: 1.5rem; }
.es-faq details { border-bottom: 1px solid var(--border-color); }
.es-faq summary {
  cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; position: relative;
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text-primary);
}
.es-faq summary::-webkit-details-marker { display: none; }
.es-faq summary::after { content: "+"; position: absolute; right: .25rem; top: .95rem; font-family: var(--font-mono); color: var(--text-muted); font-size: 1.15rem; }
.es-faq details[open] summary::after { content: "\2212"; }
.es-faq details > p { padding-bottom: 1.1rem; font-size: .95rem; color: var(--text-secondary); line-height: 1.7; }
.es-faq summary:focus-visible { outline: 2px solid var(--product-accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- sibling links ---------- */
.es-siblings { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 1px; background: var(--border-color); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; margin-top: 1.5rem; }
.es-siblings a { display: block; padding: 1.1rem 1.2rem; background: var(--bg-primary); text-decoration: none; transition: background var(--transition-fast); }
.es-siblings a:hover { background: var(--bg-tertiary); }
.es-siblings .n { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; color: var(--product-accent); font-weight: 600; display: block; margin-bottom: .3rem; }
.es-siblings .t { font-family: var(--font-display); font-size: .96rem; font-weight: 600; color: var(--text-primary); display: block; }

/* ---------- closing CTA band ---------- */
.es-cta-band { padding: clamp(3rem,6vw,4.5rem) 0; background: linear-gradient(135deg, var(--product-accent) 0%, var(--product-accent-dark) 100%); text-align: center; }
.es-cta-band h2 { font-family: var(--font-display); font-size: clamp(1.5rem,3.4vw,2.2rem); font-weight: 700; letter-spacing: -.02em; color: #fff; text-wrap: balance; margin-bottom: .8rem; }
.es-cta-band p { color: rgba(255,255,255,.88); font-size: 1.05rem; max-width: 54ch; margin: 0 auto 1.8rem; line-height: 1.6; }
.es-cta-row { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.es-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .78rem 1.6rem; border-radius: 980px; font-size: .96rem; font-weight: 600; text-decoration: none; transition: transform var(--transition-fast), background var(--transition-fast); }
.es-btn--solid { background: #fff; color: var(--product-accent-dark); }
.es-btn--ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.es-btn:hover { transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) { .es-btn:hover { transform: none; } }
@media (max-width: 560px) { .es-triad { gap: 1.2rem; } .es-stats { gap: 1.4rem; } }

/* ==========================================================================
   Enhancements — added after live review on 2026-09-18
   Everything below uses existing tokens only, so light and dark both follow.
   ========================================================================== */

/* --- skip link: first tab stop, visible only when focused ---------------- */
.es-skip {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -120%);
  z-index: 200; background: var(--product-accent); color: #fff;
  padding: .6rem 1.2rem; border-radius: 0 0 10px 10px; font-size: .9rem;
  font-weight: 600; text-decoration: none; transition: transform var(--transition-fast);
}
.es-skip:focus { transform: translate(-50%, 0); }

/* --- focus-visible: style.css resets button outlines to none, which leaves
       keyboard users with no indicator at all. Restore it everywhere. ------ */
.tx1-page a:focus-visible,
.tx1-page button:focus-visible,
.tx1-page summary:focus-visible,
.tx1-page [tabindex]:focus-visible {
  outline: 2px solid var(--product-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.es-cta-band a:focus-visible { outline-color: #fff; }
.es-section--dark a:focus-visible { outline-color: var(--product-accent); }

/* --- chapter rail: the always-on Windows scrollbar reads as a defect.
       Make it thin and add edge fades so the overflow is legible instead. -- */
.es-rail { scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; position: relative; }
.es-rail::-webkit-scrollbar { height: 3px; }
.es-rail::-webkit-scrollbar-track { background: transparent; }
.es-rail::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.es-rail:hover::-webkit-scrollbar-thumb { background: var(--text-muted); }
.es-rail ol { scroll-snap-type: x proximity; }
.es-rail li { scroll-snap-align: start; }
@supports (mask-image: linear-gradient(90deg, #000, #000)) {
  .es-rail {
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  }
}

/* --- anchor targets clear the sticky header ----------------------------- */
.tx1-page :target { scroll-margin-top: 5rem; }

/* --- prose polish -------------------------------------------------------- */
.es-col p, .es-lede, .es-triad p, .es-faq details > p { text-wrap: pretty; }
.es-col p a, .es-panel p a {
  color: var(--product-accent); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--product-accent) 45%, transparent);
  transition: text-decoration-color var(--transition-fast);
}
.es-col p a:hover, .es-panel p a:hover { text-decoration-color: var(--product-accent); }
.es-section--dark .es-col p a { color: var(--product-accent); }

/* --- tables: zebra + row hover make wide matrices trackable -------------- */
.es-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--text-primary) 3%, transparent); }
.es-table tbody tr:hover { background: var(--product-accent-soft); }
.es-tablewrap { position: relative; }
.es-table thead th { position: sticky; top: 0; z-index: 1; }

/* --- inline CTA: lift it slightly so it reads as an object, not a note --- */
.es-inline-cta { box-shadow: var(--shadow-sm); }
.es-inline-cta a { box-shadow: 0 1px 2px rgba(16,185,129,.35); }

/* --- sibling cards: directional affordance ------------------------------ */
.es-siblings a { position: relative; padding-right: 2.4rem; }
.es-siblings a::after {
  content: "→"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1rem; transition: transform var(--transition-fast), color var(--transition-fast);
}
.es-siblings a:hover::after { color: var(--product-accent); transform: translateY(-50%) translateX(3px); }

/* --- print: these are reference pages people print ---------------------- */
@media print {
  .header, .es-rail, .scroll-progress, .back-to-top,
  .es-inline-cta, .es-cta-band, .es-siblings, .footer { display: none !important; }
  .es-section, .es-hero { padding: 1.2rem 0; background: #fff !important; }
  .es-section--dark { background: #fff !important; color: #000 !important; }
  .es-section--dark .es-sec-title, .es-section--dark p { color: #000 !important; }
  .es-col, .es-wrap { max-width: 100%; }
  .es-faq details { border-bottom: 1px solid #ccc; }
  .es-faq details > p { display: block !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

@media (prefers-reduced-motion: reduce) {
  .es-siblings a:hover::after { transform: translateY(-50%); }
  .es-skip { transition: none; }
}

/* --- alignment fix -------------------------------------------------------
   The page template combines both classes on one element: <div class="es-wrap
   es-col">. That made .es-col's 68ch cap apply to the whole box, and
   .es-wrap's margin-inline:auto then CENTRED that narrow box — so section
   content sat ~267px right of the hero, which uses .es-wrap alone.
   Keep the box at wrap width and cap the reading measure on the children,
   letting full-width components opt out. */
.es-wrap.es-col { max-width: min(100% - 2.5rem, 1120px); }
.es-wrap.es-col > * { max-width: var(--measure); }
.es-wrap.es-col > .es-tablewrap,
.es-wrap.es-col > .es-triad,
.es-wrap.es-col > .es-stats,
.es-wrap.es-col > .es-siblings,
.es-wrap.es-col > .es-faq,
.es-wrap.es-col > figure,
.es-wrap.es-col > svg { max-width: 100%; }

/* --- dark-band contrast fix ---------------------------------------------
   `.es-section--dark p` and `.es-col p` both score (0,1,1), so the later rule
   won and dark bands inherited --text-secondary (#424245) on a #1d1d1f ground:
   1.68:1, far under the 4.5:1 AA floor for body text. Headings were unaffected
   (16.8:1), which is why it was easy to miss. Raise specificity so the band
   always wins, and use a slightly brighter grey than before (11.3:1). */
.es-section--dark .es-col p,
.es-section--dark .es-col .es-lede,
.es-section--dark .es-triad p,
.es-section--dark .es-panel p,
.es-section--dark .es-faq details > p,
.es-section--dark .es-inline-cta p,
.es-section--dark p,
.es-section--dark .es-lede { color: #d2d2d7; }

.es-section--dark .es-col strong,
.es-section--dark .es-triad h4,
.es-section--dark .es-h3,
.es-section--dark .es-panel--note strong { color: #fff; }

/* nested components sitting inside a dark band need their own surfaces too */
.es-section--dark .es-panel { border-left-color: rgba(255,255,255,.22); }
.es-section--dark .es-panel--note {
  border-left-color: var(--product-accent);
  background: rgba(16,185,129,.12);
}
.es-section--dark .es-triad > div { border-top-color: var(--product-accent); }
.es-section--dark .es-crumb,
.es-section--dark .es-faq summary { color: #f5f5f7; }
.es-section--dark .es-faq details { border-bottom-color: rgba(255,255,255,.14); }
.es-section--dark .es-table th,
.es-section--dark .es-table td { color: #d2d2d7; border-bottom-color: rgba(255,255,255,.14); }

/* ==========================================================================
   Accessible accent split — measured on the live site 2026-09-18
   White on #10b981 is 2.54:1; as text on white it is 2.56:1. Both fail AA.
   #10b981 stays for decoration and for marks on DARK grounds (6.7:1 there).
   #047857 (5.5:1 with white, and as text on white) carries anything that has
   to be read. Dark theme gets a brighter ink because #047857 on near-black
   is only 3.1:1.
   ========================================================================== */
.tx1-page {
  --product-ink: #047857;        /* accent AS TEXT on light grounds  */
  --product-fill: #047857;       /* filled surface behind white text */
  --product-fill-hover: #065f46;
}
[data-theme="dark"] .tx1-page {
  --product-ink: #34d399;        /* 8.9:1 on #1d1d1f */
  --product-fill: #047857;
  --product-fill-hover: #065f46;
}

/* accent used as readable text on a light ground */
.es-eyebrow                        { color: var(--product-ink); }
.es-crumb a:hover                  { color: var(--product-ink); }
.es-siblings .n                    { color: var(--product-ink); }
.es-col p a, .es-panel p a         { color: var(--product-ink); }
.es-col p a,
.es-panel p a                      { text-decoration-color: color-mix(in srgb, var(--product-ink) 45%, transparent); }
.es-col p a:hover,
.es-panel p a:hover                { text-decoration-color: var(--product-ink); }

/* filled surfaces that carry white text */
.es-inline-cta a                   { background: var(--product-fill); box-shadow: 0 1px 2px rgba(4,120,87,.35); }
.es-inline-cta a:hover             { background: var(--product-fill-hover); }
.es-skip                           { background: var(--product-fill); }
.es-cta-band {
  background: linear-gradient(135deg, var(--product-fill) 0%, var(--product-fill-hover) 100%);
}
.es-cta-band p                     { color: rgba(255,255,255,.94); }
.es-btn--solid                     { color: var(--product-fill-hover); }

/* focus ring needs 3:1 against both grounds as a UI affordance */
.tx1-page a:focus-visible,
.tx1-page button:focus-visible,
.tx1-page summary:focus-visible,
.tx1-page [tabindex]:focus-visible { outline-color: var(--product-ink); }

/* on DARK grounds the bright emerald already passes — keep it there */
.es-section--dark .es-eyebrow      { color: #10b981; }
.es-section--dark .es-col p a      { color: #34d399; }
.es-stats .n                       { color: #34d399; }

/* ==========================================================================
   Parent-stylesheet overrides — measured failures style.css brings with it.
   Scoped to .tx1-page so synthetik.au itself is untouched.
   ========================================================================== */

/* --text-muted (#86868b) is 3.33:1 on white — used by the footer, the footer
   column headings and the rail's inactive links. One token fixes all of them. */
.tx1-page                    { --text-muted: #6e6e73; }   /* 5.0:1 on white   */
[data-theme="dark"] .tx1-page{ --text-muted: #a1a1a6; }   /* 7.9:1 on black   */

/* .btn-primary rides --accent-color, which flips to #2997ff in dark: white on
   that is 3.0:1. TX1:Trinity's product colour is the emerald anyway, so unify
   every primary CTA on it — accessible in both themes and on-brand. */
.tx1-page .btn-primary {
  background: var(--product-fill);
  border-color: var(--product-fill);
  color: #fff;
}
.tx1-page .btn-primary:hover {
  background: var(--product-fill-hover);
  border-color: var(--product-fill-hover);
}
.tx1-page .btn-outline {
  color: var(--product-ink);
  border-color: color-mix(in srgb, var(--product-ink) 55%, transparent);
}
.tx1-page .btn-outline:hover {
  color: #fff;
  background: var(--product-fill);
  border-color: var(--product-fill);
}

/* inline accent links outside .es-col (landing-page prose) */
.tx1-page a[href]:not([class]) { color: var(--product-ink); }
.es-section--dark a[href]:not([class]) { color: #34d399; }
