/* Home page layout: graph and searchable node list side by side.
   Layout only — colors, chips, cards and toolbar skin live in synthwave.css. */

/* minmax(0,·) — a plain 1fr track sizes to min-content, so a wide canvas
   inside either panel can push the whole page sideways on phones. */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 100%;
}

/* Graph panel --------------------------------------------------------------- */

.home-layout .global-graph-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  /* blog-adapter.css centers .global-graph-panel (max-width: 85ch, auto
     margins) for the old blog index. Inside this grid, auto margins turn off
     track-stretch — Firefox shrink-wraps the panel to its legend row, Chrome
     merely caps it — so cancel both and let the grid size the panel. */
  max-width: none;
  margin: 0;
}

.home-layout .global-graph-panel #graph {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

/* vis-network sizes its canvas in px; clamp it to the container so a stale
   measurement (rotate, address-bar show/hide) can't stretch the page. */
#graph canvas {
  max-width: 100%;
}

/* Node list panel ----------------------------------------------------------- */

.node-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.node-list-header {
  flex-shrink: 0;
}

.node-list-header .search-input {
  width: 100%;
}

.clear-selection[hidden] {
  display: none;
}

.node-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.node-list-panel .pagination {
  flex-shrink: 0;
  margin: 0;
}

/* Empty state --------------------------------------------------------------- */

.node-list .panel-empty {
  color: var(--sw-muted, var(--text-muted));
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

/* Scrollbar hiding ---------------------------------------------------------- */

.node-list::-webkit-scrollbar {
  display: none;
}

.node-list {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Responsive ---------------------------------------------------------------- */

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(300px, 46vh) minmax(340px, 1fr);
    height: auto;
    min-height: auto;
  }

  .home-layout .global-graph-panel {
    min-height: 320px;
    height: 45vh;
  }

  .node-list-panel {
    min-height: 50vh;
  }
}

@media (max-width: 600px) {
  .home-layout .global-graph-panel {
    min-height: 280px;
    height: 40vh;
  }

  .node-list-header {
    padding: 0.75rem;
  }

  .node-list {
    padding: 0.75rem;
  }

  .node-list-header .search-input {
    font-size: 1rem;
  }

  .node-list .post-card {
    padding: 1rem;
  }

  .node-list-panel .pagination {
    padding: 0.75rem;
  }
}
