/* =========================================================
   Cluster Wiki - Responsive / Fluid Layout
   ========================================================= */

:root{
  --sidebar-width:clamp(250px, 21vw, 320px);
  --content-max:1600px;
  --page-padding:clamp(18px, 4vw, 64px);
  --doc-padding:clamp(22px, 3vw, 48px);

  --bg:#f7f8fa;
  --panel:#fff;
  --text:#20242a;
  --muted:#68717d;
  --line:#dfe3e8;
  --accent:#2f6f9f;
  --accent-soft:#eaf2f8;
  --code:#20252b;
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  min-width:320px;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  line-height:1.65;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--sidebar-width);
  overflow-y:auto;
  background:#20262d;
  color:#dbe1e7;
  border-right:1px solid #343b43;
  z-index:100;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:22px 20px;
  border-bottom:1px solid #343b43;
}

.brand-mark{
  display:grid;
  place-items:center;
  flex:0 0 42px;
  width:42px;
  height:42px;
  border-radius:6px;
  background:#dce8f0;
  color:#203544;
  font-size:12px;
  font-weight:800;
}

.brand strong{
  display:block;
  color:#fff;
}

.brand span{
  display:block;
  color:#9da8b3;
  font-size:11px;
}

.language-switcher{
  display:flex;
  gap:7px;
  padding:13px 20px;
  border-bottom:1px solid #343b43;
  font-size:11px;
}

.language-switcher a{
  color:#aeb8c1;
  text-decoration:none;
  font-weight:700;
}

.language-switcher a.active,
.language-switcher a:hover{
  color:#fff;
}

.search-box{
  padding:15px 16px 8px;
}

.search-box input{
  width:100%;
  min-width:0;
  border:1px solid #414952;
  border-radius:5px;
  background:#171c21;
  color:#fff;
  padding:10px 12px;
  outline:0;
}

nav{
  padding:4px 10px 30px;
}

.nav-title{
  color:#8e9aa6;
  font-size:10px;
  letter-spacing:.12em;
  font-weight:700;
  padding:16px 10px 7px;
}

nav a{
  display:block;
  color:#c8d0d8;
  text-decoration:none;
  font-size:13px;
  padding:6px 10px;
  border-radius:4px;
}

nav a:hover,
nav a.current{
  color:#fff;
  background:#303941;
}

.cluster-menu{
  margin-top:12px;
}

.cluster-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:calc(100% - 8px);
  margin:18px 4px 7px;
  padding:9px 10px;
  color:#fff;
  background:#303941;
  border:0;
  border-left:4px solid #8fb5cf;
  border-top:1px solid #46515b;
  border-bottom:1px solid #46515b;
  border-radius:4px;
  font:inherit;
  font-size:13px;
  font-weight:800;
  letter-spacing:.12em;
  line-height:1.2;
  text-align:left;
  cursor:pointer;
}

.cluster-title:hover,
.cluster-title:focus-visible,
.section-toggle:hover,
.section-toggle:focus-visible{
  background:#3a4650;
  outline:2px solid #8fb5cf;
  outline-offset:1px;
}

.nav-chevron{flex:0 0 auto;margin-left:10px;font-size:15px;line-height:1;}
.cluster-items[hidden],.slurm-items[hidden]{display:none!important;}
.cluster-items{padding-bottom:3px;}

.cluster-menu a{
  padding-left:22px;
}

.sidebar-footer{
  position:sticky;
  bottom:0;
  padding:13px 18px;
  background:#20262d;
  color:#7e8994;
  font-size:11px;
  border-top:1px solid #343b43;
}

/* =========================================================
   MAIN AREA
   ========================================================= */

.content{
  margin-left:var(--sidebar-width);
  width:calc(100% - var(--sidebar-width));
  min-height:100vh;
}

.topbar{
  width:100%;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:30px;
  padding:clamp(28px, 4vw, 52px) var(--page-padding) clamp(22px, 3vw, 32px);
  border-bottom:1px solid var(--line);
  background:var(--panel);
}

.topbar > div:first-child{
  min-width:0;
}

.eyebrow{
  color:var(--accent);
  font-size:11px;
  font-weight:800;
  letter-spacing:.13em;
}

.topbar h1{
  margin:4px 0 0;
  font-size:clamp(23px, 2.2vw, 32px);
  font-weight:650;
  line-height:1.25;
  overflow-wrap:anywhere;
}

.status{
  flex:0 0 auto;
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}

.status span{
  display:inline-block;
  width:7px;
  height:7px;
  background:#5c9b69;
  border-radius:50%;
  margin-right:6px;
}

/* =========================================================
   DOCUMENT
   ========================================================= */

.doc-section{
  width:min(calc(100% - (var(--page-padding) * 2)), var(--content-max));
  margin:clamp(22px, 3vw, 40px) auto;
  padding:var(--doc-padding);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:7px;
  overflow:hidden;
}

.markdown-content{
  min-width:0;
}

.markdown-content h1{
  margin:0 0 18px;
  font-size:clamp(26px, 2.4vw, 34px);
  line-height:1.25;
}

.markdown-content h2{
  margin:clamp(24px, 3vw, 34px) 0 12px;
  padding-bottom:7px;
  border-bottom:1px solid var(--line);
  font-size:clamp(21px, 1.8vw, 27px);
  line-height:1.3;
}

.markdown-content h3{
  margin:24px 0 9px;
  font-size:clamp(18px, 1.5vw, 21px);
}

.markdown-content p{
  max-width:100%;
  color:#4f5862;
}

.markdown-content a{
  color:var(--accent);
}

.markdown-content ul,
.markdown-content ol{
  padding-left:1.5rem;
}

.markdown-content img{
  display:block;
  max-width:100%;
  height:auto;
}

/* =========================================================
   TABLES / CODE
   ========================================================= */

.markdown-content table{
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  border-collapse:collapse;
  margin:20px 0;
  font-size:14px;
  -webkit-overflow-scrolling:touch;
}

.markdown-content th,
.markdown-content td{
  min-width:100px;
  border:1px solid var(--line);
  padding:9px 11px;
  text-align:left;
}

.markdown-content th{
  background:#f1f4f6;
}

pre{
  width:100%;
  max-width:100%;
  margin:18px 0;
  padding:17px 20px;
  overflow-x:auto;
  background:var(--code);
  color:#e7edf2;
  border-radius:5px;
  font:13px/1.55 "SFMono-Regular",Consolas,"Liberation Mono",monospace;
  -webkit-overflow-scrolling:touch;
}

code{
  font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
  background:#eef1f3;
  padding:2px 5px;
  border-radius:3px;
  font-size:.9em;
  overflow-wrap:anywhere;
}

pre code{
  background:transparent;
  padding:0;
  overflow-wrap:normal;
}

blockquote{
  margin:20px 0;
  padding:13px 16px;
  border-left:4px solid #7896a9;
  background:#f0f4f7;
  color:#515c66;
}

footer{
  width:min(calc(100% - (var(--page-padding) * 2)), var(--content-max));
  margin:70px auto 30px;
  color:#818a94;
  font-size:12px;
}

/* =========================================================
   MOBILE MENU
   ========================================================= */

.menu-toggle{
  display:none;
  position:fixed;
  top:12px;
  left:12px;
  z-index:200;
  border:0;
  border-radius:5px;
  padding:9px 11px;
  background:#20262d;
  color:#fff;
  cursor:pointer;
}

.hidden-by-search{
  display:none!important;
}

/* =========================================================
   LARGE SCREENS
   ========================================================= */

@media (min-width:1600px){
  .markdown-content{
    max-width:1100px;
  }
}

/* =========================================================
   TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width:1100px){
  :root{
    --sidebar-width:250px;
    --page-padding:clamp(18px, 3vw, 35px);
  }

  .topbar{
    gap:20px;
  }

  .doc-section{
    width:calc(100% - (var(--page-padding) * 2));
  }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width:900px){
  :root{
    --page-padding:20px;
  }

  .sidebar{
    width:min(300px, 88vw);
    transform:translateX(-100%);
    transition:transform .2s ease;
    box-shadow:10px 0 30px rgba(0,0,0,.18);
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .menu-toggle{
    display:block;
  }

  .content{
    width:100%;
    margin-left:0;
  }

  .topbar{
    padding-top:58px;
  }

  .doc-section{
    width:calc(100% - 40px);
  }

  footer{
    width:calc(100% - 40px);
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width:600px){
  :root{
    --page-padding:14px;
    --doc-padding:20px;
  }

  .topbar{
    display:block;
    padding:58px 14px 20px;
  }

  .topbar h1{
    font-size:24px;
  }

  .status{
    display:none;
  }

  .doc-section{
    width:calc(100% - 28px);
    margin:18px auto;
    border-radius:6px;
  }

  .markdown-content h1{
    font-size:26px;
  }

  .markdown-content h2{
    font-size:21px;
  }

  .markdown-content h3{
    font-size:18px;
  }

  pre{
    margin-left:-4px;
    width:calc(100% + 8px);
    border-radius:4px;
    padding:14px;
    font-size:12px;
  }

  .markdown-content table{
    font-size:13px;
  }

  footer{
    width:calc(100% - 28px);
    margin:45px auto 25px;
  }
}

/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width:380px){
  .doc-section{
    padding:17px;
  }

  .topbar h1{
    font-size:22px;
  }

  .brand{
    padding-left:16px;
    padding-right:16px;
  }
}

/* Slurm navigation hierarchy */
.slurm-group{margin:2px 0 5px;}
.slurm-heading{display:flex;align-items:stretch;}
.slurm-heading .slurm-parent{flex:1;font-weight:700;}
.slurm-heading .slurm-parent.current{color:#fff;background:#303941;}
.section-toggle{flex:0 0 32px;border:0;border-radius:4px;background:transparent;color:#b5c0ca;cursor:pointer;}
.section-toggle .nav-chevron{margin:0;}
.slurm-group .slurm-child{padding-left:34px;font-size:12px;color:#b5c0ca;}
.slurm-group .slurm-child.current{color:#fff;background:#303941;}




/* Configurable expandable sidebar */
.cluster-title{display:flex;align-items:center;gap:6px;}
.cluster-toggle,.slurm-toggle{display:inline-grid;place-items:center;flex:0 0 24px;width:24px;height:26px;padding:0;border:0;border-radius:4px;background:transparent;color:#dbe1e7;cursor:pointer;font-size:17px;}
.cluster-toggle:hover,.slurm-toggle:hover{background:#46515b;color:#fff;}
.toggle-arrow{display:inline-block;transition:transform .15s ease;}
.cluster-menu.is-open>.cluster-title .toggle-arrow,.slurm-group.is-open>.slurm-heading .toggle-arrow{transform:rotate(90deg);}
.cluster-content,.slurm-children{display:none;}
.cluster-menu.is-open>.cluster-content,.slurm-group.is-open>.slurm-children{display:block;}
.cluster-menu a{padding-left:22px;}
.slurm-heading{display:flex;align-items:center;gap:2px;}
.slurm-heading .slurm-parent{flex:1;min-width:0;font-weight:700;}
.slurm-heading .slurm-toggle{margin-right:4px;}
.slurm-group .slurm-child{padding-left:34px;font-size:12px;color:#b5c0ca;}
.slurm-group .slurm-child.current{color:#fff;background:#303941;}
.hidden-by-search{display:none!important;}
.rag-sidebar-link{display:flex;align-items:center;gap:10px;margin:12px 12px 18px;padding:11px 10px;border:1px solid #42617a;border-radius:7px;background:#263746;color:#f4f7fa;text-decoration:none;transition:background .15s,border-color .15s;}
.rag-sidebar-link:hover{background:#30485b;border-color:#6d9abb;}
.rag-sidebar-link .rag-link-icon{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex:0 0 30px;border-radius:6px;background:#dceaf4;color:#243b4c;font-size:18px;}
.rag-sidebar-link strong,.rag-sidebar-link small{display:block;}
.rag-sidebar-link strong{font-size:12px;line-height:1.4;}
.rag-sidebar-link small{margin-top:3px;color:#c0ccd6;font-size:10px;line-height:1.35;}
.rag-sidebar-link .rag-link-arrow{margin-left:auto;color:#dceaf4;font-size:17px;}
