/*
 *
 * extensions of standard menu style definitions, see master style sheet for more menu related styles.
 *
 */

ul#menu-bar /*top level menu*/
{
  font: system; font-rendering-mode:classic;
  behavior:menu-bar;
  flow: horizontal;
  color:windowtext; 
  margin:0;  
}

ul#menu-bar > li /* menu item in menu bar */ 
{  
  padding:2dip 8dip;
  margin:0;
  white-space:nowrap;
  width:max-intrinsic;
  display:block;
  flow:horizontal;
}

ul#menu-bar > li:current /* current menu item in menu bar */ 
{  
  background-color:highlight; color:highlighttext; 
}

button[type="menu"]
{
  behavior:button popup-menu; 
}

button[type="menu"]:owns-popup /* button when popup is shown */
{
	background-image:url(theme:button-pressed); /* ?? */  
}

menu  /* popup menu */
{
  font: system; font-rendering-mode:classic;
  behavior:menu; /*is a menu*/
  flow: vertical;
  display:none; 
  margin:0;  
  padding:1dip;
  max-width:max-intrinsic;
  /*min-width: max-intrinsic;*/
  border:1dip solid threedshadow;
  background-color: window;
  color:windowtext;
  margin:0 1dip; /* to offset it from parent li */    
}

menu menu /* secondary popup menu */
{
  max-width: max-intrinsic;
}

/* menu item in popup menus */
menu li
{  
  width:*;
  flow:horizontal;
  padding-left:24dip; /* room for icon */
  padding-right:12dip; /* room for the arrow */
  padding-top:4dip; 
  padding-bottom:4dip; 
  foreground-repeat: no-repeat;
  foreground-position: 2dip 50%;
  color:windowtext;
}

menu li:rtl 
{  
  width:*;
  padding-right:24dip; /* room for icon */
  padding-left:12dip; /* room for the arrow */
  foreground-repeat: no-repeat;
  foreground-position-right: 2dip;
  foreground-position-top: 50%;
  text-align:right;
  color:windowtext;
}


menu li:disabled { color:graytext; foreground-image: none; }

/* accesskey label (span) */
menu li span.accesskey
{
  display:block;
  width:max-intrinsic;
  white-space:nowrap;
  margin-left:*; /* spring to attach it to the right */
  padding-left:1em;
  color:threedshadow;
}

menu li:current span.accesskey
{
  color:#FFD700;
}


/* menu with single <menu> inside - submenu */
menu li:has-child-of-type(menu)
{
  foreground-image:url(stock:arrow-right); /* that arrow */
  foreground-repeat: no-repeat;
  foreground-position: 100% 50%;
}

menu li:has-child-of-type(menu):rtl
{
  foreground-image:url(stock:arrow-left); /* that arrow */
  foreground-repeat: no-repeat;
  foreground-position: 0% 50%;
}


/* current menu item */
menu li:hover:owns-popup,
menu li:current
{ 
  //background-color:highlight; 
  //color:highlighttext;  
  //border-radius:3dip;
  background:url(theme:list-view-item-selected) stretch;
}

/* menu separator */
menu hr 
{
  margin:2dip; 
}


/* radio menu item */
menu li[type="radio"]
{ 
	behavior:radio; 
	foreground-repeat:no-repeat; 
	foreground-position:3dip 50%;
	foreground-image:url(theme:radio-normal);  
}
menu li[type="radio"]:hover
{ 
	foreground-image:url(theme:radio-hover);  
}
menu li[type="radio"]:active
{ 
	foreground-image:url(theme:radio-pressed);  
}
menu li[type="radio"]:disabled
{ 
	foreground-image:url(theme:radio-disabled);  
}
menu li[type="radio"]:checked
{ 
	foreground-image:url(theme:radio-checked-normal);  
}
menu > li[type="radio"]:checked:hover
{ 
	foreground-image:url(theme:radio-checked-hover);  
}
menu li[type="radio"]:checked:active
{ 
	foreground-image:url(theme:radio-checked-pressed);  
}
menu li[type="radio"]:checked:disabled
{ 
	foreground-image:url(theme:radio-checked-disabled);  
}

/* checkmark menu item */
menu li[type="check"]
{ 
	behavior:check; 
	foreground-repeat:no-repeat; 
	foreground-position:3dip 50%;
	foreground-image:url(theme:check-normal);  
}
menu li[type="check"]:hover
{ 
	foreground-image:url(theme:check-hover);  
}
menu li[type="check"]:active
{ 
	foreground-image:url(theme:check-pressed);  
}
menu li[type="check"]:disabled
{ 
	foreground-image:url(theme:check-disabled);  
}
menu li[type="check"]:checked
{ 
	foreground-image:url(theme:check-checked-normal);  
}
menu li[type="check"]:checked:hover
{ 
	foreground-image:url(theme:check-checked-hover);  
}
menu li[type="check"]:checked:active
{ 
	foreground-image:url(theme:check-checked-pressed);  
}
menu li[type="check"]:checked:disabled
{ 
	foreground-image:url(theme:check-checked-disabled);  
}

