/* gogridgo column-resize addon — see colresize.js. Everything is scoped to
   [data-gg-colresize], so grids without the feature are untouched. */

/* The grip is absolutely positioned inside the header cell, so .gg-th needs a
   containing block; user-select stops a drag from selecting the caption
   (sortable headers already had it). */
.gg-grid[data-gg-colresize] .gg-th {
  position: relative;
  user-select: none;
}

/* Straddles the boundary (half in this cell, half over the next) so the
   pointer finds it exactly where a user expects the column edge to be. */
.gg-grid[data-gg-colresize] .gg-grip {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  touch-action: none;
}

/* The last column's grip stays inside the table. Straddling there would poke
   4px past the table edge, the scroll wrapper would count it as content, and
   TopScroll would draw a bar for a table that fits — with nothing to scroll
   but those 4px. */
.gg-grid[data-gg-colresize] .gg-th:last-child .gg-grip {
  right: 0;
}

/* A hairline on hover: the affordance appears where the pointer is, without
   drawing a permanent line next to every caption. */
.gg-grid[data-gg-colresize] .gg-grip:hover::after,
.gg-grid[data-gg-colresize].gg-resizing .gg-grip:hover::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 3px;
  width: 2px;
  background: #4f46e5;
  border-radius: 1px;
}

/* While dragging, the whole grid keeps the resize cursor even if the pointer
   drifts off the 8px strip. */
.gg-grid[data-gg-colresize].gg-resizing,
.gg-grid[data-gg-colresize].gg-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

/* The filter row carries its own grip (see render.go) so the boundary is
   draggable along the whole header block, not just the caption line — it needs
   no extra rules: .gg-filter-th is also a .gg-th, so the two rules above
   already give it the containing block and the 8px strip.

   A fixed layout clips overflow instead of growing the column, so long values
   need an ellipsis to stay readable (virtual mode already does this). */
.gg-grid[data-gg-colresize] .gg-td {
  overflow: hidden;
  text-overflow: ellipsis;
}
