/* =============================================
   AFMA Navigation Block — style.css v1.3
   ============================================= */

:root {
  --afma-bg:         #000024;
  --afma-accent:     #d60400;
  --afma-yellow:     #ffb600;
  --afma-white:      #ffffff;
  --afma-h:          72px;
  --afma-sidebar-w:  69px;
  --afma-mob-bar-h:  63px;
  --afma-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);

  /* Calculé par JS : bottom du header dans la page */
  --afma-header-bottom: 72px;
}

/* ══════════════════════════════════════════════
   HEADER
   sticky + overflow:visible pour que le mega menu
   en position:absolute top:100% soit visible
   ══════════════════════════════════════════════ */
.afma-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--afma-h);
  background: var(--afma-bg);
  border-top: 3px solid var(--afma-accent);
  transition: background var(--afma-transition), box-shadow var(--afma-transition);
  overflow: visible;
}

.afma-header[data-sticky="transparent-to-solid"] {
  background: transparent;
  border-top-color: transparent;
  box-shadow: none;
}
.afma-header[data-sticky="transparent-to-solid"].is-scrolled {
  background: var(--afma-bg);
  border-top-color: var(--afma-accent);
  box-shadow: 0 2px 24px rgba(0,0,36,0.5);
}
.afma-header[data-sticky="always-solid"] {
  background: var(--afma-bg);
}
.afma-header[data-sticky="always-transparent"] {
  background: transparent !important;
  border-top-color: transparent !important;
  box-shadow: none !important;
}

.afma-header__inner {
  max-width: 1512px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  gap: 24px;
}

/* ── Navigation principale ───────────────────── */
.afma-header__nav { flex: 1; display: flex; justify-content: center; }

.afma-header__nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: stretch; gap: 48px;
}

.afma-header__nav-item { position: static; display: flex; align-items: center; }

.afma-header__nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 22px; font-weight: 700;
  color: var(--afma-white); text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.02em;
  line-height: var(--afma-h); padding: 0 4px;
  position: relative; white-space: nowrap;
  transition: color var(--afma-transition);
}

.afma-header__nav-link::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--afma-accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--afma-transition);
}

.afma-header__nav-item:hover  > .afma-header__nav-link::after,
.afma-header__nav-item.is-open > .afma-header__nav-link::after,
.afma-header__nav-link:focus-visible::after { transform: scaleX(1); }

.afma-header__nav-item.is-active > .afma-header__nav-link { color: var(--afma-yellow); }

.afma-header__nav-chevron {
  display: flex; align-items: center;
  transition: transform var(--afma-transition); opacity: 0.6;
}
.afma-header__nav-item:hover  > .afma-header__nav-link .afma-header__nav-chevron,
.afma-header__nav-item.is-open > .afma-header__nav-link .afma-header__nav-chevron {
  transform: rotate(180deg);
}

.afma-font--dazzle { font-family: 'Dazzle Unicase', 'Georgia', serif; font-style: normal; }
.afma-font--daniel { font-family: 'Daniel', 'Georgia', serif; font-style: normal; }

/* ── Langue ──────────────────────────────────── */
.afma-header__lang {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Open Sans', sans-serif; font-size: 11px; font-weight: 400;
  color: var(--afma-white); text-transform: uppercase; letter-spacing: 0.06em;
  opacity: 0.85; cursor: pointer;
  transition: opacity var(--afma-transition); white-space: nowrap;
}
.afma-header__lang:hover { opacity: 1; }
.afma-header__lang-icon  { display: flex; align-items: center; }
.afma-header__lang-chevron { display: flex; align-items: center; opacity: 0.6; }
.afma-header__lang-link { color: var(--afma-white); text-decoration: none; opacity: 0.5; transition: opacity var(--afma-transition); }
.afma-header__lang-link.is-active, .afma-header__lang-link:hover { opacity: 1; }
.afma-header__lang-link + .afma-header__lang-link::before { content: '/'; margin-right: 4px; opacity: 0.4; }

/* ══════════════════════════════════════════════
   MEGA MENU
   top est positionné via JS avec --afma-header-bottom
   pour coller exactement sous le header quel que soit
   le contexte (barre admin WP, scroll, etc.)
   ══════════════════════════════════════════════ */
.afma-header__submenu {
  /* absolute top:100% = s'ouvre exactement sous le header,
     fonctionne avec sticky, barre admin WP, n'importe quel contexte */
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--afma-bg);
  border-top: 2px solid var(--afma-accent);
  opacity: 0; visibility: hidden;
  transform: translateY(-10px);
  transition: opacity var(--afma-transition), transform var(--afma-transition), visibility var(--afma-transition);
  z-index: 999;
  pointer-events: none;
}

.afma-header__nav-item:hover        > .afma-header__submenu,
.afma-header__nav-item:focus-within > .afma-header__submenu,
.afma-header__nav-item.is-open      > .afma-header__submenu {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: all;
}

.afma-header__submenu-inner {
  max-width: 1512px; margin: 0 auto;
  display: flex; align-items: stretch; min-height: 280px;
}

/* Panneau gauche */
.afma-submenu-panel {
  position: relative; width: 36%; flex-shrink: 0;
  padding: 40px 48px 44px;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden; background: var(--afma-bg);
}
.afma-submenu-panel__bg {
  position: absolute; inset: 0;
  background-image: var(--panel-bg); background-size: cover; background-position: center;
  opacity: 0.22; pointer-events: none;
}
.afma-submenu-panel::after {
  content: ''; position: absolute; inset: 0 0 0 auto; width: 10%;
  background: rgba(255,255,255,0.07); pointer-events: none;
}
.afma-submenu-panel__content { position: relative; z-index: 1; }
.afma-submenu-panel__title {
  font-size: 30px; font-weight: 700; text-transform: uppercase;
  color: var(--afma-white); margin: 0 0 16px; line-height: 1.1; letter-spacing: 0.02em;
}
.afma-submenu-panel__text {
  font-family: 'Open Sans', sans-serif; font-size: 14px; font-weight: 400;
  line-height: 1.65; color: rgba(255,255,255,0.9); margin: 0 0 28px; max-width: 380px;
}
.afma-submenu-panel__btn {
  display: inline-block; background: var(--afma-yellow); color: #000;
  font-family: 'Inter', 'Open Sans', sans-serif; font-size: 15px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none;
  padding: 13px 28px; line-height: 1;
  transition: background var(--afma-transition), transform var(--afma-transition);
}
.afma-submenu-panel__btn:hover { background: #e6a400; transform: translateY(-1px); }

/* Liens droite */
.afma-submenu-links {
  flex: 1; padding: 36px 40px 40px 60px;
  display: flex; align-items: flex-start;
}
.afma-submenu-links ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0 40px; width: 100%; align-content: start;
}
.afma-submenu-links__item {
  display: flex; align-items: center; gap: 14px;
  font-family: 'Dazzle Unicase', 'Georgia', serif;
  font-size: 17px; font-weight: 700;
  color: var(--afma-white); text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: color var(--afma-transition), gap var(--afma-transition);
}
.afma-submenu-links__item:hover { color: var(--afma-yellow); gap: 20px; }
.afma-submenu-links__arrow {
  display: flex; align-items: center; flex-shrink: 0;
  color: var(--afma-yellow);
  transition: transform var(--afma-transition);
}
.afma-submenu-links__item:hover .afma-submenu-links__arrow { transform: translateX(4px); }

/* Overlay */
.afma-header__overlay {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  height: 100vh;
  background: rgba(0,0,36,0.55); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--afma-transition), visibility var(--afma-transition);
  z-index: 998; pointer-events: none;
}
.afma-header:has(.afma-header__nav-item:hover)   .afma-header__overlay,
.afma-header:has(.afma-header__nav-item.is-open) .afma-header__overlay {
  opacity: 1; visibility: visible;
}

/* ══════════════════════════════════════════════
   TIROIR MENU MOBILE — full screen sous header
   ══════════════════════════════════════════════ */
.afma-mobile-menu {
  display: none; /* affiché uniquement sur mobile */
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  height: calc(100vh - var(--afma-h) - var(--afma-mob-bar-h));
  background: var(--afma-bg);
  overflow-y: auto;
  z-index: 997;
  overscroll-behavior: contain;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.afma-mobile-menu.is-open {
  transform: translateX(0);
}

.afma-mobile-menu__nav {
  padding: 0;
}

.afma-mobile-menu__item {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.afma-mobile-menu__trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 20px 24px;
  background: none; border: none; cursor: pointer;
  color: var(--afma-white);
  font-size: 22px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.02em;
  text-align: left;
}

.afma-mobile-menu__chevron {
  display: flex; align-items: center; opacity: 0.6; flex-shrink: 0;
  transition: transform var(--afma-transition);
}

.afma-mobile-menu__item.is-open .afma-mobile-menu__chevron {
  transform: rotate(180deg);
}

/* Sous-menu mobile en accordéon */
.afma-mobile-menu__sub {
  display: none;
  flex-direction: column;
  background: rgba(255,255,255,0.04);
  padding: 8px 0 16px 24px;
}

.afma-mobile-menu__item.is-open .afma-mobile-menu__sub {
  display: flex;
}

.afma-mobile-menu__sub-link {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Dazzle Unicase', 'Georgia', serif;
  font-size: 14px; font-weight: 700;
  color: var(--afma-white); text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color var(--afma-transition);
}

.afma-mobile-menu__sub-link:hover { color: var(--afma-yellow); }

.afma-mobile-menu__sub-arrow {
  display: flex; align-items: center; flex-shrink: 0;
  color: var(--afma-yellow);
}

/* ── Burger desktop supprimé — burger dans barre mobile bas ── */

/* ══════════════════════════════════════════════
   BARRE LATÉRALE DESKTOP — Figma 233:904
   ══════════════════════════════════════════════ */
.afma-sidebar {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 990; display: flex; flex-direction: column;
  width: var(--afma-sidebar-w);
}
.afma-sidebar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; width: var(--afma-sidebar-w); height: var(--afma-sidebar-w);
  background: rgba(0,0,36,0.8); color: var(--afma-white);
  text-decoration: none; position: relative;
  transition: background var(--afma-transition);
}
.afma-sidebar__item:nth-child(1) { background: rgba(0,0,36,0.8); }
.afma-sidebar__item:nth-child(2) { background: rgba(0,0,36,1.0); }
.afma-sidebar__item:nth-child(3) { background: rgba(0,0,36,0.8); }
.afma-sidebar__item:hover { background: var(--afma-accent); }
.afma-sidebar__icon  { display: flex; align-items: center; justify-content: center; color: var(--afma-white); }
.afma-sidebar__label { font-family: 'Open Sans', sans-serif; font-size: 10px; font-weight: 400; color: var(--afma-white); text-align: center; line-height: 1.2; }
.afma-sidebar__badge { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; background: var(--afma-accent); border-radius: 50%; }
.afma-sidebar__network {
  width: var(--afma-sidebar-w); height: var(--afma-sidebar-w);
  background: rgba(0,0,36,0.5);
  display: flex; align-items: center; justify-content: center;
  color: var(--afma-white); opacity: 0.8;
}

/* ══════════════════════════════════════════════
   BARRE MOBILE BAS — Figma 1248:5073
   Fond #000024 + bloc jaune à droite
   ══════════════════════════════════════════════ */
.afma-mobile-bar {
  display: none; /* masqué desktop */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--afma-mob-bar-h);
  z-index: 996;
  overflow: hidden;
}

.afma-mobile-bar__actions {
  position: absolute;
  inset: 0;
  background: var(--afma-bg);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-right: 64px; /* réserve le bloc jaune */
}

.afma-mobile-bar__btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; flex: 1;
  color: var(--afma-white); text-decoration: none;
  height: 100%;
  transition: background var(--afma-transition);
}
.afma-mobile-bar__btn:hover,
.afma-mobile-bar__btn:active { background: rgba(255,255,255,0.08); }

.afma-mobile-bar__icon  { display: flex; align-items: center; color: var(--afma-white); }
.afma-mobile-bar__label {
  font-family: 'Open Sans', sans-serif;
  font-size: 8.75px; font-weight: 400;
  color: var(--afma-white); text-align: center; line-height: 1.2; white-space: nowrap;
}

/* Bloc jaune droit — langue / réseau */
.afma-mobile-bar__right {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 64px;
  background: var(--afma-yellow);
  display: flex; align-items: center; justify-content: center;
}

/* Burger dans le bloc jaune — fidèle Figma 1248:5075 */
.afma-mobile-bar__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  width: 100%;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

.afma-mobile-bar__burger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: #000;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

/* État ouvert — croix */
.afma-mobile-bar__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.afma-mobile-bar__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.afma-mobile-bar__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .afma-header__nav-link { font-size: 18px; }
  .afma-header__nav-list { gap: 28px; }
  .afma-submenu-panel { width: 30%; padding: 32px 32px 36px; }
  .afma-submenu-panel__title { font-size: 24px; }
  .afma-submenu-links { padding: 28px 28px 32px 40px; }
  .afma-submenu-links__item { font-size: 15px; }
}

@media (max-width: 900px) {
  .afma-header__inner { padding: 0 16px; }
  .afma-header__nav,
  .afma-header__lang { display: none; }
  /* Le burger est dans afma-mobile-bar__right, pas dans le header */
  .afma-sidebar { display: none; }
  .afma-mobile-menu { display: block; }
  .afma-mobile-bar  { display: flex; }

  /* Compensation contenu pour barre mobile */
  body { padding-bottom: var(--afma-mob-bar-h); }
}

/* ── Focus visible ───────────────────────────── */
.afma-header__nav-link:focus-visible,
.afma-submenu-links__item:focus-visible,
.afma-submenu-panel__btn:focus-visible,
.afma-sidebar__item:focus-visible,
.afma-mobile-bar__btn:focus-visible,
.afma-mobile-menu__trigger:focus-visible {
  outline: 2px solid var(--afma-yellow);
  outline-offset: 2px;
}
