/* Open EP Mapping Lab — site styles */

/* Self-hosted IBM Plex (SIL Open Font License 1.1, vendor/fonts/ibm-plex/LICENSE-OFL.txt) */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../vendor/fonts/ibm-plex/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/ibm-plex/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }

/* Demo and figure boxes (see filters/badges.lua) */
.demo {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
}

/* Badge label at the top of each demo: a colored dot and the badge name, sentence case */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0;
  color: inherit;
}
.badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}

.badge-exact { color: #1a7f37; }
.badge-simulation { color: #0969da; }
.badge-approximate-model { color: #9a6700; }
.badge-schematic { color: #6e7781; }

/* Interactive demos */
.demo-description { color: #57606a; font-size: 0.92rem; margin-bottom: 0.5rem; }
.demo-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
.demo-row canvas { flex: 1 1 220px; }
.demo-controls { display: grid; gap: 0.35rem 1rem; margin: 0.75rem 0 0.25rem; }
.demo-control { display: grid; grid-template-columns: 12rem minmax(0, 1fr) 5.5rem; align-items: center; gap: 0.75rem; }
.demo-control label { font-size: 0.92rem; }
.demo-control input[type="range"] { width: 100%; }
.demo-control output { font-variant-numeric: tabular-nums; font-size: 0.92rem; text-align: right; }
.demo-control select { justify-self: start; max-width: 100%; min-width: 0; font-size: 0.92rem; padding: 0.15rem 0.3rem; }
.demo-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.25rem 0; }
.demo-button { font-size: 0.92rem; padding: 0.25rem 0.75rem; border: 1px solid #8c959f; border-radius: 6px; background: #ffffff; cursor: pointer; }
.demo-button:hover { background: #f6f8fa; }
.demo-button:focus-visible, .demo-control select:focus-visible { outline: 2px solid #0969da; outline-offset: 2px; }
.demo-button[disabled] { opacity: 0.6; cursor: progress; }
.demo-readout { background: #f6f8fa; border-radius: 6px; padding: 0.5rem 0.75rem; margin: 0.5rem 0 0.75rem; font-size: 0.92rem; }
@media (max-width: 600px) {
  .demo-control { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .demo-control select { width: 100%; }
  .demo-control output { text-align: left; }
}

/* Interview and self-check answers: native <details>, so they open with Enter or Space. */
details.model-answer {
  border-left: 3px solid #155e9a;
  background: #f6f8fa;
  border-radius: 0 6px 6px 0;
  padding: 0.4rem 0.9rem;
  margin: 0.25rem 0 1.4rem;
}
details.model-answer > summary {
  cursor: pointer;
  color: #155e9a;
  font-weight: 500;
  font-size: 0.95rem;
}
details.model-answer[open] > summary { margin-bottom: 0.5rem; }
details.model-answer > summary:focus-visible {
  outline: 2px solid #155e9a;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Narrow screens: wide tables scroll sideways instead of spilling out of the page. */
@media (max-width: 575.98px) {
  main.content table { display: block; overflow-x: auto; }
}

/* Visual summary: a chain of stages, each with a small decorative sketch (aria-hidden) and real text. */
.filter-chain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.4rem, 1fr));
  gap: 0.6rem;
  counter-reset: stage;
}
.filter-chain .stage {
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 6px;
  padding: 0.5rem 0.6rem 0.4rem;
  font-size: 0.86rem;
  line-height: 1.4;
}
.filter-chain .stage p { margin: 0 0 0.35rem; }
.filter-chain svg.sketch { width: 100%; height: auto; display: block; margin-bottom: 0.3rem; }
.filter-chain svg.sketch .axis { stroke: #b8c0c8; stroke-width: 1; fill: none; }
.filter-chain svg.sketch .curve { stroke: #155e9a; stroke-width: 2; fill: none; stroke-linejoin: round; }
.filter-chain svg.sketch text { font-size: 11px; fill: #5b6875; font-family: inherit; }
.filter-chain .stage:last-child { border-color: #155e9a; }

/* Long display equations scroll sideways on narrow screens instead of widening the page. */
main.content span.math.display { display: block; overflow-x: auto; overflow-y: hidden; max-width: 100%; }
