/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Media lightbox dialog sizing - 95% viewport for full-screen experience */
.modal-lightbox {
  width: 95vw;
  max-width: 95vw;
  height: 95vh;
}

/* Hotwire Combobox - full width and consistent styling */
fieldset.hw-combobox {
  width: 100% !important;
}

div.hw-combobox__main__wrapper {
  width: 100% !important;
}

/* Combobox control metrics — the combobox is a chassis control (WLS-1246).
 * The contract and its reasons live in architecture.md Section 6; what follows
 * is only the arithmetic, which is not self-evident from the values.
 *
 * The gem's visible box (.hw-combobox__main__wrapper) sets no height of its own,
 * so the height falls out of border + padding + line box:
 *
 *   2 x 1px border + 2 x 7px padding + 20px line box = 36px = h-9
 *
 * The padding is derived rather than written as 7px so it stays correct if the
 * control height or the leading moves. The field is made block-level because the
 * gem leaves it inline-block, and an inline box reserves descender space beneath
 * it — the half pixel that rounded the control up to 37px. It already spans the
 * full width, so nothing else about the layout changes.
 *
 * This binds every call site, including the `f.combobox` form-builder ones this
 * app uses — the metrics are on the component, not on a helper.
 */
.hw-combobox {
  --hw-font-size: 0.875rem; /* text-sm, as on .input / .select */
  --hw-line-height: 1.25rem; /* text-sm leading */
  --hw-padding--slim: calc((2.25rem - var(--hw-line-height)) / 2 - var(--hw-border-width--slim));
  --hw-border-color: hsl(var(--border));
  --hw-component-bg-color: hsl(var(--input-background));
  --hw-focus-color: hsl(var(--ring));
}

.hw-combobox__input {
  display: block;
}

/* WLS-69: Hide blank option in combobox dropdowns to prevent duplicate placeholder
 * The placeholder is shown in the input field; showing it again as a selectable
 * option in the dropdown creates confusion. The blank option still functions
 * for clearing selections via keyboard navigation.
 */
.hw-combobox__option--blank {
  display: none;
}

/* WLS-70: Combobox listbox fixed positioning for modal escape
 * When combobox-position controller applies fixed positioning,
 * ensure the listbox appears above modals (modal z-index is 10)
 */
.hw-combobox__listbox[style*="position: fixed"] {
  z-index: 9999 !important;
}

/* KPI card: suppress card hover when hovering the target button */
[data-controller="card-link"]:hover:has([data-controller="kpi-target"]:hover) {
  background-color: hsl(var(--card)) !important;
  cursor: default;
}

/* Copy Enrollment Link button - CSS class-based state management */
.copy-enrollment-link-btn .copied-state {
  display: none;
}
.copy-enrollment-link-btn.copied .default-state {
  display: none;
}
.copy-enrollment-link-btn.copied .copied-state {
  display: inline-flex;
  align-items: center;
}
