/* -------------------------------------------------------------------------
 * SDG second-level navigation ("extra layer").
 *
 * The SDG sidebar block (fido_sdgs / menu_block:sdgs, template
 * menu--sdgs.html.twig) renders the children of the active section item as an
 * always-open, indented sub-list.
 *
 * The sub-list sits INSIDE the active top-level <li>, which the theme paints
 * white (.sidebar nav ul.nav li.active { background:#fff }). So to be seamless
 * with the surrounding pink region the sub-list must paint its OWN background
 * with the section colour (pink #C31575), scoped to body.sdgs-section -- that
 * keeps it "follows the section" (the same literal the theme already uses for
 * this section) rather than a global hard-code, and covers the white active
 * background behind it. No tints (a translucent tint over the white active
 * <li> reads grey, which is the bug this replaces).
 *
 * Links: white text like the top-level items, just indented. The current page
 * is a white strip with dark text, like the active top-level item. No bottom
 * margin/padding, so the list flows flush into the pink items above and below
 * (no white separator strip).
 *
 * Attached via the fido/sdg_subnav library from menu--sdgs.html.twig.
 * Hand-maintained (not from the gulp SCSS build); if the SCSS is rebuilt, fold
 * these rules into scss/components/sidebar.scss next to the .sidebar-menu rules.
 * ---------------------------------------------------------------------------*/

.sidebar nav.menu--sdgs ul.sdg-submenu {
  list-style: none;
  /* Full-bleed inside the sidebar (counteracts the 1rem li padding); no bottom
     margin so there is no white strip below the last item. */
  margin: 0 -1rem;
  padding: 0;
}

.sidebar nav.menu--sdgs ul.sdg-submenu .sdg-submenu__item {
  padding: 0;
}

.sidebar nav.menu--sdgs ul.sdg-submenu .sdg-submenu__link {
  display: block;
  padding: 0.5rem 1rem 0.5rem 1.75rem; /* indented under the parent item */
  color: #fff;                          /* white, like the top-level items */
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: none;
}

/* Hover: every sidebar menu item gets a white underline, like the header menu
   (#block-fido-main-menu > ul > li > a:hover). Covers both first-sidebar menus
   (the SDG menu--sdgs and the main-menu menu--sidebar) at every level.
   The .sdg-submenu__link selector is spelled out in full so it outranks the
   base `.sdg-submenu__link { text-decoration: none }` rule (which otherwise
   wins by specificity and swallows the hover underline on the sub-items). */
.sidebar nav.menu--sdgs a:hover,
.sidebar nav.menu--sdgs a:focus,
.sidebar nav.menu--sdgs ul.sdg-submenu .sdg-submenu__link:hover,
.sidebar nav.menu--sdgs ul.sdg-submenu .sdg-submenu__link:focus,
.sidebar nav ul.sidebar-menu a:hover,
.sidebar nav ul.sidebar-menu a:focus {
  color: #fff;
  text-decoration: underline;
}

/* Active indicator: the exact current page is marked with an UNDERLINE on white
   text, exactly like the header menu (#block-fido-main-menu a.active uses
   text-decoration: underline). No white background -- the item keeps the
   section-pink bg, same as the non-active items. Applies to the current
   top-level item and the current sub-item. */
.sidebar nav.menu--sdgs .nav-link.is-current,
.sidebar nav.menu--sdgs ul.sdg-submenu .sdg-submenu__link.is-current {
  color: #fff;
  background-color: transparent;
  text-decoration: underline;
}

/* Paint the sub-list with THIS section's colour so it is seamless with the
   surrounding pink region (and covers the white active-<li> it sits inside).
   Scoped to the section -> follows the section rather than a global hard-code. */
body.sdgs-section .sidebar nav.menu--sdgs ul.sdg-submenu {
  background-color: #C31575;
}

/* The OTHER first-sidebar menu (menu--sidebar.html.twig, block
   fido_navigationprincipale -- the navy non-SDG sections). Same active
   treatment: the current page (both levels) is an underline on white text,
   keeping the section-colour (navy) background -- no white strip. This replaces
   the theme's .sidebar nav ul.sidebar-menu a.active white highlight, which no
   longer fires now that the template emits is-current instead of active. */
.sidebar nav ul.sidebar-menu a.is-current,
.sidebar nav ul.sidebar-menu .sidebar-menu__sub a.is-current {
  color: #fff;
  background-color: transparent;
  text-decoration: underline;
}
