#header-section {
  --header-background: #171918;
  --header-text: #f6f4f0;
  position: sticky;
  top: var(--drupal-displace-offset-top, 0px);
  z-index: 90;
  color: var(--header-text);
  background: var(--header-background);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);

  .site-header__bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 28px;
    min-height: 76px;
    padding: 10px 0;
  }
  .site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    color: var(--header-text);
    font-family: var(--font-title);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -.035em;
    text-decoration: none;
  }
  .site-brand__mark { flex-shrink: 0; width: 44px; height: 44px; }
  .site-brand__mark--easel { width: 36px; height: 48px; }
  .site-brand__mark--artist { width: 46px; height: 50px; }
  .site-brand__mark--triangle-brush { width: 52px; height: 44px; }
  .site-header__brand:hover { color: var(--color-brown-100); }
  .site-header__menu { flex: 1; min-width: 0; }
  .site-header__menu .offcanvas-body { justify-content: center; padding: 0; }
  .navbar-nav { align-items: center; gap: clamp(12px, 2vw, 32px); margin: 0; padding: 0; list-style: none; }
  .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 2px;
    color: var(--header-text);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    text-decoration: none;
    transition: color .15s ease;
  }
  .nav-link:hover { color: var(--color-brown-100); }
  .nav-link.active {
    color: var(--header-text);
    &::after {
      content: '';
      position: absolute;
      right: 2px;
      bottom: 3px;
      left: 2px;
      height: 2px;
      border-radius: 2px;
      background: currentColor;
    }
  }
  a:focus:not(:focus-visible), button:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
  }
  a:focus-visible, button:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 3px; }
  .site-header__actions { display: flex; flex-shrink: 0; align-items: center; gap: 12px; margin-left: auto; }
  .site-account__toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-width: 44px; min-height: 44px; padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px;
    background: transparent; color: var(--header-text); font-size: 15px; line-height: 1.6; text-decoration: none;
    .bi { font-size: 21px; }
    &:hover, &[aria-expanded='true'] { color: var(--header-text); background: rgba(255, 255, 255, .08); }
  }
  .site-account__menu {
    min-width: 230px; padding: 8px; margin-top: 8px; border: 1px solid #e6e1db; border-radius: 10px;
    background: #fff; box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    li { margin: 0; padding: 0; list-style: none; }
    .dropdown-item { display: flex; align-items: center; min-height: 44px; padding: 9px 14px; border-radius: 5px; color: #332a22; font-size: 15px; text-decoration: none; }
    .dropdown-item:hover, .dropdown-item:focus { color: #332a22; background: #f5f2f0; }
    .dropdown-item:focus-visible { outline-color: var(--color-brown-200); outline-offset: -2px; }
    .site-account__return { color: #005747; font-weight: 600; }
    .site-account__logout { border-top: 1px solid #eee8e0; border-radius: 0; margin-top: 5px; }
  }
  .block-language {
    .dropdown-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-width: 148px;
      min-height: 44px;
      padding: 8px 20px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: transparent;
      color: var(--header-text);
      font-size: 16px;
      line-height: 1.6;
    }
    .dropdown-toggle:hover, .dropdown-toggle.show { background: rgba(255, 255, 255, .07); }
    .language-switcher__icon { font-size: 17px; opacity: .7; }
    .language-switcher__label { flex: 1; text-align: left; }
    .dropdown-toggle::after {
      flex-shrink: 0;
      width: 6px;
      height: 6px;
      margin: -3px 1px 0 4px;
      border: 0;
      border-right: 1.5px solid currentColor;
      border-bottom: 1.5px solid currentColor;
      transform: rotate(45deg);
      opacity: .7;
      transition: transform .15s ease;
    }
    .dropdown-toggle.show::after { margin-top: 3px; transform: rotate(225deg); }
    .dropdown-menu {
      margin-right: 0;
      min-width: 100%;
      width: 100%;
      padding: 8px;
      border: 1px solid rgba(255, 255, 255, .12);
      border-radius: 10px;
      background: #222522;
      box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
      li + li { margin-top: 3px; }
    }
    .language-link {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 20px;
      min-height: 44px;
      padding: 10px 14px;
      border: 0;
      border-radius: 5px;
      color: var(--header-text);
      background: transparent;
      font-size: 16px;
      text-align: left;
      text-decoration: none;
    }
    a.language-link:hover, a.language-link:focus { color: var(--header-text); background: rgba(255, 255, 255, .08); }
    .language-link.is-active { padding-right: 34px; background: rgba(255, 255, 255, .06); }
    .language-link .bi-check2 { position: absolute; right: 10px; font-size: 16px; opacity: .75; }
  }
  .mobile-offcanvas-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 6px;
    color: var(--header-text);
    background: transparent;
  }
  .mobile-offcanvas-button:hover { background: rgba(255, 255, 255, .08); }
  .navbar-toggler-icon { width: 24px; height: 24px; }
}

@media (max-width: 991.98px) {
  #header-section {
    .site-header__bar { min-height: 68px; gap: 12px; padding: 10px 0; }
    .site-header__brand { font-size: 28px; }
    .site-brand__mark { width: 36px; height: 36px; }
    .site-brand__mark--easel { width: 30px; height: 38px; }
    .site-brand__mark--artist { width: 36px; height: 40px; }
    .site-brand__mark--triangle-brush { width: 42px; height: 36px; }
    .site-header__actions { gap: 8px; }
    .block-language .dropdown-toggle { min-width: 132px; padding-inline: 16px; font-size: 15px; }
    a:focus-visible, button:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 3px; }
    #mobileMenu {
      --bs-offcanvas-width: min(340px, 90vw);
      top: var(--drupal-displace-offset-top, 0px);
      color: var(--header-text);
      background: var(--header-background);
      border-left: 1px solid rgba(255, 255, 255, .14);
      &:focus { outline: none; box-shadow: none; }
      .offcanvas-header { gap: 20px; padding: 20px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
      .offcanvas-title { margin: 0; color: var(--header-text); font-size: 24px; }
      .btn-close { flex-shrink: 0; width: 44px; height: 44px; box-sizing: border-box; margin: 0 0 0 auto; padding: 12px; opacity: 1; }
      .offcanvas-body { padding: 20px; }
      .navbar-nav { align-items: stretch; gap: 8px; }
      .nav-link { min-height: 52px; padding: 12px 16px; border-radius: 5px; font-size: 18px; }
      .nav-link:hover { color: var(--header-text); background: rgba(255, 255, 255, .05); }
      .nav-link.active { color: var(--header-text); background: rgba(255, 255, 255, .1); box-shadow: none; }
      .nav-link.active::after { display: none; }
      .nav-link:focus-visible { outline-offset: 2px; }
    }
  }
}

@media (max-width: 360px) {
  #header-section {
    .site-header__bar { gap: 8px; }
    .site-header__brand { gap: 5px; font-size: 20px; }
    .site-brand__mark { width: 24px; height: 24px; }
    .site-brand__mark--easel { width: 26px; height: 34px; }
    .site-brand__mark--artist { width: 30px; height: 34px; }
    .site-brand__mark--triangle-brush { width: 34px; height: 28px; }
    .block-language .dropdown-toggle { gap: 7px; padding-inline: 12px; }
    .block-language .dropdown-toggle::after { margin-left: 2px; }
  }
}

@media (max-width: 575px) {
  #header-section .block-language {
    .dropdown-toggle { min-width: 44px; padding-inline: 10px; }
    .language-switcher__label {
      position: absolute; width: 1px; height: 1px; padding: 0;
      overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
    .dropdown-menu { min-width: 150px; width: auto; }
  }
}

@media (prefers-reduced-motion: reduce) {
  #header-section .nav-link, #header-section .block-language .dropdown-toggle::after { transition: none; }
}
