/* B1 Proof of concept (rebuild 01, it was 06): the small board and the concept detail view.
   The head row, the stage (a wall, js/concepts.js) and the strip are laid out by the page's stylesheet (css/home.css,
   from the kit). The board is the build's (css/board.css), sized small here. The detail view is the phase 1 stub. */

.board-assembly--sm{
  --flap-w:40px;--flap-h:52px;--flap-fs:16px;--row-gap:3px;--col-gap:3px;
  --lever-w:22px;--handle-h:26px;--handle-top:5px;
  padding:8px;gap:8px;
}
.concepts-board .board-note{margin-top:12px}

/* ===== the detail stub ===== */
.concept-dialog{
  margin:auto;
  width:min(1180px,calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
  padding:0;
  border:1px solid var(--frame);
  background:var(--ink);
  color:var(--paper);
  box-shadow:0 0 80px color-mix(in srgb,var(--red) 14%,transparent);
  overflow:auto;
  overscroll-behavior:contain;
}
.concept-dialog::backdrop{background:rgba(10,10,10,.92)}
.cd-inner{padding:clamp(18px,3vw,36px)}
.cd-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:22px}
.cd-for{font-size:var(--px-8);color:var(--red-text);text-transform:uppercase}
.cd-title{margin-top:10px;font-weight:700;font-size:clamp(22px,2.2vw,30px);line-height:1.15}
.cd-line{margin-top:6px;font-size:15px;color:var(--quiet)}
.cd-close{
  flex:0 0 auto;width:40px;height:40px;
  border:1px solid var(--line);color:var(--dim);font-size:22px;line-height:1;
  transition:color .2s,border-color .2s;
}
.cd-close:hover{color:var(--paper);border-color:var(--red-dark)}
.cd-graphic{display:flex;justify-content:center}
.cd-graphic > .fmt{max-width:100%}
.cd-graphic > .fmt--roster,.cd-graphic > .fmt--result{width:min(100%,520px)}
.cd-graphic > .fmt--wipe{width:min(100%,640px)}
.cd-credit{margin-top:12px;font-size:12.5px;line-height:1.5;color:var(--mute);text-align:center}
.cd-credit a{color:var(--soft);text-decoration:none;border-bottom:1px solid var(--line)}
.cd-fields{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;
  margin-top:26px;background:var(--line);border:1px solid var(--line);
}
.cd-fields > div{background:var(--surface);padding:14px 16px}
.cd-fields dt{font-family:var(--f-label);font-weight:600;font-size:var(--label-size-sm);letter-spacing:var(--label-track);text-transform:uppercase;color:var(--red-text)}
.cd-fields dd{margin-top:6px;font-size:15px;line-height:1.45;color:var(--dim)}
.cd-fields dd.is-todo{color:var(--annot)}

html:has(.concept-dialog[open]){overflow:hidden}

/* portrait formats (4 to 5): the graphic on the left, the fields beside it */
@media (min-width:1000px){
  .concept-dialog.is-portrait .cd-inner{
    display:grid;
    grid-template-columns:minmax(0,520px) minmax(0,1fr);
    grid-template-areas:"head head" "graphic fields" "credit fields";
    column-gap:36px;align-items:start;
  }
  .concept-dialog.is-portrait .cd-head{grid-area:head}
  .concept-dialog.is-portrait .cd-graphic{grid-area:graphic}
  .concept-dialog.is-portrait .cd-credit{grid-area:credit;text-align:left}
  .concept-dialog.is-portrait .cd-fields{grid-area:fields;grid-template-columns:1fr;margin-top:0}
  .concept-dialog.is-portrait .cd-graphic > .fmt--roster,
  .concept-dialog.is-portrait .cd-graphic > .fmt--result{width:100%}
}

/* ===== smaller screens ===== */
@media (max-width:640px){
  .cd-fields{grid-template-columns:1fr 1fr}
  /* 16 to 9 graphics keep a readable size and scroll sideways, with a fade at the edge as the cue */
  .cd-graphic{justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;
    -webkit-mask-image:linear-gradient(90deg,#000 85%,transparent);mask-image:linear-gradient(90deg,#000 85%,transparent)}
  .concept-dialog:not(.is-portrait) .cd-graphic > .fmt{flex:0 0 auto;width:720px;max-width:none}
  .concept-dialog.is-portrait .cd-graphic{-webkit-mask-image:none;mask-image:none}
}
@media (max-width:400px){
  .board-assembly--sm{--flap-w:34px;--flap-h:44px}
  .cd-fields{grid-template-columns:1fr}
}
/* the smallest phones: seven flaps and the lever inside a 280 px column */
@media (max-width:359px){
  .board-assembly--sm{--flap-w:28px;--flap-h:36px}   /* the pixel face keeps 16 px, on whole pixels in an even flap */
}
