/* Menu burger (écrans de 1125 px et moins) : un panneau à droite avec la navigation, les paramètres et le compte */
.ff-header__burger,
.ff-drawer {
  display: none;
}

@media (max-width: 1125px) {
  .ff-header__burger {
    display: inline-flex;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    order: 9;
    margin-right: calc(-1 * var(--ff-space-2));
  }

  .ff-header__burger > .fa-regular {
    font-size: 17px;
  }

  .ff-header .ff-header__account {
    display: none;
  }

  .ff-header--site .ff-header__start {
    gap: var(--ff-space-1);
  }

  .ff-header__nav {
    display: none;
  }

  .ff-drawer:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: block;
  }

  .ff-drawer__veil {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--ff-text) 40%, transparent);
  }

  .ff-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ff-space-1);
    box-sizing: border-box;
    width: min(320px, 86vw);
    padding: var(--ff-space-4);
    overflow-y: auto;
    background: var(--ff-surface);
    box-shadow: 0 8px 24px var(--ff-shadow-overlay);
    color: var(--ff-text);
    font-family: var(--ff-font-body);
  }

  .ff-drawer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ff-space-2);
    margin-bottom: var(--ff-space-3);
  }

  .ff-drawer__brand {
    display: flex;
    align-items: center;
    gap: var(--ff-space-2);
    min-width: 0;
    color: var(--ff-text);
    font-family: var(--ff-font-display);
    font-size: var(--ff-font-size-m);
    font-weight: 700;
    letter-spacing: -0.3px;
    text-decoration: none;
  }

  .ff-drawer__brand img {
    flex-shrink: 0;
    object-fit: contain;
  }

  .ff-drawer__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
  }

  .ff-drawer__close > .fa-regular {
    font-size: 17px;
  }

  .ff-drawer__nav,
  .ff-drawer__sub {
    display: flex;
    flex-direction: column;
    gap: var(--ff-space-1);
  }

  .ff-drawer__sub {
    margin: var(--ff-space-1) 0 var(--ff-space-1) calc(var(--ff-space-3) + 8px);
    padding-left: var(--ff-space-3);
    border-left: 1px solid var(--ff-border);
  }

  .ff-drawer__user {
    display: flex;
    align-items: center;
    gap: var(--ff-space-1);
    margin-bottom: var(--ff-space-2);
    padding-bottom: var(--ff-space-3);
    border-bottom: 1px solid var(--ff-border);
  }

  .ff-drawer__user .ff-drawer__link {
    cursor: default;
    flex: 1 1 0;
    min-width: 0;
    font-weight: 600;
  }

  .ff-drawer__link {
    display: flex;
    align-items: center;
    gap: var(--ff-space-3);
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 var(--ff-space-3);
    border: 0;
    border-radius: var(--ff-radius-control);
    background: transparent;
    color: var(--ff-text);
    font-family: var(--ff-font-body);
    font-size: var(--ff-font-size-m);
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    list-style: none;
    cursor: pointer;
  }

  .ff-drawer__link::-webkit-details-marker {
    display: none;
  }

  .ff-drawer__link > .fa-regular:first-child {
    width: 18px;
    font-size: 18px;
    text-align: center;
  }

  .ff-drawer__link > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ff-drawer__chevron {
    margin-left: auto;
    color: var(--ff-text-muted);
    font-size: 12px;
    transition: transform .14s ease;
  }

  .ff-drawer__settings[open] .ff-drawer__chevron {
    transform: rotate(180deg);
  }

  .ff-drawer__link:not(.ff-drawer__account):hover,
  .ff-drawer__logout:hover {
    background: var(--ff-surface-alt);
  }

  .ff-drawer__link[aria-current="page"] {
    background: var(--ff-series-tint);
    color: var(--ff-series-accent);
    font-weight: 600;
  }

  .ff-drawer__logout {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--ff-radius-control);
    color: var(--ff-text-muted);
    text-decoration: none;
  }

  .ff-drawer__logout:hover {
    background: var(--ff-danger-bg);
    color: var(--ff-danger);
  }

  .ff-drawer__link:focus-visible,
  .ff-drawer__logout:focus-visible,
  .ff-drawer__brand:focus-visible {
    outline: 2px solid var(--ff-focus);
    outline-offset: 2px;
  }

  @media (max-width: 620px) {
    .ff-header__burger {
      order: 2;
      margin-right: calc(-1 * var(--ff-space-2));
    }
  }

  body.ff-drawer-open {
    overflow: hidden;
  }
}

@media (max-width: 1125px) and (prefers-reduced-motion: no-preference) {
  .ff-drawer__panel {
    animation: ff-drawer-in .18s ease-out;
  }

  @keyframes ff-drawer-in {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}
