@use '../../00-settings/settings' as *;
@use '../../00-mixins/mixins' as *;

.tabs {
  [role='tabpanel'] {
    @include theme('background-color', 'color-secondary-pastel', 'tab-background-color');

    padding: 20px 20px 10px;

    &:target {
      display: block;
    }

    &[aria-hidden] {
      &[aria-hidden='true'] {
        display: none;
      }

      &[aria-hidden='false'] {
        display: block;
      }
    }
  }

  [role='tablist'] {
    display: flex;
    flex-direction: column;
    margin: 0;
    list-style: none;

    @include desktop {
      flex-direction: row;
    }

    > li[role='presentation'] {
      flex: 0 0 auto;
      margin: 0;

      a,
      a[href^="mailto:"],
      a[download],
      a[href^="http://"]:not([href*="gent.be"]),
      a[href^="https://"]:not([href*="gent.be"]) {
        @include reset-link-background;
        @include theme('color', 'color-tertiary', 'default-text-color');

        & {
          display: inline-block;
          width: 100%;
          padding: 20px;
          font-weight: 600;
          line-height: 128%;
          text-align: center;
          text-decoration: none;
        }

        @include desktop {
          width: auto;
          font-size: 1rem;
          line-height: 130%;
          text-align: left;
        }

        &::after {
          @include theme('color', 'color-zero');

          & {
            content: '';
            display: block;
            bottom: 0;
            left: 0;
            width: 0;
            margin: 0 auto;
            overflow: visible;
            transition: width 100ms;
            border-bottom: 3px solid;
          }
        }

        &[role='tab'][aria-selected='true'],
        &:hover,
        &:focus {
          background: transparent;

          &::after {
            width: 100%;
          }
        }
      }

      [role='tab'][aria-selected='true'] {
        @include theme('background-color', 'color-secondary-pastel', 'tab-background-color');

        border-bottom: 0;
      }
    }
  }

  &.light {
    [role='tabpanel'] {
      background-color: transparent;
    }

    [role='tablist'] {
      @include theme('border-color', 'color-secondary-pastel', 'tab-background-color');
    }
  }
}
