/* ============================================================
   Chocolata Graphics — layout : header, rails latéraux, footer
   ============================================================ */

/* ---------- Header fixe ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-h);
  background: var(--paper);
}

.site-header__brand img {
  width: 186px;
  height: auto;
}

.lang-switch {
  position: absolute;
  right: calc(var(--rail-w) + 18px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.lang-switch a {
  padding: 4px 2px;
  opacity: 0.35;
}

.lang-switch a[aria-current] {
  opacity: 1;
  font-weight: 700;
  color: #111;
}

/* ---------- Rails latéraux ---------- */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 90;
  width: var(--rail-w);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rail--left {
  left: 0;
  justify-content: flex-start;
  padding: calc(var(--header-h) + 24px) 0 22px;
}

.rail--right {
  right: 0;
  justify-content: flex-start;
  gap: 26px;
  padding-top: calc(var(--header-h) + 26px);
}

.rail__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* Libellé + « // » sur la même ligne verticale : WEB-DESIGN // MOTION-DESIGN // … */
.rail__item {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  letter-spacing: 0.2em;
}

.rail__item a {
  position: relative;
  padding: 2px;
}

/* Rollover : filet vertical à droite du libellé, qui monte du bas vers le haut,
   à la couleur d'accent de la rubrique (voir .cat--<slug> dans base.css).
   L'item est pivoté de 180° : gauche/haut locaux = droite/bas à l'écran. */
.rail__item a::after {
  content: "";
  position: absolute;
  inset: 2px auto 2px -7px;
  width: 1px;
  background: var(--cat-accent, var(--ink));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.rail__item a:hover::after,
.rail__item a:focus-visible::after {
  transform: scaleY(1);
}

.rail__sep {
  margin-inline-start: 1em;
}

/* Picto sous WEB-DESIGN, comme sur le site en ligne */
.rail__picto {
  margin-top: 34px;
}

.rail__picto img {
  width: 34px;
  height: auto;
}

.rail__contact {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  letter-spacing: 0.22em;
  padding: 4px 2px;
}

.rail__insta {
  padding: 4px;
}

/* ---------- Contenu principal ---------- */
main {
  margin: 0 var(--rail-w);
  padding-top: var(--header-h);
}

/* ---------- Footer ---------- */
.site-footer {
  margin: 0 var(--rail-w);
  padding: 56px 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  background: #fff;
  color: #1c1c1c;
}

.site-footer__logo img {
  width: 92px;
  height: auto;
}

.site-footer__copy {
  font-size: 9px;
  letter-spacing: 0.14em;
}

/* ---------- Burger (mobile) ---------- */
.nav-toggle {
  display: none;
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 110;
  width: 40px;
  height: 40px;
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 1.5px;
  margin: 3.5px auto;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-open .nav-toggle__bar:first-child {
  transform: translateY(2.5px) rotate(45deg);
}

.nav-open .nav-toggle__bar:nth-child(2) {
  transform: translateY(-2.5px) rotate(-45deg);
}

.u-mobile-only {
  display: none;
}

/* ---------- Responsive (référence : site en ligne) ---------- */
@media (max-width: 960px) {
  :root {
    --rail-w: 0px;
    --header-h: 60px;
  }

  .nav-toggle {
    display: block;
  }

  .site-header__brand img {
    width: 150px;
  }

  .lang-switch {
    right: 18px;
  }

  .rail--right {
    display: none;
  }

  /* Le rail gauche devient un panneau plein écran */
  .rail--left {
    inset: var(--header-h) 0 0 0;
    width: auto;
    justify-content: center;
    padding: 0;
    background: var(--paper);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.4s ease, visibility 0.4s;
  }

  .nav-open .rail--left {
    transform: translateX(0);
    visibility: visible;
  }

  .rail__list {
    gap: 8px;
  }

  .rail__item {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 13px;
    letter-spacing: 0.22em;
  }

  .rail__item a::after {
    display: none;
  }

  .rail__item a {
    padding: 12px 8px;
  }

  .rail__sep {
    display: none;
  }

  .rail__picto {
    position: absolute;
    bottom: 32px;
  }

  .u-mobile-only {
    display: flex;
  }

  main,
  .site-footer {
    margin: 0;
  }
}

/* ---------- Home audio toggle ---------- */

.lang-switch--home {
  position: absolute;
}

.lang-switch--home .audio-toggle {
  position: absolute;
  left: calc(100% + 7px);
  top: 50%;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  opacity: 0.65;
  transform: translateY(-50%);
}

.lang-switch--home .audio-toggle:hover,
.lang-switch--home .audio-toggle:focus-visible {
  opacity: 1;
}

.lang-switch--home .audio-toggle__icon {
  display: block;
  width: 26px;
  height: 26px;
}

.lang-switch--home .audio-toggle.is-playing .audio-icon__mute {
  display: none;
}