/* cshpc/assets/css/app.css */
:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --surface: #ffffff;
  --border: #e2e8f0;
  --accent: #2563eb;

  --bg2: #f8fafc;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --surface: #0f172a;
  --border: #1f2a44;
  --accent: #60a5fa;

  --bg2: #0b1220;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

body.cshpc {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* ===== Header ===== */
.cshpc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .cshpc-header {
  background: rgba(11, 18, 32, 0.7);
}

.cshpc-header__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.cshpc-header__actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

/* Buttons */
.cshpc-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}
.cshpc-btn:hover { box-shadow: var(--shadow); }

/* Mobile menu button */
.cshpc-btn--menu {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  padding: 8px 10px;
  border-radius: 12px;
  display: none; /* enabled in media */
}
.cshpc-btn--menu:hover { box-shadow: var(--shadow); }

/* ===== Layout grid ===== */
/* Base grid (default 3 columns) */
.cshpc-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 260px;
  gap: 18px;
}

/* 2 columns mode: Left + Main (no right column) */
body.cshpc-layout-2 .cshpc-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

/* If right column is not rendered, make sure there is no empty gap */
body.cshpc-layout-2 .cshpc-toc {
  display: none;
}

@media (max-width: 860px) {
  body.cshpc-layout-2 .cshpc-shell { grid-template-columns: 1fr; }
}

/* Sidebar / TOC sticky (desktop/tablet) */
.cshpc-sidebar,
.cshpc-toc {
  position: sticky;
  top: 84px;
  height: calc(100vh - 96px);
  overflow: auto;
}

.cshpc-sidebar__inner,
.cshpc-toc__inner {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.cshpc-sidebar__title,
.cshpc-toc__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Sidebar nav */
.cshpc-sidenav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cshpc-sidenav a {
  display: block;
  padding: 6px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.cshpc-sidenav a:hover { background: rgba(37, 99, 235, 0.10); }
.cshpc-sidenav .current-menu-item > a {
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(37, 99, 235, 0.22);
  font-weight: 800;
}

/* Main */
.cshpc-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  min-width: 0;
}

.cshpc-article__title { margin: 0 0 10px; font-size: 34px; line-height: 1.15; }
.cshpc-article__meta { color: var(--muted); font-size: 14px; }

/* Prose */
.cshpc-prose { font-size: 16px; }
.cshpc-prose h2 { margin-top: 28px; font-size: 24px; }
.cshpc-prose h3 { margin-top: 22px; font-size: 19px; }
.cshpc-prose p { color: var(--text); }

.cshpc-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
  font-size: 0.95em;
  /* padding: 2px 6px; */
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(100, 116, 139, 0.08);
}
.cshpc-prose pre {
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.06);
}
html[data-theme="dark"] .cshpc-prose pre { background: rgba(0, 0, 0, 0.25); }

/* TOC */
.cshpc-toc__nav a {
  display: block;
  padding: 5px 6px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}
.cshpc-toc__nav a:hover { color: var(--text); background: rgba(37, 99, 235, 0.10); }
.cshpc-toc__nav a.is-active { color: var(--text); background: rgba(37, 99, 235, 0.16); }

/* Footer */
.cshpc-footer { border-top: 1px solid var(--border); margin-top: 18px; }
.cshpc-footer__inner { max-width: 1320px; margin: 0 auto; padding: 16px 18px; color: var(--muted); }

/* CmdK */
.cshpc-cmdk[hidden] { display: none; }
.cshpc-cmdk__backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 100; }
.cshpc-cmdk__panel {
  position: fixed;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 101;
  overflow: hidden;
}
.cshpc-cmdk__input {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  outline: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.cshpc-cmdk__results { max-height: 420px; overflow: auto; padding: 8px; }
.cshpc-cmdk__item { padding: 10px 10px; border-radius: 14px; cursor: pointer; }
.cshpc-cmdk__item:hover { background: rgba(37,99,235,0.10); }
.cshpc-cmdk__itemTitle { font-weight: 700; }
.cshpc-cmdk__itemMeta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.cshpc-cmdk__hint { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* Branding */
.cshpc-brand { display: flex; align-items: center; gap: 14px; }
.cshpc-brand__technion img { height: 42px; width: auto; }

.cshpc-brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.cshpc-brand__faculty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.cshpc-brand__site {
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
.cshpc-brand__site:hover { text-decoration: underline; }

.cshpc-brand__mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
}

/* ===== Sidebar accordion ===== */
.cshpc-sidenav li { position: relative; }
.cshpc-sidenav li.menu-item-has-children > a { padding-right: 34px; }

.cshpc-sidenav .cshpc-navtoggle {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.cshpc-sidenav .cshpc-navtoggle:hover { box-shadow: var(--shadow); }
.cshpc-sidenav .cshpc-navtoggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}
.cshpc-sidenav li.is-open > .cshpc-navtoggle svg { transform: rotate(90deg); }

.cshpc-sidenav li.menu-item-has-children > ul {
  display: none;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.cshpc-sidenav li.is-open > ul { display: block; }

/* ===== Search overlay ===== */
.cshpc-searchbtn{
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: min(520px, 52vw);
  justify-content: space-between;
}
.cshpc-searchbtn:hover{ box-shadow: var(--shadow); }
.cshpc-searchbtn__text{ opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cshpc-searchbtn__kbd{
  font-size: 12px;
  opacity: 0.7;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px 8px;
}

.cshpc-search[hidden]{ display:none; }
.cshpc-search__backdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
}
.cshpc-search__panel{
  position: fixed;
  top: 8vh; left: 50%;
  transform: translateX(-50%);
  width: min(820px, 92vw);
  max-height: 84vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 301;
  display: flex;
  flex-direction: column;
}

.cshpc-search__bar{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.cshpc-search__input{
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.cshpc-search__close{
  border: 1px solid var(--border);
  background: rgba(100,116,139,0.06);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.cshpc-search__meta{
  display:flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.cshpc-chip{
  border: 1px solid var(--border);
  background: rgba(100,116,139,0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}
.cshpc-chip.is-active{
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.28);
}

.cshpc-search__results{ padding: 10px; overflow:auto; }
.cshpc-search__hint{ padding: 18px 14px; color: var(--muted); font-size: 14px; }
.cshpc-search__item{
  display:block;
  padding: 12px 12px;
  border-radius: 14px;
  text-decoration:none;
  color: var(--text);
  border: 1px solid transparent;
}
.cshpc-search__item:hover,
.cshpc-search__item.is-selected{
  background: rgba(37,99,235,0.10);
  border-color: rgba(37,99,235,0.22);
}
.cshpc-search__title{ font-weight: 800; }
.cshpc-search__row{ display:flex; gap: 8px; margin-top: 6px; align-items:center; }
.cshpc-badge{
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(100,116,139,0.06);
  color: var(--muted);
}
.cshpc-search__date{ font-size: 12px; color: var(--muted); }

/* Code block copy */
.cshpc-prewrap { position: relative; }
.cshpc-copybtn {
  position: absolute;
  top: -14px;
  right: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cshpc-copybtn:hover { box-shadow: var(--shadow); }
.cshpc-copybtn svg { width: 14px; height: 14px; }
.cshpc-copybtn.is-copied {
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.28);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .cshpc-shell { grid-template-columns: 280px minmax(0, 1fr); }
  .cshpc-toc { display: none; }
}

@media (max-width: 860px) {
  .cshpc-shell { grid-template-columns: 1fr; }
  .cshpc-toc { display: none; }

  .cshpc-btn--menu { display: inline-flex; align-items: center; justify-content: center; }

  .cshpc-brand__faculty { display: none; }
  .cshpc-brand__site { font-size: 15px; }
  .cshpc-brand__technion img { height: 34px; }

  .cshpc-searchbtn { min-width: auto; padding: 8px 10px; }
  .cshpc-searchbtn__text { display: none; }
  .cshpc-searchbtn__kbd { display: none; }
  .cshpc-search__panel { top: 6vh; }
}

/* ===== Mobile: sidebar becomes an off-canvas drawer ===== */
@media (max-width: 860px) {
  .cshpc-sidebar-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 118;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  /* override sticky layout for mobile */
  .cshpc-sidebar{
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(360px, 92vw);
    z-index: 119;
    transform: translateX(-105%);
    transition: transform .25s ease;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cshpc-sidebar__inner{
    min-height: calc(100vh - 28px);
  }

  html.is-sidebar-open .cshpc-sidebar{
    transform: translateX(0);
  }
  html.is-sidebar-open .cshpc-sidebar-backdrop{
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===== Top nav is not used ===== */
.cshpc-topnav { display: none; }

/* Mobile drawer header inside sidebar */
.cshpc-sidebar__mhead { display: none; }

@media (max-width: 860px) {
  .cshpc-sidebar__mhead{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }
  .cshpc-sidebar__mtitle{
    font-weight: 900;
    font-size: 14px;
  }

  /* Hide desktop title on mobile drawer */
  .cshpc-sidebar__title--desktop { display: none; }

  /* IMPORTANT: override desktop sticky sizing */
  .cshpc-sidebar{
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: min(360px, 92vw);
    z-index: 119;
    transform: translateX(-105%);
    transition: transform .25s ease;
    overflow: hidden !important; /* inner will scroll */
  }

  .cshpc-sidebar__inner{
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.cshpc-card{
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.cshpc-card__title{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}
.cshpc-annlist{ display: grid; gap: 10px; }
.cshpc-muted{ color: var(--muted); font-size: 13px; }

/* ===== Link styles (HPC theme) ===== */

/* Base link defaults (outside menus/buttons) */
.cshpc-main a,
.cshpc-toc a {
  color: var(--accent);
}

/* Prose links: classy underline + subtle highlight */
.cshpc-prose a:not(.cshpc-btn):not(.cshpc-search__item):not(.cshpc-annitem) {
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 0.10em;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(37, 99, 235, 0.35);
  border-radius: 10px;
  padding: 0.05em 0.18em;
  transition: background 0.15s ease, color 0.15s ease, text-decoration-color 0.15s ease, box-shadow 0.15s ease;
}

.cshpc-prose a:not(.cshpc-btn):not(.cshpc-search__item):not(.cshpc-annitem):hover {
  background: rgba(37, 99, 235, 0.10);
  text-decoration-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

.cshpc-prose a:not(.cshpc-btn):not(.cshpc-search__item):not(.cshpc-annitem):active {
  background: rgba(37, 99, 235, 0.16);
}

.cshpc-prose a:not(.cshpc-btn):not(.cshpc-search__item):not(.cshpc-annitem):visited {
  text-decoration-color: rgba(100, 116, 139, 0.45);
}

/* Keyboard accessibility */
.cshpc a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Optional: nicer external-link hint in prose (only if you add rel="noopener" target="_blank") */
.cshpc-prose a[target="_blank"]:not(.cshpc-btn):not(.cshpc-annitem)::after {
  content: "↗";
  font-size: 0.95em;
  margin-left: 0.22em;
  opacity: 0.55;
}

.cshpc-mailbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 14px;
  border-radius: 12px;

  border: 1px solid var(--border);
  background: rgba(37,99,235,0.10);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.cshpc-mailbtn::before {
  content: "✉";
}

.cshpc-mailbtn:hover {
  box-shadow: var(--shadow);
}





/* ===== Header page actions ===== */
.cshpc-pageactions{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cshpc-pageactions__btn{
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}

.cshpc-pageactions__btn:hover{
  box-shadow: var(--shadow);
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.22);
}

.cshpc-pageactions__btn:active{
  transform: translateY(1px);
}

.cshpc-pageactions__btn svg{
  width: 18px;
  height: 18px;
}

@media (max-width: 860px){
  .cshpc-pageactions{
    gap: 6px;
  }

  .cshpc-pageactions__btn{
    width: 40px;
    height: 40px;
  }
}


/* ===== Print / PDF ===== */
@media print {
  .cshpc-header,
  .cshpc-sidebar,
  .cshpc-toc,
  .cshpc-footer,
  .cshpc-search,
  .cshpc-pageactions,
  .cshpc-btn,
  .cshpc-copybtn {
    display: none !important;
  }

  .cshpc-shell {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .cshpc-main {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .cshpc-article__title {
    font-size: 28px !important;
  }

  .cshpc-prose img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  .cshpc-prose a {
    color: #000 !important;
    text-decoration: underline !important;
  }
}


/* ===== Cluster cards ===== */
.cshpc-clusters-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 8px;
}

.cshpc-cluster-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.cshpc-cluster-card__title{
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

.cshpc-cluster-card__text{
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.cshpc-cluster-card__link{
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  color: var(--accent);
}

.cshpc-cluster-card__link::after{
  content: "→";
  opacity: 0.75;
}

.cshpc-cluster-card__link:hover{
  text-decoration: underline;
}

@media (max-width: 1100px){
  .cshpc-clusters-grid{
    grid-template-columns: 1fr;
  }
}

/* ===== Callout / Note blocks ===== */
.cshpc-callout{
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 18px 0;
}

.cshpc-callout__title{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  background: rgba(37,99,235,0.12);
  color: var(--text);
}

.cshpc-callout__title::before{
  content: "i";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: var(--accent);
  flex: 0 0 18px;
}

.cshpc-callout__content{
  padding: 16px 18px;
}

.cshpc-callout__content p{
  margin: 0 0 12px;
}

.cshpc-callout__content p:last-child{
  margin-bottom: 0;
}

/* Note */
.cshpc-callout--note{
  border-left-color: #2563eb;
}
.cshpc-callout--note .cshpc-callout__title{
  background: rgba(37,99,235,0.12);
}

/* Warning */
.cshpc-callout--warning{
  border-left-color: #d97706;
}
.cshpc-callout--warning .cshpc-callout__title{
  background: rgba(217,119,6,0.12);
}
.cshpc-callout--warning .cshpc-callout__title::before{
  content: "!";
  background: #d97706;
}

/* Important */
.cshpc-callout--important{
  border-left-color: #dc2626;
}
.cshpc-callout--important .cshpc-callout__title{
  background: rgba(220,38,38,0.10);
}
.cshpc-callout--important .cshpc-callout__title::before{
  content: "!";
  background: #dc2626;
}

/* Access */
.cshpc-callout--access{
  border-left-color: #0f766e;
}
.cshpc-callout--access .cshpc-callout__title{
  background: rgba(15,118,110,0.10);
}
.cshpc-callout--access .cshpc-callout__title::before{
  content: "↗";
  background: #0f766e;
}

/* Mobile */
@media (max-width: 860px){
  .cshpc-callout__title{
    padding: 10px 14px;
    font-size: 15px;
  }

  .cshpc-callout__content{
    padding: 14px 14px;
  }
}


/* ===== Tables ===== */
.cshpc-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0 24px;
  font-size: 15px;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cshpc-prose thead th {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
  font-weight: 800;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.cshpc-prose tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

.cshpc-prose tbody tr:last-child td {
  border-bottom: 0;
}

.cshpc-prose tbody tr:nth-child(even) td {
  background: rgba(100, 116, 139, 0.04);
}

.cshpc-prose tbody tr:hover td {
  background: rgba(37, 99, 235, 0.06);
}

.cshpc-prose th code,
.cshpc-prose td code {
  white-space: nowrap;
}

/* Better spacing for first/last cells */
.cshpc-prose th:first-child,
.cshpc-prose td:first-child {
  padding-left: 18px;
}

.cshpc-prose th:last-child,
.cshpc-prose td:last-child {
  padding-right: 18px;
}

/* Table wrapper for horizontal scroll */
.cshpc-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0 24px;
  border-radius: 16px;
}

.cshpc-table-wrap table {
  margin: 0;
  min-width: 640px;
}

/* Optional compact table */
.cshpc-prose table.cshpc-table--compact thead th,
.cshpc-prose table.cshpc-table--compact tbody td {
  padding: 10px 12px;
  font-size: 14px;
}

/* Optional centered cells */
.cshpc-prose table.cshpc-table--center th,
.cshpc-prose table.cshpc-table--center td {
  text-align: center;
}

/* Optional subtle caption */
.cshpc-prose table caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

/* Mobile */
@media (max-width: 860px) {
  .cshpc-prose table {
    font-size: 14px;
    border-radius: 14px;
  }

  .cshpc-prose thead th,
  .cshpc-prose tbody td {
    padding: 12px 13px;
  }

  .cshpc-table-wrap {
    margin: 16px 0 20px;
  }
}

/* back-to-top icon */
#back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 9999;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(0) scale(1.08);
}

#back-to-top:focus {
    outline: 2px solid #94a3b8;
    outline-offset: 3px;
}

#back-to-top i {
    pointer-events: none;
}

@media (max-width: 768px) {
    #back-to-top {
        right: 16px;
        bottom: 16px;
    }
}







/* ===== Dynamic cluster links block ===== */
.cshpc-cluster-links{
  margin: 24px 0;
}

.cshpc-cluster-links__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cshpc-cluster-links__title{
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.cshpc-cluster-links__overview{
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
}

.cshpc-cluster-links__overview:hover{
  text-decoration: underline;
}

.cshpc-cluster-links__grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cshpc-cluster-links__item{
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.cshpc-cluster-links__item:hover{
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.22);
}

.cshpc-cluster-links__item.is-current{
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.28);
}

.cshpc-cluster-links__itemTitle{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  line-height: 1.4;
  padding: 10px;
}

.cshpc-cluster-links__itemTitle::after{
  content: "→";
  opacity: 0.65;
}

@media (max-width: 860px){
  .cshpc-cluster-links__head{
    flex-direction: column;
    align-items: flex-start;
  }

  .cshpc-cluster-links__grid{
    grid-template-columns: 1fr;
  }

  .cshpc-cluster-links__title{
    font-size: 24px;
  }
}

.cshpc-newscard__bottom {
    padding: 10px 0;
}

/* Announcements grid (top) */
.cshpc-anngrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

/* Responsive */
@media (max-width: 1100px) {
  .cshpc-anngrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .cshpc-anngrid {
    grid-template-columns: 1fr;
  }
}

/* Card */
.cshpc-anncard {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.cshpc-anncard:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.cshpc-anncard__title {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
}

.cshpc-anncard__meta {
  font-size: 12px;
  color: var(--muted);
}

.cshpc-anncard__link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.cshpc-anncard__link:hover {
  text-decoration: underline;
}

/* ===== Announcements: right column list ===== */
.cshpc-annpanel .cshpc-card__title {
  margin-bottom: 12px;
}

.cshpc-annlist {
  display: grid;
  gap: 10px;
}

.cshpc-annitem {
  display: block;
  padding: 12px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(100,116,139,0.05);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.cshpc-annitem:hover {
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.24);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.cshpc-annitem.is-pinned {
  border-color: rgba(37,99,235,0.30);
  background: rgba(37,99,235,0.06);
}

.cshpc-annitem__title {
  font-weight: 800;
  line-height: 1.35;
}

.cshpc-annitem__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ===== Announcements: top cards for 2-column layout ===== */
.cshpc-anngrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.cshpc-anncard {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.cshpc-anncard:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  background: rgba(37,99,235,0.05);
  border-color: rgba(37,99,235,0.24);
}

.cshpc-anncard.is-pinned {
  border-color: rgba(37,99,235,0.30);
  background: rgba(37,99,235,0.06);
}

.cshpc-anncard__title {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
}

.cshpc-anncard__meta {
  font-size: 12px;
  color: var(--muted);
}

.cshpc-anncard__link {
  margin-top: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.cshpc-anncard__link:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .cshpc-anngrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cshpc-anngrid {
    grid-template-columns: 1fr;
  }
}




/* ===== FAQ ===== */
.cshpc-faq {
  margin: 24px 0;
}

.cshpc-faq__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.cshpc-faq__title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.cshpc-faq__search {
  min-width: 260px;
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.cshpc-faq__groups {
  display: grid;
  gap: 22px;
}

.cshpc-faq__groupTitle {
  margin: 0 0 10px;
  font-size: 20px;
}

.cshpc-faq__items {
  display: grid;
  gap: 10px;
}

.cshpc-faq__item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.cshpc-faq__question {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 800;
  position: relative;
}

.cshpc-faq__question::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  line-height: 1;
  opacity: 0.55;
}

.cshpc-faq__item.is-open .cshpc-faq__question::after {
  content: "−";
}

.cshpc-faq__answer {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
  background: rgba(100,116,139,0.04);
}

.cshpc-faq__item.is-open .cshpc-faq__answer {
  display: block;
}

@media (max-width: 860px) {
  .cshpc-faq__title {
    font-size: 24px;
  }

  .cshpc-faq__question {
    padding: 14px 16px;
    font-size: 15px;
  }

  .cshpc-faq__answer {
    padding: 0 16px 16px;
  }
}

.cshpc-note {
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.cshpc-note--danger {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
}

.cshpc-note--danger strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}
[data-toc-scope] h2,
[data-toc-scope] h3 {
    scroll-margin-top: 80px;
}

/* Internal Service Redirect page — no sidebar */
body.page-template-page-internal-service-redirect .cshpc-shell {
    grid-template-columns: minmax(0, 1fr);
}

body.page-template-page-internal-service-redirect .cshpc-shell > main {
    grid-column: 1 / -1;
    width: 100%;
}