/* Web Scripting Sandbox (information-technology/web-scripting.php). The shared parts are in studio.css. On a laptop
   or desktop: the challenge on the left; on the right page.html and script.js side by side, above the preview and
   the console. On smaller screens it all stacks and the page scrolls. Theme tokens only; the preview is a web page,
   white like a browser's, and the console is a code panel. */

.ws-view{flex:1;min-height:0}
.ws-tasks{display:grid;grid-template-columns:minmax(250px,310px) minmax(0,1fr);gap:10px}
.ws-task{gap:8px}
.ws-task-btns{flex:none;border-top:1px solid var(--line);padding-top:8px}
.ws-count{font:600 12px/1 var(--font-mono);color:var(--muted)}
.ws-code{min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);grid-template-rows:minmax(0,1.1fr) minmax(0,1fr);gap:10px}
.ws-code > .panel{padding:8px 10px 10px}
.ws-ro{font:500 11px/1 var(--font-body);text-transform:none;letter-spacing:0;margin-left:6px}
.ws-pre{margin:0;background:var(--panel-2);color:var(--ink-soft)}
.ws-state{font:600 11.5px/1 var(--font-mono);color:var(--muted)}
.ws-frame-box{flex:1;min-height:0;position:relative;border:1px solid var(--line-strong);border-radius:6px;overflow:hidden;background:#fff}
.ws-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:#fff}
.ws-frame.ws-hidden{left:-10000px;width:600px;height:400px;visibility:hidden}

/* the console */
.ws-console{flex:1;min-height:0;overflow:auto;border:1px solid var(--line-strong);border-radius:6px;background:var(--paper);font:12.5px/1.45 var(--font-mono);padding:4px 0}
.ws-console:empty::before{content:"Nothing yet: console.log(), alert() and errors show here.";display:block;padding:4px 10px;color:var(--muted);font-family:var(--font-body)}
.ws-line{padding:3px 10px;border-bottom:1px solid var(--line);color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere}
.ws-line::before{content:"› ";color:var(--muted)}
.ws-warn{background:var(--warn-tint)}
.ws-info{color:var(--ink-soft)}
.ws-alert{background:var(--accent-tint);color:var(--accent-deep)}
.ws-alert::before{content:"◆ "}
.ws-error{background:var(--bad-tint);color:var(--ink)}
.ws-error::before{content:"✗ ";color:var(--bad)}
.ws-error b{color:var(--bad)}

/* the playground and the reference */
.ws-examples{display:flex;flex-wrap:wrap;gap:6px}
.ws-ref > .panel{height:100%}
.ws-ref-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px;align-content:start;padding-top:6px}
.ws-ref-card{border:1px solid var(--line);border-radius:6px;padding:8px 10px;background:var(--panel-2)}
.ws-ref-card h3{margin:0 0 4px;font:700 13.5px/1.3 var(--font-display);color:var(--ink)}
.ws-ref-card .st-model{background:var(--paper);max-height:none;white-space:pre;overflow-x:auto;font-size:12px}

@media (min-width:901px) and (max-width:1200px){
  .ws-tasks{grid-template-columns:minmax(230px,270px) minmax(0,1fr)}
}
@media (max-width:900px){
  .ws-tasks{display:flex;flex-direction:column}
  .ws-code{display:flex;flex-direction:column}
  .ws-task .st-scroll,.ws-ref .st-scroll{overflow:visible;flex:none}
  .ws-html{height:220px}
  .ws-js{height:300px}
  .ws-prev{height:300px}
  .ws-con{height:200px}
}
