/**
 * Shared inner-page styles (templates: archery-voice-template.php,
 * archery-contact-template.php). Loaded only on those pages (see inc/enqueue.php).
 *
 * Desktop (>1280px) version of the slide-in menu (.ui-mobile-menu-wrapper),
 * opened by the banner "Menu" toggle. The theme hides this menu on desktop
 * (styles.css) and drives the tablet/mobile version from the fixed
 * .ui-menu-mobile bar (tablet.css); this block restores it as a full-width
 * top overlay with an in-wrapper header, matching the prototype. Behaviour
 * (open/close/panels) is handled by main.js initMobileMenu.
 */

@media (min-width: 1281px) {
   .ui-banner-inner {
      position: sticky;
      top: 0;
      z-index: 9990;
      pointer-events: none;
   }

   .ui-banner-inner .ui-logo,
   .ui-banner-inner .ui-bt-actions {
      pointer-events: auto;
   }

   body.ui-menu-open .ui-banner-inner {
      z-index: 100000;
   }

   .ui-banner-inner .ui-logo,
   .ui-banner-inner .ui-bt-actions a:not(.ui-menu-toggle) {
      transition:
         opacity 0.3s ease,
         background-color 0.3s ease,
         color 0.3s ease,
         border-color 0.3s ease;
   }

   body.is-page-scrolled .ui-banner-inner .ui-logo,
   body.is-page-scrolled .ui-banner-inner .ui-bt-actions a:not(.ui-menu-toggle) {
      opacity: 0;
      pointer-events: none;
   }

   body.ui-menu-open.is-page-scrolled .ui-banner-inner .ui-logo,
   body.ui-menu-open.is-page-scrolled
      .ui-banner-inner
      .ui-bt-actions
      a:not(.ui-menu-toggle) {
      opacity: 1;
      pointer-events: auto;
   }

   body.ui-menu-open .ui-banner-inner .ui-logo img {
      filter: brightness(0) invert(1);
   }

   .ui-mobile-menu-wrapper {
      position: fixed;
      top: 0;
      z-index: 99999;
      right: 0;
      left: 0;
       border-radius: 0 0 15px 15px;
      background: #70CBD3;
      padding-bottom: 102px;
      padding-inline: 20px;
      padding-top: 15px;
      display: block;
      /* Hidden by default; JS adds .is-open to fade it in */
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.3s ease, visibility 0.3s ease;
   }

   .ui-mobile-menu-wrapper.is-open {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
   }

   .ui-mobile-menu-wrapper .ui-mobile-menu-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
   }

   .ui-mobile-menu-wrapper .ui-mobile-menu-header .ui-logo img {
      filter: invert(1);
   }

   .ui-mobile-menu-wrapper .ui-mobile-menu-header .ui-mobile-menu-actions {
      display: flex;
      align-items: center;
      gap: 10px;
   }


   .ui-mobile-menu-wrapper .ui-mobile-menu-top-links {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 25px;
   }

   .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul {
      display: flex;
      align-items: center;
      list-style: none;
      margin: 0;
      padding: 0;
      gap: 16px;
   }


   .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul li a {
      color: #000;
      font-family: Montserrat;
      font-size: 14px;
      font-style: normal;
      font-weight: 400;
      line-height: 14px;
      /* 110% */
      display: flex;
   }

   .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul .ui-mobile-menu-lang {
      display: flex;
      align-items: center;
      gap: 3px;
      padding-left: 16px;
      border-left: 1px solid #000;
   }

   .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul .ui-mobile-menu-lang .active {
      text-decoration: underline;
      font-weight: 700;
   }

   .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul .ui-mobile-menu-lang span {
      display: flex;
      align-items: center;
      line-height: 10px;
   }

   .ui-mobile-menu-body ul li a {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #000;
      padding-block: 15px;
      color: #000;
      font-family: Castoro;
      font-size: 24px;
      font-style: normal;
      font-weight: 400;
      line-height: 18.2px;
      /* 75.833% */
   }

   .ui-mobile-menu-body ul li a svg {
      width: 25px;
      height: 25px;
   }

   .ui-mobile-menu-body ul {
      list-style: none;
      margin: 0;
      padding: 0;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content .ui-menu-item-links-boxs .ui-menu-item-links-box {
      min-height: 225px;
   }

   /* --- Detail view: a single panel shown inside the menu --- */

   /* Back button (between the header and the panel) */
   .ui-mobile-menu-back {
      display: none;
      align-items: center;
      gap: 8px;
      padding: 0;
      margin-bottom: 16px;
      background: none;
      border: 0;
      color: #000;
      cursor: pointer;
   }

   .ui-mobile-menu-back svg {
      width: 20px;
      height: 20px;
   }

   .ui-mobile-menu-wrapper.is-detail .ui-mobile-menu-back {
      display: flex;
      border-radius: 15px;
      border: 1px solid #E9511C;
      background: #E9511C;
      width: 42px;
      height: 42px;
      justify-content: center;
      align-items: center;
      color: #FFF;
   }

   .ui-mobile-menu-wrapper.is-detail.theme-2 .ui-mobile-menu-back {
      background: #70CBD3;
      border: 1px solid #E9511C;
   }

   /* In detail view: hide the list + top links, drop the bottom padding */
   .ui-mobile-menu-wrapper.is-detail {
      padding-bottom: 15px;
   }

   .ui-mobile-menu-wrapper.is-detail .ui-mobile-menu-top-links,
   .ui-mobile-menu-wrapper.is-detail .ui-mobile-menu-body {
      display: none;
   }

   /* Wrapper adopts the selected panel's theme colour (theme-1/3 = default
      blue, theme-2 = orange) */
   .ui-mobile-menu-wrapper.theme-2 {
      background: #E9511C;
   }

   .ui-mobile-menu-wrapper.theme-2 .ui-mobile-menu-back {
      color: #FFF;
   }

   /* Panels render inline inside the wrapper (not absolutely positioned like
      the desktop mega-menu); the wrapper supplies the background colour */
   .ui-mobile-menu-wrapper .ui-menu-items-content {
      position: static;
      padding: 0;
      border-radius: 0;
      background: transparent;
   }

   /* Keep a tall panel scrollable within the fixed wrapper */
   .ui-mobile-menu-wrapper {
      max-height: 100vh;
      overflow-y: auto;
   }

   .ui-menu-items-content .ui-menu-item-links-boxs {
      margin-bottom: 14px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-links-boxs .ui-menu-item-links-box {
      min-height: 174px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-center-link p:first-child {
      margin-bottom: 10px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-end-link {
      flex: 1;
      max-width: 100%;
      height: 73px;
   }

   .ui-mobile-menu-wrapper .ui-menu-actions,
   .ui-menu-temoignage-wrapper {
      display: none;
   }

   /* ---- Refinements desktop ----------------------------------- */

   /* Panneau pleine largeur, contenu centré sur une colonne de
      1160px, ombre portée + entrée fondu/translation. */
   .ui-mobile-menu-wrapper {
      padding-top: 26px;
      padding-bottom: 56px;
      padding-inline: max(32px, calc((100% - 1160px) / 2));
      box-shadow: 0 40px 80px rgba(0, 0, 0, 0.22);
      transform: translateY(-12px);
      transition: opacity 0.3s ease, visibility 0.3s ease,
         transform 0.35s ease;
   }

   .ui-mobile-menu-wrapper.is-open {
      transform: translateY(0);
   }

   /* Le switcher de langue et "Nous contacter" sortent du burger en
      desktop : ils restent accessibles dans la top bar. */
   .ui-mobile-menu-wrapper .ui-mobile-menu-top-links {
      display: none;
   }

   .ui-mobile-menu-wrapper .ui-mobile-menu-header {
      margin-bottom: 34px;
   }

   /* Liste : typo éditoriale, hover orange. */
   .ui-mobile-menu-body > ul > li > a {
      padding-block: 26px;
      font-size: 40px;
      line-height: 1.05;
      border-bottom-color: rgba(0, 0, 0, 0.35);
   }

   .ui-mobile-menu-body > ul > li > a > span {
      transition: transform 0.25s ease;
   }

   .ui-mobile-menu-body > ul > li > a svg {
      width: 34px;
      height: 34px;
      transition: transform 0.25s ease;
   }

   .ui-mobile-menu-body > ul > li > a:hover > span {
      transform: translateX(10px);
   }

   .ui-mobile-menu-body > ul > li > a:hover svg {
      transform: translateX(8px);
   }

   .ui-mobile-menu-body > ul > li > a:hover svg path {
      stroke: #E9511C;
   }

   /* ---- Open/close like tablet: the banner row IS the control bar ----------
      The inner banner's own row already holds [Devenir mentor] [Devenir mécène]
      [Menu toggle] (inner-banner.php). On open we hide the overlay's in-panel
      header (its logo + duplicate CTAs + close) and lift that banner row above
      the overlay, recolouring it — so the CTAs stay ALIGNED with the toggle in
      one row, and the toggle both opens and closes from the same spot. No JS. */

   /* No in-panel header on desktop — removes the panel logo + duplicate CTAs +
      close. The banner row supplies the CTAs + the toggle-as-close. */
   .ui-mobile-menu-wrapper .ui-mobile-menu-header {
      display: none;
   }

   /* Clear the top of the sheet so the floating banner row doesn't overlap the
      menu list. Tune this to the banner's height on the real page. */
   .ui-mobile-menu-wrapper {
      padding-top: 150px;
   }

   /* Lift the banner CTA row (CTAs + toggle) above the overlay (z-index 99999)
      so it stays visible + clickable while the menu is open. .ui-banner-inner is
      itself a stacking context (sticky + z-index above), so this is measured
      inside it — hence the matching z-index bump on the row while the menu is
      open; position is untouched → no jump. */
   body.ui-menu-open .ui-banner-inner .ui-banner-inner-actions .ui-bt-actions {
      position: relative;
      z-index: 100000;
   }

   /* Recolour the row over the coloured overlay (like tablet): solid buttons +
      the toggle go white; the outline button becomes white-on-transparent. */
   body.ui-menu-open
      .ui-banner-inner
      .ui-bt-actions
      .ui-btn-sky-blue:not(.outline) {
      background: #fff;
      color: #000;
      border-color: #fff;
   }

   body.ui-menu-open .ui-banner-inner .ui-bt-actions .ui-btn-sky-blue.outline {
      background: transparent;
      color: #fff;
      border-color: #fff;
   }

   /* ---- Lauréat·es detail view (Figma node 1375-965) ------------------------
      main.js mirrors the open panel's key onto the wrapper (.panel-laureats).
      The laureate features drop their photo and sit two per row, each a tall
      quote card with a full-width "Découvrir plus" card underneath.

      Width, logo and back button: same as every other panel. The sheet keeps
      the shared 1160px column (it used to go full-bleed with 20px gutters).
      The lifted banner row keeps its own logo (white, above the overlay) while
      the menu is open, so this view must not re-show the in-wrapper header's
      logo — it used to, from before the banner logo stayed visible, which
      printed two logos and left the back button (then pinned at top: 93px)
      under the banner layer. The back button now flows below the banner. */

   /* The open panel becomes a 2-column grid: the links band spans both
      columns, then each laureate card fills one (a 3rd wraps below). */
   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"].is-open {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 24px 22px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-links-boxs {
      grid-column: 1 / -1;
      margin-bottom: 0;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links {
      flex-direction: column;
      margin-bottom: 0;
   }

   /* Each laureate: the photo on the left of the quote card (like the home
      page panel), the "Découvrir plus" card across the full width below. */
   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links {
      display: grid;
      grid-template-columns: 145px minmax(0, 1fr);
      gap: 6px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-img {
      grid-column: 1;
      grid-row: 1;
      max-width: none;
      aspect-ratio: auto;
      min-height: 145px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-center-link {
      grid-column: 2;
      grid-row: 1;
      min-height: 145px;
      padding: 20px 30px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-center-link p:first-child {
      font-size: 16px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-center-link p:last-child strong {
      font-size: 18px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-end-link {
      grid-column: 1 / -1;
      grid-row: 2;
      flex: 0 0 auto;
      width: 100%;
      height: 88px;
   }

   .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-end-link p {
      font-size: 16px;
   }
}

/* ==========================================================================
   Big screens (>=1700px) — mirrors css/big-screen.css for this page.

   Every fixed px length above is re-expressed in vw so the 1440px-reference
   design scales up proportionally instead of leaving the content marooned in
   whitespace. Conversion: 1px = 0.0694486429vw (100 / 1440). Percentages, fr
   units and ratio line-heights are left untouched.

   The clamp() display headings drop their px ceiling here: the cap started
   binding at ~1700px, which would freeze them while the rest of the page
   grew. @keyframes offsets stay in px — a media query cannot override an
   individual keyframe step.
   ========================================================================== */

@media (min-width: 1700px) {
  .ui-mobile-menu-wrapper {
    border-radius: 0 0 1.04173vw 1.04173vw;
    padding-bottom: 7.08376vw;
    padding-inline: 1.38897vw;
    padding-top: 1.04173vw;
  }

  .ui-mobile-menu-wrapper .ui-mobile-menu-header {
    margin-bottom: 0.83338vw;
  }

  .ui-mobile-menu-wrapper .ui-mobile-menu-header .ui-mobile-menu-actions {
    gap: 0.69449vw;
  }

  .ui-mobile-menu-wrapper .ui-mobile-menu-top-links {
    margin-bottom: 1.73622vw;
  }

  .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul {
    gap: 1.11118vw;
  }

  .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul li a {
    font-size: 0.97228vw;
    line-height: 0.97228vw;
  }

  .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul .ui-mobile-menu-lang {
    gap: 0.20835vw;
    padding-left: 1.11118vw;
    border-left: 0.06945vw solid #000;
  }

  .ui-mobile-menu-wrapper .ui-mobile-menu-top-links ul .ui-mobile-menu-lang span {
    line-height: 0.69449vw;
  }

  .ui-mobile-menu-body ul li a {
    border-bottom: 0.06945vw solid #000;
    padding-block: 1.04173vw;
    font-size: 1.66677vw;
    line-height: 1.26397vw;
  }

  .ui-mobile-menu-body ul li a svg {
    width: 1.73622vw;
    height: 1.73622vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content .ui-menu-item-links-boxs .ui-menu-item-links-box {
    min-height: 15.62594vw;
  }

  .ui-mobile-menu-back {
    gap: 0.55559vw;
    margin-bottom: 1.11118vw;
  }

  .ui-mobile-menu-back svg {
    width: 1.38897vw;
    height: 1.38897vw;
  }

  .ui-mobile-menu-wrapper.is-detail .ui-mobile-menu-back {
    border-radius: 1.04173vw;
    border: 0.06945vw solid #E9511C;
    width: 2.91684vw;
    height: 2.91684vw;
  }

  .ui-mobile-menu-wrapper.is-detail.theme-2 .ui-mobile-menu-back {
    border: 0.06945vw solid #E9511C;
  }

  .ui-mobile-menu-wrapper.is-detail {
    padding-bottom: 1.04173vw;
  }

  .ui-menu-items-content .ui-menu-item-links-boxs {
    margin-bottom: 0.97228vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-links-boxs .ui-menu-item-links-box {
    min-height: 12.08406vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-center-link p:first-child {
    margin-bottom: 0.69449vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-end-link {
    height: 5.06975vw;
  }

  .ui-mobile-menu-wrapper {
    padding-top: 1.80566vw;
    padding-bottom: 3.88912vw;
    padding-inline: max(2.22236vw, calc((100% - 80.56043vw) / 2));
    box-shadow: 0 2.77795vw 5.55589vw rgba(0, 0, 0, 0.22);
    transform: translateY(-0.83338vw);
  }

  .ui-mobile-menu-wrapper .ui-mobile-menu-header {
    margin-bottom: 2.36125vw;
  }

  .ui-mobile-menu-body > ul > li > a {
    padding-block: 1.80566vw;
    font-size: 2.77795vw;
  }

  .ui-mobile-menu-body > ul > li > a svg {
    width: 2.36125vw;
    height: 2.36125vw;
  }

  .ui-mobile-menu-body > ul > li > a:hover > span {
    transform: translateX(0.69449vw);
  }

  .ui-mobile-menu-body > ul > li > a:hover svg {
    transform: translateX(0.55559vw);
  }

  .ui-mobile-menu-wrapper {
    padding-top: 10.4173vw;
  }

  /* Lauréat·es detail view (mirrors the >=1281px block above). */
  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"].is-open {
    gap: 1.66677vw 1.52787vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links {
    grid-template-columns: 10.07005vw minmax(0, 1fr);
    gap: 0.41669vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-img {
    min-height: 10.07005vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-center-link {
    min-height: 10.07005vw;
    padding: 1.38897vw 2.08346vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-center-link p:first-child {
    font-size: 1.11118vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-center-link p:last-child strong {
    font-size: 1.25008vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-end-link {
    height: 6.11148vw;
  }

  .ui-mobile-menu-wrapper .ui-menu-items-content[data-panel="laureats"] .ui-menu-item-bottom-links .ui-mi-end-link p {
    font-size: 1.11118vw;
  }
}

/* "Retour" link at the top of the detail pages (template-parts/back-link.php):
   article, équipe, conseil, mentor, parrain·marraine. A cyan outline pill like
   the banner's outline buttons; the arrow nudges left on hover. */
.ui-back {
  /* Its own line above whatever follows (an inline eyebrow on the article). */
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 26px;
  padding: 0 16px;
  border: 1px solid #70cbd3;
  border-radius: 15px;
  background: transparent;
  color: #000;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.26px;
  text-decoration: none;
  transition: background-color 0.3s, border-color 0.3s;
}

.ui-back:hover,
.ui-back:focus-visible {
  background: #70cbd3;
  color: #000;
}

.ui-back:focus-visible {
  outline: 2px solid #e9511c;
  outline-offset: 3px;
}

/* An SVG, not the ← glyph: a glyph sits on the text baseline and never quite
   centres in the pill; the SVG box does. */
.ui-back-arr {
  flex: none;
  display: block;
  width: 16px;
  height: 16px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ui-back:hover .ui-back-arr {
  transform: translateX(-4px);
}

@media (max-width: 640px) {
  .ui-back {
    margin-bottom: 20px;
    font-size: 13px;
  }
}

@media (min-width: 1700px) {
  .ui-back {
    gap: 0.69449vw;
    min-height: 2.91684vw;
    margin-bottom: 1.80566vw;
    padding: 0 1.11118vw;
    border-width: 0.06945vw;
    border-radius: 1.04173vw;
    font-size: 0.97228vw;
    letter-spacing: 0.01806vw;
  }

  .ui-back-arr {
    width: 1.11118vw;
    height: 1.11118vw;
  }

  .ui-back:hover .ui-back-arr {
    transform: translateX(-0.27779vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-back,
  .ui-back-arr {
    transition: none;
  }
}
