/*
 * The drag edge of a resizable column — see panels.js for the markup.
 *
 * The handle takes no room: it is a zero-width element between the column and
 * the content, with an 9px hit area centred on the edge and a 2px accent line
 * that shows on hover, focus and while dragging. Colours come from tokens.css.
 */

[data-bilder-resize] {
  position: relative;
  flex: none;
  align-self: stretch;
  width: 0;
  z-index: 30;
  outline: none;
  touch-action: none;
}

/* Inside the column instead of next to it: pinned to the column's inner edge. */
[data-bilder-resize][data-edge] {
  position: absolute;
  top: 0;
  bottom: 0;
}
[data-bilder-resize][data-edge]:not([data-side='right']) {
  right: 0;
}
[data-bilder-resize][data-edge][data-side='right'] {
  left: 0;
}

/* The hit area. */
[data-bilder-resize]::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  width: 9px;
  cursor: col-resize;
}

/* The line. */
[data-bilder-resize]::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  border-radius: 1px;
  background: var(--accent, #0e8fa6);
  opacity: 0;
  transition: opacity 120ms ease 80ms;
  pointer-events: none;
}

[data-bilder-resize]:hover::after,
[data-bilder-resize]:focus-visible::after,
[data-bilder-resize].is-dragging::after {
  opacity: 1;
  transition-delay: 0ms;
}

[data-bilder-resize]:focus-visible::before {
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--ring, #0e8fa6);
}

/* While dragging: the resize cursor everywhere, no text selection, and iframes
   (PDF previews, embedded pages) do not swallow the pointer. */
html.bilder-resizing,
html.bilder-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
html.bilder-resizing iframe,
html.bilder-resizing embed,
html.bilder-resizing object {
  pointer-events: none !important;
}

/* Phones: columns become drawers, nothing to drag. */
@media (max-width: 767px) {
  [data-bilder-resize] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-bilder-resize]::after {
    transition: none;
  }
}
