@import url('./scenes.css?v=3');

.animation-workshop.wrap {
  --workshop-gutter: clamp(1rem, 3vw, 3rem);
  --workshop-reader-inset: 100px;
  inline-size: min(90rem, calc(100% - 2 * var(--workshop-gutter)));
  max-inline-size: none;
  padding-block: 20px 3rem;
}
.animation-workshop h1 {
  inline-size: auto;
  margin: .15em 0 .35em;
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 1.12;
  letter-spacing: -.025em;
}
.animation-workshop-header p { margin: 0; }
.workshop-filters { display: flex; flex-wrap: wrap; gap: .85rem; margin: 1rem 0 1.25rem; }
.workshop-filters label { display: grid; gap: .3rem; flex: 1 1 12rem; min-inline-size: 0; max-inline-size: 21rem; }
.workshop-filters .workshop-search { flex-basis: 16rem; max-inline-size: none; }
.workshop-filters :is(select, input[type="search"]) {
  inline-size: 100%;
  min-block-size: 44px;
  border: 1px solid #78906f;
  border-radius: 7px;
  background: #fffdf5;
  color: #234b3e;
  padding-inline: .75em;
  font: inherit;
}
.workshop-layout {
  display: grid;
  grid-template-columns: minmax(15.625rem, 27%) minmax(0, 1fr);
  grid-template-areas: "index stage";
  gap: 1.15rem;
  align-items: start;
}
.workshop-index {
  grid-area: index;
  min-inline-size: 0;
  scroll-margin-block-start: .5rem;
}
.workshop-index-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem .75rem;
}
.workshop-index-heading p { margin: 0; }
.workshop-list { display: grid; gap: .35rem; list-style: none; padding: 8px; margin: 0; }
.workshop-list a {
  display: grid;
  min-block-size: 44px;
  padding: .45rem .7rem;
  border: 1px solid #c5d0ba;
  border-radius: 7px;
  background: #fffdf5;
  color: #234b3e;
  text-decoration: none;
}
.workshop-list a:hover { border-color: #78906f; }
.workshop-list a[aria-current="true"] { border-color: #78906f; background: #dce9d3; }
.workshop-list a small { font-size: .84rem; }
.workshop-more { min-block-size: 44px; margin-block: .55rem 0; margin-inline: 8px; }
.workshop-stage {
  grid-area: stage;
  min-inline-size: 0;
  overflow-wrap: anywhere;
  scroll-margin-block-start: .5rem;
}
.workshop-stage .math-demonstration { margin: 0; }
.workshop-stage .math-demo-title { scroll-margin-block-start: .5rem; }
.workshop-stage .animation-scene > svg,
.workshop-stage .animation-scene .batch-svg {
  inline-size: 100%;
  block-size: auto;
  max-block-size: none;
}
/* These two diagrams declare their width cap inline. */
.workshop-stage .animation-scene :is(.place-value-diagram, .signed-sum-diagram) {
  max-width: none !important;
}
.workshop-navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin-block: .75rem 0;
}
.workshop-position {
  margin: 0;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.workshop-navigation :is(button, a),
.workshop-reader-link,
.workshop-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35em;
  min-block-size: 44px;
  max-inline-size: 100%;
  padding: .45rem .75rem;
  border: 1px solid #78906f;
  border-radius: 7px;
  background: #fffdf5;
  color: #234b3e;
  text-align: center;
  font-weight: 650;
  line-height: 1.25;
}
.workshop-reset { align-self: flex-end; }
.workshop-navigation :is(button, a):hover:not([aria-disabled="true"]),
.workshop-reader-link:hover,
.workshop-reset:hover { background: var(--student-sage-hover); }
.workshop-navigation button[aria-disabled="true"] {
  background: #ebece3;
  border-color: #b2bdad;
  color: #58695b;
  cursor: default;
}
.workshop-navigation .workshop-results-link { margin-inline-start: auto; }
.workshop-stage .workshop-related {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
  max-inline-size: 100%;
  min-block-size: 44px;
  margin-block: .9rem 0;
  padding: .5rem .9rem;
  border: 1px solid var(--student-sage-border);
  border-radius: 7px;
  background: var(--student-sage);
  color: var(--student-action);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.workshop-stage .workshop-related:hover { background: var(--student-sage-hover); text-decoration: underline; }
.workshop-stage .workshop-related:focus-visible { outline-offset: 3px; }
.workshop-stage .workshop-related[hidden], .animation-workshop [hidden] { display: none; }
html:not([lang="en"]) .workshop-link .visual-en,
html[lang="en"] .workshop-link .visual-fr { display: none; }
@media (max-width: 1180px) {
  .animation-workshop.wrap { --workshop-reader-inset: 76px; }
}
@media (min-height: 480px) {
  .workshop-stage {
    display: flex;
    flex-direction: column;
    max-block-size: calc(100vh - var(--workshop-reader-inset) - .5rem);
    max-block-size: calc(100dvh - var(--workshop-reader-inset) - .5rem);
  }
  .workshop-stage > :not(.math-demonstration),
  .workshop-stage .math-demonstration > * { flex: none; }
  .workshop-stage .math-demonstration {
    display: flex;
    flex-direction: column;
    min-block-size: 0;
    overflow: auto;
    scroll-padding-block: 3.5rem;
    padding: clamp(12px, 2vmin, 18px);
  }
  .workshop-stage .math-demonstration > :is(svg, [data-batch-frame]:has(.batch-svg)) {
    flex: 0 1 auto;
    min-block-size: 7.5rem;
  }
  .workshop-stage [data-batch-frame]:has(.batch-svg),
  .workshop-stage [data-batch-frame] .workshop-frame:has(> .batch-svg) {
    display: flex;
    flex-direction: column;
  }
  .workshop-stage [data-batch-frame] :is(.workshop-frame, .batch-svg) { min-block-size: 0; }
  .workshop-stage .math-demo-title,
  .workshop-stage .math-demo-actions:last-child {
    position: sticky;
    z-index: 1;
    background: inherit;
  }
  .workshop-stage .math-demo-title { inset-block-start: 0; margin-block-end: .5rem; }
  .workshop-stage .math-demo-actions:last-child { inset-block-end: 0; }
  .workshop-stage :is(.math-demo-objective, .math-demo-choices) { margin-block-end: .5rem; }
  .workshop-stage .math-demo-caption { margin-block: .5rem; min-block-size: 0; }
}
@media (min-width: 821px) and (min-height: 480px) {
  .workshop-stage { position: sticky; inset-block-start: var(--workshop-reader-inset); }
  .workshop-reader-link { display: none; }
}
@media (max-width: 820px), (max-height: 479px) {
  .workshop-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "index"; }
  .workshop-stage { max-block-size: none; }
  .workshop-index-heading:has(.workshop-reader-link:not([hidden])) {
    position: sticky;
    inset-block-start: var(--workshop-reader-inset);
    z-index: 2;
    padding-block: .25rem;
    background: var(--paper);
  }
  .workshop-index :is(.workshop-list a, .workshop-more) { scroll-margin-block-start: 4rem; }
}
@media (max-width: 820px) and (min-height: 480px) {
  .workshop-stage .math-demonstration {
    flex: none;
    max-block-size: calc(100vh - var(--workshop-reader-inset) - .5rem);
    max-block-size: calc(100dvh - var(--workshop-reader-inset) - .5rem);
  }
}
@media (max-width: 820px) {
  .workshop-filters label { flex-basis: 8.25rem; }
  .workshop-filters .workshop-search { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .workshop-filters label:has([data-workshop-notion]) { flex-basis: 100%; max-inline-size: none; }
  .workshop-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workshop-navigation button {
    align-self: stretch;
    padding-inline: .35rem;
    font-size: calc(.875rem + var(--site-font-increase, 0px));
  }
  .workshop-stage .math-demonstration:not(:has(.place-value-diagram)) .math-demo-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .workshop-stage .math-demo-controls-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .workshop-stage .math-demo-choices button { min-inline-size: 0; padding-inline: .5rem; }
}
