/* ============================================================
   Course authoring (admin): courses, sections, pages, quizzes
   ============================================================ */

/* sortable tables (sections, pages) */
.au-tbl td{vertical-align:middle}
.au-tbl th a{color:inherit}
.au-tbl .au-grip{width:2.5rem;padding-right:0;color:var(--gray-500)}
.au-tbl tbody#sortable tr{cursor:grab;background:#fff}
.au-tbl tbody#sortable tr:hover .au-grip{color:var(--ink)}
.au-tbl tbody#sortable tr:hover{background:var(--paper)}
.au-tbl tbody#sortable tr{cursor:grab}
.au-tbl tr.sortable-drag{cursor:grabbing;box-shadow:var(--shadow-lg);background:#fff}
.au-tbl tr.sortable-ghost{background:var(--amber-50)}
.au-tbl tr.sortable-ghost td{border-top:1px dashed var(--amber-border);border-bottom:1px dashed var(--amber-border)}
.au-name{min-width:16rem}
@media (max-width:760px){.au-name{min-width:11rem}}
.au-name__in{display:flex;gap:.5rem;align-items:flex-start;padding-left:calc(var(--depth,0) * 1.5rem)}
.au-name__branch{color:var(--gray-500);font-family:var(--ff-mono);line-height:1.5}
.au-desc{font-size:.85rem;margin-top:.15rem;max-width:60ch}
.au-acts{display:inline-flex;gap:.35rem;align-items:center;justify-content:flex-end;flex-wrap:nowrap}
.au-hint{display:flex;align-items:center;gap:.4rem;font-size:.9rem;margin-bottom:-1.75rem}
.au-create{display:grid;gap:.6rem}

/* forms */
.au-form{max-width:960px}
.au-form .field--narrow input,.au-form .field--narrow select{max-width:12rem}
.au-form .field .check{font-weight:500}
.au-form .field .check input{min-height:0;padding:0;flex:none}
.au-meta{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}

/* nested questions / answers */
.au-questions{display:grid;gap:1rem}
.au-questions>.btn,.au-answers>.btn{justify-self:start}
.q-card{display:grid;gap:1.1rem;background:#fff;border:1px solid var(--gray-200);border-radius:var(--r-lg);padding:1.25rem 1.5rem}
.q-card__hdr,.a-row__hdr{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.q-card__hdr h4{font-size:1rem}
.au-answers{display:grid;gap:.6rem;padding:1rem;background:var(--paper);border:1px solid var(--gray-200);border-radius:var(--r)}
.a-row{display:grid;grid-template-columns:minmax(0,1fr) auto 7rem auto;gap:.75rem;align-items:end}
.a-row .field input[type=text]{min-height:44px}
.a-row .check{min-height:44px}
.a-row__rm{min-height:44px;display:flex;align-items:center}
@media (max-width:760px){
  .a-row{grid-template-columns:1fr 1fr;padding-bottom:.75rem;border-bottom:1px solid var(--gray-200)}
  .a-row>.field:first-child{grid-column:1/-1}
  .q-card{padding:1rem}
}

/* CKEditor (the CDN build is 4.x: .cke; 5.x renders .ck-editor) */
.cke,.cke_chrome,.ck-editor{max-width:100%;width:100%!important;box-sizing:border-box}
.cke_chrome{border:1px solid var(--gray-300)!important;border-radius:var(--r);overflow:hidden;box-shadow:none!important;padding:0!important}
.cke_top{background:var(--gray-100)!important;border-bottom:1px solid var(--gray-200)!important;box-shadow:none!important}
.cke_bottom{background:var(--gray-100)!important;border-top:1px solid var(--gray-200)!important;box-shadow:none!important}
.cke_focus,.cke_chrome:focus-within{border-color:var(--blue)!important;box-shadow:0 0 0 4px rgba(23,153,206,.15)!important}
.ck-editor .ck-toolbar{background:var(--gray-100);border-color:var(--gray-300);border-radius:var(--r) var(--r) 0 0!important}
.ck-editor .ck-editor__editable{min-height:180px;border-color:var(--gray-300);border-radius:0 0 var(--r) var(--r)!important}
.ck-editor .ck-editor__editable.ck-focused{border-color:var(--blue);box-shadow:0 0 0 4px rgba(23,153,206,.15)}

/* form_for output: hidden inputs come before the first section */
.au-form>.form-section:first-of-type{border-top:0;padding-top:0}
.au-form .form-grid{align-items:start}
/* answer rows: only the first row shows column labels */
.au-answers .a-row~.a-row>.field>label:not(.check){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:760px){.au-answers .a-row~.a-row>.field>label:not(.check){position:static;width:auto;height:auto;clip:auto}}
.au-questions{counter-reset:q}
.q-card{counter-increment:q}
.q-card__hdr h4::after{content:" " counter(q)}
.check-grid .check{font-weight:500}
.mini-courses{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr))}
.mini-course{display:grid;gap:.6rem;align-content:start}
.mini-course .btn{justify-self:start}
