/* Button sizes. Loaded on the front end and in the editor (functions.php), and listed in CSS Class Manager.
   A size is a plain class added to a Button block (Advanced → Additional CSS class), not a block style, so it sits
   alongside whichever style the button has: Fill, Outline or a preset style. The size sets only the font size,
   height and side padding; shape, colours, border, hover, case and letter spacing come from the button's style.
   Preset styles that draw their own boxes (Text, Arrow Join) size those in their own button-styles/*.css. */

/* Small: 24px high, the smallest target WCAG 2.2 AA allows (2.5.8), matching Aequitas Two (26 Nov 2026; was 28px).
   The height is set by padding (half the height, minus half the font size, minus the border), the same way Deep Tech
   sets its 44px buttons, so Fill and Outline stay level in a row; the min-height keeps sub-pixel rounding from taking
   it under. Change --btn-small-height to make every small button taller or shorter. */
.wp-block-button.btn-small {
  --btn-small-height: 24px;
  --btn-small-border: 0px;
}

.wp-block-button.is-style-outline.btn-small {
  --btn-small-border: 2px;
}

.wp-block-button.btn-small .wp-block-button__link {
  font-size: var(--wp--preset--font-size--xsmall);
  line-height: 1;
  padding: calc(var(--btn-small-height) / 2 - 0.5em - var(--btn-small-border))
    0.75rem;
  box-sizing: border-box;
  min-height: var(--btn-small-height);
  vertical-align: top;
}

/* Medium (26 Nov 2026, from Aequitas Two): 35px high, between Small and the regular 44px button, for buttons that
   should stand out less than a regular one. Like Small it sets only the size, so the button keeps its style's look.
   The text is 0.945rem (15.12px), chosen so Inter's capitals are exactly 11px tall, leaving whole 12px gaps. The text
   box is trimmed to the capitals and padded evenly, so the caps sit exactly in the middle; browsers without text-box
   (Firefox) centre the line-height 1 box instead, which is very nearly the same. A preset whose regular buttons are
   smaller or in another font sets --btn-medium-height and --btn-medium-font-size in its own style.css. */
.wp-block-button.btn-medium {
  --btn-medium-height: 35px;
  --btn-medium-font-size: 0.945rem;
  --btn-medium-border: 0px;
}

.wp-block-button.is-style-outline.btn-medium {
  --btn-medium-border: 2px;
}

.wp-block-button.btn-medium .wp-block-button__link {
  font-size: var(--btn-medium-font-size);
  line-height: 1;
  padding: calc(var(--btn-medium-height) / 2 - 0.5em - var(--btn-medium-border))
    1.125rem;
  box-sizing: border-box;
  min-height: var(--btn-medium-height);
  vertical-align: top;
}

@supports (text-box: trim-both cap alphabetic) {
  .wp-block-button.btn-medium .wp-block-button__link {
    text-box: trim-both cap alphabetic;
    padding-block: calc(
      (var(--btn-medium-height) - 1cap) / 2 - var(--btn-medium-border)
    );
  }
}
