/* board.css - the home page board (used by the public page and by edit mode). */

/* The wrapper is what the layout reacts to: wide = the collage, narrow = one tidy column (phones, and edit mode's mobile preview). */
.board-wrap {
  container-type: inline-size;
  container-name: boardwrap;
  max-width: 1100px; /* the board never gets wider than this, so it looks the same on every monitor */
  margin: 0 auto;
}
.board {
  position: relative;
  container-type: inline-size; /* captions are sized in cqw: they shrink with the board */
  width: 100%;
}
.slot { position: absolute; transform: translate(-50%, -50%); }
.slot--caption { white-space: nowrap; }
.doodle { display: block; width: 100%; height: auto; pointer-events: none; }
.slot--doodle { pointer-events: none; } /* visitors cannot click them; edit mode turns this back on */
.board.is-editing .slot--doodle { pointer-events: auto; }
.caption {
  margin: 0;
  font-family: var(--hand);
  font-weight: 400;
  line-height: 1;
  font-size: calc(var(--cap-size, 4) * 1cqw * var(--font-scale, 1)); /* size is in board units; each style has its own natural size */
  color: var(--ink, #2a2622);
  text-shadow: 0 0 0.12em rgba(243, 238, 227, 0.6);
}
h1.caption { font-size: calc(var(--cap-size, 4) * 1cqw * var(--font-scale, 1)); }
/* The other two text styles, the same as on the cards. */
.caption[data-font='label'] { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; line-height: 1.55; --font-scale: 0.6; text-shadow: none; }
.caption[data-font='label'] .caption-text { background: var(--tape, #1c2133); padding: 0.14em 0.55em; border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.caption[data-font='typewriter'] { font-family: var(--font-typewriter); font-weight: 400; line-height: 1.1; --font-scale: 0.72; }

/* The three extra handwriting styles, the same as on the cards. */
.caption[data-font='apple'] { font-family: var(--font-apple); line-height: 1.3; --font-scale: 0.62; }
.caption[data-font='beanie'] { font-family: var(--font-beanie); line-height: 1; --font-scale: 1.15; }
.caption[data-font='marker'] { font-family: var(--font-marker); line-height: 1.15; --font-scale: 0.72; }

/* Edit mode */
.board.is-editing .slot { cursor: grab; touch-action: none; user-select: none; }
.board.is-editing .slot.is-dragging { cursor: grabbing; }
.board.is-editing .card-open { pointer-events: none; }
.board.is-editing .card { transition: none; }
.board.is-editing .card:hover { transform: rotate(var(--tilt, 0deg)); }
.board.is-editing .slot.is-selected { outline: 2px dashed #c8452d; outline-offset: 6px; }
.board.is-editing .slot.is-multi { outline: 2px dashed #c8452d; outline-offset: 6px; }
.board.is-editing .slot:focus-visible { outline: 3px solid #c8452d; outline-offset: 6px; }

/* Narrow with no phone layout arranged yet (.is-stacked): the board becomes a single column in the same order (top to bottom, then left to
   right), each card nudged a little so it still feels like a scrapbook. Once a phone layout has been arranged in edit mode, phones
   show that instead, with everything where it was put, and these rules do not apply. */
@container boardwrap (max-width: 700px) {
  .board.is-stacked { aspect-ratio: auto !important; display: flex; flex-direction: column; gap: 6cqw; padding: 6cqw 0 10cqw; }
  .is-stacked .slot, .is-stacked .slot--caption {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 62% !important;
    margin-left: 6%;
    white-space: normal;
  }
  .is-stacked .slot:nth-child(even) { margin-left: 30%; }
  .is-stacked .slot--caption { width: auto !important; margin: 0 6% !important; text-align: center; }
  .is-stacked .slot--doodle { display: none; } /* doodles point at things on the big board; in one column they would point at nothing */
  .is-stacked .caption { font-size: calc(7cqw * var(--font-scale, 1)) !important; }
  .is-stacked h1.caption { font-size: calc(10cqw * var(--font-scale, 1)) !important; }
}
