body.tax-sh_portfolio_category .gallery-page-title {
  display: flex !important;
  flex-flow: row wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: clamp(12px, 2.5vw, 24px) !important;
}
body.tax-sh_portfolio_category .gallery-page-title > h1 {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow-wrap: anywhere !important;
}
body.tax-sh_portfolio_category .gallery-page-title > .back-home-button {
  flex: 0 0 auto !important;
  width: max-content !important;
  max-width: 100% !important;
  margin: 0 !important;
  align-self: center !important;
  white-space: nowrap !important;
}

/* Keep taxonomy headers in normal flow so their description stays visible below. */
body.tax-sh_portfolio_category .gallery-page-title { position: static !important; top: auto !important; flex-flow: row nowrap !important; }
@media (max-width: 1100px) { body.tax-sh_portfolio_category .gallery-page-title { flex-flow: row wrap !important; } }
@media (max-width: 520px) {
 body.tax-sh_portfolio_category #portfolio-category-heading { display:flex !important; flex-wrap:wrap !important; align-items:baseline !important; font-size:32px !important; line-height:1.2 !important; }
 body.tax-sh_portfolio_category #portfolio-category-heading .bio-title-separator { display:none !important; }
 body.tax-sh_portfolio_category #portfolio-category-heading .bio-name-main { white-space:nowrap !important; }
 body.tax-sh_portfolio_category #portfolio-category-heading .bio-name-main::before { content:"|"; margin-left:.325em; }
}

@media (max-width: 520px) {
 html body.tax-sh_portfolio_category .gallery-page-title > h1#portfolio-category-heading.section-title { font-size: 32px !important; line-height: 1.2 !important; }
 html body.tax-sh_portfolio_category .gallery-page-title > h1#portfolio-category-heading.section-title .bio-name-main { white-space: nowrap !important; }
}

.taxonomy-page .taxonomy-results-transition { transition: opacity .18s cubic-bezier(.22,.61,.36,1), transform .18s cubic-bezier(.22,.61,.36,1); will-change: opacity, transform; }
@media (prefers-reduced-motion: reduce) {
 .taxonomy-results-transition { animation: none !important; transition: none !important; }
}

/* The category filter itself (rows, hierarchy, mobile scroll strip) is the shared
   .gallery-filters component in style.css; direction follows html[dir] for FA and EN. */
