/*
 * 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.
 */

/*
 * Aligned offers tables (OffersTableComponent, in the list grouped by
 * department): from md up, the columns keep the fixed widths of
 * OffersTableComponent::WIDTHS, so the tables line up. A table on its own keeps
 * the automatic layout. Title takes what is left, at least 8rem: the table's
 * minimum width adds up the columns its header row shows, so it follows the
 * column picker. Past it, the table scrolls sideways in its frame. With every
 * column shown it comes to 68rem, inside the page's 69rem (max-w-6xl less its
 * padding) and the frame's border.
 */
@media (min-width: 48rem) {
  [data-offers-table="aligned"] {
    --offers-w-followed: 0rem;
    --offers-w-status: 0rem;
    --offers-w-new-candidates: 0rem;
    --offers-w-employment-type: 0rem;
    --offers-w-experience: 0rem;
    --offers-w-published: 0rem;
    --offers-w-reference: 0rem;
  }

  [data-offers-table="aligned"]:has(th[data-column="followed"]:not([hidden])) { --offers-w-followed: 6rem; }
  [data-offers-table="aligned"]:has(th[data-column="status"]:not([hidden])) { --offers-w-status: 7rem; }
  [data-offers-table="aligned"]:has(th[data-column="new_candidates"]:not([hidden])) { --offers-w-new-candidates: 9rem; }
  [data-offers-table="aligned"]:has(th[data-column="employment_type"]:not([hidden])) { --offers-w-employment-type: 9rem; }
  [data-offers-table="aligned"]:has(th[data-column="experience"]:not([hidden])) { --offers-w-experience: 7rem; }
  [data-offers-table="aligned"]:has(th[data-column="published"]:not([hidden])) { --offers-w-published: 14rem; }
  [data-offers-table="aligned"]:has(th[data-column="reference"]:not([hidden])) { --offers-w-reference: 8rem; }

  [data-offers-table="aligned"] table {
    table-layout: fixed;
    min-width: calc(8rem + var(--offers-w-followed) + var(--offers-w-status) + var(--offers-w-new-candidates)
      + var(--offers-w-employment-type) + var(--offers-w-experience) + var(--offers-w-published) + var(--offers-w-reference));
  }
}
