/* ==========================================================================
   Tabs Component (.lm-tabs)
   Horizontal tabs that control external content panels via IDs
   ========================================================================== */

@layer components {
  .lm-tabs {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .lm-tabs::after {
    position: absolute;
    bottom: 0;
    left: 0;
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-blue-dark);
    transition: background-color 0.3s ease;
  }

  .lm-tabs--two-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .lm-tabs--three-items {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Ensure tabs stretch horizontally and distribute evenly using grid */
  .lm-tabs .lm-tabs__tab {
    position: relative;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    font-weight: normal;
    min-height: 42px;
    background-color: transparent;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }

  .lm-tabs .lm-tabs__tab.tab-active::after {
    position: absolute;
    bottom: 0;
    left: 0;
    content: "";
    display: block;
    width: 100%;
    height: 6px;
    background-color: var(--color-blue-dark);
    transition: background-color 0.3s ease;
  }

  /* Label styling */
  .lm-tabs__label {
    display: inline-block;
    padding-inline: var(--space-3, 0.75rem);
    padding-block: var(--space-2, 0.5rem);
  }

  @media screen and (min-width: 1024px) {
    .lm-tabs__label {
      white-space: nowrap;
    }
  }

  /* Active state tweaks on top of .tabs-box/.tab utilities */
  .lm-tabs .lm-tabs__tab.tab-active,
  .lm-tabs .lm-tabs__tab[aria-selected="true"] {
    background-color: #E5EEF8;
    font-weight: 600;
    color: var(--color-blue-dark);
  }
}