/*
 * tcw-library-v2.css  ·  The Carbon Workbench
 * Visual v2 for the public Library: homepage, Learn, Kit, product pages.
 *
 * Scoped behind data-tcw-visual="v2" like the app layer, and attaches to the
 * verified class names already in the pages. Avoid styling generic legacy
 * classes unless their markup has been checked across every page that uses
 * them: this layer is shared by Learn, Field Kit and the calculator hub.
 *
 * Load after tcw-tokens-v2.css, which supplies the tokens.
 *
 * ── Why the Library matters more than the app right now ──────────────────
 * This is the part that compounds while nobody is watching: indexed pages,
 * backlinks, embeds on other people's sites, domain age. The app serves
 * whoever is signed in today. These pages serve search traffic that grows
 * whether or not anyone is working on the product.
 */

/* ══ masthead ═══════════════════════════════════════════════════════════ */

html[data-tcw-visual="v2"] .article-nav {
  background: var(--tcw-v2-carbon);
  border-bottom: 1px solid color-mix(in srgb, var(--tcw-v2-brand) 30%, transparent);
}
html[data-tcw-visual="v2"] .article-nav a {
  font-family: var(--tcw-v2-sans);
  font-size: 13.5px;
  color: #c8cfcc;
}
html[data-tcw-visual="v2"] .article-nav a:hover { color: #fcfcfa; }

/* landing-body is the body element on the public library, not a content
   wrapper. Keep the document fluid and put readable measures on inner
   components only. */
html[data-tcw-visual="v2"] body.landing-body {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ══ article hero ═══════════════════════════════════════════════════════ */
/*
 * The dark masthead already worked. It needs the type scale, the brand cast
 * and the hairline, not a rebuild.
 */

/* Learn articles share this structure. Field Kit guides use a separate,
   verified two-column hero and retain their page-local layout. */
html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--tcw-v2-brand) 16%, var(--tcw-v2-carbon)) 0%,
      var(--tcw-v2-carbon) 62%);
  border-bottom: 2px solid var(--tcw-v2-brand);
  padding: 58px 24px 52px;
  text-align: left;
}
html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero .eyebrow,
html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero .article-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--tcw-v2-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tcw-v2-brand-lift);
  margin-bottom: 14px;
}
html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero .eyebrow::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--tcw-v2-brand-lift);
  border-radius: 1px;
  transform: rotate(45deg);
}

html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero h1 {
  font-family: var(--tcw-v2-serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: #fcfcfa;
  margin: 0;
  max-width: 20ch;
}
html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero h1 em {
  font-style: italic;
  color: var(--tcw-v2-brand-lift);
}
html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero p {
  font-family: var(--tcw-v2-sans);
  font-size: 16px;
  line-height: 1.55;
  color: #a9b2ae;
  margin: 16px 0 0;
  max-width: 58ch;
}

/* Most Learn articles predate article-hero-inner. Align their direct hero
   content to the same reading column without requiring 36 page rewrites. */
html[data-tcw-visual="v2"] body:has(.article-body) .article-hero > .eyebrow,
html[data-tcw-visual="v2"] body:has(.article-body) .article-hero > .article-eyebrow,
html[data-tcw-visual="v2"] body:has(.article-body) .article-hero > h1,
html[data-tcw-visual="v2"] body:has(.article-body) .article-hero > p {
  margin-left: auto;
  margin-right: auto;
}
html[data-tcw-visual="v2"] body:has(.article-body) .article-hero > .eyebrow,
html[data-tcw-visual="v2"] body:has(.article-body) .article-hero > .article-eyebrow {
  display: flex;
  max-width: 760px;
}

/* ══ article body ═══════════════════════════════════════════════════════ */
/*
 * Measure, rhythm and a proper scale. Long-form reading is the job here, and
 * these pages are what search traffic actually lands on.
 */

html[data-tcw-visual="v2"] .article-body {
  font-family: var(--tcw-v2-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--tcw-v2-text);
  max-width: 68ch;
  margin: 0 auto;
  padding: 46px 24px 60px;
}
html[data-tcw-visual="v2"] .article-body p { margin: 0 0 1.15em; }
html[data-tcw-visual="v2"] .article-body > p:first-of-type {
  font-size: 19px;
  line-height: 1.55;
  color: var(--tcw-v2-text);
}

html[data-tcw-visual="v2"] .article-body h2 {
  font-family: var(--tcw-v2-serif);
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 2.2em 0 0.5em;
  padding-top: 1.1em;
  border-top: 1px solid var(--tcw-v2-rule);
}
html[data-tcw-visual="v2"] .article-body h3 {
  font-family: var(--tcw-v2-sans);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 1.9em 0 0.4em;
}

html[data-tcw-visual="v2"] .article-body a {
  color: var(--tcw-v2-text);
  text-decoration: underline;
  text-decoration-color: var(--tcw-v2-brand-lift);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
html[data-tcw-visual="v2"] .article-body a:hover {
  color: var(--tcw-v2-brand);
  text-decoration-thickness: 2px;
}

html[data-tcw-visual="v2"] .article-body blockquote {
  margin: 1.7em 0;
  padding: 0 0 0 20px;
  border-left: 2px solid var(--tcw-v2-brand);
  font-family: var(--tcw-v2-serif);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--tcw-v2-text);
}

html[data-tcw-visual="v2"] .article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  margin: 1.6em 0;
  font-variant-numeric: tabular-nums slashed-zero;
}
html[data-tcw-visual="v2"] .article-body th {
  font-family: var(--tcw-v2-mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--tcw-v2-muted);
  text-align: left;
  padding: 10px 14px;
  background: var(--tcw-v2-inset);
  border-bottom: 1px solid var(--tcw-v2-rule);
}
html[data-tcw-visual="v2"] .article-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tcw-v2-rule);
}

html[data-tcw-visual="v2"] .article-body code {
  font-family: var(--tcw-v2-mono);
  font-size: 0.88em;
  background: var(--tcw-v2-inset);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ══ hub cards ══════════════════════════════════════════════════════════ */
/*
 * Thirty-five identical cards was the Library's version of the app's tool
 * wall. Flattening them into a ruled index makes the list scannable and
 * stops it reading as a grid of ghosts.
 */

html[data-tcw-visual="v2"] .learn-grid .article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 168px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--tcw-v2-rule);
  border-radius: 0;
  background: none;
}
html[data-tcw-visual="v2"] .learn-grid .article-card:hover {
  background: var(--tcw-v2-inset);
  box-shadow: -14px 0 0 var(--tcw-v2-inset), 14px 0 0 var(--tcw-v2-inset);
  transform: none;
}
html[data-tcw-visual="v2"] .learn-grid .article-card h2,
html[data-tcw-visual="v2"] .learn-grid .article-card h3,
html[data-tcw-visual="v2"] .learn-grid .article-card .ac-title {
  font-family: var(--tcw-v2-serif);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
html[data-tcw-visual="v2"] .learn-grid .article-card .ac-label {
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  margin: 0 0 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tcw-v2-brand) 9%, var(--tcw-v2-paper));
  font-family: var(--tcw-v2-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tcw-v2-muted);
}
html[data-tcw-visual="v2"] .learn-grid .article-card .ac-meta,
html[data-tcw-visual="v2"] .learn-grid .article-card .ac-read {
  font-family: var(--tcw-v2-mono);
  font-size: 10.5px;
  color: var(--tcw-v2-muted);
  white-space: nowrap;
}
html[data-tcw-visual="v2"] .learn-grid .article-card .ac-meta {
  width: 100%;
  margin-top: auto;
}
html[data-tcw-visual="v2"] .learn-grid .article-card p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--tcw-v2-muted);
  margin: 0 0 14px;
  max-width: 70ch;
}

@media (max-width: 720px) {
  html[data-tcw-visual="v2"] .article-nav {
    padding: 11px 16px;
    gap: 10px;
  }
  html[data-tcw-visual="v2"] .article-nav-logo span { display: none; }
  html[data-tcw-visual="v2"] .article-nav > div {
    gap: 9px !important;
    margin-left: auto;
  }
  html[data-tcw-visual="v2"] .article-nav > div > a:not(.nav-cta) { display: none; }
  html[data-tcw-visual="v2"] .article-nav .nav-cta {
    padding: 8px 11px;
    white-space: nowrap;
  }
  html[data-tcw-visual="v2"] .article-nav .public-explore summary {
    padding: 8px 4px;
    white-space: nowrap;
  }
  html[data-tcw-visual="v2"] .article-nav .public-explore-menu {
    position: fixed;
    top: 58px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 74px);
    overflow-y: auto;
  }
  html[data-tcw-visual="v2"] :is(body:has(.article-body), body.calc-library-page) .article-hero {
    padding: 40px 18px 36px;
  }
  html[data-tcw-visual="v2"] .article-body {
    padding: 32px 18px 44px;
    font-size: 16.5px;
  }
  html[data-tcw-visual="v2"] .article-body > p:first-of-type { font-size: 17.5px; }
}

/* ══ calculators hub ════════════════════════════════════════════════════ */
/*
 * Grouped by who the tool is for, not by what it is called. "Biochar
 * Calculator" means nothing to a sustainability lead at a manufacturer;
 * "Scope 1, 2 and 3" means everything. Someone arriving cold should find
 * themselves in the first line they read.
 */

html[data-tcw-visual="v2"] .calc-hub { max-width: 1000px; margin: 0 auto; padding: 44px 24px 64px; }

html[data-tcw-visual="v2"] .calc-group { margin-bottom: 42px; }
html[data-tcw-visual="v2"] .calc-group__h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--tcw-v2-rule);
}
html[data-tcw-visual="v2"] .calc-group__t {
  font-family: var(--tcw-v2-serif);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 0;
}
html[data-tcw-visual="v2"] .calc-group__n {
  font-family: var(--tcw-v2-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tcw-v2-muted);
}

html[data-tcw-visual="v2"] .calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1px;
  background: var(--tcw-v2-rule);
  border: 1px solid var(--tcw-v2-rule);
  border-top: 0;
}
html[data-tcw-visual="v2"] .calc-card {
  display: block;
  background: var(--tcw-v2-paper);
  padding: 16px 18px 17px;
  text-decoration: none;
  color: var(--tcw-v2-text);
  position: relative;
}
html[data-tcw-visual="v2"] .calc-card:hover { background: var(--tcw-v2-inset); }
html[data-tcw-visual="v2"] .calc-card:hover .calc-card__go { color: var(--tcw-v2-brand); }

html[data-tcw-visual="v2"] .calc-card__top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}
/* Two letters, not a pictogram. Legible at any size and never childish. */
html[data-tcw-visual="v2"] .calc-card__code {
  font-family: var(--tcw-v2-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--tcw-v2-brand);
  border: 1px solid color-mix(in srgb, var(--tcw-v2-brand) 40%, transparent);
  border-radius: 2px;
  padding: 3px 6px;
}
html[data-tcw-visual="v2"] .calc-card__free {
  font-family: var(--tcw-v2-mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--tcw-v2-muted);
  margin-left: auto;
}
html[data-tcw-visual="v2"] .calc-card__t {
  font-family: var(--tcw-v2-sans);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.25;
  margin: 0 0 5px;
}
html[data-tcw-visual="v2"] .calc-card__d {
  font-size: 13px;
  line-height: 1.5;
  color: var(--tcw-v2-muted);
  margin: 0 0 11px;
}
/* What it gives you back. The thing a stranger actually wants to know. */
html[data-tcw-visual="v2"] .calc-card__out {
  font-family: var(--tcw-v2-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--tcw-v2-muted);
  padding-top: 9px;
  border-top: 1px solid var(--tcw-v2-rule);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
html[data-tcw-visual="v2"] .calc-card__go { color: var(--tcw-v2-muted); }

html[data-tcw-visual="v2"] .calc-note {
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--tcw-v2-muted);
  margin: 0 0 34px;
}
html[data-tcw-visual="v2"] .calc-note b { color: var(--tcw-v2-text); font-weight: 600; }

@media (max-width: 640px) {
  html[data-tcw-visual="v2"] .calc-hub { padding: 30px 18px 48px; }
  html[data-tcw-visual="v2"] .calc-grid { grid-template-columns: minmax(0, 1fr); }
  html[data-tcw-visual="v2"] .calc-group__h {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}
