/* Stage 5C — include 404 editorial arrow links within the approved Stage 4D system. */
/* Stage 4D — shared behaviour, not a replacement for approved component designs.
   Editorial arrow links have one continuous Brown Butter rule beneath the full
   clickable phrase AND arrow. Buttons and card surfaces keep their own identity. */

:is(
  .sb-seasons__cta,.sb-about__link,.sb-latest-all,.sb-category-all,
  .sb-blog-text-link,.sb-about-secondary-cta,.sb-cat-jump,.sb-cat-index-link,
  .sb-search-index-link,.sb-contact-text-link,.sb-lib-directory-jump,
  .sb-homehero__secondary,.sb-404-back,.sb-404-categories-header>a
){
  display:inline-flex;
  align-items:center;
  gap:9px!important;
  width:fit-content;
  max-width:100%;
  min-height:44px;
  text-decoration:none!important;
  border-bottom:2px solid var(--sb-brown-butter)!important;
  color:var(--sb-blackberry)!important;
  transition:color var(--sb-motion-speed) var(--sb-motion-ease),
             border-color var(--sb-motion-speed) var(--sb-motion-ease);
}
:is(
  .sb-seasons__cta,.sb-about__link,.sb-latest-all,.sb-category-all,
  .sb-blog-text-link,.sb-about-secondary-cta,.sb-cat-jump,.sb-cat-index-link,
  .sb-search-index-link,.sb-contact-text-link,.sb-lib-directory-jump,
  .sb-homehero__secondary,.sb-404-back,.sb-404-categories-header>a
):is(:hover,:focus-visible){
  color:var(--sb-berry-hover)!important;
  border-bottom-color:var(--sb-blackberry)!important;
  gap:9px!important;
}
:is(
  .sb-seasons__cta,.sb-about__link,.sb-latest-all,.sb-category-all,
  .sb-blog-text-link,.sb-about-secondary-cta,.sb-cat-jump,.sb-cat-index-link,
  .sb-search-index-link,.sb-contact-text-link,.sb-lib-directory-jump,
  .sb-homehero__secondary,.sb-404-back,.sb-404-categories-header>a
) > span[aria-hidden="true"]{
  display:inline-block;
  flex:none;
  line-height:1.2;
  transition:transform var(--sb-motion-speed) var(--sb-motion-ease);
}
:is(
  .sb-seasons__cta,.sb-about__link,.sb-latest-all,.sb-category-all,
  .sb-blog-text-link,.sb-about-secondary-cta,.sb-cat-jump,.sb-cat-index-link,
  .sb-search-index-link,.sb-contact-text-link,.sb-lib-directory-jump,
  .sb-homehero__secondary,.sb-404-back,.sb-404-categories-header>a
):is(:hover,:focus-visible) > span[aria-hidden="true"]{
  transform:translate(2px,-1px);
}
/* When a nested label and arrow are both spans, the whole anchor still owns the rule. */
.sb-seasons__cta:is(:hover,:focus-visible) .sb-seasons__cta-label{transform:none}

/* Stage 5D — approved 0.2s ease for theme-owned interactive controls.
   Zero specificity: existing component transitions retain their intended properties;
   missing transitions gain a restrained colour/background/border/shadow fade.
   Never target third-party plugin widgets, ad slots or consent interfaces. */
:where(main,.sb-header,.sb-site-footer,.sb-announcement) :where(
  .sb-announcement-link,
  .sb-menu-desktop>li>a,.sb-menu-mobile>li>a,.sb-menu-desktop .sub-menu a,.sb-menu-mobile .sub-menu a,
  .sb-header-action,.sb-search-form button,.sb-basic-search button,
  .sb-homehero__search button,
  .sb-404-crumb a,.sb-404-form button,.sb-404-primary,
  .sb-about-breadcrumb a,.sb-about-main-cta,.sb-about-favourites-cta,
  .sb-contact-breadcrumb a,.sb-contact-button,.sb-contact-outline,
  .sb-work-breadcrumb a,.sb-work-button,.sb-work-write,
  .sb-folio-breadcrumb a,.sb-folio-meta a,.sb-folio-action,.sb-folio-save,
  .sb-blog-crumb a,.sb-search-breadcrumbs a,
  .sb-lib-breadcrumb a,.sb-lib-search button,.sb-lib-chip,.sb-lib-apply,
  .sb-lib-favourites-list a,.sb-lib-directory-group li a,
  .sb-cat-explore a,.sb-cat-explore-all,
  .sb-search-input-row button,.sb-search-empty-actions a,
  .sb-sidebar-author-cta,.sb-sidebar-link,.sb-sidebar-search button,.sb-sidebar-browse,
  .sb-privacy-breadcrumb a,.sb-privacy-quick-nav a,
  .sb-seasons__nav a,.sb-category-card--no-bake,
  .sb-footer-legal-row a,.sb-footer-back-top,
  .sb-note-author a,.sb-note-date,.sb-note-tools a
){
  transition:color var(--sb-motion-speed) var(--sb-motion-ease),
             background-color var(--sb-motion-speed) var(--sb-motion-ease),
             border-color var(--sb-motion-speed) var(--sb-motion-ease),
             box-shadow var(--sb-motion-speed) var(--sb-motion-ease),
             text-decoration-color var(--sb-motion-speed) var(--sb-motion-ease),
             opacity var(--sb-motion-speed) var(--sb-motion-ease);
}
/* Breadcrumbs use the already-approved underline on hover, but its colour
   now fades in rather than switching on as a dark, immediate line. */
main :is(
  .sb-404-crumb,.sb-about-breadcrumb,.sb-contact-breadcrumb,
  .sb-work-breadcrumb,.sb-folio-breadcrumb,.sb-blog-crumb,
  .sb-search-breadcrumbs,.sb-lib-breadcrumb,.sb-privacy-breadcrumb
) a{
  text-decoration-line:underline;
  text-decoration-color:transparent;
}
/* These captions/titles change inside linked card surfaces, not on the link itself. */
:where(main) :where(
  .sb-lib-card-link h3,.sb-blog-card-title,.sb-blog-feature-title,
  .sb-latest-view,.sb-cat-feature strong,.sb-sidebar-recipe-title
){
  transition:color var(--sb-motion-speed) var(--sb-motion-ease),
             text-decoration-color var(--sb-motion-speed) var(--sb-motion-ease);
}
/* First-party controls set their easing explicitly; third-party controls remain untouched. */
/* Ordinary paragraph and recipe-content links must react clearly, but do not
   recolour decorative photos or third-party widget controls. */
main :where(.sb-folio-story,.sb-about-story,.sb-contact-copy,.sb-work-policy,.sb-privacy-content,.sb-cat-description,.sb-entry-content) a:not(.wp-block-button__link){
  color:var(--sb-blackberry);
  text-decoration-color:var(--sb-brown-butter);
  transition:color var(--sb-motion-speed) var(--sb-motion-ease),
             text-decoration-color var(--sb-motion-speed) var(--sb-motion-ease);
}
main :where(.sb-folio-story,.sb-about-story,.sb-contact-copy,.sb-work-policy,.sb-privacy-content,.sb-cat-description,.sb-entry-content) a:not(.wp-block-button__link):is(:hover,:focus-visible){
  color:var(--sb-berry-hover);
  text-decoration-color:currentColor;
}
/* Tiny remaining text controls follow the same colour/underline behaviour. */
:where(.sb-lib-clear,.sb-cat-empty a,.sb-lib-empty a,.sb-work-email):is(:hover,:focus-visible){
  color:var(--sb-berry-hover);
  text-decoration-color:currentColor;
}
.sb-lib-clear,.sb-work-email{
  transition:color var(--sb-motion-speed) var(--sb-motion-ease),
             text-decoration-color var(--sb-motion-speed) var(--sb-motion-ease);
}
/* Styled theme dropdowns (including native keyboard controls). Don't touch
   browser/WordPress admin, consent interfaces or external plugin forms. */
.sb-library-page .sb-lib-filter-label select{
  -webkit-appearance:none;
  appearance:none;
  font-family:var(--sb-font-body);
  font-weight:750;
  color:var(--sb-deep-cocoa);
  background-color:var(--sb-surface);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23773F55' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 6 4.5 4 4.5-4'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:16px 16px;
  padding-right:39px;
  min-height:44px;
  border:1px solid #CDB9A8;
  border-radius:10px;
  cursor:pointer;
  transition:border-color var(--sb-motion-speed) var(--sb-motion-ease),
             box-shadow var(--sb-motion-speed) var(--sb-motion-ease),
             background-color var(--sb-motion-speed) var(--sb-motion-ease);
}
.sb-library-page .sb-lib-filter-label select:hover{border-color:var(--sb-blackberry);background-color:#FFFAF4}
.sb-library-page .sb-lib-filter-label select:focus-visible{
  outline:3px solid var(--sb-blackberry);
  outline-offset:3px;
}
/* Deliberately preserve the native menu popup: its options remain keyboard-usable. */
@media (prefers-reduced-motion:reduce){
  :where(main,.sb-header,.sb-site-footer,.sb-announcement) :where(a,button,select,input){transition-duration:.01ms!important}
}


/* Stage 5F — a site-wide audit of theme-owned hover-only underlines.
   For links that already gained an underline on hover, preserve their resting
   appearance with a transparent line, then animate ONLY its colour to the
   existing Brown Butter. Avoid `text-decoration: underline` on hover: that
   shorthand can reset the colour and flash dark before the transition. */
main :is(
  .sb-404-crumb a, .sb-about-breadcrumb a, .sb-contact-breadcrumb a,
  .sb-work-breadcrumb a, .sb-folio-breadcrumb a, .sb-blog-crumb a,
  .sb-search-breadcrumbs a, .sb-lib-breadcrumb a, .sb-privacy-breadcrumb a,
  .sb-folio-meta a, .sb-folio-related-item,
  .sb-homehero__label > a,
  .sb-lib-favourites-list a, .sb-lib-directory-group li a,
  .sb-privacy-quick-nav a
){
  text-decoration-line:underline;
  text-decoration-color:transparent;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
  transition:color var(--sb-motion-speed) var(--sb-motion-ease),
             text-decoration-color var(--sb-motion-speed) var(--sb-motion-ease);
}
main :is(
  .sb-404-crumb a, .sb-about-breadcrumb a, .sb-contact-breadcrumb a,
  .sb-work-breadcrumb a, .sb-folio-breadcrumb a, .sb-blog-crumb a,
  .sb-search-breadcrumbs a, .sb-lib-breadcrumb a, .sb-privacy-breadcrumb a,
  .sb-folio-meta a, .sb-folio-related-item,
  .sb-homehero__label > a,
  .sb-lib-favourites-list a, .sb-lib-directory-group li a,
  .sb-privacy-quick-nav a
):is(:hover,:focus-visible){
  text-decoration-line:underline;
  text-decoration-color:var(--sb-brown-butter);
}
/* Keep the approved editorial arrow rules, which use a border, not a
   separate text underline. They must not acquire an extra dark line. */
.sb-category-all:is(:hover,:focus-visible){text-decoration:none}
/* Stage 5G: footer legal links follow the footer navigation colour-only hover;
   the specific footer.css control owns that behaviour, with no extra underline. */
