/* =========================================================================
 * Sections + auto-generated menu
 * ========================================================================= */

/* ---------- menu (top-tab strip beneath the header) ---------- */

.section-menu {
  position: sticky;
  top: 84px;          /* sits beneath the sticky header + hanging drawer tabs */
  z-index: 90;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 24px;
  background: var(--u-bg-elev);
  border-bottom: 1px solid var(--u-border);
  overflow-x: auto;
  scrollbar-width: thin;
}
.section-menu::-webkit-scrollbar { height: 4px; }
.section-menu::-webkit-scrollbar-thumb { background: var(--u-border-accent); border-radius: 2px; }

.section-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: var(--u-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--u-text-dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.section-menu-item:hover { color: var(--u-text); }
.section-menu-item.is-active {
  color: var(--u-accent);
  border-bottom-color: var(--u-accent);
}
.section-menu-icon {
  font-size: 13px;
  line-height: 1;
  opacity: 0.85;
}

/* ---------- section ---------- */

.section {
  /* Offset so smooth-scroll doesn't hide the head under the sticky menu. */
  scroll-margin-top: 130px;   /* clear sticky header + drawer tabs + section menu */
  padding: 28px 0 12px 0;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--u-border);
}
.section-icon {
  font-size: 18px;
  line-height: 1;
  color: var(--u-accent);
}
.section-name {
  font-family: var(--u-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--u-text);
}

/* ---------- body layouts ---------- */

.section-body--grid {
  display: grid;
  grid-template-columns: repeat(var(--section-cols, 4), minmax(0, 1fr));
  gap: 12px;
}

.section-body--stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-body--flex {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-body--single {
  display: block;
}

/* Item-provided code path (code/style/script panes on the item) renders
   as a plain block container so the item's own CSS behaves predictably. */
.section-body--item-code {
  display: block;
}

/* ---------- empty-state placeholder ---------- */

.section-empty {
  padding: 24px 28px;
  border: 1px dashed var(--u-border-accent);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  text-align: center;
}
.section-empty-title {
  font-family: var(--u-mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--u-accent);
  margin-bottom: 4px;
}
.section-empty-hint {
  font-size: 12px;
  color: var(--u-text-dim);
  line-height: 1.5;
}

/* (gauge / gauge-stub styling lives in css/gauges.css) */

/* ---------- mobile ---------- */

@media (max-width: 768px) {
  .section-menu { padding: 0 12px; top: 120px; }
  .section-menu-item { padding: 9px 12px; font-size: 10px; letter-spacing: 1px; }
  .section { padding: 20px 0 8px 0; scroll-margin-top: 170px; }
  .section-body--grid { grid-template-columns: repeat(min(var(--section-cols, 4), 2), minmax(0, 1fr)); }
}
