/* /carbon-ledger/ (vis.eco -> Universal Carbon Ledger -> Enoqi).
   Loaded after project.css; uses its sap- blocks and adds only what this
   page needs. Prefix: cl-.

   One accent per stage, on the timeline bar, the card and the table column:
   vis.eco and UCL in EoI colours (the theme's yellow and a darker shade of
   its primary blue, dark enough for white text), Enoqi in its brand magenta
   to mark it as a separate company. */

.cl-tl__stage--viseco, .cl-stage--viseco, .cl-compare--viseco { --accent: #ebc71d; --on-accent: #2c2f37; }
.cl-tl__stage--ucl,    .cl-stage--ucl,    .cl-compare--ucl    { --accent: #4064b7; --on-accent: #fff; }
.cl-tl__stage--enoqi,  .cl-stage--enoqi,  .cl-compare--enoqi  { --accent: #970056; --on-accent: #fff; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---- Hero --------------------------------------------------------------- */

.cl-title { font-size: 2.2rem; line-height: 1.15; }
.cl-lede { max-width: 56ch; }
@media (min-width: 768px) {
  .cl-title { font-size: 3.4rem; }
}

.cl-path {
  display: flex; flex-wrap: wrap; align-items: center;
  margin: 0; padding: 0; list-style: none;
  font-weight: 600;
}
.cl-path li + li::before {
  content: "\2192"; margin: 0 .7rem;
  color: rgba(255, 255, 255, .75);
}
.cl-path a {
  display: inline-block; padding: .15rem 0;
  border-bottom: 3px solid #ebc71d;
  color: #fff;
}
.cl-path li:nth-child(2) a { border-bottom-color: #6281c8; }
.cl-path li:nth-child(3) a { border-bottom-color: #d4338f; }
.cl-path a:hover, .cl-path a:focus { color: #fff; text-decoration: none; border-bottom-color: #fff; }

/* ---- Timeline ----------------------------------------------------------- */
/* Positions are in months from September 2020; see the comment in the HTML. */

.cl-tl { position: relative; padding: 2.2rem 0 2rem; }

.cl-tl__axis { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.cl-tl__year {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--at) / var(--total) * 100%);
  padding-left: .35rem;
  border-left: 1px solid #e0e4ea;
  color: #6b6f7a;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em;
}
.cl-tl__year--first { left: 0; padding-left: 0; border-left: 0; }

.cl-tl__stages { position: relative; z-index: 1; margin: 0; padding: 0; list-style: none; }
.cl-tl__stage { padding: .8rem 0; }

/* The link is exactly as wide as the bar; the labels may run past it. */
.cl-tl__link {
  display: block; position: relative;
  margin-left: calc(var(--start) / var(--total) * 100%);
  width: calc((var(--end) - var(--start)) / var(--total) * 100%);
  color: #2c2f37;
  white-space: nowrap;
}
.cl-tl__link:hover, .cl-tl__link:focus { color: #2c2f37; text-decoration: none; }
.cl-tl__link:focus { outline: none; }
.cl-tl__link:hover .cl-tl__name, .cl-tl__link:focus .cl-tl__name { text-decoration: underline; }
.cl-tl__link:focus .cl-tl__bar { outline: 3px solid #2c2f37; outline-offset: 3px; }

.cl-tl__name {
  display: block;
  font-family: "Roboto Slab", Helvetica, Arial, sans-serif;
  font-size: 1.05rem; font-weight: 700; line-height: 1.3;
}
.cl-tl__dates { display: block; color: #555a66; font-size: .85rem; }
.cl-tl__kind {
  margin-left: .5rem;
  color: #6b6f7a;
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.cl-tl__bar {
  display: block; position: relative;
  height: 14px; margin: .45rem 0 .4rem;
  border-radius: 7px;
  background: var(--accent);
}
/* Enoqi is open-ended: the bar fades out. */
.cl-tl__stage--enoqi .cl-tl__bar {
  border-radius: 7px 0 0 7px;
  background: linear-gradient(90deg, #970056 0, #970056 72%, rgba(151, 0, 86, 0) 100%);
}
.cl-tl__scope { display: block; color: #6b6f7a; font-size: .85rem; font-style: italic; }
/* Labels sit on white, so grid lines and the spin-off line pass behind them. */
.cl-tl__name, .cl-tl__dates, .cl-tl__scope { display: table; background: #fff; }
.cl-tl__stage--enoqi .cl-tl__name,
.cl-tl__stage--enoqi .cl-tl__dates,
.cl-tl__stage--enoqi .cl-tl__scope { margin-left: .5rem; }

.cl-tl__diamond {
  position: absolute; top: 50%;
  left: calc(var(--at) / (var(--end) - var(--start)) * 100%);
  width: 12px; height: 12px;
  border: 2px solid #2c2f37;
  background: #fff;
  transform: translate(-50%, -50%) rotate(45deg);
}
.cl-tl__diamond--key { width: 18px; height: 18px; border: 3px solid #970056; }

/* One-line summary on hover and keyboard focus. */
.cl-tl__tip {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 3;
  width: max-content; max-width: 22rem;
  padding: .5rem .75rem;
  border-radius: 4px;
  background: #2c2f37; color: #fff;
  font-size: .85rem; line-height: 1.4;
  white-space: normal;
  opacity: 0; visibility: hidden;
  transition: opacity .15s, visibility .15s;
  pointer-events: none;
}
.cl-tl__stage--ucl .cl-tl__tip,
.cl-tl__stage--enoqi .cl-tl__tip { right: 0; left: auto; }
.cl-tl__link:hover .cl-tl__tip,
.cl-tl__link:focus .cl-tl__tip { opacity: 1; visibility: visible; }

/* The spin-off: the one highlighted moment. */
.cl-tl__spinoff {
  position: absolute; top: 1.6rem; bottom: 0;
  left: calc(var(--at) / var(--total) * 100%);
  border-left: 2px dashed #970056;
  pointer-events: none;
}
.cl-tl__spinoff span {
  position: absolute; bottom: 0; left: .45rem;
  color: #970056;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap;
}

.cl-milestones__title {
  margin: 2rem 0 .8rem;
  color: #6b6f7a;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.cl-milestones {
  display: flex; flex-wrap: wrap;
  gap: .5rem 2.2rem;
  margin: 0; padding: 0; list-style: none;
  font-size: .95rem;
}
.cl-milestones li { position: relative; padding-left: 1.5rem; }
.cl-milestones li::before {
  content: ""; position: absolute; left: .2rem; top: .45rem;
  width: 10px; height: 10px;
  border: 2px solid #2c2f37;
  transform: rotate(45deg);
}
.cl-milestones li.is-key::before { border-color: #970056; background: #970056; }
.cl-milestones__when { margin-right: .35rem; font-weight: 700; }

/* Under 768 px: vertical, top to bottom, same content. */
@media (max-width: 767.98px) {
  .cl-tl { padding: 0; }
  .cl-tl__axis, .cl-tl__spinoff, .cl-tl__diamond { display: none; }
  .cl-tl__stage { padding: 0 0 1.6rem; }
  .cl-tl__link {
    margin-left: 0; width: auto;
    padding-left: 1.5rem;
    white-space: normal;
  }
  .cl-tl__bar {
    position: absolute; top: .2rem; bottom: .2rem; left: 0;
    width: 8px; height: auto; margin: 0;
    border-radius: 4px;
  }
  .cl-tl__stage--enoqi .cl-tl__bar {
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #970056 0, #970056 60%, rgba(151, 0, 86, 0) 100%);
  }
  .cl-tl__scope { margin-top: .2rem; }
  .cl-tl__stage--enoqi .cl-tl__name,
  .cl-tl__stage--enoqi .cl-tl__dates,
  .cl-tl__stage--enoqi .cl-tl__scope { margin-left: 0; }
  .cl-tl__tip {
    position: static; width: auto; max-width: none;
    margin-top: .3rem; padding: 0;
    background: none; color: #555a66;
    font-size: .95rem;
    opacity: 1; visibility: visible;
  }
  .cl-milestones { display: block; }
  .cl-milestones li + li { margin-top: .4rem; }
}

/* ---- Stage cards -------------------------------------------------------- */

.cl-badge { background: var(--accent); color: var(--on-accent); }

.cl-stage__when {
  margin-bottom: 1rem;
  color: #555a66;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.cl-stage__when::before {
  content: ""; display: inline-block;
  width: .7rem; height: .7rem; margin-right: .5rem;
  border-radius: 50%;
  background: var(--accent);
}

.cl-factbox { border-top: 4px solid var(--accent); }

.cl-features { margin: 0 0 1rem; padding: 0; list-style: none; }
.cl-features li { position: relative; padding: .4rem 0 .4rem 1.6rem; }
.cl-features li::before {
  content: ""; position: absolute; left: 0; top: .95rem;
  width: .6rem; height: .6rem;
  background: var(--accent);
}

.cl-transition {
  margin: 2rem 0 0; padding: 1.4rem 1.6rem;
  border-left: 4px solid #4064b7;
  background: #f2f4f8;
  font-family: "Roboto Slab", Helvetica, Arial, sans-serif;
  font-size: 1.1rem; line-height: 1.55;
}

/* How it works (UCL): supplier -> buyer, emissions alongside. */
.cl-flow { margin: 3rem 0 0; }
.cl-flow__diagram { display: flex; align-items: stretch; max-width: 46rem; }
.cl-flow__node {
  display: flex; flex: 0 0 8rem; align-items: center; justify-content: center;
  padding: 1.2rem .8rem;
  border: 2px solid #2c2f37; border-radius: 4px;
  font-family: "Roboto Slab", Helvetica, Arial, sans-serif;
  font-weight: 700;
}
.cl-flow__links {
  display: flex; flex: 1 1 auto; flex-direction: column; justify-content: center;
  gap: 1.4rem;
  padding: 0 .4rem;
}
.cl-flow__link {
  position: relative;
  padding: 0 1rem .35rem;
  border-bottom: 3px solid #2c2f37;
  font-size: .9rem; line-height: 1.35; text-align: center;
}
.cl-flow__link::after {
  content: ""; position: absolute; right: -2px; bottom: -8px;
  border-top: 6.5px solid transparent; border-bottom: 6.5px solid transparent;
  border-left: 11px solid #2c2f37;
}
.cl-flow__link--co2 { border-bottom-color: #4064b7; color: #4064b7; font-weight: 700; }
.cl-flow__link--co2::after { border-left-color: #4064b7; }
.cl-flow figcaption { max-width: 46rem; margin-top: 1rem; color: #555a66; font-size: .9rem; }

@media (max-width: 575.98px) {
  .cl-flow__diagram { flex-direction: column; }
  .cl-flow__node { flex-basis: auto; }
  .cl-flow__links { gap: .8rem; padding: 1rem 0 1rem 1.2rem; }
  .cl-flow__link {
    padding: .2rem 0 .9rem .9rem;
    border-bottom: 0; border-left: 3px solid #2c2f37;
    text-align: left;
  }
  .cl-flow__link--co2 { border-left-color: #4064b7; }
  .cl-flow__link::after {
    right: auto; bottom: -2px; left: -8px;
    border-top: 11px solid #2c2f37; border-right: 6.5px solid transparent;
    border-bottom: 0; border-left: 6.5px solid transparent;
  }
  .cl-flow__link--co2::after { border-top-color: #4064b7; border-left-color: transparent; }
}

/* Enoqi: the outcome, set apart from the two EoI projects. */
.cl-stage--enoqi { padding: 70px 0 60px; background: #f9eef4; }
.cl-stage--enoqi .cl-factbox { background: #fff; }
.cl-outcome {
  margin-bottom: 1.2rem;
  color: #970056;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.cl-num { color: #970056; }

.cl-smart {
  margin: .5rem 0 2.5rem; padding: 1.8rem 2rem;
  border-left: 4px solid #970056;
  background: #fff;
}
.cl-smart p { max-width: 62ch; }
.cl-smart__axes {
  display: flex; flex-wrap: wrap;
  gap: .8rem 1.6rem;
  margin: 1.2rem 0 1.8rem; padding: 0; list-style: none;
  font-weight: 600;
}
.cl-smart__axes li { display: flex; align-items: center; gap: .6rem; }
.cl-smart__axes span {
  display: flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem;
  border-radius: 4px;
  background: #970056; color: #fff;
  font-family: "Roboto Slab", Helvetica, Arial, sans-serif;
  font-size: 1.3rem; font-weight: 700;
}

/* SMART score: a plain scale, F (lowest) to A+ (highest). */
.cl-grade { display: flex; align-items: center; gap: .8rem; max-width: 30rem; }
.cl-grade__end {
  min-width: 2rem;
  font-family: "Roboto Slab", Helvetica, Arial, sans-serif;
  font-size: 1.2rem; font-weight: 700; text-align: center;
}
.cl-grade__bar {
  flex: 1 1 auto; height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #d9dce3, #970056);
}
.cl-grade__legend {
  display: flex; justify-content: space-between;
  max-width: 30rem; margin: .3rem 0 0;
  color: #6b6f7a;
  font-size: .8rem;
}

.cl-button { background: #970056; }
.cl-button:hover, .cl-button:focus { background: #6f0040; }

/* ---- What carried over -------------------------------------------------- */

.cl-compare { width: 100%; border-collapse: collapse; }
.cl-compare th, .cl-compare td {
  padding: .9rem 1rem;
  border-top: 1px solid #e0e4ea;
  text-align: left; vertical-align: top;
}
.cl-compare thead th {
  border-top: 0; border-bottom: 4px solid var(--accent, #2c2f37);
  color: #2c2f37;
  font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.cl-compare tbody th {
  width: 19%;
  font-family: "Roboto Slab", Helvetica, Arial, sans-serif;
  font-weight: 700;
}
.cl-compare tbody tr:last-child > * { border-bottom: 1px solid #e0e4ea; }

/* Under 768 px: one card per idea. */
@media (max-width: 767.98px) {
  .cl-compare, .cl-compare tbody, .cl-compare tr, .cl-compare th, .cl-compare td { display: block; width: auto; }
  .cl-compare thead {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .cl-compare tbody tr { margin-bottom: 1.5rem; border: 1px solid #e0e4ea; }
  .cl-compare tbody th { width: auto; border-top: 0; background: #f2f4f8; }
  .cl-compare tbody tr:last-child > * { border-bottom: 0; }
  .cl-compare td { padding-left: 1.3rem; }
  .cl-compare td::before {
    content: attr(data-label); display: block; margin-bottom: .2rem;
    color: #6b6f7a;
    font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  }
  .cl-compare td:nth-of-type(1) { box-shadow: inset 4px 0 0 #ebc71d; }
  .cl-compare td:nth-of-type(2) { box-shadow: inset 4px 0 0 #4064b7; }
  .cl-compare td:nth-of-type(3) { box-shadow: inset 4px 0 0 #970056; }
}
