/* portal.css - Virtus Cyber Academy classroom portal theme.
 *
 * Palette B + Geist Mono fallback chain matches handout.css and the
 * single-page interactives. Stage 1 read-only classroom surface
 * (R-CLASSROOM-STAGE-1-PORTAL-RENDERING-2026-05-13).
 *
 * License: (c) 2026 Virtus Cyber Academy.
 */

:root {
  --bg:        #0a0a0a;
  --bg-card:   #131313;
  --bg-deep:   #1a1a1a;
  --fg:        #d0d0d0;
  --fg-muted:  #9ca3af;
  --fg-faint:  #707070;
  --green:     #4ade80;
  --gold:      #fbbf24;
  --red:       #ef4444;
  --blue:      #6b9fcf;
  --border:    #2a2a2a;
  --sidebar-w: 17rem;
  --mono:      'Geist Mono', 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
}

* { box-sizing: border-box; }

body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--gold); }

code, pre { font-family: var(--mono); }

/* --- Header --- */
.va-portal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  font-size: 0.88rem;
}
.va-portal-home {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.va-portal-home:hover { color: var(--green); text-decoration: none; }
.va-portal-home-disabled {
  color: var(--fg-faint);
  font-weight: 600;
  font-size: 0.85rem;
}
.va-portal-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.va-portal-breadcrumb a { color: var(--blue); }
.va-portal-crumb-current { color: var(--fg); }
.va-portal-public {
  color: var(--fg-muted);
  font-size: 0.78rem;
  flex-shrink: 0;
}
.va-portal-public:hover { color: var(--gold); }

/* --- Sidebar toggle button (mobile) --- */
.va-portal-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 40;
  padding: 0.7rem 1.1rem;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* --- Two-pane layout --- */
.va-portal-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 100%;
}

.va-portal-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1rem;
  position: sticky;
  top: 3rem;
  height: calc(100vh - 3rem);
  overflow-y: auto;
}

.va-portal-sidebar-course {
  margin: 0 0 1rem 0;
  font-size: 1.05rem;
}
.va-portal-sidebar-course a {
  color: var(--gold);
  font-weight: 700;
}

.va-portal-sidebar-group { margin-bottom: 1rem; }
.va-portal-sidebar-group h3 {
  margin: 0 0 0.35rem 0;
  color: var(--fg-muted);
  font-size: 0.72rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.va-portal-sidebar-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.va-portal-sidebar-group li { margin: 0.15rem 0; }
.va-portal-sidebar-group a {
  display: block;
  padding: 0.2rem 0.45rem;
  font-size: 0.82rem;
  color: var(--fg);
  border-left: 2px solid transparent;
  border-radius: 0 2px 2px 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.va-portal-sidebar-group a:hover {
  background: var(--bg-deep);
  text-decoration: none;
  color: var(--gold);
}
.va-portal-sidebar-group a.active {
  background: rgba(251,191,36,0.08);
  border-left-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* --- Main content area --- */
.va-portal-main {
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  max-width: 56rem;
  margin: 0;
}
.va-portal-main-wide {
  max-width: none;
}
.va-portal-page-title {
  margin: 0 0 0.4rem 0;
  color: var(--gold);
  font-size: 1.7rem;
  line-height: 1.25;
}
.va-portal-page-meta {
  margin: 0 0 1.4rem 0;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.va-portal-lead {
  font-size: 1.05rem;
  color: var(--fg);
  margin: 0.8rem 0 1.2rem 0;
}
.va-portal-content { font-size: 0.97rem; }
.va-portal-content h1, .va-portal-content h2 {
  color: var(--green); margin-top: 1.8rem; line-height: 1.3;
}
.va-portal-content h3, .va-portal-content h4 {
  color: var(--blue); margin-top: 1.4rem; line-height: 1.3;
}
.va-portal-content h2 { font-size: 1.35rem; }
.va-portal-content h3 { font-size: 1.1rem; }
.va-portal-content h4 { font-size: 1rem; }
.va-portal-content p { margin: 0.8rem 0; }
.va-portal-content a { color: var(--green); }
.va-portal-content a:hover { color: var(--gold); }
.va-portal-content ul, .va-portal-content ol { margin: 0.6rem 0 0.6rem 1.5rem; }
.va-portal-content li { margin: 0.2rem 0; }
.va-portal-content code {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
  color: var(--gold);
  font-size: 0.9em;
}
.va-portal-content pre {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.7rem 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
.va-portal-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--fg);
}
.va-portal-content blockquote {
  border-left: 3px solid var(--gold);
  background: rgba(251,191,36,0.04);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--fg);
}
.va-portal-content table {
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
  width: 100%;
}
.va-portal-content th, .va-portal-content td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.65rem;
  text-align: left;
}
.va-portal-content th {
  background: var(--bg-card);
  color: var(--green);
  font-weight: 600;
}
.va-portal-content tr:nth-child(2n) td { background: rgba(255,255,255,0.015); }
.va-portal-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.6rem 0;
}
.va-portal-content img { max-width: 100%; height: auto; }

/* --- Pygments syntax highlight bridge --- */
.codehilite .k, .codehilite .kd, .codehilite .kn { color: var(--gold); }
.codehilite .s, .codehilite .s1, .codehilite .s2 { color: var(--green); }
.codehilite .c, .codehilite .c1, .codehilite .cm { color: var(--fg-faint); font-style: italic; }
.codehilite .n, .codehilite .na, .codehilite .nv { color: var(--fg); }
.codehilite .o { color: var(--blue); }
.codehilite .mi, .codehilite .mf, .codehilite .mh { color: var(--blue); }
.codehilite .nf, .codehilite .nc { color: var(--blue); }

/* --- Interactive-embed block --- */
.vca-interactive-embed {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  margin: 1.2rem 0;
  overflow: hidden;
}
.vca-interactive-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.8rem;
  background: rgba(251,191,36,0.06);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.vca-interactive-label { color: var(--gold); font-weight: 600; }
.vca-interactive-open { color: var(--green); font-size: 0.78rem; }
.vca-interactive-frame {
  display: block;
  width: 100%;
  height: 640px;
  border: none;
  background: var(--bg);
}

/* --- Portal-root catalog grid --- */
.va-portal-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0;
}
.va-portal-course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  color: var(--fg);
  transition: border-color 200ms ease, background 200ms ease;
}
.va-portal-course-card:hover {
  border-color: var(--gold);
  background: var(--bg-deep);
  text-decoration: none;
}
.va-portal-course-card h2 {
  margin: 0 0 0.4rem 0;
  color: var(--gold);
  font-size: 1.15rem;
}
.va-portal-course-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* --- CTA buttons (course landing) --- */
.va-portal-cta {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  background: var(--green);
  color: var(--bg);
  border-radius: 4px;
  font-weight: 600;
  margin: 0.5rem 0 1.2rem 0;
}
.va-portal-cta:hover { background: var(--gold); text-decoration: none; color: var(--bg); }

.va-portal-section { margin: 1.4rem 0; }
.va-portal-section h2 {
  color: var(--green);
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  margin-bottom: 0.5rem;
}
.va-portal-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.va-portal-section li {
  padding: 0.2rem 0;
  border-bottom: 1px dashed var(--border);
}
.va-portal-section li:last-child { border-bottom: none; }
.va-portal-section li a { color: var(--green); }

/* --- Footer --- */
.va-portal-footer {
  margin-top: 3rem;
  padding: 1.4rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.78rem;
  color: var(--fg-muted);
}
.va-portal-footer p { margin: 0.3rem 0; }
.va-portal-footer a { color: var(--green); }

/* --- Responsive: sidebar drawer on narrow screens --- */
@media (max-width: 820px) {
  .va-portal-layout {
    grid-template-columns: 1fr;
  }
  .va-portal-sidebar {
    position: fixed;
    top: 3rem;
    left: -100%;
    width: 84vw;
    max-width: var(--sidebar-w);
    height: calc(100vh - 3rem);
    z-index: 35;
    border-right: 1px solid var(--gold);
    transition: left 220ms ease;
  }
  body.sidebar-open .va-portal-sidebar { left: 0; }
  .va-portal-sidebar-toggle { display: inline-block; }
  .va-portal-main { padding: 1rem; }
  .vca-interactive-frame { height: 520px; }
}
