/*
 * PBK M1.03D — native navigation and widget blocks.
 *
 * The same file is loaded on the front end and in Gutenberg. It uses only
 * semantic roles exposed by theme.json, preserves native block behaviour and
 * never relies on colour alone to communicate state.
 */

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-navigation,
  .wp-block-archives,
  .wp-block-calendar,
  .wp-block-categories,
  .wp-block-latest-comments,
  .wp-block-latest-posts,
  .wp-block-page-list,
  .wp-block-rss,
  .wp-block-search,
  .wp-block-social-links,
  .wp-block-tag-cloud,
  .wp-block-widget-group,
  .wp-block-html,
  .wp-block-shortcode,
  .wp-block-legacy-widget
) {
  box-sizing: border-box;
  min-inline-size: 0;
  max-inline-size: 100%;
}

/* Navigation, including the native overlay and submenu interactions. */
:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation {
  margin-block: var(--wp--preset--spacing--lg, 1.5rem);
  color: var(--pbk-content-text-strong);
  font-size: 1rem;
  font-weight: 500;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
  .wp-block-navigation__container,
  .wp-block-navigation__submenu-container
) {
  list-style: none;
  margin: 0;
  padding: 0;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wp--preset--spacing--xs, 0.5rem) var(--wp--preset--spacing--md, 1rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
  .wp-block-navigation-item,
  .wp-block-navigation-link,
  .wp-block-navigation-submenu,
  .wp-block-home-link
) {
  position: relative;
  min-inline-size: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation-submenu {
  display: inline-flex;
  align-items: center;
  gap: var(--wp--preset--spacing--2-xs, 0.25rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
  .wp-block-navigation-item__content,
  .wp-block-navigation-link__content,
  .wp-block-home-link__content
) {
  box-sizing: border-box;
  display: inline-flex;
  min-block-size: 2.5rem;
  align-items: center;
  border-radius: 0.375rem;
  color: inherit;
  padding: var(--wp--preset--spacing--xs, 0.5rem) 0.625rem;
  line-height: 1.35;
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
  .wp-block-navigation-item__content,
  .wp-block-navigation-link__content,
  .wp-block-home-link__content
):hover {
  background: var(--wp--preset--color--action-soft, var(--pbk-content-surface-strong));
  color: var(--pbk-content-action-hover);
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
  .wp-block-navigation-item.current-menu-item,
  .wp-block-navigation-item.current-menu-ancestor
) > .wp-block-navigation-item__content {
  background: var(--wp--preset--color--action-soft, var(--pbk-content-surface-strong));
  color: var(--pbk-content-action);
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
  .wp-block-navigation__responsive-container-open,
  .wp-block-navigation__responsive-container-close
) {
  box-sizing: border-box;
  display: inline-flex;
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pbk-content-border);
  border-radius: 0.375rem;
  background: var(--pbk-content-surface);
  color: var(--pbk-content-text-strong);
  padding: var(--wp--preset--spacing--xs, 0.5rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__submenu-icon {
  box-sizing: border-box;
  display: inline-flex;
  inline-size: 1rem;
  min-inline-size: 1rem;
  block-size: 1rem;
  min-block-size: 1rem;
  flex: 0 0 1rem;
  align-items: center;
  align-self: center;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: currentColor;
  padding: 0;
  line-height: 0;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__submenu-icon svg {
  display: block;
  inline-size: 1rem;
  block-size: 1rem;
  flex: 0 0 1rem;
  color: currentColor;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
  .wp-block-navigation__responsive-container-open,
  .wp-block-navigation__responsive-container-close
):hover {
  border-color: var(--pbk-content-action);
  background: var(--wp--preset--color--action-soft, var(--pbk-content-surface-strong));
  color: var(--pbk-content-action-hover);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation-submenu__toggle:hover {
  background: transparent;
  color: var(--pbk-content-action-hover);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
  .wp-block-navigation__responsive-container-open,
  .wp-block-navigation__responsive-container-close,
  .wp-block-navigation-submenu__toggle,
  .wp-block-navigation-item__content
):focus-visible {
  outline: 3px solid var(--pbk-content-focus);
  outline-offset: 2px;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__submenu-container {
  z-index: 20;
  min-inline-size: min(18rem, calc(100vw - 2rem));
  border: 1px solid var(--pbk-content-border);
  border-radius: 0.5rem;
  background: var(--pbk-content-surface);
  padding: var(--wp--preset--spacing--xs, 0.5rem);
  box-shadow: 0 0.5rem 1.5rem color-mix(in srgb, var(--pbk-content-dark) 12%, transparent);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  inline-size: 100%;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
  box-sizing: border-box;
  overflow: auto;
  background: var(--pbk-content-canvas);
  color: var(--pbk-content-text-strong);
  padding: var(--wp--preset--spacing--lg, 1.5rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  align-items: stretch;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
}

/* Polylang's standalone switcher has a different editor/front-end wrapper. */
:where(.pbk-content, .editor-styles-wrapper) :where(
  ul.wp-block-polylang-language-switcher,
  .wp-block-polylang-language-switcher ul
) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  ul.wp-block-polylang-language-switcher,
  .wp-block-polylang-language-switcher ul
) > li {
  display: inline-flex;
  align-items: center;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  margin: 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

.editor-styles-wrapper :where(
  ul.wp-block-polylang-language-switcher,
  .wp-block-polylang-language-switcher ul
) > li {
  min-block-size: 2.5rem;
  border-radius: 0.375rem;
  padding: var(--wp--preset--spacing--xs, 0.5rem) var(--wp--preset--spacing--sm, 0.75rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-polylang-language-switcher a {
  display: inline-flex;
  min-block-size: 2.5rem;
  align-items: center;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  border-radius: 0.375rem;
  color: var(--pbk-content-text-strong);
  padding: var(--wp--preset--spacing--xs, 0.5rem) var(--wp--preset--spacing--sm, 0.75rem);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-polylang-language-switcher a:hover {
  background: var(--wp--preset--color--action-soft, var(--pbk-content-surface-strong));
  color: var(--pbk-content-action-hover);
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-polylang-language-switcher :where(
  .current-lang,
  .lang-item-current
) > a,
:where(.pbk-content, .editor-styles-wrapper) .wp-block-polylang-language-switcher a[aria-current] {
  background: var(--wp--preset--color--action-soft, var(--pbk-content-surface-strong));
  color: var(--pbk-content-action);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-polylang-language-switcher a:focus-visible,
:where(.pbk-content, .editor-styles-wrapper) .pll-switcher-select:focus-visible {
  outline: 3px solid var(--pbk-content-focus);
  outline-offset: 2px;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-polylang-language-switcher,
  .wp-block-navigation
) :where(img.flag, img.pll-flag, .lang-item img) {
  display: block;
  inline-size: 1.25rem;
  block-size: 0.9375rem;
  flex: 0 0 auto;
  border-radius: 0.25rem;
  object-fit: cover;
}

.editor-styles-wrapper .wp-block-polylang-language-switcher a:not(:first-child) {
  margin-inline-start: 0;
}

:where(.pbk-content, .editor-styles-wrapper) .pll-switcher-select {
  box-sizing: border-box;
  min-block-size: 2.5rem;
  max-inline-size: 100%;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background-color: var(--pbk-content-canvas);
  color: var(--pbk-content-text-strong);
  padding: var(--wp--preset--spacing--xs, 0.5rem) 2.25rem var(--wp--preset--spacing--xs, 0.5rem) var(--wp--preset--spacing--sm, 0.75rem);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

:where(.pbk-content, .editor-styles-wrapper) .pll-switcher-select:hover {
  border-color: var(--pbk-content-border);
  background-color: var(--wp--preset--color--action-soft, var(--pbk-content-surface-strong));
}

/* Dynamic lists use one quiet, prose-like presentation. */
:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-archives,
  .wp-block-page-list,
  .wp-block-rss,
  .wp-block-latest-posts,
  .wp-block-latest-comments
) {
  margin-block: var(--wp--preset--spacing--lg, 1.5rem);
  padding-inline-start: 0;
  list-style: none;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-archives,
  .wp-block-page-list,
  .wp-block-rss,
  .wp-block-latest-posts
) :where(a:not(.wp-element-button):not(.wp-block-button__link)) {
  color: var(--wp--style--color--link, var(--pbk-content-action));
  font-weight: 500;
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-archives,
  .wp-block-page-list,
  .wp-block-rss,
  .wp-block-latest-posts
) :where(a:not(.wp-element-button):not(.wp-block-button__link)):hover {
  color: var(--wp--style--color--link, var(--pbk-content-action-hover));
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-archives,
  .wp-block-page-list
) :where(ul, ol) {
  margin-block: var(--wp--preset--spacing--sm, 0.75rem) 0;
  padding-inline-start: var(--wp--preset--spacing--lg, 1.5rem);
  list-style: none;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-archives,
  .wp-block-page-list
) li {
  min-inline-size: 0;
  margin-block: 0;
  padding: 0;
  border: 0;
  overflow-wrap: anywhere;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-archives,
  .wp-block-page-list,
  .wp-block-rss,
  .wp-block-latest-posts:not(.is-grid)
) li + li {
  margin-block-start: var(--wp--preset--spacing--sm, 0.75rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-latest-posts.is-grid > li {
  margin-block-start: 0;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-page-list-item {
  min-inline-size: 0;
}

/* Categories are compact taxonomy filters, not a vertically divided widget. */
:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-categories,
  ul.wp-block-categories-list
) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  margin-block: var(--wp--preset--spacing--lg, 1.5rem);
  padding: 0;
  color: var(--pbk-content-action);
  list-style: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-categories li {
  display: inline-flex;
  min-inline-size: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wp--preset--spacing--2-xs, 0.25rem);
  margin: 0;
  padding: 0;
  border: 0;
  overflow-wrap: anywhere;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-categories a:not(.wp-element-button) {
  display: inline-flex;
  align-items: center;
  border-radius: var(--wp--custom--pbk--radius--badge, 0.375rem);
  background: var(--pbk-content-term-chip-background);
  color: inherit;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1rem;
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-categories a:not(.wp-element-button):hover {
  background: var(--pbk-content-term-chip-background-hover);
  color: var(--pbk-content-action-hover);
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-categories a:not(.wp-element-button):focus-visible {
  outline: 3px solid var(--pbk-content-focus);
  outline-offset: 2px;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-categories ul.children {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  margin-block: var(--wp--preset--spacing--xs, 0.5rem) 0;
  padding-inline-start: var(--wp--preset--spacing--sm, 0.75rem);
  list-style: none;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-archives-dropdown,
  .wp-block-categories-dropdown
) select {
  box-sizing: border-box;
  min-block-size: 2.75rem;
  max-inline-size: 100%;
  border: 1px solid var(--pbk-content-border);
  border-radius: 0.375rem;
  background: var(--pbk-content-canvas);
  color: var(--pbk-content-text);
  padding: var(--wp--preset--spacing--xs, 0.5rem) 2.5rem var(--wp--preset--spacing--xs, 0.5rem) var(--wp--preset--spacing--sm, 0.75rem);
  font: inherit;
}

/* Calendar remains a readable table on narrow screens. */
:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar {
  overflow-x: auto;
  margin-block: var(--wp--preset--spacing--lg, 1.5rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar table {
  inline-size: 100%;
  min-inline-size: 20rem;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--pbk-content-border);
  border-radius: var(--pbk-content-radius-frame);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar :where(caption, th, td) {
  border: 0;
  padding: var(--wp--preset--spacing--xs, 0.5rem);
  text-align: center;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar caption {
  margin-block-start: var(--wp--preset--spacing--xs, 0.5rem);
  border: 0;
  background: var(--pbk-content-surface-strong);
  color: var(--pbk-content-text-strong);
  font-weight: 600;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar :where(th, td):not(:last-child) {
  border-inline-end: 1px solid var(--pbk-content-border);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar thead th,
:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar tbody tr:not(:last-child) td {
  border-block-end: 1px solid var(--pbk-content-border);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar th {
  background: var(--pbk-content-surface);
  color: var(--pbk-content-text-strong);
  font-weight: 600;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar .wp-calendar-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--wp--preset--spacing--md, 1rem);
  margin-block-start: var(--wp--preset--spacing--xs, 0.5rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar :where(
  td a,
  .wp-calendar-nav a
) {
  color: var(--wp--style--color--link, var(--pbk-content-action));
  font-weight: 500;
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-calendar :where(
  td a,
  .wp-calendar-nav a
):hover {
  color: var(--wp--style--color--link, var(--pbk-content-action-hover));
}

/* Latest comments keep Core's avatar geometry and quiet list spacing. */
:where(.pbk-content, .editor-styles-wrapper) .wp-block-latest-comments li {
  min-inline-size: 0;
  border: 0;
  padding: 0;
  overflow-wrap: anywhere;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-latest-posts__featured-image {
  margin-block-end: var(--wp--preset--spacing--xs, 0.5rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-latest-posts__featured-image img {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  block-size: auto;
  border-radius: 0.375rem;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-latest-posts__post-date,
  .wp-block-latest-comments__comment-date,
  .wp-block-rss__item-publish-date,
  .wp-block-rss__item-author
) {
  display: block;
  margin-block-start: var(--wp--preset--spacing--2-xs, 0.25rem);
  color: var(--pbk-content-text-muted);
  font-size: var(--wp--preset--font-size--small, 0.875rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-latest-comments__comment-excerpt {
  margin-block-start: var(--wp--preset--spacing--xs, 0.5rem);
  color: inherit;
  font-size: inherit;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-latest-comments__comment-excerpt p {
  font-size: inherit;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-rss__item-excerpt {
  margin-block-start: var(--wp--preset--spacing--xs, 0.5rem);
  color: var(--pbk-content-text-muted);
  font-size: var(--wp--preset--font-size--small, 0.875rem);
  line-height: 1.6;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-rss li {
  margin-block: 0;
  padding: 0;
  border: 0;
  overflow-wrap: anywhere;
}

:where(.pbk-content, .editor-styles-wrapper) .pbk-stylebook-empty-state:empty,
:where(.pbk-content, .editor-styles-wrapper) .wp-block-rss:empty {
  display: block;
  min-block-size: 4rem;
  border: 1px dashed var(--pbk-content-border);
  border-radius: 0.5rem;
  background: var(--pbk-content-surface);
}

/* Search maps Core's variants to the same control language as KTUI forms. */
:where(.pbk-content, .editor-styles-wrapper) .wp-block-search {
  margin-block: var(--wp--preset--spacing--lg, 1.5rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__label {
  display: block;
  margin-block-end: var(--wp--preset--spacing--xs, 0.5rem);
  color: var(--pbk-content-text-strong);
  font-weight: 600;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__inside-wrapper {
  display: flex;
  min-inline-size: 0;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  border: 0;
  background: transparent;
  padding: 0;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__input {
  box-sizing: border-box;
  min-inline-size: 0;
  min-block-size: 2.5rem;
  block-size: 2.5rem;
  flex: 1 1 auto;
  border: 1px solid var(--pbk-content-border);
  border-radius: var(--pbk-content-radius-control);
  background: var(--pbk-content-canvas);
  color: var(--pbk-content-text);
  padding: 0 var(--wp--preset--spacing--md, 1rem);
  box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
  font: inherit;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__button {
  box-sizing: border-box;
  display: inline-flex;
  min-block-size: 2.5rem;
  block-size: 2.5rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid var(--pbk-content-action);
  border-radius: var(--pbk-content-radius-control);
  background: var(--pbk-content-action);
  color: var(--wp--preset--color--on-action, var(--pbk-content-on-dark));
  padding: 0 var(--wp--preset--spacing--md, 1rem);
  box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__button:hover {
  border-color: var(--pbk-content-action-hover);
  background: var(--pbk-content-action-hover);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__button-inside .wp-block-search__inside-wrapper {
  gap: var(--wp--preset--spacing--2-xs, 0.25rem);
  border: 1px solid var(--pbk-content-border);
  border-radius: var(--pbk-content-radius-control);
  background: var(--pbk-content-canvas);
  padding: var(--wp--preset--spacing--2-xs, 0.25rem);
  box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__button-inside .wp-block-search__input {
  min-block-size: 2rem;
  block-size: 2rem;
  border: 0;
  border-radius: calc(var(--pbk-content-radius-control) - 0.125rem);
  padding-inline: var(--wp--preset--spacing--xs, 0.5rem);
  box-shadow: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__button-inside .wp-block-search__button {
  min-block-size: 2rem;
  block-size: 2rem;
  padding-inline: var(--wp--preset--spacing--sm, 0.75rem);
  box-shadow: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__button-inside .wp-block-search__inside-wrapper:focus-within {
  border-color: var(--pbk-content-focus);
  outline: 3px solid var(--pbk-content-focus);
  outline: 3px solid color-mix(in srgb, var(--pbk-content-focus) 30%, transparent);
  outline-offset: 2px;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-search__button-inside .wp-block-search__input:focus-visible {
  outline: 0;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-search__input,
  .wp-block-search__button,
  .wp-block-archives-dropdown select,
  .wp-block-categories-dropdown select
):focus-visible {
  outline: 3px solid var(--pbk-content-focus);
  outline-offset: 2px;
}

/* The editorial share actions and the default Social Icons block share one skin. */
.pbk-social-action {
  box-sizing: border-box;
  display: inline-flex;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: var(--wp--preset--color--action-soft, #eff6ff);
  color: var(--wp--preset--color--text-strong, #020617);
  padding: 0.625rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.pbk-social-action:hover {
  background: var(--wp--preset--color--surface-strong, #dbeafe);
  color: var(--wp--custom--pbk--color--action-hover, #1e3a8a);
  text-decoration: none;
}

.pbk-social-action:focus-visible {
  outline: 3px solid var(--wp--custom--pbk--color--focus, Highlight);
  outline-offset: 3px;
}

.pbk-social-action__icon,
.pbk-social-action__icon svg {
  display: block;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  color: currentColor;
  fill: currentColor;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links {
  --pbk-social-action-size: 2.5rem;
  --pbk-social-icon-size: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  margin-block: var(--wp--preset--spacing--lg, 1.5rem);
  padding: 0;
  list-style: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links.has-small-icon-size {
  --pbk-social-action-size: 2rem;
  --pbk-social-icon-size: 1rem;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links.has-large-icon-size {
  --pbk-social-action-size: 3rem;
  --pbk-social-icon-size: 1.5rem;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links.has-huge-icon-size {
  --pbk-social-action-size: 3.5rem;
  --pbk-social-icon-size: 1.75rem;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-link {
  margin: 0;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-link:hover {
  transform: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.is-style-logos-only) .wp-block-social-link-anchor {
  box-sizing: border-box;
  display: inline-flex;
  min-block-size: var(--pbk-social-action-size);
  align-items: center;
  justify-content: center;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  border: 0;
  border-radius: 9999px;
  padding: calc((var(--pbk-social-action-size) - var(--pbk-social-icon-size)) / 2);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.is-style-logos-only):not(.is-style-pill-shape):not(.has-visible-labels) .wp-block-social-link-anchor {
  inline-size: var(--pbk-social-action-size);
  block-size: var(--pbk-social-action-size);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.is-style-logos-only) .wp-block-social-link-anchor svg {
  inline-size: var(--pbk-social-icon-size);
  block-size: var(--pbk-social-icon-size);
  color: currentColor;
  fill: currentColor;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.is-style-logos-only):not(.has-icon-background-color) .wp-social-link {
  background: transparent;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.is-style-logos-only):not(.has-icon-background-color) .wp-block-social-link-anchor {
  background: var(--wp--preset--color--action-soft, #eff6ff);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.is-style-logos-only):not(.has-icon-color) .wp-block-social-link-anchor {
  color: var(--pbk-content-text-strong);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.is-style-logos-only):not(.has-icon-background-color) .wp-block-social-link-anchor:hover {
  background: var(--wp--preset--color--surface-strong, #dbeafe);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.is-style-logos-only):not(.has-icon-color) .wp-block-social-link-anchor:hover {
  color: var(--pbk-content-action-hover);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-link-anchor:hover {
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-link-anchor:focus-visible {
  outline: 3px solid var(--pbk-content-focus);
  outline-offset: 2px;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-social-links:not(.has-visible-labels) .wp-block-social-link-label {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The default Tag Cloud keeps Core's inline flow and popularity scale. */
:where(.pbk-content, .editor-styles-wrapper) .wp-block-tag-cloud {
  margin-block: var(--wp--preset--spacing--lg, 1.5rem);
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-tag-cloud:not(.is-style-outline) a {
  color: var(--wp--style--color--link, var(--pbk-content-action));
  font-weight: 500;
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-tag-cloud:not(.is-style-outline) a:hover {
  color: var(--wp--style--color--link, var(--pbk-content-action-hover));
}

/* Containers for legacy, raw and widget content remain bounded. */
:where(.pbk-content, .editor-styles-wrapper) .wp-block-widget-group {
  margin-block: var(--wp--preset--spacing--xl, 2rem);
  border: 1px solid var(--pbk-content-border);
  border-radius: 0.5rem;
  background: var(--pbk-content-surface);
  padding: var(--wp--preset--spacing--lg, 1.5rem);
  overflow-wrap: anywhere;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-widget-group > :first-child {
  margin-block-start: 0;
}

:where(.pbk-content, .editor-styles-wrapper) .wp-block-widget-group > :last-child {
  margin-block-end: 0;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-html,
  .wp-block-shortcode,
  .wp-block-legacy-widget
) {
  margin-block: var(--wp--preset--spacing--lg, 1.5rem);
  overflow-wrap: anywhere;
}

:where(.pbk-content, .editor-styles-wrapper) :where(
  .wp-block-html,
  .wp-block-shortcode,
  .wp-block-legacy-widget
) :where(img, iframe, table, pre) {
  max-inline-size: 100%;
}

:where(.pbk-content, .editor-styles-wrapper) .pbk-stylebook-custom-html {
  border: 1px dashed var(--pbk-content-border);
  border-radius: 0.5rem;
  background: var(--pbk-content-surface);
  padding: var(--wp--preset--spacing--md, 1rem);
}

/* Native front-end pagination generated by wp_link_pages() for core/nextpage. */
:where(.pbk-content, .editor-styles-wrapper) .post-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wp--preset--spacing--xs, 0.5rem);
  margin-block: var(--wp--preset--spacing--xl, 2rem);
  border-block-start: 1px solid var(--pbk-content-border);
  padding-block-start: var(--wp--preset--spacing--md, 1rem);
  color: var(--pbk-content-text-strong);
  font-weight: 600;
}

:where(.pbk-content, .editor-styles-wrapper) .post-nav-links .post-page-numbers {
  box-sizing: border-box;
  display: inline-flex;
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pbk-content-border);
  border-radius: 0.375rem;
  background: var(--pbk-content-surface);
  color: var(--pbk-content-action);
  padding: var(--wp--preset--spacing--xs, 0.5rem) var(--wp--preset--spacing--sm, 0.75rem);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .post-nav-links a.post-page-numbers:hover {
  border-color: var(--pbk-content-action);
  background: var(--wp--preset--color--action-soft, var(--pbk-content-surface-strong));
  color: var(--pbk-content-action-hover);
  text-decoration: none;
}

:where(.pbk-content, .editor-styles-wrapper) .post-nav-links .post-page-numbers.current {
  border-color: var(--pbk-content-action);
  background: var(--pbk-content-action);
  color: var(--wp--preset--color--on-action, var(--pbk-content-on-dark));
}

:where(.pbk-content, .editor-styles-wrapper) .post-nav-links a.post-page-numbers:focus-visible {
  outline: 3px solid var(--pbk-content-focus);
  outline-offset: 2px;
}

@media (max-width: 48rem) {
  :where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__container,
  :where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
    inline-size: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  :where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation-item__content {
    inline-size: 100%;
  }

  :where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation .wp-block-navigation__submenu-container {
    position: static;
    inline-size: 100%;
    min-inline-size: 0;
    margin-block-start: var(--wp--preset--spacing--2-xs, 0.25rem);
    box-shadow: none;
  }

}

@media (forced-colors: active) {
  :where(.pbk-content, .editor-styles-wrapper) :where(
    .wp-block-navigation .wp-block-navigation-item__content,
    .wp-block-search__button,
    .wp-block-social-link-anchor,
    .wp-block-tag-cloud.is-style-outline a,
    .post-nav-links .post-page-numbers
  ) {
    border: 1px solid ButtonText;
  }

  :where(.pbk-content, .editor-styles-wrapper) .wp-block-navigation :where(
    .wp-block-navigation-item.current-menu-item,
    .wp-block-navigation-item.current-menu-ancestor
  ) > .wp-block-navigation-item__content {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
