/* ----------------------------------
* Tabs
* ---------------------------------- */

[role="tablist"] {
  margin: 0;
  padding: 0;
  position: absolute;
  width: 100%;
  height: 100%;
}

[role="tablist"] > [role="tab"] {
  list-style: none;
  margin: 0;
  padding: 0;
  float: left;
}

/* Items calcs */
[role="tablist"][data-items="2"] > [role="tab"] {
  width: calc(100% / 2);
}

[role="tablist"][data-items="3"] > [role="tab"] {
  width: calc(100% / 3);
}

[role="tablist"][data-items="4"] > [role="tab"] {
  width: calc(100% / 4);
}

[role="tablist"][data-items="5"] > [role="tab"] {
  width: calc(100% / 5);
}

[role="tablist"] > [role="tab"] > a {
  font-size: 1.3rem;
  text-decoration: none;
  line-height: 4rem;
  text-align: center;
  color: #FFF;
  float: left;
  width: 100%;
  background: #000 no-repeat center top;
  position: relative;
  color: #fff;
}

[role="tablist"] > [role="tab"] > a:active {
  background-color: #008aaa;
  color: #fff;
}

[role="tablist"] > [role="tab"][aria-disabled="true"] > a:active {
  background-color: #000;
}

[role="tablist"] > [role="tab"] > a.icon {
  font-size: 0;
}

[role="tablist"] > [role="tab"] > a.icon:after {
  content: '';
  width: 100%;
  height: 100%;
  position: absolute;
  background: none no-repeat center top / 3rem auto;
  left: 0;
  z-index: 1;
}


/* Selected state */
[role="tablist"] > [role="tab"]:target > a,
[role="tablist"] > [role="tab"][aria-selected="true"] > a {
  color: #62c6f5
}

[role="tablist"] > [role="tab"]:target > a.icon:after,
[role="tablist"] > [role="tab"][aria-selected="true"] > a.icon:after {
  background-position: center -4rem;
}

/* Disabled state */
[role="tablist"] > [role="tab"][aria-disabled="true"] > a {
  color: #4d4d4d;
}

[role="tablist"] > [role="tab"][aria-disabled="true"] > a.icon:after {
  background-position: center -8rem;
}

[role="tablist"] [role="tabpanel"] {
  position: absolute;
  top: 4rem;
  left: 0;
  visibility: hidden;
  width: 100%;
  height: calc(100% - 4rem);
  z-index: 10;
  display: block;
  overflow: auto;
}

[role="tablist"] :target [role="tabpanel"],
[role="tablist"] [aria-selected="true"] [role="tabpanel"] {
  z-index: 1;
  visibility: visible;
}

/* Position bottom */
[role="tablist"].bottom > [role="tab"] {
  height: 100%;
}

[role="tablist"].bottom  > [role="tab"] > a {
  position: relative;
  height: 4rem;
  top: calc(100% - 4rem);
}

[role="tablist"].bottom [role="tabpanel"] {
  top: 0;
}

/* ----------------------------------
 * Filters
 * ---------------------------------- */

[role="tablist"][data-type="filter"] {
  background: #c7c7c7;
  display: inline-block;
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  background: #eef2f5 url(tabs/images/ui/background.png) repeat-x left bottom;
  height: 4rem;
}

[role="tablist"][data-type="filter"] > [role="tab"] {
  float: left;
  text-align: center;
  -moz-box-sizing: border-box;
  color: #737272;
  border-left: solid 0.1rem #b1b4b5;
}

[role="tablist"][data-type="filter"] > [role="tab"]:first-child {
  border-left: none;
}

[role="tablist"][data-type="filter"] > [role="tab"] > a {
  display: block;
  padding: 0 0.5rem;
  text-decoration: none;
  color: #737272;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-color: transparent;
  font-weight: normal;
  font-size: 1.6rem;
  line-height: 4rem;
  width: auto;
  float: none;
}

/* Selected state */
[role="tablist"][data-type="filter"] > [role="tab"]:target,
[role="tablist"][data-type="filter"] > [role="tab"][aria-selected="true"] {
  background: #fff;
}

[role="tablist"][data-type="filter"] > [role="tab"]:target > a,
[role="tablist"][data-type="filter"] > [role="tab"][aria-selected="true"] > a {
  color: #000;
  font-weight: 500;
}

[role="tablist"][data-type="filter"] > [role="tab"] > a:active {
  background-color: #008aaa;
  color: #fff;
}

/* Bottom position */
[role="tablist"][data-type="filter"].bottom {
  bottom: 100%;
  top: auto;
  background: #eef2f5 url(tabs/images/ui/background-revert.png) repeat-x left top;
}

[role="tablist"][data-type="filter"].bottom > [role="tab"] > a {
  height: auto;
}
