/* Simply Bake — Stage 5AF | unified rounded button and search-field system
   Scope: the theme's own interactive buttons and the Hubbub controls INSIDE
   the approved recipe hero. No site-wide button/a wildcard; never change
   consent banners, ads, third-party forms, photo cards or input fields.

   Text actions, share/save controls and icon-only actions use 50px
   rounding. Apply buttons paired with dropdown selects match the selects. Colours, hover/focus, sizes, plugin event listeners,
   saved states and navigation links remain owned by the existing components. */
:root {
  --sb-button-radius: 50px;
  --sb-icon-button-radius: 50px;
  --sb-compact-button-radius: 50px;
  --sb-infield-button-radius: 50px;
  --sb-dropdown-button-radius: 10px;
}

/* Labelled first-party actions: one 50px rounded style. */
:is(
  .sb-menu > li.sb-recipe-index-cta > a,
  .sb-search-form button,
  .sb-basic-search button,
  .sb-404-form button,
  .sb-404-primary,
  .sb-about-main-cta,
  .sb-about-favourites-cta,
  .sb-contact-button,
  .sb-contact-outline,
  .sb-work-button,
  .sb-work-write,
  .sb-folio-action,
  .sb-folio-save,
  .sb-lib-apply,
  .sb-cat-explore a,
  .sb-search-empty-actions a,
  .sb-sidebar-author-cta,
  .sb-sidebar-browse,
  .sb-post-author__link,
  .sb-notes .sb-notes-submit,
  .sb-reader-link,
  .sb-wprm-sheet .sb-wprm-actions a,
  .sb-wprm-sheet .sb-wprm-actions button,
  .sb-wprm-sheet .sb-wprm-scale-button,
  .wp-block-button__link
) {
  border-radius: var(--sb-button-radius) !important;
}

/* Retain the approved individual heights/padding. Centre text and icon as
   one unit without changing click handlers or semantic link/button types. */
:is(
  .sb-search-form button,
  .sb-basic-search button,
  .sb-homehero__search button,
  .sb-404-form button,
  .sb-404-primary,
  .sb-about-main-cta,
  .sb-about-favourites-cta,
  .sb-contact-button,
  .sb-contact-outline,
  .sb-work-button,
  .sb-work-write,
  .sb-folio-action,
  .sb-lib-search button,
  .sb-lib-apply,
  .sb-cat-explore a,
  .sb-search-input-row button,
  .sb-search-empty-actions a,
  .sb-sidebar-author-cta,
  .sb-sidebar-browse,
  .sb-post-author__link,
  .sb-notes .sb-notes-submit,
  .sb-wprm-sheet .sb-wprm-actions a,
  .sb-wprm-sheet .sb-wprm-actions button
) {
  text-align: center;
  justify-content: center;
  align-items: center;
}

/* Icon-only first-party controls. Header search, saved recipes and mobile
   menu buttons keep their original 44px targets and become circles. */
.sb-header-action,
.sb-sidebar-search button {
  border-radius: var(--sb-icon-button-radius) !important;
}

/* Preserve the existing accessible minimum 44px sidebar search target. */
.sb-sidebar-search button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-basis: 44px;
}

/* Hubbub's real anchors/buttons, only within the recipe post share strip.
   Some provider CSS uses !important; this selector intentionally outranks
   it without touching any social widget elsewhere. */
.sb-folio-article .sb-folio-hero-copy .sb-folio-share :is(a,button),
.sb-folio-article .sb-folio-hero-copy .sb-folio-share .dpsp-networks-btns-wrapper li :is(a,button),
.sb-folio-article .sb-folio-hero-copy .sb-folio-share [class*="dpsp-network"] :is(a,button) {
  border-radius: var(--sb-icon-button-radius) !important;
}

/* Mobile flyout links use the matching 50px rounded shape. Desktop
   ordinary text links remain text links, not false buttons. */
@media (max-width: 1050px) {
  .sb-menu-mobile > li > a,
  .sb-menu-mobile .sub-menu a,
  body.sb-has-library .sb-menu-mobile > li > a,
  body.sb-has-library .sb-menu-mobile > li.sb-recipe-index-cta > a {
    border-radius: var(--sb-button-radius) !important;
  }
}

/* Pagination controls use 50px rounding; preserve existing dimensions.  */
.sb-lib-pager :is(a,.sb-lib-pager-number,.sb-lib-pager-step,.post-page-numbers) {
  border-radius: var(--sb-button-radius) !important;
}

/* Compact serving, page-number, and seasonal selectors have 50px
   rounding without changing their selected states. */
.sb-wprm-sheet :is(.sb-wprm-scale-button,
                    .sb-wprm-servings-controls button.wprm-recipe-adjustable-servings,
                    .sb-wprm-servings-controls button.wprm-toggle),
.sb-wprm-body :where(.wprm-recipe-adjustable-servings-container,.wprm-recipe-ingredients-adjustable-servings) :where(button,a),
.sb-lib-pager .sb-lib-pager-number,
.sb-seasons__nav a {
  border-radius: var(--sb-compact-button-radius) !important;
}

/* Search submit buttons and their surrounding input containers both use
   50px rounding, leaving existing widths and padding alone. */
.sb-homehero__search button,
.sb-search-input-row button,
.sb-lib-search button,
.sb-sidebar-search button {
  border-radius: var(--sb-infield-button-radius) !important;
}

/* Make first-party search bars match the rounded buttons, while
   preserving their current focus, placeholder, height and flex layouts. */
:is(
  .sb-homehero__search,
  .sb-search-input-row,
  .sb-lib-search,
  .sb-sidebar-search form,
  .sb-search-form input[type="search"],
  .sb-basic-search input[type="search"],
  .sb-404-form input[type="search"],
  .sb-404-form input:not([type])
) {
  border-radius: 50px !important;
}

/* Include the *box* around the custom 0.5x / 1x / 2x servings selector.
   Keep its flex wrapping, padding, labels and selected state unchanged. */
.sb-wprm-sheet .sb-wprm-servings-controls:not([hidden]),
.sb-wprm-sheet .sb-wprm-scale-options {
  border-radius: 50px !important;
}

/* Exception requested for select + submit pair. The Recipe Index's
   Category/Sort dropdowns compute to 10px rounded, so Apply matches.
   Do not make the select fields themselves pill-shaped. */
.sb-library-page .sb-lib-filter-bar .sb-lib-apply {
  border-radius: var(--sb-dropdown-button-radius) !important;
}

/* The icon in Back to Top is itself a compact interactive affordance.
   Keep the footer link, labels and hover unchanged. */
.sb-site-footer .sb-footer-back-icon {
  border-radius: var(--sb-icon-button-radius) !important;
}

/* Existing menus, forms, WPRM, Hubbub, Slickstream and other plugins keep
   their own focus and hover colours. Retain strong keyboard focus for the
   header controls if the plugin has no custom rule. */
.sb-header-action:focus-visible,
.sb-sidebar-search button:focus-visible {
  outline: 3px solid var(--sb-blackberry);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .sb-header-action,.sb-sidebar-search button { transition-duration: .01ms !important; }
}
