/* ==========================================================================
   Community HPC section only. Loaded by templates/layout_hpc.html.
   Nothing here affects the rest of the site, so edit freely.
   ========================================================================== */

/* ---------- Layout: content left, sticky stream top-right ---------- */
.hpc-row {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.hpc-row #main {
  flex: 1 1 auto;
  min-width: 0;            /* lets long <pre> blocks scroll instead of stretching */
}

.hpc-stream {
  flex: 0 0 300px;         /* stream width — change this to resize it */
  position: sticky;
  top: 12px;               /* how far from the top it parks while scrolling */
  margin-top: 20px;
}

.hpc-stream img {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--border);
  border-radius: 4px;
}

.hpc-stream-cap {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

.hpc-nav-active { border-bottom-color: var(--accent) !important; }

/* ---------- Left-hand section nav ---------- */
.hpc-side {
  flex: 0 0 170px;         /* sidebar width */
  position: sticky;
  top: 12px;
  margin-top: 20px;
}

.hpc-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.hpc-side li { margin: 0; }

.hpc-side a {
  display: block;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.35;
}

.hpc-side a:hover { color: var(--text); }

.hpc-side a.active {
  color: var(--text);
  border-left-color: var(--accent);
  font-weight: bold;
}

/* ---------- Sections ---------- */
.hpc-section {
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.hpc-section:last-of-type { border-bottom: none; }

.hpc-section h2 {
  font-size: 1.25rem;
  font-weight: normal;
  letter-spacing: .08em;
  margin: 0 0 4px 0;
}

.hpc-section h3 {
  font-size: 1rem;
  font-weight: bold;
  margin: 20px 0 6px 0;
}

.hpc-lede {
  color: var(--muted);
  margin: 0 0 16px 0;
  font-size: 14px;
}

.hpc-section p,
.hpc-section li { line-height: 1.65; }

.hpc-toc {
  margin: 8px 0 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 14px;
}
.hpc-toc a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); }
.hpc-toc a:hover { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Code blocks ---------- */
.hpc-section pre {
  background: #f7f7f7;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 10px 0;
}
.hpc-section code { font-family: 'Courier New', Courier, monospace; }
.hpc-section p code,
.hpc-section li code,
.hpc-section td code {
  background: #f2f2f2;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 13px;
}

/* ---------- Tables (specs, queue, nodes) ---------- */
.hpc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0;
}
.hpc-table th,
.hpc-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.hpc-table th {
  font-weight: bold;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.hpc-table tbody tr:hover { background: #fafafa; }
.hpc-table .num { text-align: right; }

.hpc-state-idle  { color: #2e7d32; }
.hpc-state-alloc { color: #ef6c00; }
.hpc-state-down  { color: #c62828; }

/* ---------- Small status / meta bits ---------- */
.hpc-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0 0;
}

.hpc-note {
  border-left: 3px solid var(--border);
  padding: 8px 0 8px 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.hpc-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0;
}

/* ---------- Project list ---------- */
.hpc-project {
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}
.hpc-project:last-child { border-bottom: none; }
.hpc-project h3 { margin: 0 0 4px 0; }
.hpc-project .hpc-project-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.hpc-project p { margin: 0; font-size: 14px; }

/* ---------- Grafana embed ---------- */
.hpc-embed {
  width: 100%;
  height: 700px;          /* matches the cluster dashboard's 20 grid rows */
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fafafa;
}

/* ---------- Form ---------- */
.hpc-form { margin-top: 14px; max-width: 620px; }

.hpc-field { margin-bottom: 14px; }

.hpc-field label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.hpc-field input[type="text"],
.hpc-field input[type="email"],
.hpc-field textarea,
.hpc-field select {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--card-bg);
  color: var(--text);
}

.hpc-field input:focus,
.hpc-field textarea:focus,
.hpc-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.hpc-field textarea { min-height: 110px; resize: vertical; }

.hpc-field .hpc-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }

.hpc-err { color: #c62828; font-size: 12px; margin-top: 3px; }

.hpc-btn {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.hpc-btn:hover { opacity: .85; }

/* honeypot — hidden from humans, catches dumb bots */
.hpc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.hpc-flash {
  border: 1px solid #2e7d32;
  border-left: 3px solid #2e7d32;
  background: #f2f9f2;
  color: #1b5e20;
  padding: 10px 14px;
  border-radius: 3px;
  margin: 14px 0;
  font-size: 14px;
}
.hpc-flash.err { border-color: #c62828; border-left-color: #c62828; background: #fdf3f3; color: #b71c1c; }

/* ---------- Donate ---------- */
.hpc-donate-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.hpc-donate-links a {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.hpc-donate-links a:hover { border-color: var(--accent); }

/* ---------- Narrower desktop: shrink the stream before wrapping ---------- */
@media (max-width: 1100px) {
  .hpc-stream { flex-basis: 230px; }
  .hpc-row { gap: 20px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .hpc-row { display: block; }

  /* Section nav becomes a horizontal scrolling strip above the content */
  .hpc-side {
    position: static;
    margin: 0 0 16px 0;
    border-bottom: 1px solid var(--border);
  }
  .hpc-side ul {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border-left: none;
    padding-bottom: 2px;
  }
  .hpc-side a {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    margin-left: 0;
    padding: 6px 10px;
  }
  .hpc-side a.active { border-left: none; border-bottom-color: var(--accent); }

  .hpc-stream {
    position: static;
    width: 260px;
    max-width: 100%;
    margin: 0 0 18px auto;
  }
  .hpc-stream-cap { text-align: right; }
  .hpc-embed { height: 460px; }
}
