/**
 * Learn curriculum pages. Shared site nav styles live in /css/site-nav.css.
 */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #222;
  background: #f7f9f7;
  line-height: 1.5;
}

.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 12px;
  font-size: 1.7rem;
  color: #2c5530;
}

.intro {
  margin: 0;
}

.lesson-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
}

.lesson-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.lesson-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.lesson-card h2 a {
  color: #2c5530;
  text-decoration: none;
}

.lesson-card h2 a:hover {
  text-decoration: underline;
}

.lesson-card p {
  margin: 0 0 8px;
}

.lesson-card p:last-child {
  margin-bottom: 0;
}

.lesson-note {
  color: #555;
  font-size: 0.92rem;
}

.lesson-links a {
  font-weight: 600;
  color: #2c5530;
}

.lesson-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.lesson-steps {
  margin: 0 0 8px;
  padding-left: 1.3rem;
}

.lesson-steps li + li {
  margin-top: 4px;
}

.site-footer {
  max-width: 1200px;
  margin: 28px auto 0;
  padding: 18px 20px 8px;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  border-top: 1px solid #e0e0e0;
}

.site-footer a {
  color: #2c5530;
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .nav-word-accent {
  color: #d32f2f;
  font-weight: 700;
}

@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .lesson-card { padding: 14px; }
}

/* Learn lab: list beside the tool. The iframe is the workspace scroller. */
.page.learn-lab-page {
  max-width: 1600px;
}

.learn-lab-page .site-top-nav,
.learn-lab-page .site-footer {
  max-width: none;
}

.learn-shell {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px 18px 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.learn-shell .intro {
  margin: 0 0 16px;
}

.lab-layout {
  display: block;
}

.lab-side {
  display: flex;
  flex-direction: column;
  min-height: 16rem;
  max-height: 70vh;
  overflow: hidden;
}

.lab-lessons {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  gap: 6px;
  overflow-y: auto;
}

.lab-lessons button {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  color: #2c5530;
  background: #f7f9f7;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
}

.lab-lessons button:hover,
.lab-lessons button:focus-visible {
  background: #e8f5e9;
  border-color: #2c5530;
}

.lab-lessons button.is-completed {
  background: #d8eedc;
  border-color: #1b5e20;
}

.lab-lessons button[aria-current="true"],
.lab-lessons button[aria-current="true"]:hover,
.lab-lessons button[aria-current="true"]:focus-visible {
  background: #fff4c2;
  border-color: #c4a035;
  color: #5a4510;
}

.lab-steps {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lab-step-panel[hidden] {
  display: none;
}

.lab-step-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.lab-step-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lab-step-panel p {
  margin: 0 0 8px;
}

.lab-step-panel p:last-child {
  margin-bottom: 0;
}

.lesson-brief h2,
.lesson-brief h3,
.lesson-card > h3,
.lab-step-panel h3 {
  margin: 12px 0 6px;
  font-size: 0.95rem;
  color: #2c5530;
}

.lesson-status {
  display: inline-block;
  margin: 0 0 8px;
  color: #1b5e20;
  font-weight: 700;
  font-size: 0.9rem;
}

.lesson-status[hidden] {
  display: none;
}

.lesson-card.is-completed {
  background: #e8f5e9;
  border-color: #1b5e20;
}

.lesson-complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}

.lesson-complete-actions button {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.lesson-complete-actions [data-learn-complete] {
  background: #2c5530;
  color: #fff;
  border: 1px solid #2c5530;
}

.lesson-complete-actions [data-learn-clear] {
  background: #e7f1fb;
  color: #0d47a1;
  border: 1px solid #0d47a1;
}

.lesson-complete-actions [data-learn-clear-all] {
  background: #fdecea;
  color: #8d2a22;
  border: 1px solid #8d2a22;
}

.lab-lesson-title {
  display: block;
}

.lab-lessons button .lesson-status {
  margin: 4px 0 0;
}

.lab-workspace iframe {
  display: block;
  width: 100%;
  min-height: 70vh;
  height: 70vh;
  border: 1px solid #c8d6c9;
  border-radius: 8px;
  background: #fff;
}

@media (min-width: 900px) {
  .lab-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
  }

  .lab-side {
    height: calc(100vh - 15rem);
    min-height: 70vh;
    max-height: none;
  }

  .lab-workspace iframe {
    height: calc(100vh - 15rem);
    min-height: 70vh;
  }

  .lab-step-panel .lesson-complete-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lab-step-panel .lesson-complete-actions [data-learn-clear-all] {
    grid-column: 1 / -1;
  }
}

/* Fixed lab Coach: the lesson list uses the space until guidance is expanded. */
.lab-lessons { flex: 1 1 auto; }
.lab-lessons button { flex-shrink: 0; }
.lab-coach-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; margin-top: 12px; background: #d9e8f5; border: 1px solid #b7cfe0; border-radius: 8px 8px 0 0; flex: 0 0 auto; }
.lab-coach-header h2 { margin: 0; font-size: 1.05rem; color: #245b74; }
.lab-coach-header button, .lab-live-coach button { font: inherit; font-size: .88rem; border: 1px solid #9cb39f; border-radius: 6px; padding: 6px 8px; background: #f1f7f2; color: #244c2a; cursor: pointer; }
.lab-coach-header button:focus-visible, .lab-live-coach button:focus-visible { outline: 2px solid #0d47a1; outline-offset: 2px; }
.lab-side:not(.is-coach-expanded) .lab-steps { flex: 0 0 auto; margin-top: 0; padding-top: 0; border-top: 0; }
.lab-side:not(.is-coach-expanded) .lab-step-body { display: none; }
.lab-side.is-coach-expanded .lab-lessons { flex: 0 0 auto; }
.lab-side.is-coach-expanded .lab-lessons button:not([aria-current="true"]) { display: none; }
.lab-live-coach .first-run-coach-body { overflow: visible; }
.lab-live-coach .first-run-coach-hint { margin: 0 0 10px; }
.lab-live-coach .first-run-coach-steps { padding-left: 22px; margin: 0 0 12px; }
.lab-live-coach .first-run-coach-steps li { margin-bottom: 8px; }
.lab-live-coach .is-done > .first-run-step-btn { color: #267632; text-decoration: line-through; }
.lab-live-coach .is-current > .first-run-step-btn { color: #0864bd; font-weight: 700; }
.lab-live-coach .first-run-coach-actions { margin: 12px 0; }
.lab-live-coach button[aria-pressed="true"] { background: #d8eedc; }
