// Tabs

//
// Variables
//

@import "../variables";


//
// Base styles
//

joomla-tab {
  display: flex;
  flex-direction: column;
}

joomla-tab[view=tabs] > div[role=tablist] {
  display: flex;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  list-style: outside none none;
  background-color: #f5f5f5;
  border-color: #ccc #ccc currentcolor;
  border-style: solid solid none;
  border-width: 1px 1px 0;
  border-radius: .25rem .25rem 0 0;
  border-image: none;
  box-shadow: 0 1px #fff inset, 0 2px 3px -3px rgba(0, 0, 0, .15), 0 -4px 0 rgba(0, 0, 0, .05) inset, 0 0 3px rgba(0, 0, 0, .04);
}

joomla-tab[view=accordion] > div[role=tablist] {
  display: none;
}

joomla-tab button[role=tab] {
  position: relative;
  display: block;
  padding: .75em 1em;
  color: #0d1321;
  text-decoration: none;
  background-color: transparent;
  border: unset;
  box-shadow: 1px 0 0 rgba(0, 0, 0, .05);
  appearance: none;
}

joomla-tab button[role=tab][aria-expanded="true"],
joomla-tab button[role=tab][aria-selected="true"] {
  background-color: rgba(0, 0, 0, .03);
  background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .05) 100%);
  border-right: 0 none;
  border-left: 0 none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: 2px 0 1px -1px rgba(0, 0, 0, .08) inset, -2px 0 1px -1px rgba(0, 0, 0, .08) inset, 0 1px 0 rgba(0, 0, 0, .02) inset;
}

joomla-tab button[aria-expanded="true"]::after,
joomla-tab button[aria-selected="true"]::after
{
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 5px;
  content: "";
  background-color: #006898;
  opacity: .8;
}

joomla-tab > joomla-tab-element {
  position: relative;
  display: none;
  padding: 15px;
  background-color: #fefefe;
  border: 1px solid #ccc;
  border-radius: 0 0 .25rem .25rem;
  box-shadow: 0 0 3px rgba(0, 0, 0, .04);
}

joomla-tab > joomla-tab-element[active] {
  display: block;
}

joomla-tab[orientation=vertical] {
  flex-direction: row;
  align-items: flex-start;
}

joomla-tab[orientation=vertical] > div[role=tablist] {
  flex-direction: column;
  min-width: 30%;
  height: auto;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: .25rem;
  box-shadow: none;
}

joomla-tab[orientation=vertical] > div[role=tablist] button:last-of-type {
  border-bottom: 0;
}

joomla-tab[orientation=vertical] > div[role=tablist] button {
  position: relative;
  display: block;
  padding: .75em 1em;
  color: #0d1321;
  text-decoration: none;
  background-color: transparent;
  border-bottom: 1px solid #ddd;
  box-shadow: none;
  appearance: none;
}

joomla-tab[orientation=vertical] > div[role=tablist] button[aria-expanded="true"] {
  background-color: #fff;
  background-image: none;
  border-right: 0 none;
  border-left: 0 none;
  box-shadow: none;
}

joomla-tab[orientation=vertical] > div[role=tablist] button[aria-expanded="true"]::after {
  top: 0;
  bottom: 0;
  left: -1px;
  width: 5px;
  height: auto;
}

joomla-tab[orientation=vertical] > joomla-tab-element {
  padding: 15px;
  border: 0 none;
  box-shadow: none;
}

joomla-tab[view=accordion] {
  flex-direction: column;
  white-space: normal;
  border-radius: .25rem;
  box-shadow: 0 1px #fff inset, 0 0 3px rgba(0, 0, 0, .04);

  > button {
    position: relative;
    display: block;
    padding: .75em 1em;
    color: #0d1321;
    text-decoration: none;
    background-color: #f5f5f5;
    border: unset;
    box-shadow: 1px 0 0 rgba(0, 0, 0, .05);
    appearance: none;

    &[aria-expanded=true],
    &:focus {
      background-color: rgba(0, 0, 0, .03);
      background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .05) 100%);
    }
  }
}

joomla-tab[view=accordion] joomla-tab-element {
  display: none;
  padding: 15px;
}

joomla-tab[view=accordion] joomla-tab-element[active] {
  display: block;
  border-bottom: 1px solid #ddd;
}

joomla-tab[view=accordion] [active] {
  background-color: #fff;
}

joomla-tab[view=accordion] button {
  appearance: none;
  border-bottom: 1px solid #ddd;
}

joomla-tab[view=accordion] button[aria-expanded="true"]::after {
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
}
