/* =====================================================================
   Course pages — LearnDash courses, lessons and topics (v7.4)
   Loaded only on LearnDash pages (functions.php). Scoped to .ld-shell so
   nothing here can leak into the rest of the site.

   Goals: a readable column, a clear heading rhythm, tables that look like
   the Institute's reports, and LearnDash's own chrome (status pills, list
   headers, buttons) in the Institute palette instead of plugin blue.
   ===================================================================== */

/* ---- Layout: a reading column, not a full-width wall of text --------- */
.ld-shell{padding:clamp(36px,4vw,64px) 0 clamp(64px,7vw,110px)}
/* Content starts on the same left edge as the page title above it; a
   sticky side panel uses the space on the right. */
.ld-shell .ld-layout{
  display:grid;grid-template-columns:minmax(0,800px) 280px;
  justify-content:space-between;gap:clamp(48px,6vw,110px);align-items:start;
}
.ld-shell .ld-main{min-width:0}
.ld-shell .ld-body{max-width:none}
.ld-shell .ld-backlink{margin:0 0 18px}

.ld-aside{position:sticky;top:120px;display:flex;flex-direction:column;gap:16px}
.admin-bar .ld-aside{top:152px}
.ld-aside-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px 22px}
.ld-aside-label{margin:0 0 12px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--ember-deep)}
.ld-toc{display:flex;flex-direction:column;border-left:2px solid var(--line-soft)}
.ld-toc a{
  display:block;margin-left:-2px;padding:7px 0 7px 14px;border-left:2px solid transparent;
  font-size:14px;line-height:1.4;color:var(--ink-dim);text-decoration:none;transition:color .2s,border-color .2s;
}
.ld-toc a:hover{color:var(--ink)}
.ld-toc a.is-active{color:var(--ink);font-weight:600;border-left-color:var(--ember)}
.ld-aside-title{display:block;font-family:var(--serif);font-size:18px;line-height:1.3;color:var(--ink);text-decoration:none;margin-bottom:10px}
.ld-aside-title:hover{color:var(--ember-deep)}
.ld-aside-link{font-size:13px;font-weight:600;color:var(--ember-deep);text-decoration:none}
.ld-aside-link:hover{color:var(--ink)}
.ld-aside-text{margin:0;font-size:14px;line-height:1.6;color:var(--ink-dim)}
.ld-aside-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 16px}
.ld-aside-stats div{padding:12px 14px;border-radius:10px;background:var(--panel-2);border:1px solid var(--line-soft)}
.ld-aside-stats strong{display:block;font-family:var(--serif);font-weight:400;font-size:28px;line-height:1;color:var(--ink)}
.ld-aside-stats span{display:block;margin-top:6px;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint)}
.ld-aside-btn{display:flex;justify-content:center;width:100%;margin-top:18px}
.ld-shell .learndash-wrapper .ld-tab-content h2[id]{scroll-margin-top:130px}

@media (max-width:1080px){
  .ld-shell .ld-layout{grid-template-columns:minmax(0,800px)}
  .ld-aside{display:none}
}
.ld-shell .learndash-wrapper{font-family:var(--sans)}

/* ---- Body copy ------------------------------------------------------- */
.ld-shell .learndash-wrapper .ld-tab-content{font-size:17px;line-height:1.75;color:var(--ink-dim)}
.ld-shell .learndash-wrapper .ld-tab-content > p,
.ld-shell .learndash-wrapper .ld-tab-content li > p{margin:0 0 1.15em;font-size:17px;line-height:1.75;color:var(--ink-dim)}
.ld-shell .learndash-wrapper .ld-tab-content > p:first-of-type{font-size:19px;line-height:1.7;color:var(--ink)}
.ld-shell .learndash-wrapper .ld-tab-content strong,
.ld-shell .learndash-wrapper .ld-tab-content b{color:var(--ink);font-weight:600}
.ld-shell .learndash-wrapper .ld-tab-content a:not(.ld-button){color:var(--ember-deep);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.ld-shell .learndash-wrapper .ld-tab-content a:not(.ld-button):hover{color:var(--ink)}

/* ---- Headings: one clear rhythm -------------------------------------- */
.ld-shell .learndash-wrapper .ld-tab-content h2{
  font-family:var(--serif);font-weight:400;color:var(--ink);
  font-size:clamp(25px,2.6vw,31px);line-height:1.2;letter-spacing:-.005em;
  margin:2.3em 0 .65em;padding-top:1.1em;border-top:1px solid var(--line);
}
.ld-shell .learndash-wrapper .ld-tab-content > h2:first-child,
.ld-shell .learndash-wrapper .ld-tab-content > .kcc-video-soon + h2{margin-top:.4em;padding-top:0;border-top:0}
.ld-shell .learndash-wrapper .ld-tab-content h3{
  font-family:var(--serif);font-weight:500;color:var(--ink);
  font-size:clamp(19px,2vw,22px);line-height:1.3;margin:1.8em 0 .5em;
}
.ld-shell .learndash-wrapper .ld-tab-content h4{font-size:15px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ember-deep);margin:1.6em 0 .5em}

/* ---- Lists ----------------------------------------------------------- */
.ld-shell .learndash-wrapper .ld-tab-content ul,
.ld-shell .learndash-wrapper .ld-tab-content ol{margin:0 0 1.4em;padding:0;list-style:none}
.ld-shell .learndash-wrapper .ld-tab-content li{position:relative;margin:0 0 .7em;padding-left:30px;line-height:1.65;color:var(--ink-dim)}
.ld-shell .learndash-wrapper .ld-tab-content ul > li::before{
  content:"";position:absolute;left:8px;top:.68em;width:7px;height:7px;border-radius:50%;background:var(--ember);
}
.ld-shell .learndash-wrapper .ld-tab-content ol{counter-reset:pri-ol}
.ld-shell .learndash-wrapper .ld-tab-content ol > li{counter-increment:pri-ol;padding-left:38px}
.ld-shell .learndash-wrapper .ld-tab-content ol > li::before{
  content:counter(pri-ol);position:absolute;left:0;top:.12em;width:24px;height:24px;border-radius:50%;
  background:var(--navy);color:#fff;font:600 12px/24px var(--sans);text-align:center;
}
/* "Avoid this mistake:" items in Good practice */
.ld-shell .learndash-wrapper .ld-tab-content li.ld-avoid::before{background:#C2543A}
.ld-shell .learndash-wrapper .ld-tab-content li.ld-avoid > strong:first-child{color:#A43F28}

/* ---- Tables: styled like the Institute's reports --------------------- */
.ld-shell .ld-table-wrap{
  margin:1.6em 0 1.8em;overflow-x:auto;-webkit-overflow-scrolling:touch;
  border:1px solid var(--line);border-radius:12px;background:var(--panel);
  box-shadow:0 1px 2px rgba(22,32,58,.04),0 12px 30px -20px rgba(22,32,58,.18);
}
.ld-shell .learndash-wrapper .ld-tab-content table{
  width:100%;margin:0;border-collapse:collapse;border:0;font-size:15px;line-height:1.45;background:transparent;
}
.ld-shell .learndash-wrapper .ld-tab-content table th,
.ld-shell .learndash-wrapper .ld-tab-content table thead td{
  background:var(--navy);color:#fff;text-align:left;font-weight:600;font-size:12px;letter-spacing:.08em;text-transform:uppercase;
  padding:13px 18px;border:0;white-space:nowrap;
}
.ld-shell .learndash-wrapper .ld-tab-content table td{
  padding:13px 18px;border:0;border-top:1px solid var(--line-soft);color:var(--ink-dim);vertical-align:top;
}
.ld-shell .learndash-wrapper .ld-tab-content table tbody tr:nth-child(even) td{background:var(--panel-2)}
.ld-shell .learndash-wrapper .ld-tab-content table tbody tr:hover td{background:color-mix(in srgb,var(--ember) 7%,#fff)}
.ld-shell .learndash-wrapper .ld-tab-content table td:first-child{color:var(--ink);font-weight:600}
.ld-shell .learndash-wrapper .ld-tab-content table .ld-num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.ld-shell .learndash-wrapper .ld-tab-content table .ld-pct{color:#A43F28;font-weight:600}
.ld-shell .learndash-wrapper .ld-tab-content table tr.ld-total td{background:color-mix(in srgb,var(--ember) 10%,#fff);color:var(--ink);font-weight:700}

/* ---- Figures / screenshots ------------------------------------------ */
.ld-shell .kcc-shot{margin:2em 0}
.ld-shell .kcc-shot a{border-radius:12px}
.ld-shell .kcc-shot figcaption{margin-top:12px;font-size:14px;line-height:1.5;color:var(--ink-faint);text-align:center}

/* ---- Callouts -------------------------------------------------------- */
.ld-shell .kcc-video-soon{border-radius:12px;margin:0 0 2.2em}
.ld-shell .learndash-wrapper .ld-tab-content .kcc-video-soon strong{color:#fff}
.ld-shell .learndash-wrapper .ld-tab-content .kcc-video-soon p{margin:0;font-size:15px;line-height:1.55;color:#9AA7C2}
.ld-shell .kcc-video-soon p:empty{display:none}
.ld-shell .kcc-note{border-radius:0 12px 12px 0}
.ld-shell .kcc-practice{
  display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin:2.4em 0 0;padding:18px 22px;
  border:1px solid color-mix(in srgb,var(--ember) 45%,var(--line));border-radius:12px;
  background:color-mix(in srgb,var(--ember) 7%,#fff);font-size:16px;
}
.ld-shell .kcc-practice span{margin:0;padding:4px 10px;border-radius:999px;background:var(--ember);color:#16203A;font-size:11px}
.ld-shell .kcc-practice a{color:var(--ink)!important;text-decoration:none!important}
.ld-shell .kcc-practice a:hover{color:var(--ember-deep)!important}

/* ---- "Check your understanding" — answers hidden until asked ---------- */
.ld-shell .learndash-wrapper .ld-tab-content ol.ld-quiz{margin-top:.6em}
.ld-shell .learndash-wrapper .ld-tab-content ol.ld-quiz > li{
  padding:16px 18px 16px 54px;margin:0 0 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);
  color:var(--ink);font-weight:500;
}
.ld-shell .learndash-wrapper .ld-tab-content ol.ld-quiz > li::before{left:16px;top:16px;background:var(--ember);color:#16203A}
.ld-shell .ld-quiz details{margin-top:10px}
.ld-shell .ld-quiz summary{
  display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;
  font-size:13px;font-weight:600;letter-spacing:.04em;color:var(--ember-deep);
}
.ld-shell .ld-quiz summary::-webkit-details-marker{display:none}
.ld-shell .ld-quiz summary::before{content:"+";display:inline-block;width:18px;height:18px;border-radius:50%;border:1.5px solid currentColor;text-align:center;line-height:15px;font-size:14px}
.ld-shell .ld-quiz details[open] summary::before{content:"–"}
.ld-shell .ld-quiz details p{margin:10px 0 0!important;padding:12px 14px;border-left:3px solid var(--c2);background:color-mix(in srgb,var(--c2) 6%,#fff);border-radius:0 8px 8px 0;font-size:15.5px!important;font-weight:400;color:var(--ink-dim)!important}

/* ---- LearnDash chrome in the Institute palette ---------------------- */
.ld-shell .learndash-wrapper .ld-primary-background,
.ld-shell .learndash-wrapper .ld-table-list .ld-table-list-header.ld-primary-background{background-color:var(--navy)!important}
.ld-shell .learndash-wrapper .ld-primary-color,
.ld-shell .learndash-wrapper .ld-primary-color-hover:hover{color:var(--ember-deep)!important}
.ld-shell .learndash-wrapper .ld-status{border-radius:999px;font-weight:600;letter-spacing:.06em}
.ld-shell .learndash-wrapper .ld-status-progress.ld-primary-background{background-color:var(--ember)!important;color:#16203A!important}
.ld-shell .learndash-wrapper .ld-status-complete,
.ld-shell .learndash-wrapper .ld-secondary-background{background-color:var(--c2)!important}
.ld-shell .learndash-wrapper .ld-secondary-color{color:var(--c2)!important}
.ld-shell .learndash-wrapper .ld-expand-button.ld-primary-background{background-color:var(--navy)!important;border-radius:999px}
.ld-shell .learndash-wrapper .ld-expand-button.ld-button-alternate{color:var(--ink)!important}
.ld-shell .learndash-wrapper .ld-expand-button.ld-button-alternate .ld-icon{background:var(--navy)!important;color:#fff!important}

/* Breadcrumb + progress card */
.ld-shell .learndash-wrapper .ld-topic-status,
.ld-shell .learndash-wrapper .ld-lesson-status,
.ld-shell .learndash-wrapper .ld-course-status{
  background:var(--panel);border:1px solid var(--line);border-radius:12px;margin-bottom:2em;box-shadow:none;
}
.ld-shell .learndash-wrapper .ld-breadcrumbs{background:var(--panel-2);border-radius:12px 12px 0 0;padding:14px 20px}
.ld-shell .learndash-wrapper .ld-breadcrumbs a{color:var(--ink-dim);font-weight:500}
.ld-shell .learndash-wrapper .ld-breadcrumbs a:hover{color:var(--ember-deep)}
.ld-shell .learndash-wrapper .ld-progress .ld-progress-bar{background:var(--line-soft);border-radius:999px;height:6px}
.ld-shell .learndash-wrapper .ld-progress .ld-progress-heading .ld-progress-label{color:var(--ink);letter-spacing:.06em}
.ld-shell .learndash-wrapper .ld-progress .ld-progress-stats{color:var(--c2)}

/* Course content and lesson content lists */
.ld-shell .learndash-wrapper .ld-item-list .ld-item-list-item{border:1px solid var(--line);border-radius:12px;margin-bottom:12px;background:var(--panel);box-shadow:none}
.ld-shell .learndash-wrapper .ld-item-list .ld-item-list-item:hover{border-color:color-mix(in srgb,var(--ember) 55%,var(--line))}
.ld-shell .learndash-wrapper .ld-item-list .ld-item-name .ld-item-title{color:var(--ink);font-weight:600;font-size:16px}
.ld-shell .learndash-wrapper .ld-item-list .ld-item-components,
.ld-shell .learndash-wrapper .ld-item-list .ld-item-component{color:var(--ink-faint)}
.ld-shell .learndash-wrapper .ld-table-list{border-radius:12px;overflow:hidden;border:1px solid var(--line)}
.ld-shell .learndash-wrapper .ld-table-list .ld-table-list-header{padding:14px 20px}
.ld-shell .learndash-wrapper .ld-table-list .ld-table-list-item{border-color:var(--line-soft)}
.ld-shell .learndash-wrapper .ld-table-list .ld-table-list-item-preview{color:var(--ink);font-size:15.5px}
.ld-shell .learndash-wrapper .ld-table-list .ld-table-list-item-preview:hover{color:var(--ember-deep)}
.ld-shell .learndash-wrapper .ld-section-heading h2{font-family:var(--serif);font-weight:400;font-size:clamp(24px,2.4vw,30px);color:var(--ink)}

/* Previous / Mark complete / Next */
.ld-shell .learndash-wrapper .ld-content-actions{margin-top:2.6em;padding-top:1.6em;border-top:1px solid var(--line)}
.ld-shell .learndash-wrapper .ld-content-actions .ld-button{border-radius:999px!important;padding:12px 22px!important}
.ld-shell .learndash-wrapper .ld-content-actions .ld-course-step-back{color:var(--ink-faint);font-size:13px}

@media (max-width:640px){
  .ld-shell .learndash-wrapper .ld-tab-content,
  .ld-shell .learndash-wrapper .ld-tab-content > p{font-size:16px}
  .ld-shell .learndash-wrapper .ld-tab-content > p:first-of-type{font-size:17px}
  .ld-shell .learndash-wrapper .ld-tab-content table td,
  .ld-shell .learndash-wrapper .ld-tab-content table th{padding:11px 12px}
  .ld-shell .learndash-wrapper .ld-tab-content ol.ld-quiz > li{padding-left:48px}
}
