/* css/panelResize.css — resizable tile panel (dashboard.html, project.html).
 *
 * Paired with js/panelWidthInit.js (sets --tile-panel-w before first paint) and
 * js/panelResize.js (adds the .panel-divider and handles the interaction).
 *
 * Everything here is inside min-width: 1024px and skipped under
 * html.panel-resize-off (an Android app-layout session). Below 1024px, and in
 * the app, both pages keep exactly the fixed widths they had before.
 *
 * The ID selectors beat the Tailwind width classes on the panels
 * (md:w-[300px], lg:w-[280px]) on specificity alone, and the fallbacks inside
 * var() are those same defaults, so with no saved width nothing changes.
 */

.panel-divider { display: none; }

@media (min-width: 1024px) {
  html:not(.panel-resize-off) #dashRightSidebar { width: var(--tile-panel-w, 300px); }
  html:not(.panel-resize-off) #projTilesBlock   { width: var(--tile-panel-w, 280px); }

  /* An 8px hit area centred on the panel's existing left border. The negative
     margins make it overlap both neighbours, so it takes no width of its own. */
  html:not(.panel-resize-off) .panel-divider {
    display: block;
    position: relative;
    z-index: 5;
    flex: 0 0 8px;
    width: 8px;
    margin: 0 -4px;
    align-self: stretch;
    cursor: col-resize;
    touch-action: none;           /* a touch drag resizes rather than scrolls */
  }

  /* The visible line: transparent at rest (the panel's own border shows), the
     accent on hover, while dragging, and on keyboard focus. */
  .panel-divider::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 3px;
    width: 2px;
    border-radius: 1px;
    background: transparent;
    transition: background 0.15s;
  }
  .panel-divider:hover::after,
  .panel-divider[data-dragging]::after,
  .panel-divider:focus-visible::after { background: var(--accent); }

  /* Keyboard focus also gets an outline, so it reads as focus and not hover.
     --border-soft was too faint for this in the light theme (10% alpha). */
  .panel-divider:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
}

/* While dragging: no text selection, and the resize cursor everywhere, so it
   does not flicker to a pointer over the tiles. */
body.panel-resizing,
body.panel-resizing * {
  cursor: col-resize;
  -webkit-user-select: none;
  user-select: none;
}
