/* Scoped styles for the Pieces of Learning, Connected article. */
.kg-flow,
.kg-progression,
.kg-use-cases,
.kg-callout {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.kg-flow *,
.kg-progression *,
.kg-use-cases *,
.kg-callout * {
  box-sizing: border-box;
}

/* Mediumish automatically renders any page-bundle image whose filename contains
   "cover" above the article. Keep that asset for listing cards/previews, but hide
   the duplicate in-article featured image because the post places its visuals
   deliberately in the narrative. */
.featured-image {
  display: none !important;
}

/* Explicit flow rows give arrows their own breathing room instead of squeezing
   them between auto-fit cards. */
.kg-flow {
  margin: 1.5rem 0 2rem;
  padding: 1.15rem;
  border-radius: 17px;
  background: #f5f8fb;
}

.kg-flow-row {
  display: grid;
  align-items: stretch;
  gap: 0.78rem;
}

.kg-flow-row--four {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
}

.kg-flow-row--three {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
}

.kg-flow-row--branch {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0.55rem;
}

.kg-flow-row--branch > .kg-flow-step {
  width: min(100%, 18rem);
}

.kg-flow-row--branch > .kg-flow-arrow {
  transform: rotate(90deg);
}

.kg-flow-branch {
  display: grid;
  width: min(100%, 36rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.78rem;
}

.kg-flow-step {
  display: flex;
  min-width: 0;
  min-height: 4.15rem;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 0.75rem;
  border: 1px solid #d8e2ec;
  border-radius: 12px;
  background: #fff;
  color: #102a43;
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
  text-align: center;
}

.kg-flow-arrow,
.kg-flow-down {
  align-self: center;
  color: #627d98;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.kg-flow-arrow {
  min-width: 1.25rem;
  font-size: 1.25rem;
}

.kg-flow-down {
  margin: 0.62rem 0;
  font-size: 1.35rem;
}

.kg-callout {
  margin: 1.45rem 0 1.85rem;
  padding: 1rem 1.05rem;
  border-left: 4px solid #1f9d83;
  border-radius: 0 13px 13px 0;
  background: #effaf7;
  color: #183b35;
}

.kg-callout strong {
  display: block;
  margin-bottom: 0.22rem;
}

.kg-callout p {
  margin: 0;
  color: #365c55;
  font-size: 0.93rem;
  line-height: 1.55;
}

.kg-progression {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1.05rem;
  margin: 1.5rem 0;
  padding: 1.1rem;
  border: 1px solid #dce5ed;
  border-radius: 16px;
  background: #f8fafc;
}

.kg-progression--related {
  margin-top: -0.45rem;
}

.kg-progression-node {
  padding: 0.82rem;
  border: 1px solid #9fb3c8;
  border-radius: 12px;
  background: #fff;
  color: #102a43;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.kg-progression-edge {
  min-width: 5.8rem;
  color: #486581;
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
}

.kg-progression-edge span {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1.35rem;
}

.kg-use-cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.4rem 0 1.8rem;
}

.kg-use-case {
  padding: 0.95rem;
  border: 1px solid #dfe8f2;
  border-radius: 14px;
  background: #fbfcfe;
}

.kg-use-case strong {
  display: block;
  margin-bottom: 0.32rem;
  color: #102a43;
  font-size: 0.83rem;
}

.kg-use-case p {
  margin: 0;
  color: #52667a;
  font-size: 0.82rem;
  line-height: 1.48;
}

/* Static figures captured from the Learning Explorer. */
.kg-story-figure {
  margin: 1.45rem 0 2.1rem;
}

.kg-figure-link {
  display: block;
  border-radius: 14px;
}

.kg-story-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  background: #07101d;
  box-shadow: 0 12px 34px rgba(7, 16, 29, 0.12);
  cursor: zoom-in;
}

.kg-story-figure figcaption {
  margin: 0.6rem auto 0;
  max-width: 94%;
  color: #65778a;
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 820px) {
  .kg-use-cases {
    grid-template-columns: 1fr;
  }

  .kg-flow-row--four,
  .kg-flow-row--three {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .kg-flow-branch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .kg-flow-arrow {
    min-width: 0;
    transform: rotate(90deg);
  }

  .kg-flow-down {
    margin: 0.4rem 0;
  }
}

@media (max-width: 520px) {
  .kg-progression {
    grid-template-columns: 1fr;
  }

  .kg-progression-edge {
    min-width: 0;
  }

  .kg-progression-edge span {
    display: inline;
    margin-right: 0.35rem;
  }

  .kg-story-figure {
    margin-left: -0.2rem;
    margin-right: -0.2rem;
  }

}

/* Link to the full Learning Explorer. */
.kg-explorer-link {
  display: inline-block;
  margin: -0.55rem 0 1.75rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-weight: 650;
}
