@import (reference) '../../styles/variables.less';

.@{prefix}-header {
  position: relative;
  z-index: 2000;
  border-bottom: solid 0.5px @c-border;
  @{dark-selector} & {
    border-bottom: solid 0.5px @c-border-dark;
  }

  &::selection,
  & ::selection {
    background: @c-primary-light;
  }

  &:not([data-static]) {
    top: 0;
    position: sticky;
    background-color: fadeout(@c-site-bg, 10%);
    backdrop-filter: blur(6px);

    @{dark-selector} & {
      background-color: @c-header-bg-dark;
    }

    // to avoid backdrop filter conflict with navbar overlay
    &[data-mobile-active] {
      background-color: @c-site-bg;
      backdrop-filter: none;

      @{dark-selector} & {
        background-color: @c-site-bg-dark;
      }
    }
  }

  &-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    // margin: 0 auto;
    padding: 0 40px;
    // max-width: @s-content-width;
    height: @s-header-height;
    box-sizing: border-box;

    @media @mobile {
      height: @s-header-height-m;
    }
  }

  &-left {
    width: @s-header-icon-width;
    display: flex;
    align-items: center;
  }

  &-right {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;

    @media @mobile {
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding-top: 24px;
      border-top: 1px solid @c-border;

      @{dark-selector} & {
        border-top-color: @c-border-dark;
      }
    }
    // }

    @media @mobile {
      position: fixed;
      top: @s-header-height-m;
      left: 0;
      right: 0;
      height: calc(100vh - @s-header-height-m);
      display: block;
      background-color: fadeout(@c-site-bg, 40%);
      border-top: 1px solid @c-border-light;
      backdrop-filter: blur(30px);
      box-sizing: border-box;
      transition: all 0.2s;

      @{dark-selector} & {
        background-color: fadeout(@c-site-bg-dark, 40%);
        border-top: 1px solid @c-border-less-dark;
      }

      .@{prefix}-header:not([data-mobile-active]) & {
        opacity: 0;
        visibility: hidden;
        padding-top: 20px;
      }
    }
  }

  &-menu-btn {
    position: absolute;
    top: 50%;
    inset-inline-end: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    transform: translateY(-50%);
    display: none;

    @media @mobile {
      display: block;
    }

    > svg {
      width: 20px;
      fill: @c-text-secondary;

      @{dark-selector} & {
        fill: @c-text-secondary-dark;
      }
    }
  }
}
