/* ------------------------------ */
/* General Lists
/* ------------------------------ */

/* Inside entry content, make lists airier. */
.entry-content {
  & ul,
  & ol {
    & li {
      margin-bottom: var(--wp--preset--spacing--x-small);
      &:last-child {
        margin-bottom: 0;
      }
    }
  }
}

/* Option to override airy content lists */
.entry-content ul.is-style-tight,
.entry-content ol.is-style-tight,
ul.is-style-tight,
ol.is-style-tight {
  & li {
    margin-bottom: 0;
  }
}

/* ------------------------------ */
/* MDH Sidebar Navigation
/* ------------------------------ */

/* Since several of these styles are shared by the Categories list on single
post, we elect to keep these rules here in the List styles instead of with WP
Block Page List */

.mdh--sidebar-nav ul,
ul.mdh--category-nav {
  list-style: none;
  padding: 0;
}

.mdh--sidebar-nav ul {
  margin-top: 0;
}

/* Settings for all sidebar nav links */
.mdh--sidebar-nav ul li a,
.mdh--sidebar-nav a.mdh--sidebar-nav__top-level-link,
ul.mdh--category-nav li a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--wp--preset--color--neutral-darker);
  text-decoration: none;

  &:hover,
  &:active,
  &:focus {
    background-color: var(--wp--preset--color--neutral-lightest);
  }
}

/* Apparent top level: bigger & bolder */
.mdh--sidebar-nav a.mdh--sidebar-nav__top-level-link,
ul.mdh--category-nav > li > a {
  font-weight: var(--wp--custom--font-weight--semi-bold);
  font-size: var(--wp--preset--font-size--large);
}

/* Highlight:
/*   - The current page
/*   - Or the ancestor if on level 3 or below when using inline nav
/* If category nav, highlight:
/*   - The current category
/*   - The top level if on single post (news/blog/etc article) */
.wp-block-group.mdh--sidebar-nav a[aria-current="page"],
.wp-block-group.mdh--sidebar-nav .wp-block-page-list:not(.mdh--show-submenus) li.current-menu-ancestor > a,
.mdh--single-post .mdh--sidebar-nav ul.mdh--category-nav > li > a {
  background-color: var(--wp--preset--color--neutral-darker);
  color: var(--wp--preset--color--neutral-true-white);

  &:hover,
  &:active,
  &:focus {
    background-color: var(--wp--preset--color--neutral-darkest);
  }
}

/* Indent subsections */
.wp-block-group.mdh--sidebar-nav ul li a,
.wp-block-group.mdh--sidebar-nav .mdh--category-nav > li > ul a {
  padding-left: 2rem;
}
.wp-block-group.mdh--sidebar-nav ul li ul a {
  margin-left: 2rem;
}
.wp-block-group.mdh--sidebar-nav .mdh--category-nav > li > ul a {
  margin-left: 0;
}

/* Don't show below level 3. */
/* Level 3 and below appear in the tertiary/inline nav below the page header */
.wp-block-group.mdh--sidebar-nav .wp-block-page-list:not(.mdh--show-submenus) .wp-block-navigation__submenu-container {
  display: none;
}


/* Category Lists used as Sidebar Nav in News section */

/* Category lists have less specific core/default styles than Page Lists, so
there are more settings to override  */
.mdh--sidebar-nav ul.mdh--category-nav,
.mdh--sidebar-nav ul.mdh--category-nav ul {
  list-style-type: none;
}

.mdh--sidebar-nav ul.mdh--category-nav li {
  display: block;
}

/* Keep a trail highlight on the top level if on an archive page */
.mdh--category-archive .mdh--sidebar-nav ul.mdh--category-nav > li > a,
.mdh--tag-archive .mdh--sidebar-nav ul.mdh--category-nav > li > a {
  background-color: var(--wp--preset--color--neutral-white);
  &:hover,
  &:active,
  &:focus {
    background-color: var(--wp--preset--color--neutral-lightest);
  }
}

/* ------------------------------ */
/* MDH Sidebar Contact List
/* ------------------------------ */

ul.mdh--sidebar-contact__list {
  margin-top: var(--wp--preset--spacing--small);
  padding-left: 0;
  list-style: none;

  & li {
    margin-bottom: var(--wp--preset--spacing--small);
  }

  & p {
    margin: 0;
  }

  & .mdh--sidebar-contact__name {
    font-weight: var(--wp--custom--font-weight--semi-bold);
  }
}


/* ------------------------------ */
/* RHN Portal Sidebar Filters
/* ------------------------------ */

.mdh--rhn-portal-sidebar ul {
  padding-left: 0;
}

.mdh--rhn-portal-sidebar li {
  list-style: none;
  margin-bottom: var(--wp--preset--spacing--x-small);

  &:last-child {
    /* More margin here, for space before divider */
    margin-bottom: var(--wp--preset--spacing--small);
  }
}

/* Dividing lines between lists */

.mdh--rhn-portal-sidebar .wp-block-group {
  border-bottom: var(--wp--preset--color--primary-lighter) 1px solid;

  &:last-child {
    border-bottom: 0;
  }
}
