/* ProgramWise — course page styles (shared by every file in /course).
   Relies on shared tokens/fonts/header from ../style.css, which must be
   linked before this file. */

.lp-layout{
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 44px;
  padding: 32px;
  align-items: start;
}

/* ---------------- Sidebar ---------------- */
.lp-sidebar{
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 98px);
  overflow-y: auto;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}
.lp-sidebar-toggle{ display:none; }

.lp-group{ margin-bottom: 2px; }

.lp-group-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.lp-group-link{
  flex: 1;
  padding: 10px 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper);
  text-decoration: none;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.lp-group-link:hover{ background: var(--panel); }
.lp-group-link.active{ color: var(--gold); }

.lp-group-toggle{
  background: none;
  border: none;
  color: var(--mute);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease;
}
.lp-group-toggle:hover{ background: var(--panel); color: var(--paper); }
.lp-group-toggle .chevron{
  font-size: 10px;
  display: inline-block;
  transition: transform .15s ease;
}
.lp-group.open .lp-group-toggle .chevron{ transform: rotate(90deg); }
.lp-group.open .lp-group-link{ color: var(--gold); }

.lp-sublist{
  list-style: none;
  margin: 2px 0 8px 10px;
  padding: 2px 0 4px 14px;
  border-left: 1px solid var(--line);
  display: none;
}
.lp-group.open .lp-sublist{ display: block; }

.lp-sublink{
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--mute);
  text-decoration: none;
  border-radius: 5px;
  transition: background .15s ease, color .15s ease;
}
.lp-sublink:hover{ background: var(--panel); color: var(--paper); }
.lp-sublink.active{ color: var(--teal); background: var(--panel); font-weight: 600; }

/* ---------------- Main content ---------------- */
.lp-content{ min-width: 0; }

.lp-section{
  scroll-margin-top: 90px;
}

.lp-section > h2{
  font-family: var(--font-mono);
  font-size: 26px;
  color: var(--paper);
  margin: 0 0 8px;
}
.lp-section-desc{
  color: var(--mute);
  margin: 0 0 36px;
  font-size: 15px;
  max-width: 680px;
}

.lp-subsection{ margin-bottom: 40px; scroll-margin-top: 90px; }
.lp-subsection:last-child{ margin-bottom: 0; }
.lp-subsection h3{
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--gold);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.lp-subsection p{ color: var(--paper); font-size: 15px; line-height: 1.75; margin: 0 0 14px; max-width: 700px; }
.lp-subsection ul{ color: var(--paper); font-size: 15px; line-height: 1.75; margin: 0 0 16px; padding-left: 22px; max-width: 700px; }
.lp-subsection li{ margin-bottom: 6px; }
.lp-inline{
  font-family: var(--font-mono);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--teal);
}

/* Standard Python Modules is a flat section with no wrapping .lp-subsection
   for its own intro line, so give bare <p>/<pre> inside .lp-section room too */
.lp-section > p{ color: var(--paper); font-size: 15px; line-height: 1.75; margin: 0 0 14px; max-width: 700px; }

/* ---------------- Code blocks (display only, not executable) ---------------- */
.code-block{
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 0 0 14px;
  white-space: pre;
  max-width: 700px;
}
.code-output{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px 12px;
  margin: 0 0 20px;
  white-space: pre-wrap;
  max-width: 700px;
}
.code-output::before{
  content: "OUTPUT";
  display: block;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--mute);
  margin-bottom: 8px;
}

/* token colors used by the syntax highlighter in course.js */
.tok-com{ color: var(--mute); }
.tok-kw{ color: var(--gold); font-weight: 600; }
.tok-str{ color: var(--teal); }
.tok-num{ color: #c9a7f5; }

/* ---------------- Prev/Next topic navigation ---------------- */
.lp-topic-nav{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.lp-topic-nav a{
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--paper);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  transition: border-color .15s ease, color .15s ease;
  max-width: 45%;
}
.lp-topic-nav a:hover{ border-color: var(--teal); color: var(--teal); }
.lp-topic-nav .dir{ display: block; font-size: 11px; color: var(--mute); margin-bottom: 4px; }
.lp-topic-nav .next{ text-align: right; margin-left: auto; }

/* ---------------- Mobile ---------------- */
@media (max-width: 900px){
  .lp-layout{ grid-template-columns: 1fr; padding: 20px; gap: 16px; }

  .lp-sidebar-toggle{
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: var(--panel-raised);
    border: 1px solid var(--line);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 13.5px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
  }
  .lp-sidebar{
    position: static;
    max-height: none;
    border-right: none;
    display: none;
    padding: 14px;
    background: var(--panel-raised);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .lp-sidebar.mobile-open{ display: block; }
}
