/* =========================================================================
 * Corteq mobile layout fixes  (phones, <= 767px)
 * Loaded by corteq-mobile-fixes.php, printed after Elementor's CSS.
 * Desktop / tablet layouts (>= 768px) are intentionally left untouched.
 *
 * Re-audited 2026-07-24 against the Anduril/Palantir dark redesign:
 *   - Rules 2-3 still apply to inner pages using ElementsKit icon-boxes.
 *   - Rule 4 (.cq-nws-row) still matches the News & Insights section.
 *   - Rule 1 now excludes the Warp banner display wordmark (.cq-ws-word)
 *     so it is never forced to wrap.
 * ====================================================================== */
@media (max-width: 767px) {

  /* --- 1. Custom .cq-* ticker / spec rows: wrap instead of clipping
   *        off-screen. Exclude the Warp banner giant wordmark, which is a
   *        single-line display element and must keep nowrap.               */
  [class*="cq-"] span:not(.cq-ws-word) {
    white-space: normal !important;
  }

  /* --- 2. ElementsKit icon-box grids: force single-column stacking -------- */
  .e-con.e-flex:has(.elementor-widget-elementskit-icon-box) {
    flex-direction: column !important;
  }
  .e-con.e-child:has(.elementor-widget-elementskit-icon-box) {
    width: 100% !important;
  }
  .elementor-column:has(.elementor-widget-elementskit-icon-box) {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* --- 3. Kill ElementsKit equal-height stretching (empty cards) ---------- */
  .elementor-widget-elementskit-icon-box .elementskit-infobox {
    height: auto !important;
    min-height: 0 !important;
  }

  /* --- 4. Home "News & Insights" list rows ------------------------------- *
   * The widget's own phone CSS moves the date to grid column 1 but never
   * repositions the title or arrow, so the title lands in the 24px arrow
   * column and wraps one word per line. Re-place all three cells: date and
   * title stacked full-width in column 1, arrow centered in column 2.       */
  .cq-nws-row {
    grid-template-columns: 1fr auto !important;
    column-gap: 14px !important;
    row-gap: 3px !important;
    align-items: center !important;
  }
  .cq-nws-rd { grid-column: 1 !important; grid-row: 1 !important; }
  .cq-nws-rt { grid-column: 1 !important; grid-row: 2 !important; }
  .cq-nws-ra { grid-column: 2 !important; grid-row: 1 / span 2 !important; align-self: center !important; }

  /* --- 5. Text dividers with an explicit pixel width overflowed narrow
   *        (<=374px) phones. Never let the divider exceed its container.    */
  .elementor-widget-divider .elementor-divider-separator {
    max-width: 100% !important;
  }
}
