/*
 * Dropdown navigation for the [motoresults] shortcode:
 * Season / Series / Event / Class / Session.
 *
 * Kept in its own file so it doesn't interfere with your own edits to
 * frontend.css. Each field is a rounded grey box with a small label on top
 * and the bold selected value below; the native <select> is stripped of its
 * own look (!important, because many themes style <select> aggressively) and
 * a thin chevron is drawn by CSS.
 */

.mrw-app .mrw-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 0 0 1.5em;
}

.mrw-app .mrw-nav-field {
	position: relative;
	display: block;
	box-sizing: border-box;
	flex: 1 1 160px;
	min-width: 0;
	padding: 0;
	background: #e6e6e6;
	border-radius: 14px;
	cursor: pointer;
}

.mrw-app .mrw-nav-field--season { flex: 1 1 150px; }
.mrw-app .mrw-nav-field--series { flex: 3 1 260px; }
.mrw-app .mrw-nav-field--event { flex: 2 1 200px; }
.mrw-app .mrw-nav-field--class { flex: 1 1 160px; }
.mrw-app .mrw-nav-field--session { flex: 2 1 200px; }

.mrw-app .mrw-nav-label {
	/* Sits on top of the select (which fills the whole box) without
	   intercepting clicks, so a click anywhere on the box opens the list. */
	position: absolute;
	top: 10px;
	left: 18px;
	right: 44px;
	z-index: 2;
	pointer-events: none;
	display: block;
	margin: 0;
	font-size: 0.85rem;
	font-weight: 400;
	line-height: 1.2;
	color: #222;
}

.mrw-app .mrw-nav-select {
	display: block;
	width: 100% !important;
	max-width: 100%;
	position: relative;
	z-index: 1;
	box-sizing: border-box !important;
	height: auto !important;
	margin: 0 !important;
	/* Padding (not the wrapper) provides the box spacing, so the whole grey
	   area is the clickable <select>. Top padding leaves room for the label. */
	padding: 29px 44px 11px 18px !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	font-family: inherit;
	font-size: 1rem !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	color: #111 !important;
	cursor: pointer;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.mrw-app .mrw-nav-select:focus {
	outline: none;
}

.mrw-app .mrw-nav-field:focus-within {
	box-shadow: 0 0 0 2px #222;
}

.mrw-app .mrw-nav-select:disabled {
	opacity: 0.45;
	cursor: default;
}

/* Thin chevron ("v") on the right. */
.mrw-app .mrw-nav-field::after {
	content: '';
	position: absolute;
	right: 20px;
	bottom: 20px;
	width: 8px;
	height: 8px;
	border-right: 2px solid #222;
	border-bottom: 2px solid #222;
	transform: rotate( 45deg );
	pointer-events: none;
}

/* Races + season standings options (Prestige/Junior/Youth). */
.mrw-app .mrw-nav-select option.race {
	font-weight: 700;
}

.mrw-app .mrw-results-area {
	margin-top: 0.5em;
}

@media ( max-width: 640px ) {
	.mrw-app .mrw-nav {
		gap: 10px;
	}

	.mrw-app .mrw-nav-field,
	.mrw-app .mrw-nav-field--season,
	.mrw-app .mrw-nav-field--series,
	.mrw-app .mrw-nav-field--event,
	.mrw-app .mrw-nav-field--class,
	.mrw-app .mrw-nav-field--session {
		flex: 1 1 100%;
	}

	.mrw-app .mrw-nav-select {
		font-size: 1rem !important;
	}
}
