/* WHITEBOARD: the brand guidelines on the project page, and the reader that opens every page (R55, second pass,
   30.11.2026). See whiteboard-brandbook.js. Loaded only by the three WHITEBOARD pages.
   The pages stand in the materials of the project in the markup every project has, so their look and their motion
   are the site's own (project.css, r43-ideas.css, flow.css); only what this page adds is written here. The pages
   are always shown whole, and the colours come from the site's own tokens, so the light and the night theme hold. */

/* ——— On the project page ——— */
/* One line of guidance under the count of the pages. */
.project-materials-heading p.wb-book-hint {
  margin: 12px 0 0;
  color: var(--muted);
  white-space: normal;
  text-align: start;
}
/* The Russian name of the book has one long word. On a phone it is set a little smaller, so that the word stays whole. */
@media (max-width: 760px) {
  html[lang=ru]:not(.wb-none) body[data-project-id="WhiteBoard"] #project-materials-title {
    font-size: clamp(30px, 10.2vw, 52px);
    overflow-wrap: normal;
  }
}
/* A page is pressed to be read up close. */
.wb-page .project-image-media[role=button] {
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.wb-page .project-image-media[role=button]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

/* ——— The reader ——— */
.wb-viewer {
  position: fixed;
  inset: 0;
  z-index: 2147482500; /* above the accessibility and WhatsApp buttons, under the star cursor */
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}
.wb-viewer[open] {
  display: grid;
}
.wb-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  min-height: 68px;
  padding: 10px clamp(14px, 3vw, 40px);
  padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
.wb-viewer-place {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
  margin: 0;
}
.wb-viewer-count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wb-viewer-name {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-viewer-tools {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.wb-viewer .wb-tool {
  display: grid;
  place-items: center;
  flex: none;
  box-sizing: border-box;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}
.wb-viewer .wb-tool svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wb-viewer .wb-tool:disabled {
  opacity: .32;
  cursor: default;
}
.wb-viewer .wb-tool:focus-visible,
.wb-viewer-strip button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .wb-viewer .wb-tool:not(:disabled):hover { border-color: currentColor; background: rgba(128, 128, 128, .1); }
}
/* The arrows point outwards: the next page lies ahead in the direction of reading. */
.wb-viewer-prev svg { transform: scaleX(-1); }
[dir=rtl] .wb-viewer-prev svg { transform: none; }
[dir=rtl] .wb-viewer-next svg { transform: scaleX(-1); }

.wb-viewer-stage {
  display: flex;
  direction: ltr;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}
.wb-viewer-stage[data-held=true] {
  user-select: none;
  -webkit-user-select: none;
}
.wb-viewer-sheet {
  position: relative;
  flex: none;
  margin: auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  box-shadow: 0 0 0 1px var(--line);
}
.wb-viewer-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.wb-viewer-stage[data-zoomed=true] .wb-viewer-image {
  cursor: zoom-out;
}
.wb-viewer-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  background: var(--paper);
  color: var(--muted);
  text-align: center;
}
.wb-viewer-error[hidden] {
  display: none;
}
.wb-viewer-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
  min-width: 0;
  padding: 10px clamp(12px, 3vw, 40px);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.wb-viewer-strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: none;
}
.wb-viewer-strip::-webkit-scrollbar {
  display: none;
}
.wb-viewer-strip li {
  flex: none;
}
.wb-viewer-strip button {
  display: block;
  box-sizing: border-box;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(128, 128, 128, .06);
  box-shadow: 0 0 0 1px var(--line);
  opacity: .5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 180ms ease;
}
.wb-viewer-strip button[aria-current=true] {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--ink);
}
.wb-viewer-strip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (hover: hover) and (pointer: fine) {
  .wb-viewer-strip button:hover { opacity: 1; }
}
.wb-viewer-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 760px) {
  .wb-viewer-bar { min-height: 60px; }
  .wb-viewer-place { gap: 10px; }
  .wb-viewer .wb-tool { width: 44px; height: 44px; }
  .wb-viewer-foot { gap: 8px; padding-inline: 10px; }
  .wb-viewer-strip button { width: 44px; height: 44px; }
}
/* With a mouse, the page stands on the same two rails as the tools above it and the row of pages below it.
   (The site keeps the lane of the scrollbar free at all times so that its pages never jump sideways, and that lane
   stays beside the reader, in the colour of the reader's own ground. On the rails nothing of the reader reaches the
   edge of the screen, so the lane is not seen, whichever side it is on.) */
@media (hover: hover) and (pointer: fine) {
  .wb-viewer-bar { border-bottom: 0; }
  .wb-viewer-foot { border-top: 0; }
  .wb-viewer-stage {
    margin-inline: clamp(14px, 3vw, 40px);
    border-block: 1px solid var(--line);
    scrollbar-width: thin;
  }
}
/* A low screen (a phone on its side) keeps its height for the page itself. */
@media (max-height: 520px) {
  .wb-viewer-bar { min-height: 52px; padding-block: 4px; }
  .wb-viewer .wb-tool { width: 40px; height: 40px; }
  .wb-viewer-foot { padding-block: 4px; }
  .wb-viewer-strip { display: none; }
  .wb-viewer-foot { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .wb-viewer .wb-tool,
  .wb-viewer-strip button { transition: none; }
}
@media (forced-colors: active) {
  .wb-viewer .wb-tool { border-color: ButtonText; }
  .wb-viewer-strip button[aria-current=true] { outline: 2px solid Highlight; }
}

/* ——— Without scripts: the pages stand one under the other, whole ——— */
.wb-book-plain ol {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wb-book-plain img {
  display: block;
  max-width: 100%;
  height: auto;
}
.wb-book-plain figure {
  margin: 0;
}
