// Hide the WP "Trash" actions dropdown on the sidebar post card.
.editor-post-card-panel .editor-all-actions-button {
  display: none;
}

.edit-post-visual-editor__post-title-wrapper,
.editor-visual-editor__post-title-wrapper {
  margin: 0 !important;
}

.edit-post-sidebar,
.editor-sidebar {
  select {
    background-repeat: no-repeat;
    background-position: center right;
  }
}

.edit-post-header,
.editor-header {
  .edit-post-fullscreen-mode-close {
    // background-color: #0678be;
    display: none;

    &.drupal {
      .is-fullscreen-mode & {
        display: flex;
      }
    }

    // svg {
    //   width: 48px;
    //   height: 48px
    // }
  }
}

.edit-post-layout,
.editor-layout {
  transition: ease-in-out 0.2s all;
}

.edit-post-welcome-guide {
  .components-guide__page-control {
    li[aria-current="step"] {
      svg {
        circle {
          fill: $primary-color;
        }
      }
    }
  }
}

// Hide Welcome Guide & Help menu items from Tools menu
.edit-post-more-menu__content {
  .components-popover__content {
    .components-dropdown-menu__menu {
      .components-menu-group:nth-child(3) {
        div[role='group'] {
          *:nth-child(4), *:nth-child(5) {
            display: none;
          }
        }
      }
    }
  }
}

body {
  #toolbar-bar {
    transition: ease-in-out 0.2s margin-top;
  }
}

body.is-fullscreen-mode {
  #toolbar-bar {
    /* display: none; */
    margin-top: -4rem;
  }
  .edit-post-layout,
  .editor-layout {
    left: 0 !important;
    top: 0 !important;
    z-index: 999 !important;
  }
  .ui-autocomplete {
    z-index: 1000;
  }
}

input[type="search"] {
  box-sizing: border-box;
}

// Drupal form actions (Save, Preview, Delete) in the editor header.
.drupal-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;

  .gutenberg-header-settings {
    display: flex;
    align-items: center;
    gap: 8px;

    .form-actions {
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 0px;
      margin-block: 0;

      a {
        white-space: nowrap;
      }
    }
  }
}

// Wide screens: all buttons inline, no dropdown toggle.
@media (min-width: 783px) {
  .drupal-form-actions__dropdown {
    display: none;
  }

  .drupal-form-actions__menu {
    display: contents;
  }
}

// Small screens: only Save + "..." toggle visible.
@media (max-width: 782px) {
  .drupal-form-actions__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 2px;
    color: #1e1e1e;

    &:hover {
      background: #f0f0f0;
    }
  }

  .drupal-form-actions__menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 100001;
    min-width: 160px;

    &.is-open {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    input, button, a {
      width: 100%;
      text-align: left;
      white-space: nowrap;
    }
  }
}