/*
 * Compare plans (service-compare-bnr): on white, "Choose the plan that fits your business" with the comparison's
 * "Showing key services. Show all N services" beside it, then the comparison table and the fair usage note.
 *
 * The comparison block keeps its toolbar and its table together; on wider screens a grid with subgrid rows lifts
 * the toolbar up beside the heading, as in the wireframe. On tablets and phones, and where :has or subgrid isn't supported,
 * the toolbar simply sits above the table. There, the section is only as wide as the table and sits in the middle of
 * the page, so the heading and "Show all" line up with the table's edges.
 */

.wp-block-group.service-pattern.service-pattern--compare-bnr {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--text);
}

.service-pattern--compare-bnr .wp-block-group__inner-container {
  display: contents;
}

.service-pattern--compare-bnr .service-pattern__compare-bnr-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 48px clamp(24px, 5vw, 64px);
}

.service-pattern--compare-bnr .service-pattern__compare-bnr-heading {
  margin: 0;
  color: #0d3d39;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(28px, 3.4vw, 34px);
  font-weight: 400;
  line-height: 1.15;
  text-transform: none;
}

.service-pattern--compare-bnr .service-pattern__compare-bnr-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* Wider screens: the heading and "Show all" on one row, with the table under both */

@media (min-width: 900px) {
  .service-pattern--compare-bnr .service-pattern__compare-bnr-inner:has(.services-comparison__toolbar) {
    display: grid;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-items: end;
    gap: 20px 12px;
  }

  .service-pattern--compare-bnr .service-pattern__compare-bnr-inner:has(.services-comparison__toolbar) .service-pattern__compare-bnr-heading {
    grid-row: 1;
    grid-column: 1;
  }

  .service-pattern--compare-bnr .service-pattern__compare-bnr-inner:has(.services-comparison__toolbar) .services-comparison {
    display: grid;
    grid-row: 1 / span 2;
    grid-column: 1 / -1;
    grid-template-rows: subgrid;
    grid-template-columns: subgrid;
    row-gap: 20px;
  }

  .service-pattern--compare-bnr .services-comparison__toolbar {
    grid-row: 1;
    grid-column: 2;
    margin: 0;
  }

  .service-pattern--compare-bnr .services-comparison__body-wrap {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .service-pattern--compare-bnr .service-pattern__compare-bnr-inner:has(.services-comparison__toolbar) .service-pattern__compare-bnr-note {
    grid-row: 3;
    grid-column: 1 / -1;
  }
}

/* Phones */

@media (max-width: 700px) {
  .service-pattern--compare-bnr .service-pattern__compare-bnr-inner {
    padding: 40px 16px;
  }
}
