/*
 * First-party grid -- Bootstrap 5.3's flex grid, restricted to the 60 grid classes
 * this site actually uses, with Bootstrap's exact selectors, breakpoints (sm 576,
 * md 768, lg 992, xl 1200, xxl 1400) and container max-widths (540 / 720 / 960 /
 * 1140 / 1320px).
 *
 * Part of the Bootstrap removal (PR 1 of 4). Bootstrap's CSS is still loaded and this
 * file is loaded after it; every declaration below restates Bootstrap's own, so the
 * cascade outcome is identical either way.
 *
 * The only deviation: Bootstrap's `--bs-gutter-x` / `--bs-gutter-y` mechanism is
 * reproduced under the first-party names `--gutter-x` / `--gutter-y` (same 1.5rem /
 * 0 defaults, same `calc()` expressions), so `.row > *` padding and `.row` negative
 * margins match Bootstrap exactly while owning no `--bs-*` name.
 *
 * The used set is computed by the same grep as utils/utilities.css -- see that file's
 * header -- and re-checked by core/tests/test_first_party_utilities.py.
 */

/* ---- containers -------------------------------------------------------- */

.container,
.container-xxl {
  --gutter-x: 1.5rem;
  --gutter-y: 0;
  width: 100%;
  padding-right: calc(var(--gutter-x) * 0.5);
  padding-left: calc(var(--gutter-x) * 0.5);
  margin-right: auto;
  margin-left: auto;
}

/* ---- row and columns --------------------------------------------------- */

.row {
  --gutter-x: 1.5rem;
  --gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--gutter-y));
  margin-right: calc(-0.5 * var(--gutter-x));
  margin-left: calc(-0.5 * var(--gutter-x));
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--gutter-x) * 0.5);
  padding-left: calc(var(--gutter-x) * 0.5);
  margin-top: var(--gutter-y);
}
.col-12 {
  flex: 0 0 auto;
  width: 100%;
}

/* ---- sm (576px and up) -------------------------------------------- */

@media (min-width: 576px) {
  .container {
      max-width: 540px;
    }
}

/* ---- md (768px and up) -------------------------------------------- */

@media (min-width: 768px) {
  .container {
      max-width: 720px;
    }

  .col-md-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-md-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }
}

/* ---- lg (992px and up) -------------------------------------------- */

@media (min-width: 992px) {
  .container {
      max-width: 960px;
    }

  .col-lg-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }
}

/* ---- xl (1200px and up) -------------------------------------------- */

@media (min-width: 1200px) {
  .container {
      max-width: 1140px;
    }
}

/* ---- xxl (1400px and up) -------------------------------------------- */

@media (min-width: 1400px) {
  .container,
    .container-xxl {
      max-width: 1320px;
    }
}
