/* site3: the practice library (/learn/library/), the lab and workbook pages and the cheat sheets. Uses the tokens and components of site3.css. */

/* the library page: the filter box in the band, the shelves of cards */
.lib-find{display:flex;align-items:center;gap:10px;max-width:520px;margin-top:28px;padding:0 16px;border:1px solid var(--dline);border-radius:10px;background:var(--panel);color:var(--dtext)}
.lib-find[hidden]{display:none}
.lib-find:focus-within{border-color:var(--red-l)}
.lib-find input{flex:1;min-width:0;padding:14px 0;border:0;background:none;color:#fff;font:16px "Inter Text",system-ui,sans-serif;outline:0}
.lib-find input::-webkit-search-cancel-button{display:none}/* our "Clear" button replaces the native cross */
.lib-clear{flex:none;min-height:40px;margin-right:-8px;padding:0 14px;border:0;border-radius:8px;background:#ffffff14;color:#fff;font:600 13.5px "Inter Text",system-ui,sans-serif;cursor:pointer}
.lib-clear:hover{background:#ffffff26}
.lib-meta{display:flex;flex-wrap:wrap;gap:4px 22px}
.lib-match{margin:12px 0 0;font:13px var(--mono);color:var(--dtext)}
.lib-none{display:flex;flex-wrap:wrap;align-items:center;gap:12px 18px}
.lib-none[hidden],.shelf[hidden],.parts a[hidden],.lib-clear[hidden],.lib-match[hidden]{display:none}
.lib-main{padding-block:36px 96px}
.lib-main .parts{margin:0 0 40px}
.lib-find{scroll-margin-top:72px}
.shelf{margin:0 0 56px;scroll-margin-top:80px}
.shelf h2{margin:0 0 8px;font-size:clamp(24px,2.6vw,30px)}
.shelf h2 small{margin-left:8px;font:500 13px var(--mono);color:var(--mute);letter-spacing:0}
.shelf .sub{margin-bottom:20px}
.lib-i{display:flex}.lib-i[hidden]{display:none}
.lib-i .s3-card{flex:1;min-width:0}
.lib-i .s3-card-b span{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* an item page: the header (the title first, the drawing beside the lead and the tags), lists */
.item .crumbs{margin-bottom:6px}
.item .item-head{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:0 32px;align-items:start;margin-bottom:28px}
.item-head>*{grid-column:1/-1}
.item-head .lead,.item-head .item-tags{grid-column:1}
.item-head img{grid-column:2;grid-row:3/span 2;margin-top:4px}
.item h1{max-width:none;margin:10px 0 14px}
.item .eyebrow{display:flex;flex-wrap:wrap;align-items:center;gap:0 .6ch}
.item-acc{color:var(--mute)}.item-acc::before{content:"· ";white-space:pre}
.item .lead{font-size:17.5px}
.item-head img{border:1px solid var(--line);border-radius:12px}
.item-tags{display:flex;flex-wrap:wrap;gap:6px;margin:18px 0 0;padding:0;list-style:none}
.item-list{margin:34px 0 30px}
.item-list h2{margin:0 0 12px;font-size:22px}
.item-cards{grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));gap:16px}
.item-cards .s3-card-b span{-webkit-line-clamp:2}
.item aside li.locked a{color:var(--mute)}
.item aside li.locked .num{color:var(--mute)}
/* the contents list of a phone: closed, above the text (the rail beside the text holds it on a wide screen) */
.item .toc{display:none;margin:0 0 26px;padding:0 18px;border:1px solid var(--line);border-radius:10px;background:#fff}
.toc summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;font-weight:600;color:var(--ink);cursor:pointer}
.toc summary span{font:12.5px var(--mono);font-weight:500;color:var(--mute)}
.toc[open] summary{border-bottom:1px solid var(--line)}
.toc ol{list-style:none;margin:0;padding:6px 0 8px}
.toc li a{display:flex;align-items:center;gap:10px;min-height:40px;padding:6px 0 6px 12px;border-left:2px solid transparent;text-decoration:none;font-size:15px;line-height:1.35}
.toc li a[aria-current]{border-left-color:var(--red);color:var(--ink);font-weight:600}
.toc li.locked a{color:var(--mute)}
.toc .num{flex:none}
.item aside li .num,.toc li .num{display:inline-flex;justify-content:center;flex:none;width:14px}
.item-course{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 18px;margin:36px 0 0;padding:16px 20px;border:1px dashed var(--line);border-radius:12px;font-size:15px}
.item .planned{margin-bottom:28px}

/* the blocks of the text (internal/markdoc): objectives, steps, alerts, code headers */
.prose .objectives{margin:0 0 26px;padding:20px 24px;border:1px solid var(--line);border-radius:12px;background:var(--tint)}
.prose .objectives .objectives-title{margin:0;padding:0;border:0;font:600 13px var(--mono);text-transform:uppercase;letter-spacing:.06em;color:var(--ink)}
.prose .objectives .objectives-title{display:flex;align-items:center;gap:10px}
.prose .objectives .objectives-title::before{content:"";flex:none;width:18px;height:18px;border-radius:50%;background:radial-gradient(circle,var(--red) 0 2.5px,transparent 3px 5px,var(--red) 5.5px 7px,transparent 7.5px)}
.prose .objectives ul{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:6px}
.prose .objectives li{position:relative;margin:0;padding-left:26px}
.prose .objectives li::before{content:"";position:absolute;left:5px;top:.5em;width:5px;height:10px;border:solid #16a34a;border-width:0 2px 2px 0;transform:rotate(45deg)}
.prose .step{display:grid;grid-template-columns:34px minmax(0,1fr);gap:14px;margin:0 0 20px;padding:20px 22px;border:1px solid var(--line);border-radius:12px}
.prose .step-num{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--red);color:#fff;font:600 14px var(--mono)}
.prose .step-content{min-width:0}
.prose .step-title{margin:4px 0 10px;font-size:19px}
.prose .step-content>:last-child{margin-bottom:0}
.prose .alert{display:flex;gap:12px;margin:0 0 20px;padding:14px 18px;border:1px solid var(--line);border-left:3px solid var(--ink);border-radius:10px;background:var(--tint);font-size:16px;line-height:1.6}
.prose .alert>div{min-width:0}.prose .alert p{margin:0 0 8px}.prose .alert>div>:last-child{margin-bottom:0}
.prose .alert-icon{display:grid;flex:none;place-items:center;width:22px;height:22px;margin-top:2px;border-radius:50%;background:var(--ink);color:#fff;font:700 13px/1 var(--mono)}
.prose .alert-info .alert-icon::before{content:"i"}
.prose .alert-warning .alert-icon::before,.prose .alert-danger .alert-icon::before{content:"!"}
.prose .alert-success .alert-icon::before{content:"";width:5px;height:10px;margin-top:-2px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}
.prose .alert-success .alert-icon{background:#16a34a}
.prose .alert-warning .alert-icon{background:#d97706}
.prose .alert-danger .alert-icon{background:var(--red)}
.prose .alert-success{border-left-color:#16a34a}
.prose .alert-warning{border-left-color:#d97706}
.prose .alert-danger{border-left-color:var(--red);background:#fef2f2}
.prose .alert :not(pre)>code{background:#fff}
.prose .alert a{color:#b91c1c}
.prose .code-header{display:flex;justify-content:space-between;gap:12px;margin:22px 0 0;padding:8px 16px;border-radius:10px 10px 0 0;background:var(--bg);border-bottom:1px solid var(--dline);color:#aab4c0;font:12.5px var(--mono)}
.prose .code-header span{min-width:0;overflow-wrap:anywhere}
.prose .code-header span:first-child{color:var(--red-l);text-transform:uppercase;letter-spacing:.06em}
.prose .code-header+.code-block-wrap{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}
.prose .code-block-wrap{margin-bottom:20px}

/* the lock and sign-in cards */
.gate{margin:28px 0;padding:22px 24px;border:1px solid var(--line);border-left:3px solid var(--red);border-radius:12px;background:var(--tint)}
.gate h2{margin:0 0 8px;max-width:none;font-size:22px}
.gate p{margin:0;max-width:40em}
.gate .btns{margin:18px 0 0}
[data-gated-loading] [data-preview]{display:none}

/* progress and feedback (PageActions) */
.pa{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:36px 0 0;padding:16px 20px;border:1px solid var(--line);border-radius:12px}
.pa [hidden]{display:none}
.pa-anon{flex-basis:100%;margin:0;font-size:15px}
.pa-anon a{color:var(--red);font-weight:600}
.pa-done[data-state="1"]{border-color:#16a34a;background:#ecfdf3;color:#15803d;box-shadow:none}
.pa-fb{display:flex;flex-direction:column;flex-basis:100%;gap:10px;max-width:36rem;margin:0}
.pa-fb .btn{align-self:flex-start}
.pa-stars{display:flex;align-items:center;gap:2px;margin:0;padding:0;border:0}
.pa-stars legend{padding:0 0 4px;font-size:13px;color:var(--mute)}
.pa-stars input{position:absolute;width:1px;height:1px;opacity:0}
.pa-stars label{display:grid;place-items:center;min-width:40px;min-height:40px;font-size:24px;line-height:1;color:#c9ced5;cursor:pointer}
.pa-stars label:hover,.pa-stars label:hover~label{color:var(--amber)}
.pa-stars input:focus-visible+label{outline:2px solid var(--ink);outline-offset:-2px;border-radius:8px}
.pa-stars[data-v="1"] label:nth-of-type(-n+1),.pa-stars[data-v="2"] label:nth-of-type(-n+2),.pa-stars[data-v="3"] label:nth-of-type(-n+3),.pa-stars[data-v="4"] label:nth-of-type(-n+4),.pa-stars[data-v="5"] label:nth-of-type(-n+5){color:var(--amber)}
.pa-fb textarea{width:100%;padding:10px 12px;border:1px solid #c9ced5;border-radius:8px;font:15px "Inter Text",system-ui,sans-serif;color:var(--ink);resize:vertical}
.pa-say{min-height:1em;margin:0;font-size:13.5px}
.pa-say[data-tone="ok"]{color:#15803d}.pa-say[data-tone="bad"]{color:var(--red)}

@media (max-width:900px){
  .item aside{display:none}/* its back link is the crumbs; its list is .toc */
  .item .toc{display:block}
  .lib-main .parts{flex-wrap:nowrap;overflow-x:auto;margin-inline:-24px;padding:0 24px 4px;scrollbar-width:none}
  .lib-main .parts a{flex:none;white-space:nowrap}
}
@media (max-width:560px){.item-cards .s3-card img{display:none}}/* on a phone these are short text cards */
@media (max-width:700px){
  .item .item-head{grid-template-columns:minmax(0,1fr)}
  .item-head img{grid-column:1;grid-row:auto;width:100%;max-width:280px;margin-top:20px}
}
@media (max-width:560px){
  .prose .step{grid-template-columns:minmax(0,1fr);padding:16px}
  .item .pager{grid-template-columns:minmax(0,1fr)}.item .pager .next,.item .pager .end{text-align:left}
}

/* a cheat sheet page: one column, because its lines are long */
.note>*:not(.sheet-top){max-width:760px}
.note .sheet-top{max-width:760px}
.note .eyebrow{margin-top:12px}
.note .lead{margin:0 0 26px;font-size:17.5px}
.note .prose{columns:auto}
.note .item-list{margin-top:48px}
.note .sheet-link{margin-top:24px}

/* tap size */
.item aside .back{min-height:40px;margin-bottom:6px}
.item aside li a{align-items:center;min-height:40px;padding-block:4px}
.lib-main .parts{gap:8px}
/* a member who is signed in in the browser only: when the full text has come into [data-body], the preview goes */
.item article:has([data-body]:not(:empty)) [data-preview]{display:none}

/* a study deck: a short band, then the deck's own document in a frame (site3-deck.html) */
.deck-band{padding-block:32px 36px}
.deck-band h1{font-size:clamp(26px,3.2vw,38px);margin:6px 0 10px}
.deck-band .eyebrow{margin-top:22px}
.deck-band .lead{font-size:16px;margin:0}
.deck{border-bottom:1px solid var(--line);background:#edeff2}
.deck iframe{display:block;width:100%;height:max(560px,calc(100svh - 64px));border:0;background:#fff}
.deck-pager{padding-block:32px 72px}
.deck-toc{position:fixed;right:16px;bottom:16px;z-index:8;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px;border:0;border-radius:99px;background:var(--ink);color:#fff;font:600 14px "Inter Text",system-ui,sans-serif;cursor:pointer;box-shadow:0 8px 24px -6px #0008}
.deck-toc[hidden]{display:none}
@media (max-width:560px){.deck-pager{grid-template-columns:minmax(0,1fr)}.deck-pager .next{text-align:left}}

/* a step with no title (its heading says the same words): the number and the text */
.prose .step-content>p:first-child{padding-top:3px}

/* the pager: the same gap as the cards; the last item has one link to the shelf */
.item .pager,.deck-pager{gap:16px}
.item .pager>span:empty{display:none}
.item .pager .end{text-align:right}
.item .pager .end:only-child{grid-column:1/-1;text-align:left}

/* tables (markdoc wraps each in .table-wrap): the box scrolls, the table fills it, a command is never cut inside */
.prose .table-wrap{margin:0 0 18px;overflow-x:auto}
.prose .table-wrap table{display:table;width:100%;margin:0;overflow:visible}
.prose .table-wrap table:has(th:nth-child(3)){min-width:560px}
.prose .table-wrap+.alert,.prose .table-wrap+.code-header{margin-top:24px}
.prose hr:has(+h2){display:none}/* a rule before a heading that has its own */
/* inline code stays in one piece; only a long one (markdoc gives it .wrap: a hash, a path) may break */
.prose :not(pre)>code{white-space:nowrap;overflow-wrap:normal}
.prose :not(pre)>code.wrap{white-space:normal;overflow-wrap:anywhere}
.prose td code.wrap,.prose th code.wrap{white-space:nowrap;overflow-wrap:normal}

/* a code block that scrolls sideways shows a fade on the edge that has more */
.code-block-wrap{--pre-bg:var(--bg);--pre-cue:#ffffff22}
.code-block-wrap[data-language=text]{--pre-bg:#f2f4f6;--pre-cue:#0000001c}
.code-block-wrap pre{background:
  linear-gradient(90deg,var(--pre-bg) 30%,#0000) 0 0/28px 100% no-repeat local,
  linear-gradient(270deg,var(--pre-bg) 30%,#0000) 100% 0/28px 100% no-repeat local,
  linear-gradient(90deg,var(--pre-cue),#0000) 0 0/22px 100% no-repeat scroll,
  linear-gradient(270deg,var(--pre-cue),#0000) 100% 0/22px 100% no-repeat scroll,
  var(--pre-bg)}

/* the Top link of a long page */
.to-top{position:fixed;right:16px;bottom:16px;z-index:8;display:none;align-items:center;gap:6px;min-height:44px;padding:0 18px;border-radius:99px;background:var(--ink);color:#fff;font:600 14px "Inter Text",system-ui,sans-serif;text-decoration:none;box-shadow:0 8px 24px -6px #0008}
@media (max-width:900px){.to-top:not([hidden]){display:inline-flex}}

/* print: a cheat sheet on paper. No bar, no footer, no buttons; a long command wraps instead of running off the page. */
@media print{
  .kr-top,.kr-bot,.to-top,.crumbs,[data-print],.item-list,.sheet-link,.pa,.pager,.toc,.deck-pager{display:none!important}
  body{background:#fff}
  .note>*:not(.sheet-top){max-width:none}
  .note .lead{font-size:13px;margin-bottom:14px}
  .code-block-wrap{overflow:visible;break-inside:avoid;--sk-token-comment:#555;--sk-token-keyword:#a3141a;--sk-token-string:#17622d;--sk-token-string-expression:#17622d;--sk-token-function:#5b2c9e;--sk-token-constant:#0b4f8a;--sk-token-parameter:#8a4a06}
  .code-block-wrap pre{background:#fff;overflow:visible;white-space:pre-wrap;overflow-wrap:anywhere;color:#000}
  .prose .table-wrap{overflow:visible}.prose .table-wrap table{min-width:0!important}
  .prose td code,.prose :not(pre)>code{white-space:normal;overflow-wrap:anywhere}
}
