/**
 * @file plugins/themes/default/styles/helpers.less
 *
 * Copyright (c) 2014-2019 Simon Fraser University
 * Copyright (c) 2003-2019 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @brief Helper classes and reusable components
 */

//
// A horizontal navigation list
//
// This component is applied to the hierarchical unordered navigation lists. It
// supports nested lists that will be displayed on hover.
//
// <ul class="pkp_nav_list">
//   <li>
//     <a href="#" aria-haspopup="true" aria-expanded="false">1</a>
//     <ul>
//       <li>
//         <a href="#">1-a</a>
//       </li>
//     </ul>
//   </li>
// </ul>
//
.pkp_nav_list {
	margin: 0;
	padding: 0;
	list-style: none;

	li {
		position: relative;
		display: inline-block;
	}

	a {
		display: inline-block;
		padding-left: @base;
		padding-right: @base;
		text-decoration: none;
		padding-top: @half;
		padding-bottom: @half;
	}

	ul {
		position: absolute;
		top: 100%;
		left: -9999px;
		z-index: 1000;
		width: 15em;
		margin: 0;
		padding: 0;
		background: @bg;
		border-radius: @radius;
		box-shadow: 0 0 5px rgba(0,0,0,0.3);

		li {
			display: block;
		}

		a {
			display: block;
			padding-left: @half;
			border-left: @half solid transparent;

			&:hover,
			&:focus {
				outline: 0;
				background: @bg-shade;
				border-color: @primary;
			}
		}

		li:first-child a {
			border-top-left-radius: @radius;
			border-top-right-radius: @radius;
		}

		li:last-child a {
			border-bottom-left-radius: @radius;
			border-bottom-right-radius: @radius;
		}
	}

	> li:hover ul {
		left: 0;
	}

	[aria-haspopup]:after {
		position: relative;
		display: inline-block;
		content: '';
		width: 0;
		height: 0;
		margin-left: 0.25em;
		border-top: 4px solid;
		border-right: 4px solid transparent;
		border-left: 4px solid transparent;
		vertical-align: middle;
		overflow: hidden;
	}
}

// Bootstrap dropdown components
.dropdown-menu {
	display: none;

	&.show {
		display: block;
	}
}

[data-toggle="dropdown"]:hover + .dropdown-menu,
.dropdown-menu:hover {
	display: block;
}
