/* Ben style navigation (toolbar_render_ben / toolbar_ben_shell in lib/toolbar.tcl),
   after the header of Ben's site mockup (decent-website-mockup-R07.01 styles.css):
   white bar (his r182 palette), Manrope, click-to-open dropdowns that drop a full-width panel of columns,
   icons on the right, and a Menu button on phones. Everything is under .bn-header so
   it cannot touch the classic nav (#header / #nav). Behaviour: js/nav_ben.js. */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-greek.woff2) format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

.bn-header {
	--paper: #ffffff; --sand: #f4f2ef; --ink: #1e1e1c; --muted: #5d5d58; --line: #e2dfda; /* Ben's r182 palette */
	--accent: #a8442a; --radius: 6px; --h: 80px; --logo-h: 31px;
	/* the space above the logo; the same space is left of the logo, and twice it right of the
	   last icon (whose link has 10px padding of its own) */
	--edge: calc((var(--h) - var(--logo-h)) / 2);
	position: relative; z-index: 10000; background: var(--paper); border-bottom: 1px solid var(--line);
	font: 500 16px/1.4 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	color: var(--ink); -webkit-font-smoothing: antialiased; text-align: left;
}
/* the classic header is fixed, so the page reserves 44px for it; the Ben bar is not */
body:has(.bn-header) #skel-layers-wrapper { padding-top: 0 !important; }
/* ...and on phones the old site adds its own menu button (#navButton) and slide-out
   panel (#navPanel); the Ben bar has its own Menu button */
body:has(.bn-header) #navButton, body:has(.bn-header) #navPanel { display: none !important; }
.bn-header *, .bn-header *::before, .bn-header *::after { box-sizing: border-box; }
.bn-header a { color: inherit; text-decoration: none; border: 0; }
.bn-header ul { list-style: none; margin: 0; padding: 0; }
.bn-header h2 { margin: 0; padding: 0; border: 0; }
.bn-header details > summary { list-style: none; }
.bn-header details > summary::-webkit-details-marker { display: none; }

.bn-row { height: var(--h); padding: 0 calc(var(--edge) * 2 - 10px) 0 var(--edge); display: flex; align-items: center; gap: 28px; }
.bn-logo { display: flex; align-items: center; min-height: 48px; flex-shrink: 0; }
.bn-logo img { height: var(--logo-h); width: auto; display: block; }
/* the logo is faded (30%), 70% on hover / keyboard focus */
.bn-logo img { opacity: .3; transition: opacity .15s; }
.bn-logo:hover img, .bn-logo:focus-visible img { opacity: .7; }

/* the dropdowns, centred */
.bn-nav { display: flex; align-items: center; gap: 12px; margin-inline: auto; }
.bn-group > summary { display: flex; align-items: center; min-height: 48px; padding: 0 12px; cursor: pointer; white-space: nowrap; border-radius: var(--radius); user-select: none; }
.bn-group > summary:hover { color: var(--accent); }
.bn-group[open] > summary { background: var(--sand); color: var(--ink); }
/* the section this page is in (js/nav_ben.js): rust, underlined, as in Ben's mockup */
.bn-group.is-current > summary { color: var(--accent); }
.bn-group.is-current > summary > span:not(.bn-sr) { box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 2px; }
/* a dropdown's builder icon, before its label (toolbar_ben_group) */
.bn-group > summary > i.icon { display: inline-flex; margin-right: 8px; font-size: 16px; line-height: 1; text-decoration: none; }
.bn-group > summary > i.icon::before { margin: 0; }
.bn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bn-group > summary:has(.bn-sr) > i.icon { margin-right: 0; } /* icon-only */

/* the panel: full width under the bar, columns of links */
.bn-panel {
	position: absolute; left: 0; right: 0; top: var(--h);
	background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px rgba(43,36,32,.08);
	padding: 26px max(48px, calc((100vw - 1312px) / 2)) 28px;
	display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 0 32px;
	max-height: calc(100vh - var(--h)); overflow: auto;
}
/* while a panel is open, everything under it is dimmed by 10% black (John's mockup, 13 Nov): a wide
   spread shadow, clipped at the panel's top edge so the bar itself stays white. The panel's own
   drop shadow is darker than the closed style's (John, 13 Nov). */
.bn-group[open] > .bn-panel {
	box-shadow: 0 20px 30px rgba(43,36,32,.2), 0 0 0 100vmax rgba(0,0,0,.1);
	clip-path: inset(0 -100vmax -100vmax -100vmax);
}
.bn-column { min-width: 0; }
.bn-column h2 { font-size: 16px; line-height: 1.35; font-weight: 700; letter-spacing: 0; color: var(--ink); margin: 0 0 8px; text-transform: none; }
.bn-links { display: grid; align-content: start; }
.bn-panel a { display: flex; align-items: center; min-height: 46px; line-height: 1.35; font-weight: 500; }
.bn-panel a:hover { color: var(--accent) !important; }
.bn-panel .bn-column h2 a { display: inline; min-height: 0; font-weight: 700; }
/* Ben's arrow after a linked column heading: rust, regular weight (not spoken) */
.bn-panel .bn-column h2 a::after { content: "\2192" / ""; display: inline-block; margin-left: 8px; color: var(--accent); font-weight: 400; }
/* underline on hover like the other links; the arrow (an inline-block) is not underlined */
.bn-panel .bn-column h2 a:hover { color: var(--accent) !important; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.bn-panel a[class*="fa-"]::before { display: none; } /* specials in a panel: words, no icon */

/* a link underlines on hover (as in Ben's Machines panel) */
.bn-links a:hover, .bn-sub a:hover { color: var(--accent) !important; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* *blog* / *videos:...* panels: picture tiles (Ben's nav__story), 16:10 thumbnails */
.bn-panel--stories { gap: 0 24px; }
.bn-panel a.bn-story { display: block; min-height: 0; }
.bn-thumb { position: relative; display: block; margin-bottom: 10px; }
.bn-thumb img:not(.bn-vlogo) { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--sand); }
/* videos: the homepage's play logo frame (img/yt_logo_rgb_light.png) over the picture at 70% */
.bn-vlogo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .7; border-radius: 6px; pointer-events: none; }
.bn-story-title { display: block; font-size: 12.8px; line-height: 1.35; } /* 20% under the panel's 16px */
.bn-story:hover .bn-story-title { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
/* Blog: the title under the picture, as the videos have it (no text on the picture) */
/* the bottom links ("All blog posts ->") */
.bn-bottom { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 18px; }
.bn-panel .bn-bottom a { display: inline-flex; gap: 8px; min-height: 40px; }
.bn-panel .bn-bottom a:first-child { font-weight: 650; }
.bn-panel .bn-bottom a::after { content: "\2192" / ""; color: var(--accent); font-weight: 400; }
.bn-panel .bn-bottom a:hover { color: var(--accent); }

/* *shipto* / *currency*: Ben's labelled pickers */
.bn-field { display: grid; justify-items: start; gap: 4px; margin: 6px 0 10px; font-weight: 500; }
.bn-field .xselect-wrapper { max-width: 100%; }
.bn-field select { width: auto; max-width: 100%; height: 44px; padding: 0 10px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-weight: 500; }
.bn-field .print-only { display: none; }
.bn-field[hidden] { display: none; }
.bn-tools > li.bn-tool-field .bn-field { margin: 0; grid-auto-flow: column; align-items: center; gap: 8px; }
.bn-tools > li.bn-tool-field .bn-field select { height: 40px; width: auto; }

/* a 4th level: listed under its item, indented */
.bn-sub > div { display: grid; border-left: 1px solid var(--line); padding-left: 14px; }


/* icons on the right (login, search, cart, languages) */
.bn-tools { display: flex; align-items: center; gap: 4px; margin: 0; }
.bn-tools > li { position: relative; }
.bn-tools > li > a { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 10px; border-radius: var(--radius); white-space: nowrap; font-weight: 500; }
.bn-tools > li > a:hover { background: var(--sand); }
.bn-tools > li > a::before { font-size: 18px; }
.bn-tools > li > ul { display: none; } /* the languages list: the globe goes to /languages */
.bn-tools .navtext { display: none; }

/* hovering an icon: Ben's sand, never the site's teal link-hover colour */
.bn-header .bn-tools > li > a:hover, .bn-header .bn-tools > li:hover > a { color: var(--ink) !important; background: var(--sand); }

/* the cart's hover mini-cart (built by update_shopping_cart_menu in decent_all.js,
   which injects its own white/teal styles): a white panel like the nav panels */
.bn-header #cartmenu .cartmenu-sub { margin-top: 8px; padding: 6px 0; min-width: 280px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 30px rgba(43,36,32,.12); font: 500 15px/1.35 inherit; font-family: inherit; color: var(--ink); }
.bn-header #cartmenu .cartmenu-sub:before { top: -7px; right: 22px; width: 12px; height: 12px; background: var(--paper); box-shadow: none; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.bn-header #cartmenu .cartmenu-sub:after { top: -10px; height: 10px; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-row { min-height: 46px; line-height: 1.35; padding: 8px 16px; gap: 12px; box-shadow: inset 0 1px 0 0 var(--line); color: var(--ink); }
.bn-header #cartmenu .cartmenu-sub .cartmenu-row:first-child { box-shadow: none; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-row:hover { background: var(--sand); }
.bn-header #cartmenu .cartmenu-sub .cartmenu-total { min-height: 46px; align-items: center; line-height: 1.35; padding: 8px 16px; margin-top: 0; box-shadow: inset 0 1px 0 0 var(--line); color: var(--ink) !important; font-weight: 700; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-total:hover { background: var(--sand); color: var(--accent) !important; }
/* a row's text stays dark on hover (the injected style turns it white) */
.bn-header #cartmenu .cartmenu-sub .cartmenu-row:hover,
.bn-header #cartmenu .cartmenu-sub .cartmenu-row:hover .cartmenu-name { color: var(--ink) !important; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-row:hover .cartmenu-qty { color: var(--muted) !important; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-name { color: var(--ink); font-weight: 600; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-qty { color: var(--muted); opacity: 1; font-weight: 500; margin-right: 10px; }
/* - / + : the icons are filled discs (fa-minus-circle / fa-plus-circle) whose sign is
   a cut-out, so recolouring them is confusing. Draw small round outline buttons
   instead: white with a dark sign; only the button under the mouse fills dark. */
.bn-header #cartmenu .cartmenu-sub :is(.cartmenu-row, .cartmenu-total) .cartmenu-btn {
	display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 6px;
	border: 1.5px solid var(--line); border-radius: 50%; background: var(--paper);
	color: var(--ink) !important; font-style: normal; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.bn-header #cartmenu .cartmenu-sub :is(.cartmenu-row, .cartmenu-total) .cartmenu-btn::before { font: 600 17px/1 'Manrope', system-ui, sans-serif !important; content: '+' !important; margin: 0; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-row .cartmenu-btn.fa-minus-circle::before { content: '\2212' !important; }
/* the X left of the total empties the cart (cartmenu_empty in shopping.js) */
.bn-header #cartmenu .cartmenu-sub .cartmenu-total .cartmenu-amount { display: inline-flex; align-items: center; gap: 10px; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-total .cartmenu-btn.cartmenu-empty { margin-left: 0; }
.bn-header #cartmenu .cartmenu-sub .cartmenu-total .cartmenu-btn.cartmenu-empty::before { content: '\00d7' !important; font-size: 19px !important; }
.bn-header #cartmenu .cartmenu-sub :is(.cartmenu-row, .cartmenu-total) .cartmenu-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff !important; opacity: 1; }
/* the Total line's hover choosers (country, currency symbol; cartmenu_pick_html in shopping.js): a panel like the nav panels */
.bn-header #cartmenu .cartmenu-pop { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 30px rgba(43,36,32,.12); padding: 6px 0; font-weight: 500; }
.bn-header #cartmenu .cartmenu-pop .cartmenu-opt { color: var(--ink) !important; line-height: 1.35; padding: 7px 16px; }
.bn-header #cartmenu .cartmenu-pop .cartmenu-opt:hover { background: var(--sand); color: var(--ink) !important; }
.bn-header #cartmenu .cartmenu-pop .cartmenu-opt-on { font-weight: 700; }
.bn-header #cartmenu .cartmenu-pop .cartmenu-pop-head { color: var(--muted); padding: 8px 16px 2px; }

.bn-menu { display: none; align-items: center; gap: 8px; min-height: 48px; padding: 0 10px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius); }
.bn-menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }

@media (max-width: 1180px) {
	.bn-header { --h: 72px; }
	.bn-row { gap: 16px; }
	.bn-nav { gap: 0; }
	.bn-group > summary { padding-inline: 10px; }
	.bn-panel { padding-inline: 24px; gap: 0 20px; }
	/* icons only on the right (the name would push the bar past the window), except
	   the cart, which keeps its count */
	.bn-tools > li:not(#cartmenu) > a { font-size: 0; gap: 0; }
	.bn-tools > li:not(#cartmenu) > a::before { font-size: 18px; }
}

/* phones and small tablets: a Menu button; the dropdowns stack under the bar */
@media (max-width: 860px) {
	.bn-header { --h: 64px; --logo-h: 27px; }
	.bn-row { gap: 8px; }
	.bn-menu { display: flex; }
	.bn-header .bn-tools { margin-left: auto; gap: 0; }
	/* icons only: the login name and "Cart (2)" words don't fit next to the Menu button */
	.bn-tools > li > a { padding: 0 8px; font-size: 0; gap: 0; }
	.bn-tools > li > a::before { font-size: 19px; }
	.bn-tools .cartmenu-sub { display: none !important; }
	.bn-nav { display: none; position: absolute; left: 0; right: 0; top: var(--h); flex-direction: column; align-items: stretch; gap: 0; margin: 0;
		background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px rgba(43,36,32,.12); padding: 4px 20px 14px;
		max-height: calc(100vh - var(--h)); overflow: auto; }
	.bn-nav.is-open { display: flex; }
	.bn-group { border-bottom: 1px solid var(--line); }
	.bn-group > summary { font-size: 17px; min-height: 50px; padding: 0 4px; justify-content: space-between; border-radius: 0; }
	.bn-group > summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
	.bn-group[open] > summary { background: none; }
	.bn-group > summary > span:not(.bn-sr) { flex: 1; } /* label next to its icon, caret at the far right */
	.bn-group[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
	.bn-panel { position: static; box-shadow: none; border: 0; padding: 0 4px 12px; max-height: none; grid-template-columns: 1fr 1fr; gap: 0 16px; }
	.bn-column, .bn-links { display: contents; }
	.bn-column h2 { grid-column: 1 / -1; margin: 10px 0 2px; color: var(--muted); font-size: 14px; }
	.bn-panel .bn-column h2 a::after { content: none; }
	.bn-panel a { min-height: 44px; }
	.bn-sub { grid-column: 1 / -1; }
	.bn-sub > div { grid-template-columns: 1fr 1fr; border: 0; padding: 0; gap: 0 16px; }
	.bn-panel--stories { grid-template-columns: 1fr 1fr; gap: 0 14px; }
	/* as Ben: titles only on phones, no thumbnails */
	.bn-panel a.bn-story { display: flex; align-items: center; min-height: 44px; padding-block: 6px; }
	.bn-thumb { display: none; }
	.bn-story-title { font-size: 16px; line-height: 1.25; } /* no picture above it here: full size */
	.bn-field { grid-column: 1 / -1; }
	.bn-tools > li.bn-tool-field { display: none; }
}
@media (max-width: 420px) {
	.bn-menu-label { display: none; }
}
