/* The comparison table (/specialist-tefl-courses/, .specialist-courses):
   the label column ("Duration", "Personal Tutor Support" …) was lined up with
   the course columns by a fixed `margin-top: 307.5px`, so any course whose
   heading wraps to another line pushed its ticks out of line with the labels.
   Here every column shares one set of rows (CSS subgrid): icon, heading,
   price, duration, the five features, buy, learn more, access. Each label
   lands on the same row as its tick, whatever the headings hold.
   Same rules as the Next rebuild's scripts/overviews-css/extra-so.css
   (there scoped to the page root instead of `body`). Browsers without subgrid
   keep the old layout. */
@media (min-width: 768px) {
  @supports (grid-template-rows: subgrid) {
    body .specialist-courses {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      grid-auto-flow: row;
    }
    body .specialist-courses > .ast-col-md-3 {
      width: auto;
      max-width: none;
      float: none;
      grid-row: span 12;
      display: grid;
      grid-template-rows: subgrid;
      row-gap: 0; /* the table's 30px gap stays between the two groups, not between rows */
    }
    /* Label column: the countdown over the four header rows, the labels on the duration + feature rows. */
    body .specialist-courses > .ast-col-md-3 > .clock-sidebar {
      grid-row: 1 / 4;
      align-self: start;
    }
    body .specialist-courses > .ast-col-md-3 > .features-div {
      grid-row: 4 / 10;
      display: grid;
      grid-template-rows: subgrid;
      row-gap: 0;
      margin-top: 0;
    }
    /* Course columns. */
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner {
      grid-row: 1 / -1;
      display: grid;
      grid-template-rows: subgrid;
      row-gap: 0;
    }
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .course-icon { grid-row: 1; }
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .course-heading { grid-row: 2; }
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .course-price { grid-row: 3; align-self: start; }
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .course-duration { grid-row: 4; }
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .features-div-icons {
      grid-row: 5 / 10;
      display: grid;
      grid-template-rows: subgrid;
      row-gap: 0;
      margin: 0; /* its 30px moves to the Buy button: a margin here would stretch only some columns' last row */
    }
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .buy-now-div { grid-row: 10; margin-top: 30px; }
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .learn-more-div { grid-row: 11; }
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .access-time-div { grid-row: 12; }
    /* One row = one label / tick, centred on the same line (38px, the old row pitch). */
    body .specialist-courses .features-div > div,
    body .specialist-courses .features-div-icons > div,
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .course-duration {
      display: flex;
      align-items: center;
      min-height: 38px;
      margin: 0;
    }
    body .specialist-courses .features-div > div {
      justify-content: flex-end;
    }
    body .specialist-courses .features-div-icons > div,
    body .specialist-courses > .ast-col-md-3 > .specialist-courses-inner > .course-duration {
      justify-content: center;
    }
  }
}
