@charset "utf-8";

/* Global cursor rule placed here historically; consider moving to a base/reset file */
[href], [onclick], [type=button], a, button,
input[type=checkbox] + label,
input[type=radio] + label {
  cursor: pointer;
}

.tab--container {
  overflow: hidden;
  position: relative;
  -webkit-transition: all .2s;
  transition: all .2s;
  width: 100%;
}

.tab--block {
  flex-direction: column;
  flex-shrink: 0;
  height: 0;
  margin-top: .25rem;
  padding: 0 2rem;
  -webkit-transition: all 0s;
  transition: all 0s;
  width: 100%;
}

.tabs {
  --number-of-tabs: 3;
  flex-wrap: wrap;

  & > input {
    border: none;
    outline: none;
    padding: 4px 12px;
  }

  & > input[type="radio" i] {
    -webkit-appearance: auto;
    appearance: auto;
    background-color: initial;
    border: initial;
    box-sizing: border-box;
    cursor: default;
    margin: 3px 3px 0 5px;
    padding: initial;
  }

  & > label {
    align-items: flex-end;
    cursor: pointer;
    display: flex;
    font-size: .85rem;
    justify-content: center;
    padding: 1rem;
    position: relative;
    text-align: center;
    width: calc(100% / var(--number-of-tabs));

    &:hover {
      background: var(--compare);
    }

    &:first-of-type::before {
      background-color: #ddd;
      content: "";
      height: 2px;
      left: 0;
      position: absolute;
      top: 100%;
      width: calc(var(--number-of-tabs) * 100%);
    }

    &:last-of-type::after {
      background: var(--color-6);
      content: "";
      height: 4px;
      position: absolute;
      right: 0;
      top: calc(100% - 2px);
      -webkit-transition: all .2s;
      transition: all .2s;
      width: 100%;
    }
  }

  /* Slides the active-tab underline indicator to the selected label */
  & > [type="radio"]:indeterminate ~ label:last-of-type::after,
  & > [type="radio"]:nth-of-type(1):checked ~ label:last-of-type::after {
    right: calc(100% * (var(--number-of-tabs) - 1));
  }

  & > [type="radio"]:nth-of-type(2):checked ~ label:last-of-type::after {
    right: calc(100% * (var(--number-of-tabs) - 2));
  }

  & > [type="radio"]:nth-of-type(3):checked ~ label:last-of-type::after {
    right: calc(100% * (var(--number-of-tabs) - 3));
  }

  & > [type="radio"]:nth-of-type(4):checked ~ label:last-of-type::after {
    right: calc(100% * (var(--number-of-tabs) - 4));
  }

  & > [type="radio"]:nth-of-type(5):checked ~ label:last-of-type::after {
    right: calc(100% * (var(--number-of-tabs) - 5));
  }

  & > [type="radio"]:nth-of-type(6):checked ~ label:last-of-type::after {
    right: calc(100% * (var(--number-of-tabs) - 6));
  }

  /* Slides the tab container so the matching .tab--block is visible */
  & > [type="radio"]:nth-last-of-type(1):checked ~ .tab--container .tab--block:first-of-type {
    margin-left: calc(-100% * (var(--number-of-tabs) - 1));
  }

  & > [type="radio"]:nth-last-of-type(2):checked ~ .tab--container .tab--block:first-of-type {
    margin-left: calc(-100% * (var(--number-of-tabs) - 2));
  }

  & > [type="radio"]:nth-last-of-type(3):checked ~ .tab--container .tab--block:first-of-type {
    margin-left: calc(-100% * (var(--number-of-tabs) - 3));
  }

  & > [type="radio"]:nth-last-of-type(4):checked ~ .tab--container .tab--block:first-of-type {
    margin-left: calc(-100% * (var(--number-of-tabs) - 4));
  }

  & > [type="radio"]:nth-last-of-type(5):checked ~ .tab--container .tab--block:first-of-type {
    margin-left: calc(-100% * (var(--number-of-tabs) - 5));
  }

  & > [type="radio"]:nth-last-of-type(6):checked ~ .tab--container .tab--block:first-of-type {
    margin-left: calc(-100% * (var(--number-of-tabs) - 6));
  }

  /* :has()-based approach — sets height/padding on the active block directly */
  &:has(:indeterminate) .tab--container .tab--block:nth-of-type(1),
  &:has(:nth-child(1):checked) .tab--container .tab--block:nth-of-type(1),
  &:has(:nth-child(2):checked) .tab--container .tab--block:nth-of-type(2),
  &:has(:nth-child(3):checked) .tab--container .tab--block:nth-of-type(3),
  &:has(:nth-child(4):checked) .tab--container .tab--block:nth-of-type(4),
  &:has(:nth-child(5):checked) .tab--container .tab--block:nth-of-type(5),
  &:has(:nth-child(6):checked) .tab--container .tab--block:nth-of-type(6) {
    height: 100%;
    padding: 2rem;
  }

  & .read-more {
    align-items: center;
    color: var(--color-6);
    margin-top: 1rem;

    &:hover {
      color: var(--color-7);
    }
  }

  & .img-container {
    background-color: var(--color-6);
    border-radius: var(--circle);
    margin-left: 1rem;
    padding: 0.25rem;

    &:hover {
      background: var(--color-7);
    }

    & img {
      height: 1.5rem;
      -webkit-transform: translateX(-0.25rem);
      transform: translateX(-0.25rem);
      width: 1.5rem;
    }
  }
}

@media screen and (max-width: 480px) {
  .tab--block {
    flex-direction: column !important;
    padding: 2rem .25rem;
  }

  .tabs {
    flex-direction: column;

    & thead {
      top: 0 !important;
    }

    & > label {
      align-items: center;
      height: 3rem;
      justify-content: flex-start;
      text-align: left;
      width: 100%;

      &:first-of-type::before {
        height: calc(var(--number-of-tabs) * 100%);
        left: unset;
        right: 100%;
        top: 0;
        width: 2px;
      }

      &:last-of-type::after {
        height: 100%;
        left: unset;
        right: calc(100% - 1px);
        top: unset;
        width: 4px;
      }
    }

    & > [type="radio"]:indeterminate ~ label:last-of-type::after,
    & > [type="radio"]:nth-of-type(1):checked ~ label:last-of-type::after {
      bottom: calc(100% * (var(--number-of-tabs) - 1));
      right: calc(100% - 1px);
    }

    & > [type="radio"]:nth-of-type(2):checked ~ label:last-of-type::after {
      bottom: calc(100% * (var(--number-of-tabs) - 2));
      right: calc(100% - 1px);
    }

    & > [type="radio"]:nth-of-type(3):checked ~ label:last-of-type::after {
      bottom: calc(100% * (var(--number-of-tabs) - 3));
      right: calc(100% - 1px);
    }

    & > [type="radio"]:nth-of-type(4):checked ~ label:last-of-type::after {
      bottom: calc(100% * (var(--number-of-tabs) - 4));
      right: calc(100% - 1px);
    }

    & > [type="radio"]:nth-of-type(5):checked ~ label:last-of-type::after {
      bottom: calc(100% * (var(--number-of-tabs) - 5));
      right: calc(100% - 1px);
    }

    & > [type="radio"]:nth-of-type(6):checked ~ label:last-of-type::after {
      bottom: calc(100% * (var(--number-of-tabs) - 6));
      right: calc(100% - 1px);
    }

    & .docs.multi-column {
      width: 100% !important;
    }
  }
}
