/* ABOUTME: Molo Pascal Triangle styles: 34px number buttons that shrink to fit narrow screens, spectrum
   ABOUTME: view classes, view arrows and the fixed-height caption. Designed for navy backgrounds. */
.molo-tri {
  container-type: inline-size;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.molo-tri__grid {
  /* thirteen cells and twelve 3px gaps fill the triangle block's own width */
  --molo-tri-cell: min(34px, calc((100cqi - 36px) / 13));
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.molo-tri__row { display: flex; justify-content: center; gap: 3px; }
.molo-tri__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--molo-tri-cell);
  height: var(--molo-tri-cell);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  color: var(--molo-tri-ink);
  font-family: var(--ml-font-mono);
  font-size: calc(var(--molo-tri-cell) * .35);
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .15s, box-shadow .2s;
  --molo-tri-ink: #c9cfe3;
}
.molo-tri__row:nth-child(n+11) .molo-tri__cell { font-size: calc(var(--molo-tri-cell) * .31); }
.molo-tri__cell:hover { transform: scale(1.12); }
.molo-tri__cell--s1 { background: var(--molo-spectrum-1); color: var(--molo-spectrum-1-ink); }
.molo-tri__cell--s2 { background: var(--molo-spectrum-2); color: var(--molo-spectrum-2-ink); }
.molo-tri__cell--s3 { background: var(--molo-spectrum-3); color: var(--molo-spectrum-3-ink); }
.molo-tri__cell--s4 { background: var(--molo-spectrum-4); color: var(--molo-spectrum-4-ink); }
.molo-tri__cell--s5 { background: var(--molo-spectrum-5); color: var(--molo-spectrum-5-ink); }
.molo-tri__cell--s6 { background: var(--molo-spectrum-6); color: var(--molo-spectrum-6-ink); }
.molo-tri__cell--s7 { background: var(--molo-spectrum-7); color: var(--molo-spectrum-7-ink); }
.molo-tri__cell--odd { background: var(--molo-sage); color: var(--molo-navy); }
.molo-tri__cell--even { background: rgba(255, 255, 255, .04); color: #6b7391; }
.molo-tri__cell.is-active { background: var(--molo-paper); color: var(--molo-navy); box-shadow: 0 0 0 3px var(--molo-navy), 0 0 0 5px var(--molo-paper); }
.molo-tri__cell.is-parent { box-shadow: 0 0 0 3px var(--molo-paper); }
.molo-tri__cell:focus-visible { outline: none; }
.molo-tri__arrow {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--molo-navy-border);
  border-radius: 50%;
  background: transparent;
  color: var(--molo-on-navy-muted);
  cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.molo-tri__arrow--prev { left: 0; }
.molo-tri__arrow--next { right: 0; }
.molo-tri__arrow:hover { color: var(--molo-paper); border-color: var(--molo-sage); background: var(--molo-navy-raised); }
.molo-tri__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 72px;
  text-align: center;
}
.molo-tri__eq { font-family: var(--ml-font-mono); font-size: 1.125rem; font-weight: 700; color: var(--molo-paper); }
.molo-tri__eq:empty { display: none; }
.molo-tri__text { font-size: 1rem; line-height: 1.4; color: var(--molo-on-navy-muted); }

@media (max-width: 900px) {
  .molo-tri__arrow { top: auto; bottom: -56px; }
  .molo-tri__caption { margin-top: 56px; padding-inline: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .molo-tri__cell, .molo-tri__arrow { transition: none; }
  .molo-tri__cell:hover { transform: none; }
}
