/*== ShyFox Compact Menus ===========================================================================================================================

Shrink some things so they take up less space


--- CONTEXT MENU ------------------------------------------------------------------------------------------------------------------------------------

*/

@media not (-moz-platform: macos) {
  .menupopup-arrowscrollbox,
  #context-navigation > .menuitem-iconic {border-radius: var(--big-rounding) !important;}
}

#context-navigation > .menuitem-iconic[disabled="true"] {background-color: transparent !important;}

menupopup > :is(menuitem, menu){
  height: fit-content !important;
  & > * {
    padding: 0px !important;
    margin: 1px !important;
  }
  
  max-width: 300px !important;
  border-radius: var(--rounding) !important;
  margin: 0 !important;
  
  padding-block: 0px !important;
  padding-inline-start: 5px !important;
}

/* large context menu */
@media (-moz-bool-pref: "shyfox.larger.context.menu"){
  menupopup > :is(menuitem, menu) > * {padding: 5px 0px !important;}
}

/* margin for some menus */
:is(.bookmark-item, #PlacesChevron, #bookmarks-menu-button, #sidebarMenu-popup) :is(menuitem, menu) {margin-inline: 5px !important;}

/* remove some items from sidebar header menu */
#sidebarMenu-popup :is(menuitem[data-l10n-id="sidebar-menu-close"], menuseparator:nth-last-of-type(1)) {display: none}
/* 

--- EXTENSIONS MENU ---------------------------------------------------------------------------------------------------------------------------------

*/

@media not (-moz-bool-pref: "shyfox.disable.compact.unified.extensions") {

  #unified-extensions-view{

    --uei-icon-size: 24px;
    --extensions-in-row: 4;

    width: 100% !important;
    :is(
      toolbarseparator,
      .unified-extensions-item-menu-button.subviewbutton,
      .unified-extensions-item-action-button .unified-extensions-item-contents
    ) {display: none !important;}

    :is(
      #overflowed-extensions-list,
      #unified-extensions-area,
      .unified-extensions-list 
    ){
      display: grid !important;
      grid-template-columns: repeat(var(--extensions-in-row),auto);
      justify-items: center !important;
      align-items: center !important;
    }

    :is(
      :is(
        #unified-extensions-area,
        .unified-extensions-list
      ) .unified-extensions-item,
      .unified-extensions-list
    ){max-width: max-content;}

    #unified-extensions-area {
      margin-bottom: 5px !important;
      border-top: 1px solid var(--panel-separator-color);
      border-bottom: 1px solid var(--panel-separator-color);
      padding-top: 5px !important;
      padding-bottom: 5px !important;
    }
    
    .unified-extensions-item[attention] > .unified-extensions-item-action-button.subviewbutton {
      background-position: left calc(var(--uei-dot-horizontal-position-in-panel) - 4px) bottom var(--uei-dot-vertical-position-in-panel) !important;
    }
    .unified-extensions-item-action-button {padding-right: 3px !important;}
  }
}
