/* ----------------------------------------------------------------- */
/* This CSS file will make your Firefox OS app using Building Blocks */
/* compatible with: ie 9, Firefox 18, Chrome 24, Safari 5.1          */
/* By Arnau March - @rnowm                                           */
/* ----------------------------------------------------------------- */

/* Action menu */
form[role="dialog"][data-type="action"] > header:first-child, 
form[role="dialog"][data-type="object"] > header:first-child {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

/* Buttons */
button,
a[role="button"],
.button {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

button.danger:active,
a[role="button"].danger:active,
.button.danger:active {
  background-image: none;
}

/* Confirm */
form[role="dialog"][data-type="confirm"] > section {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

form[role="dialog"][data-type="confirm"] menu {
  display: inline-block;
  width: 100%;
}

form[role="dialog"][data-type="confirm"] menu button,
form[role="dialog"][data-type="edit"] menu button {
  width: 48%;
}


/* Edit mode */
form[role="dialog"][data-type="edit"] header menu[type="toolbar"] button {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

/* headers */
section[role="region"] > header:first-child input[type="text"] {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  line-height: 3rem;
}

section[role="region"] > header:first-child menu[type="toolbar"] a,
section[role="region"] > header:first-child menu[type="toolbar"] button {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

section[role="region"] > header:first-child menu[type="toolbar"] a:last-child, 
section[role="region"] > header:first-child menu[type="toolbar"] button:last-child {
  background: url(style/headers/images/ui/separator.png) no-repeat left center;
  background-size: auto 3.4rem;
}

section[role="region"] > header:first-child form button[type="reset"] {
  background: url(style/headers/images/icons/clear.png) no-repeat center center;
  background-size: 1.7rem auto;
}

section[role="region"] > header:first-child > button,
section[role="region"] > header:first-child > a {
  background: url(style/headers/images/ui/separator-large.png) no-repeat 2rem center;
  background-size: auto 4.8rem;
}

section[role="region"] > header:first-child .icon {
  background: transparent no-repeat center center;
  background-size: 3.5rem auto; /* 3rem RBE */
}

section[role="region"] > header:first-child > button .icon:after,
section[role="region"] > header:first-child > a .icon:after {
  background: #9d3d26 url(style/headers/images/ui/negative.png) repeat-x left bottom;
  background-size: auto 100%;
}

section[role="region"] header h2 {
  background: url(style/headers/images/ui/subheader.png) repeat 0 100%;
  background-size: auto 100%;
}

/* Input areas */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="number"],
textarea {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

fieldset legend {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

form[role="search"] p {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

form[role="search"] p input {
  line-height: 3rem;
}

/* Switches */
label input[type="checkbox"][data-type="switch"] + span {
  -moz-transition: background 0.2s ease, border 0.2s ease;
  -webkit-transition: background 0.2s ease, border 0.2s ease;
}

label input[type="checkbox"][data-type="switch"].uninit + span {
  -moz-transform: none;
  -webkit-transform: none;
}

/* Drawer */
section[role="region"]:target {
  -moz-transform: translateX(80%);
  -webkit-transform: translateX(80%);
}

section[data-type="sidebar"] > header menu[type="toolbar"] a, 
section[data-type="sidebar"] > header menu[type="toolbar"] button {
  box-sizing: border-box;
  -webkit-box-sizing: border-box; 
}

section[data-type="sidebar"] > header {
  background: url(style_unstable/drawer/images/ui/header.png) repeat-x left bottom;
  background-size: 100% auto;
}

section[data-type="sidebar"] + section[role="region"] > header:first-child > button,
section[data-type="sidebar"] + section[role="region"] > header:first-child > a {
  background-position: 5rem center; /* 4rem RBE */
}

section[data-type="sidebar"] > header menu[type="toolbar"] a:last-child,
section[data-type="sidebar"] > header menu[type="toolbar"] button:last-child {
  background: url(style_unstable/drawer/images/ui/separator.png) no-repeat left center;
  background-size: auto 3.1rem;
}

section[data-type="sidebar"] > header .icon {
  background: transparent no-repeat center center;
  background-size: 100% auto;
}

section[data-type="sidebar"] > nav > ul > li > a {
  box-sizing: border-box;
  -webkit-box-sizing: border-box; 
}

/* Progress and activity */
progress {
  -webkit-appearance: none;
}

progress:not([value]) {
  -webkit-animation: 0.9s rotate infinite steps(30);
}

progress:not([value])::-webkit-progress-bar {
  background-color: transparent;
}

progress[value]::-webkit-progress-bar {
  background: #333;
}

progress[value]::-webkit-progress-value {
  background: #01c5ed;
}

progress[value].pack-activity::-webkit-progress-bar {
  background-image: url(style_unstable/progress_activity/images/ui/activity.png);
  -webkit-animation: 0.5s move infinite steps(15);
}

progress[value].pack-activity.light::-webkit-progress-bar {
  background-color: #f4f4f4;
}

@-webkit-keyframes rotate {
  from { -webkit-transform: rotate(1deg); }
  to   { -webkit-transform: rotate(360deg); }
}

@-webkit-keyframes move {
  from { background-position: 0 0; }
  to   { background-position: 1rem 0; }
}
