/* Styles universels — topbar, footer, questionnaire — partagés par les 3 pages */

/* grid-column explicite sur les 3 enfants directs de .topbar (grille
   1fr auto 1fr) : sans ça, quand .topbar__nav passe en display:none sur
   mobile, l'auto-placement CSS Grid comble les colonnes dans l'ordre avec
   les enfants restants — .topbar__actions atterrit alors dans la colonne 2
   (celle de la nav) au lieu de la colonne 3, et le burger se retrouve
   collé au centre au lieu du bord droit. */
.topbar__brand {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.4s var(--ease);
}

.topbar__brand:hover {
  transform: scale(1.03);
}

/* Nav segmentée (pilule + indicateur coulissant) */
.topbar__nav {
  grid-column: 2;
  justify-self: center;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(252, 252, 251, 0.88);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 24px rgba(111, 68, 46, 0.12);
}

.topbar__nav-indicator {
  position: absolute;
  top: 5px;
  left: 0;
  width: 0;
  height: calc(100% - 10px);
  border-radius: 999px;
  background: var(--terra-dark);
  transform: translateX(0);
  pointer-events: none;
  transition:
    transform 0.45s var(--ease),
    width 0.45s var(--ease);
}

.topbar__nav a {
  position: relative;
  z-index: 1;
  padding: 9px 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--terra-dark);
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.3s var(--ease),
    text-shadow 0.3s var(--ease);
}

.topbar__nav a:hover {
  color: var(--terra);
}

.topbar__nav a.is-active,
.topbar__nav a.is-active:hover {
  color: var(--ivory);
}

.topbar__nav-trigger {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--terra-dark);
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}

.topbar__nav-trigger:hover,
.topbar__nav-item.is-open .topbar__nav-trigger {
  color: var(--terra);
}

.topbar__nav-trigger.is-active,
.topbar__nav-item.is-open .topbar__nav-trigger.is-active {
  color: var(--ivory);
}

.topbar__nav-caret {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.35s var(--ease);
}

.topbar__nav-item.is-open .topbar__nav-caret {
  transform: translateY(1px) rotate(-135deg);
}

.topbar__dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translate(-50%, -8px);
  min-width: 290px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 18px;
  background: rgba(252, 252, 251, 0.94);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 50px rgba(111, 68, 46, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease),
    visibility 0.35s var(--ease);
}

.topbar__nav-item.is-open .topbar__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.topbar__dropdown a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--terra-dark);
  transition: background 0.3s var(--ease);
}

.topbar__dropdown a:hover {
  background: rgba(111, 68, 46, 0.07);
}

.topbar__dropdown a[aria-current="page"] {
  background: rgba(111, 68, 46, 0.07);
}

.topbar__dropdown a[aria-current="page"] .topbar__dropdown-label {
  color: var(--terra);
}

.topbar__dropdown a[aria-current="page"] .topbar__dropdown-num {
  opacity: 1;
}

.topbar__dropdown a[aria-current="page"]::after {
  content: "";
  align-self: center;
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terra);
}

.topbar__dropdown-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--terra);
  opacity: 0.8;
}

.topbar__dropdown-label {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.3;
}

@media (prefers-reduced-motion: reduce) {
  .topbar__dropdown {
    transition:
      opacity 0.2s linear,
      visibility 0.2s linear;
    transform: translate(-50%, 0);
  }
}

.topbar__actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mêmes couleurs/traitement que la pilule de nav (.topbar__nav) : pas de
   hover — un bouton qui change de fond au survol sur une photo sombre
   rendait mal, on s'aligne sur le comportement neutre de la nav. */
.topbar__cart {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  border-radius: 999px;
  background: rgba(252, 252, 251, 0.88);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: var(--hairline);
  box-shadow: 0 6px 24px rgba(111, 68, 46, 0.12);
  transition: color 0.3s var(--ease);
}

.topbar__cart .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.3s var(--ease);
}

.topbar__cart.is-active .dot {
  background: var(--terra);
}

/* Icône compacte — masquée par défaut, visible seulement en version mobile
   réduite (voir @media 900px) où le libellé "Panier" disparaît. */
.topbar__cart-icon {
  display: none;
  flex-shrink: 0;
}

.topbar__cart:focus-visible,
.topbar__burger:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
  border-radius: 999px;
}

.topbar__brand:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Topbar au-dessus d'une section sombre → texte en ivoire */
.topbar.is-on-dark .topbar__nav > a,
.topbar.is-on-dark .topbar__nav-trigger {
  color: var(--ivory);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.topbar.is-on-dark .topbar__cart {
  color: var(--ivory);
}

.topbar.is-on-dark .topbar__burger-line {
  background: var(--ivory);
}

/* Burger (mobile) */
.topbar__burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 13px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.topbar__burger-line {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--terra-dark);
  transition:
    transform 0.4s var(--ease),
    background 0.4s var(--ease);
}

.topbar__burger.is-open .topbar__burger-line:first-child {
  transform: translateY(5.75px) rotate(45deg);
}

.topbar__burger.is-open .topbar__burger-line:last-child {
  transform: translateY(-5.75px) rotate(-45deg);
}

/* Menu overlay (mobile) */
.topbar__mobile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 92px 32px 40px;
  background: rgba(253, 248, 242, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(111, 68, 46, 0.12);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.4s var(--ease),
    transform 0.4s var(--ease),
    visibility 0.4s var(--ease);
}

.topbar__mobile.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.topbar__mobile-nav {
  display: flex;
  flex-direction: column;
}

.topbar__mobile-nav a {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--terra-dark);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid rgba(111, 68, 46, 0.1);
  transition: color 0.3s var(--ease);
}

.topbar__mobile-nav a:hover {
  color: var(--terra);
}

.topbar__mobile-group {
  display: flex;
  flex-direction: column;
  padding: 6px 0 12px;
  border-bottom: 1px solid rgba(111, 68, 46, 0.1);
}

.topbar__mobile-grouplabel {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terra);
  padding: 12px 0 6px;
}

.topbar__mobile-group a {
  font-size: 1.35rem;
  padding: 10px 0;
  border-bottom: none;
}

@media (prefers-reduced-motion: reduce) {
  .topbar__mobile {
    transition: opacity 0.2s linear;
    transform: none;
  }
  .topbar__nav-indicator {
    transition: none;
  }
}

@media (max-width: 900px) {
  /* Un seul fond pour toute la barre plutôt qu'une pilule isolée sur le
     panier : logo, burger et liens (menu ouvert) reposent sur la même
     bande, donc plus besoin de faire varier leurs couleurs selon la
     section défilée derrière.
     Le flou est posé sur un ::before plutôt que sur .topbar directement :
     backdrop-filter (comme transform/filter) crée un containing block pour
     les descendants position:fixed — .topbar__cart (flottant, voir plus
     bas) se positionnerait alors par rapport à la barre de 77px de haut
     au lieu du viewport, et finirait hors-écran. */
  .topbar {
    padding: 16px 22px;
  }
  .topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(252, 252, 251, 0.88);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border-bottom: var(--hairline);
    box-shadow: 0 6px 24px rgba(111, 68, 46, 0.08);
  }
  .topbar.is-on-dark .topbar__nav > a,
  .topbar.is-on-dark .topbar__nav-trigger {
    color: var(--terra-dark);
    text-shadow: none;
  }
  .topbar.is-on-dark .topbar__burger-line {
    background: var(--terra-dark);
  }
  .topbar__nav {
    display: none;
  }
  .topbar__burger {
    display: flex;
  }

  /* Panier détaché de la barre : bouton flottant fixe en bas à droite
     (test), réduit à une icône + compteur — "Panier (00)" prenait trop de
     place à côté du burger. Posé à 84px du bas (pas 20px) pour ne pas
     chevaucher le .floating-pill des pages module (centré, bottom:18px). */
  .topbar__cart {
    position: fixed;
    right: 20px;
    bottom: 84px;
    z-index: 45;
    gap: 8px;
    padding: 13px 16px;
    box-shadow: 0 12px 32px -14px rgba(111, 68, 46, 0.45);
  }
  .topbar.is-on-dark .topbar__cart {
    color: var(--terra-dark);
  }
  .topbar__cart-icon {
    display: block;
  }
  .topbar__cart-label {
    display: none;
  }
}

.quiz__cta:hover {
  background: var(--terra-dark);
  color: var(--ivory);
}

.quiz__cta:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 4px;
}

.quiz__cta-arrow {
  transition: transform 0.5s var(--ease);
}

.quiz__cta:hover .quiz__cta-arrow {
  transform: translateX(4px);
}

@media (max-width: 720px) {
  .site-footer__motif {
    width: 160px;
    height: 160px;
    bottom: -46px;
    left: -46px;
  }
}

.site-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
}

.site-footer__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
}

.site-footer__logo {
  height: 48px;
  width: auto;
  display: block;
}

.site-footer__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terra);
}

.site-footer__nav {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.site-footer__rule {
  height: 1px;
  background: rgba(111, 68, 46, 0.18);
  margin: 56px 0 28px;
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer__copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--terra);
  opacity: 0.85;
}

.site-footer__meta {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}

/* Liens : underline animé from-left */
.site-footer__nav a,
.site-footer__meta-link,
.site-footer__top-btn {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra-dark);
  text-decoration: none;
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}

.site-footer__nav a::after,
.site-footer__meta-link::after,
.site-footer__top-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.site-footer__nav a:hover,
.site-footer__meta-link:hover,
.site-footer__top-btn:hover {
  color: var(--terra);
}

.site-footer__nav a:hover::after,
.site-footer__meta-link:hover::after,
.site-footer__top-btn:hover::after {
  transform: scaleX(1);
}

.site-footer__nav a:focus-visible,
.site-footer__meta-link:focus-visible,
.site-footer__top-btn:focus-visible,
.site-footer__brand:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 4px;
  border-radius: 3px;
}

@media (max-width: 720px) {
  .site-footer {
    padding: 64px 24px 40px;
  }
  .site-footer__top {
    align-items: flex-start;
    gap: 36px;
  }
  .site-footer__nav {
    gap: 24px 32px;
  }
  .site-footer__rule {
    margin: 44px 0 24px;
  }
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .site-footer__meta {
    gap: 28px;
  }
}
