/* Graphic (front end and editor preview). Values of the group pages. */
.sg-graphic { position: relative; }
.sg-graphic img { display: block; max-width: 100%; height: auto; }

/* ---------- map: image with labels, dots and pins (positions in % of the image) ---------- */
.sg-graphic.is-map {
  container-type: inline-size; /* label sizes follow the width of the map (cqw) */

  & .sg-graphic__img { position: relative; z-index: 1; width: 100%; }
  /* second image behind the map (globe) */
  & .sg-graphic__back { position: absolute; z-index: 0; width: 88%; left: 58%; top: 52%; transform: translate(-50%, -50%); opacity: .5; pointer-events: none; }

  & :is(.sg-graphic__labels, .sg-graphic__dots, .sg-graphic__pins) { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; z-index: 2; }
  & :is(.sg-graphic__labels, .sg-graphic__dots, .sg-graphic__pins) li { position: absolute; margin: 0; }
}

/* the map reaches the right edge of the page (governance map, production sites) */
.sg-graphic.is-map.is-bleed { margin-right: calc(-1 * max(var(--wp--custom--gutter, 24px), (var(--sg-viewport, 100vw) - var(--wp--style--global--wide-size, 1312px)) / 2)); }

/* labels without colour: bold name on the map, white glow */
.sg-graphic__labels li {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--wp--preset--color--ink);
  text-shadow: 0 0 8px rgba(255, 255, 255, .9);

  & span { font-weight: 400; font-size: 11px; }
}

/* labels with colour: coloured line on the left, sizes follow the map (Business Units) */
.sg-graphic__labels li.has-color {
  gap: .15cqw;
  padding-left: .6cqw;
  border-left: .3cqw solid var(--c);
  white-space: normal;
  text-shadow: none;

  & b { font-size: 1.04cqw; line-height: 1.28; }
  & span { font-size: .68cqw; line-height: 1.45; }
}

/* black dots with a white ring (Compacting locations) */
.sg-graphic__dots li {
  width: .95cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 .14cqw #fff, 0 0 0 .2cqw #000;
  transform: translate(-50%, -50%);
}

/* numbered pins (production sites), colour per capability */
.sg-graphic__pins li {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c, #006c67);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px #fff, 0 6px 12px -6px rgba(14, 110, 100, .7);
}

@media (max-width: 1023px) {
  .sg-graphic.is-map.is-bleed { margin-right: calc(-1 * var(--wp--custom--gutter, 24px)); }
  .sg-graphic__labels li:not(.has-color) { font-size: 10px; }
  .sg-graphic__labels li:not(.has-color) span { display: none; }
  .sg-graphic__pins li { width: 20px; height: 20px; font-size: 10px; }
}

@media (max-width: 640px) {
  .sg-graphic__labels li.has-color { border-left-width: .6cqw; padding-left: 1cqw; }
  .sg-graphic__labels li.has-color b { font-size: 2.3cqw; }
  .sg-graphic__labels li.has-color span { display: none; }
  .sg-graphic__dots li { width: 2cqw; }
}

@media (max-width: 560px) {
  .sg-graphic__labels li:not(.has-color) { font-size: 8.5px; text-shadow: 0 0 4px #fff; }
}

/* ---------- images: row of figures with captions ---------- */
.sg-graphic.is-images {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 24px;
  margin-top: 44px;

  & figure { margin: 0; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  & img { width: 100%; }
  & figcaption { display: flex; flex-direction: column; gap: 6px; }
  & figcaption b { font-size: 20px; font-weight: 700; color: var(--wp--preset--color--teal); }
  & figcaption span { font-size: 15px; line-height: 1.55; }
}

/* process: arrows between the figures, the products stand on a mint ground */
.sg-graphic.is-images.is-look-arrows {
  grid-auto-flow: row;
  grid-template-columns: 1fr 64px 1fr 64px 1fr;
  gap: 16px;
  align-items: start;

  & img { background: linear-gradient(transparent 86%, #d9e7e2 86%); }
}

.sg-graphic__arrow {
  padding-top: 28%;

  & svg { display: block; width: 56px; height: 56px; fill: #5fae9c; }
}

/* ladder: bins side by side in true proportion, standing on one line */
.sg-graphic.is-images.is-look-ladder {
  --s: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
  border-bottom: 6px solid var(--wp--preset--color--mint);

  & figure { flex: 0 0 auto; align-items: center; gap: 14px; }
  & img { width: calc(var(--s) * var(--w, 1)); }
  & figcaption { gap: 0; padding-bottom: 14px; text-align: center; }
  & figcaption b { font-size: 20px; font-variant-numeric: tabular-nums; }
  /* same caption height, so all bins stand on one line */
  & figcaption small,
  & figcaption:not(:has(small))::after { display: block; font-size: 13px; line-height: 1.5; font-weight: 600; color: var(--wp--custom--muted); }
  & figcaption:not(:has(small))::after { content: "\00a0"; }
}

@media (max-width: 1100px) {
  .sg-graphic.is-look-ladder { --s: min(130px, calc((100vw - 170px) / 5.75)); gap: 12px; }
  .sg-graphic.is-look-ladder figcaption b { font-size: 16px; }
}

@media (max-width: 900px) {
  .sg-graphic.is-images:not(.is-look-ladder) { grid-auto-flow: row; grid-template-columns: 1fr; max-width: 420px; }
  .sg-graphic.is-images.is-look-arrows { max-width: 380px; }
  .sg-graphic.is-images:not(.is-look-ladder) img { max-width: 260px; }
  .sg-graphic__arrow { padding: 0; transform: rotate(90deg); justify-self: center; }
}

@media (max-width: 620px) {
  .sg-graphic.is-look-ladder { --s: 62px; flex-wrap: wrap; justify-content: flex-start; gap: 18px 14px; }
  .sg-graphic.is-look-ladder figcaption { padding-bottom: 8px; }
  .sg-graphic.is-look-ladder figcaption b { font-size: 14px; }
}

/* ---------- cycle ---------- */
.sg-graphic__svg { display: block; width: 100%; height: auto; }

/* numbers: ring with numbered steps, the steps as a list next to it (service lifecycle) */
.sg-graphic.is-cycle.is-look-numbers,
.sg-graphic.is-cycle.is-look-default {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 56px;
  align-items: center;
  margin-top: 44px;
}

.sg-graphic__ring { fill: none; stroke: #d9e7e2; stroke-width: 22; }
.sg-graphic__num { fill: var(--wp--preset--color--teal); }
.sg-graphic__numtext { fill: #fff; font-size: 20px; font-weight: 700; }
.sg-graphic__hubtitle { fill: var(--wp--preset--color--teal); font-size: 26px; font-weight: 700; }
.sg-graphic__hubsub { fill: #45514f; font-size: 18px; }

.sg-graphic__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: sg-step;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 32px;

  & li { counter-increment: sg-step; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; }
  & li::before {
    content: counter(sg-step);
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--wp--preset--color--teal);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
  }
  & b { font-size: 16px; color: var(--wp--preset--color--ink); }
  & span { font-size: 14.5px; line-height: 1.5; color: var(--wp--custom--muted); }
}

/* arrows: three arcs around a hub, labels outside (continuous improvement) */
.sg-graphic.is-cycle.is-look-arrows { max-width: 440px; margin-inline: auto; }
.sg-graphic__hub { fill: var(--wp--preset--color--mint); }
.sg-graphic__hubtext { fill: var(--wp--preset--color--teal); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.sg-graphic__arc { fill: none; stroke: var(--wp--preset--color--teal); stroke-width: 10; stroke-linecap: round; }
.sg-graphic.is-cycle marker path { fill: var(--wp--preset--color--teal); }
.sg-graphic__lbl { fill: var(--wp--preset--color--ink); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.sg-graphic__sub { fill: var(--wp--custom--muted); font-size: 10.5px; }

@media (max-width: 900px) {
  .sg-graphic.is-cycle:is(.is-look-numbers, .is-look-default) { grid-template-columns: 1fr; gap: 32px; }
  .sg-graphic.is-cycle .sg-graphic__svg { max-width: 340px; }
}

@media (max-width: 560px) {
  .sg-graphic__steps { grid-template-columns: 1fr; }
}
