/* hellog top menu bar (topnav) -- ASCII only; to be placed at css/topnav.css */
nav.topnav {
	--tn-green: #3faf43;
	--tn-dark: #2a7a2e;
	--tn-bg: #f4faf4;
	--tn-line: #cfe6cf;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	padding: 6px 10px;
	margin: 0 0 10px 0;
	background: var(--tn-bg);
	border-bottom: 2px solid var(--tn-green);
	font-size: 14px;
	line-height: 1.4;
	position: relative;
	z-index: 50;
}
nav.topnav a { text-decoration: none; }
nav.topnav .brand { font-weight: bold; white-space: nowrap; color: var(--tn-dark); }
nav.topnav .brand img { vertical-align: -2px; border: 0; }

/* outer wrapper: always open on wide screens, summary hidden */
nav.topnav details.all { flex: 1 1 auto; }
nav.topnav details.all > summary { display: none; }
nav.topnav details.all > .cats { display: flex; flex-wrap: wrap; gap: 2px 4px; }

/* each category */
nav.topnav details.cat { position: relative; }
nav.topnav details.cat > summary {
	list-style: none;
	cursor: pointer;
	padding: 4px 10px;
	border-radius: 4px;
	color: var(--tn-dark);
	white-space: nowrap;
	user-select: none;
}
nav.topnav details.cat > summary::-webkit-details-marker { display: none; }
nav.topnav details.cat > summary::after { content: " \25BE"; font-size: 80%; opacity: .7; }
nav.topnav details.cat > summary:hover,
nav.topnav details.cat[open] > summary { background: #e1f1e1; }
nav.topnav details.cat > summary:focus-visible { outline: 2px solid var(--tn-green); outline-offset: 1px; }
nav.topnav details.cat.tools > summary { color: #777; }

nav.topnav details.cat > ul {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 15em;
	margin: 4px 0 0 0;
	padding: 6px 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--tn-line);
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
nav.topnav details.cat > ul li a {
	display: block;
	padding: 5px 14px;
	white-space: nowrap;
	color: #222;
}
nav.topnav details.cat > ul li a:hover,
nav.topnav details.cat > ul li a:focus-visible { background: #eef7ee; color: var(--tn-dark); outline: none; }
nav.topnav details.cat > ul li.sep { border-top: 1px solid #eee; margin: 4px 0; }

/* search */
nav.topnav form.search { display: flex; gap: 4px; align-items: center; margin: 0; }
nav.topnav form.search input[type="text"] { width: 11em; padding: 3px 6px; border: 1px solid #bbb; border-radius: 4px; font-size: 14px; }
nav.topnav form.search input[type="submit"] { padding: 3px 8px; font-size: 13px; }
nav.topnav form.search .help { color: #888; cursor: help; font-size: 12px; }

/* sub line for month/day pages (prev/next) */
div.topnav-sub { font-size: 13px; margin: -4px 0 8px 10px; }
div.topnav-sub a { margin-right: 1.2em; }

/* phones and narrow windows */
@media (max-width: 720px) {
	nav.topnav { padding: 6px 8px; }
	nav.topnav .brand { flex: 1 1 auto; }
	nav.topnav form.search { order: 3; flex: 1 1 100%; }
	nav.topnav form.search input[type="text"] { flex: 1 1 auto; width: auto; font-size: 16px; }
	nav.topnav details.all { order: 2; flex: 0 0 auto; }
	nav.topnav details.all > summary {
		display: block;
		list-style: none;
		cursor: pointer;
		padding: 8px 12px;
		border: 1px solid var(--tn-line);
		border-radius: 6px;
		background: #fff;
		color: var(--tn-dark);
		font-weight: bold;
	}
	nav.topnav details.all > summary::-webkit-details-marker { display: none; }
	nav.topnav details.all[open] > .cats {
		position: absolute;
		left: 0; right: 0; top: 100%;
		display: block;
		background: #fff;
		border-bottom: 2px solid var(--tn-green);
		box-shadow: 0 6px 16px rgba(0,0,0,.15);
		max-height: 75vh;
		overflow-y: auto;
	}
	nav.topnav details.cat { border-top: 1px solid #eee; }
	nav.topnav details.cat > summary { padding: 12px 14px; border-radius: 0; min-height: 20px; }
	nav.topnav details.cat > ul {
		position: static;
		margin: 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		background: #f8fcf8;
		min-width: 0;
	}
	nav.topnav details.cat > ul li a { padding: 11px 26px; white-space: normal; }
}
