/* Menu mobile éditorial de Atelier VRL. */

@media (max-width: 68rem) {
  .site-bar__contact {
    display: none;
  }

  .site-bar {
    transition:
      top 350ms var(--ease),
      min-height 350ms var(--ease),
      background-color 350ms ease,
      border-color 350ms ease,
      color 350ms ease,
      box-shadow 350ms ease;
  }

  .menu-trigger {
    position: relative;
    z-index: 4;
    justify-self: end;
    display: grid;
    grid-template-columns: auto 1.55rem;
    grid-template-rows: repeat(2, 1px);
    align-items: center;
    gap: .34rem .75rem;
    min-width: 5.8rem;
    min-height: 2.8rem;
    padding: .7rem 0 .7rem .7rem;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .menu-trigger::before {
    grid-row: 1 / -1;
    align-self: center;
    font-family: var(--mono);
    font-size: .48rem;
    font-weight: 650;
    letter-spacing: .12em;
    text-transform: uppercase;
    content: "Menu";
  }

  .menu-trigger[aria-expanded="true"]::before {
    content: "Fermer";
  }

  .menu-trigger span {
    grid-column: 2;
    width: 1.55rem;
    height: 1px;
    background: currentColor;
    transform-origin: center;
    transition: transform 380ms var(--ease), width 300ms ease;
  }

  .menu-trigger span:first-child {
    grid-row: 1;
  }

  .menu-trigger span:last-child {
    grid-row: 2;
  }

  .menu-trigger:hover span:last-child,
  .menu-trigger:focus-visible span:last-child {
    width: 1rem;
    justify-self: end;
  }

  .menu-trigger[aria-expanded="true"] span:first-child {
    transform: translateY(.175rem) rotate(45deg);
  }

  .menu-trigger[aria-expanded="true"] span:last-child {
    width: 1.55rem;
    transform: translateY(-.175rem) rotate(-45deg);
  }

  body.menu-open .site-bar {
    background: transparent;
    border-color: rgba(238, 233, 223, .2);
    box-shadow: none;
    color: var(--ivory-light);
  }

  body.menu-open .site-bar__logo {
    border-color: rgba(205, 164, 99, .45);
  }

  .site-bar__nav {
    position: fixed;
    z-index: -1;
    top: -1rem;
    right: auto;
    bottom: auto;
    left: calc(var(--gutter) * -1);
    width: 100vw;
    max-width: none;
    counter-reset: atelier-menu;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100svh;
    padding: clamp(7.8rem, 15vh, 10rem) var(--gutter) max(1.5rem, env(safe-area-inset-bottom));
    overflow: hidden auto;
    background:
      radial-gradient(circle at 88% 84%, rgba(125, 76, 31, .18), transparent 24rem),
      #15100e;
    color: var(--ivory-light);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    clip-path: inset(0 0 100% 0);
    transform: none;
    transition:
      clip-path 650ms var(--ease),
      opacity 280ms ease,
      visibility 650ms;
  }

  .site-bar__nav::before {
    display: block;
    margin-bottom: clamp(1.8rem, 4vh, 3rem);
    padding-bottom: .85rem;
    border-bottom: 1px solid rgba(238, 233, 223, .2);
    color: #c9a66d;
    font-family: var(--mono);
    font-size: .5rem;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    content: "Atelier VRL / Navigation";
  }

  .site-bar__nav::after {
    display: block;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(238, 233, 223, .2);
    color: rgba(238, 233, 223, .55);
    font-family: var(--mono);
    font-size: .48rem;
    letter-spacing: .1em;
    line-height: 1.6;
    text-transform: uppercase;
    content: "Atelier créatif indépendant · France / Worldwide";
  }

  .site-bar__nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    clip-path: inset(0 0 0 0);
  }

  .site-bar__nav a {
    counter-increment: atelier-menu;
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: clamp(.8rem, 2.2vh, 1.25rem) 0;
    border-bottom: 1px solid rgba(238, 233, 223, .16);
    color: inherit;
    font-family: var(--serif);
    font-size: clamp(2.6rem, 7vw, 4.8rem);
    font-weight: 400;
    letter-spacing: -.04em;
    line-height: .9;
    text-transform: none;
    opacity: 0;
    transform: translateY(1.4rem);
    transition:
      opacity 420ms ease,
      transform 560ms var(--ease),
      color 240ms ease,
      padding-left 320ms var(--ease);
  }

  .site-bar__nav a::before {
    align-self: start;
    padding-top: .35rem;
    color: #c9a66d;
    font-family: var(--mono);
    font-size: .48rem;
    font-style: normal;
    letter-spacing: .08em;
    content: "0" counter(atelier-menu);
  }

  .site-bar__nav a::after {
    position: static;
    width: auto;
    height: auto;
    background: none;
    color: rgba(238, 233, 223, .5);
    font-family: var(--sans);
    font-size: .9rem;
    content: "↗";
    transform: none;
    transition: color 240ms ease, transform 320ms var(--ease);
  }

  .site-bar__nav.open a {
    opacity: 1;
    transform: translateY(0);
  }

  .site-bar__nav.open a:nth-of-type(1) { transition-delay: 150ms; }
  .site-bar__nav.open a:nth-of-type(2) { transition-delay: 205ms; }
  .site-bar__nav.open a:nth-of-type(3) { transition-delay: 260ms; }
  .site-bar__nav.open a:nth-of-type(4) { transition-delay: 315ms; }

  .site-bar__nav a:hover,
  .site-bar__nav a:focus-visible,
  .site-bar__nav a[aria-current="page"] {
    padding-left: .5rem;
    color: #d4b47e;
  }

  .site-bar__nav a:hover::after,
  .site-bar__nav a:focus-visible::after {
    color: #d4b47e;
    transform: rotate(45deg);
  }
}

@media (max-width: 48rem) {
  .site-bar__nav {
    top: -.6rem;
    right: auto;
    bottom: auto;
    left: -.7rem;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

  .site-bar__nav a {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    font-size: clamp(2.65rem, 13vw, 4rem);
  }
}

@media (max-height: 42rem) and (max-width: 68rem) {
  .site-bar__nav {
    padding-top: 6.5rem;
  }

  .site-bar__nav::before {
    margin-bottom: .5rem;
  }

  .site-bar__nav a {
    padding-top: .55rem;
    padding-bottom: .55rem;
    font-size: clamp(2.1rem, 8vh, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-bar__nav,
  .site-bar__nav a,
  .menu-trigger span {
    transition-duration: .01ms !important;
  }
}
