/**
 * @file
 * Local task tabs.
 */

.tabs {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  letter-spacing: 1px;
  list-style: none;
}

.tabs__tab {
  display: flex;
  margin-inline-start: -1px;
}

.tabs__link {
  display: flex;
  flex-grow: 1;
  align-items: center;
  height: 3.375rem;
  padding-inline: 1.6875rem;
  color: hsl(201, 15%, 44%);
  text-decoration: none;
  background-color: var(--imtm-color-white);
  border: 1px solid hsl(201, 15%, 93%);
  transition: background var(--imtm-transition);
}

.tabs__link:hover {
  color: hsl(201, 15%, 5%);
  text-decoration: none;
  background-color: hsl(201, 15%, 97%);
}

.tabs__link:focus {
  position: relative;
  outline: 3px solid var(--imtm-color-blue);
  outline-offset: -3px;
}

.tabs__tab--active .tabs__link {
  position: relative;
  font-weight: 600;
  color: hsl(201, 15%, 5%);
}

.tabs__tab--active .tabs__link::after {
  position: absolute;
  inset: -1px auto -1px -1px;
  width: calc(100% + 2px);
  content: "";
  border-bottom: 0.375rem solid var(--imtm-color-blue);
}

/* Phones and small tablets: equal cells in a tidy grid instead of a ragged
   wrap; neighbouring borders overlap so the lines stay 1px. */
@media (max-width: 767.98px) {
  .tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    margin: 1rem 0;
    padding-inline-start: 1px;
    padding-block-start: 1px;
    font-size: 0.8125rem;
    letter-spacing: 0.5px;
  }

  .tabs__tab {
    margin: -1px 0 0 -1px;
  }

  .tabs__link {
    justify-content: center;
    height: 2.75rem;
    padding-inline: 0.5rem;
    text-align: center;
  }
}
