/* fk: window (useWindow composable) */

/* The `interpolate-size: allow-keywords` global feature flag this relies on
   (for the .k-window-minimized fit-content workaround below) lives in
   featherk-overrides--global.css, not here - it's document-level, not
   Window-specific. */

.fk-window.k-window {
  min-width: 10rem;
}

.fk-window.k-window.fk-window-fixed {
  position: fixed;
}

.fk-window.k-window.fk-window-can-drag > .k-window-titlebar,
.fk-window.k-window.fk-window-can-drag > .k-window-titlebar > .k-window-title {
  user-select: none;
  cursor: grab;
}

.fk-window.k-window > .k-window-titlebar > .k-window-title {
  font-size: 1.25rem;
}

.fk-window.k-window
  > .k-window-titlebar
  > .k-window-titlebar-actions
  > .k-button.k-icon-button
  > .k-svg-icon
  > svg {
  height: 1.25rem;
  width: 1.25rem;
  transform: scale(0.8);
}

/* Kendo defect workaround: without this, the Window disappears entirely
   (collapses to zero height) when transitioning to the minimized stage. */
.fk-window.k-window.k-window-minimized {
  height: fit-content !important;
}

/* Kendo defect workaround: the native resize/drag cursor does not update on
   its own during a live drag without forcing it here. */
.fk-window-is-dragging,
.fk-window-is-dragging * {
  cursor: grabbing !important;
}

/* Kendo's WindowTitlebar renders minimize/maximize/close actions
   unconditionally regardless of the minimizeButton/maximizeButton/closable
   prop values (typing + rendering defect) - useWindow's windowClass emits
   these classes as the only working way to hide them. */
.fk-window-hide-minimize .k-window-titlebar-actions [aria-label="minimize"],
.fk-window-hide-maximize .k-window-titlebar-actions [aria-label="maximize"],
.fk-window-hide-close .k-window-titlebar-actions [aria-label="close"] {
  display: none;
}

/* Animate the Window's own box shrinking/growing between stages, since Kendo
   sets height via inline style and only .k-window-content's children animate
   on their own. Suppressed during live drag/resize so the transition doesn't
   fight the user's pointer. */
@media (prefers-reduced-motion: no-preference) {
  .fk-window.k-window {
    transition:
      height 0.2s ease,
      top 0.2s ease,
      left 0.2s ease,
      right 0.2s ease,
      bottom 0.2s ease;
  }
  .fk-window.k-window.fk-window-is-resizing,
  .fk-window.k-window.fk-window-is-dragging {
    transition: none;
  }
}
