/*
  Topic-cluster band (Views/Shared/_TopicCluster.cshtml, Part 46.3): the map of a subject on its central guide (the
  hub) and the "part of the guide" strip on every page of it (a spoke). Loaded only by the band, below the page content,
  so it never delays the first paint. Colours come from the layout tokens, so light, dark and the Teen Academy follow.
*/
.ip-tc {
  --tc-tone: var(--ip-icon-green);
  --tc-soft: var(--ip-tile-emerald-bg);
  --tc-ink: var(--ip-tile-emerald-fg);
  padding-block: var(--ip-space-5, 1.5rem) var(--ip-space-3, .75rem);
}
.ip-tc--sky { --tc-tone: var(--ip-icon-blue); --tc-soft: var(--ip-tile-sky-bg); --tc-ink: var(--ip-tile-sky-fg); }
.ip-tc--gold { --tc-tone: var(--ip-icon-orange); --tc-soft: var(--ip-tile-gold-bg); --tc-ink: var(--ip-tile-gold-fg); }
.ip-tc--violet { --tc-tone: var(--ip-icon-purple); --tc-soft: var(--ip-tile-violet-bg); --tc-ink: var(--ip-tile-violet-fg); }
.ip-tc--rose { --tc-tone: var(--ip-icon-red); --tc-soft: var(--ip-tile-rose-bg); --tc-ink: var(--ip-tile-rose-fg); }

.ip-tc__frame {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--tc-soft) 85%, transparent) 0%, transparent 55%),
    var(--ip-surface);
  box-shadow: inset 0 0 0 1px var(--ip-line), var(--ip-shadow-sm);
  isolation: isolate;
}
[dir="rtl"] .ip-tc__frame {
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tc-soft) 85%, transparent) 0%, transparent 55%),
    var(--ip-surface);
}
/* An eight-pointed star lattice in the corner, the site's geometric signature, drawn in the cluster's colour. */
.ip-tc__frame::before {
  content: "";
  position: absolute;
  inset-block-start: -40px;
  inset-inline-end: -40px;
  z-index: -1;
  width: 260px;
  height: 260px;
  background: var(--tc-tone);
  opacity: .09;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Cpath d='M26 4l6.4 9.2L43.5 8.5 38.8 19.6 48 26l-9.2 6.4 4.7 11.1-11.1-4.7L26 48l-6.4-9.2-11.1 4.7 4.7-11.1L4 26l9.2-6.4L8.5 8.5l11.1 4.7z' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") 0 0 / 52px 52px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Cpath d='M26 4l6.4 9.2L43.5 8.5 38.8 19.6 48 26l-9.2 6.4 4.7 11.1-11.1-4.7L26 48l-6.4-9.2-11.1 4.7 4.7-11.1L4 26l9.2-6.4L8.5 8.5l11.1 4.7z' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") 0 0 / 52px 52px;
  pointer-events: none;
}
/* A thin bar of the cluster's colour along the top edge. */
.ip-tc__frame::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--tc-tone);
  opacity: .85;
}

.ip-tc__seal {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 15px;
  background: var(--tc-tone);
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--tc-ink) 60%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.ip-tc__kicker {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tc-ink);
}
html:is([lang="ar"], [lang="ur"]) .ip-tc__kicker {
  font-size: .82rem;
  letter-spacing: 0;
}

/* Hub: the map of the subject. */
.ip-tc--hub .ip-tc__frame {
  padding: clamp(1rem, .8rem + 1vw, 1.6rem);
}
.ip-tc__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .4rem 1rem;
  margin-block-end: 1.1rem;
}
.ip-tc__title {
  margin: .15rem 0 .25rem;
  font-size: var(--ip-text-xl, 1.25rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--ip-ink);
}
.ip-tc__lead {
  margin: 0;
  max-width: 62ch;
  font-size: .9rem;
  color: var(--ip-muted);
}
.ip-tc__count {
  align-self: center;
  padding: .3rem .7rem;
  border-radius: var(--ip-radius-pill, 999px);
  background: var(--tc-soft);
  color: var(--tc-ink);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.ip-tc__groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
  gap: .9rem 1rem;
}
.ip-tc__gtitle {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .4rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ip-muted);
}
html:is([lang="ar"], [lang="ur"]) .ip-tc__gtitle {
  font-size: .85rem;
  letter-spacing: 0;
}
.ip-tc__gtitle::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 2px;
  background: var(--tc-tone);
  transform: rotate(45deg);
}
.ip-tc__list {
  display: grid;
  gap: .3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ip-tc__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.75rem;
  padding-block: .45rem;
  padding-inline: .45rem 1.9rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ip-surface) 92%, var(--tc-soft));
  box-shadow: inset 0 0 0 1px var(--ip-line);
  color: var(--ip-ink);
  font-size: .87rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: transform .22s var(--ip-ease), box-shadow .22s var(--ip-ease), background-color .22s var(--ip-ease);
}
.ip-tc__link:hover,
.ip-tc__link:focus-visible {
  color: var(--ip-ink);
  background: var(--tc-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc-ink) 35%, var(--ip-line)), var(--ip-shadow-sm);
  transform: translateY(-1px);
}
.ip-tc__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9px;
  background: var(--tc-soft);
  font-size: .95rem;
}
.ip-tc__icon i {
  background-image: var(--tc-tone);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ip-tc__link:hover .ip-tc__icon {
  background: var(--ip-surface);
}
.ip-tc__text {
  min-width: 0;
}
.ip-tc__go {
  position: absolute;
  inset-inline-end: .65rem;
  color: var(--ip-line-strong);
  font-size: .85rem;
  transition: transform .22s var(--ip-ease), color .2s;
}
.ip-tc__link:hover .ip-tc__go,
.ip-tc__hub:hover .ip-tc__go {
  color: var(--tc-ink);
  transform: translateX(3px);
}
[dir="rtl"] .ip-tc__link:hover .ip-tc__go,
[dir="rtl"] .ip-tc__hub:hover .ip-tc__go {
  transform: scaleX(-1) translateX(3px);
}

/* Spoke: back to the guide, and on to the neighbouring pages. */
.ip-tc--spoke .ip-tc__frame {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  padding: .75rem;
}
.ip-tc__hub {
  position: relative;
  display: flex;
  flex: 0 1 21rem;
  align-items: center;
  gap: .75rem;
  min-width: min(100%, 16rem);
  padding-block: .55rem;
  padding-inline: .55rem 2.2rem;
  border-radius: 16px;
  background: var(--tc-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc-ink) 22%, transparent);
  color: var(--ip-ink);
  text-decoration: none;
  transition: box-shadow .22s var(--ip-ease), transform .22s var(--ip-ease);
}
.ip-tc__hub:hover,
.ip-tc__hub:focus-visible {
  color: var(--ip-ink);
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc-ink) 45%, transparent), var(--ip-shadow-md);
}
.ip-tc--spoke .ip-tc__seal {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 13px;
  font-size: 1.15rem;
}
.ip-tc__hubtext {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ip-tc__hubname {
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.25;
}
.ip-tc__hubcount {
  font-size: .74rem;
  color: var(--ip-muted);
}
.ip-tc__chips {
  display: flex;
  flex: 1 1 24rem;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ip-tc__chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.25rem;
  padding: .3rem .7rem;
  border-radius: var(--ip-radius-pill, 999px);
  background: var(--ip-surface);
  box-shadow: inset 0 0 0 1px var(--ip-line);
  color: var(--ip-ink);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s var(--ip-ease), box-shadow .2s var(--ip-ease), color .2s var(--ip-ease);
}
.ip-tc__chip i {
  color: var(--tc-ink);
  font-size: .85rem;
}
a.ip-tc__chip:hover,
a.ip-tc__chip:focus-visible {
  color: var(--ip-ink);
  background: var(--tc-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc-ink) 35%, var(--ip-line));
}
.ip-tc__chip.is-current {
  background: var(--tc-tone);
  box-shadow: none;
  color: #fff;
  font-weight: 700;
}
.ip-tc__chip.is-current i {
  color: #fff;
}

.ip-tc a:focus-visible {
  outline: 3px solid var(--ip-focus);
  outline-offset: 2px;
}

/* Phones: the guide card on its own row and the neighbours in one swipeable line. */
@media (max-width: 640px) {
  .ip-tc__head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .ip-tc__count {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .ip-tc__hub {
    flex-basis: 100%;
  }
  .ip-tc__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -.75rem;
    padding-inline: .75rem;
    padding-block-end: .25rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .ip-tc__chips li {
    scroll-snap-align: start;
  }
}

/* The Teen Academy's dark stage. */
.tn-main .ip-tc__frame {
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.tn-main .ip-tc__hub,
.tn-main .ip-tc__chip,
.tn-main .ip-tc__link {
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  color: #f3f1ff;
}
.tn-main .ip-tc__hubcount,
.tn-main .ip-tc__lead {
  color: rgba(243, 241, 255, .7);
}
.tn-main .ip-tc__chip i,
.tn-main .ip-tc__kicker {
  color: #c9b8ff;
}
.tn-main .ip-tc__chip.is-current {
  background: var(--tc-tone);
  color: #fff;
}
.tn-main .ip-tc__chip.is-current i {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .ip-tc__link,
  .ip-tc__hub,
  .ip-tc__chip,
  .ip-tc__go {
    transition: none;
  }
  .ip-tc__link:hover,
  .ip-tc__hub:hover {
    transform: none;
  }
}

@media print {
  .ip-tc {
    display: none;
  }
}
