﻿/********************************************
  www.HS-and-H.com Header css (responsive)
********************************************/

:root {
  --header-height:	35px;          /* default */
  --header-bg:		#333333;
  --header-ink:		#ffffff;
  --submenu-bg:		#273754;
  --hover-bg:		#595959;

  /* Larger hit targets on touch / small screens */
  --tap-target:		44px;

  /* Max content width for very wide desktops (optional) */
  --page-max:		1440px;
}

/* Adapt header height a bit by viewport */
@media (max-width: 720px) {
  :root { -header-height: 25px; }
}
@media (min-width: 1280px) {
  :root { --header-height: 35px; }
}

/*
html, body {
  padding:			0;
  margin:			0;
}

/* Offset page content so fixed header/footer doesn’t overlap 
body {
  padding-top:	23px; /*	var(--header-height);
  padding-bottom:	var(--footer-height);
}
*/

/* iOS safe area (optional) */
/*
@supports (padding: max(0px)) {
  body { padding-top: calc(var(--header-height) + env(safe-area-inset-top)); }
}
*/

/* ===== Header bar ===== */
#header {
  position: fixed;
  inset: 0 0 auto 0;              /* top:0; left:0; right:0 */
  height: var(--header-height);
  background: var(--header-bg);
  color: var(--header-ink);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
  /*box-shadow: inset 0 12px 8px 4px #252525;*/
  z-index: 9999;
}

/* Constrain interior on huge screens */
#header > * {
  max-width: var(--page-max);
}

/* Brand/logo */
#header .brand {
  display: inline-flex;
  align-items: center;
  height: 100%;
}
#header .brand img {
  height: calc(var(--header-height) - 4px);
  width: auto;
}

/* Slogan on the right */
#slogan {
  margin-left: auto;
  height: 100%;
  display: flex;
  align-items: center;
}
#slogan img {
  height: calc(var(--header-height) - 4px);
  width: auto;
}

/* ===== Nav ===== */
nav {
  font-family: 'Myriad Pro', Arial, system-ui, sans-serif;
  font-size: 14pt;
  margin-left: 8px;
  position: relative;             /* for submenu positioning on mobile container */
}

/* Desktop layout by default */
.nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;                   /* horizontal */
  gap: 2px;
  background: transparent;
}
.nav > li {
  position: relative;
  height: var(--header-height);
}
.nav > li > a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  color: var(--header-ink);
  text-decoration: none;
}
.nav > li > a:hover { background: var(--hover-bg); }

/* Submenus */
.has-sub > .submenu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 200px;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: var(--submenu-bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
  z-index: 1000;
}
.has-sub:hover > .submenu,
.has-sub:focus-within > .submenu {
  visibility: visible;
  opacity: 1;
}
.submenu > li { width: 100%; }
.submenu a {
  display: block;
  padding: 8px 12px;
  color: #fff;
  text-decoration: none;
}
.submenu a:hover { background: rgba(0,0,0,0.2); }

/* ===== Mobile / narrow screens ===== */
.nav-toggle {
  display: none;                   /* hidden on desktop */
}

@media (max-width: 900px) {
  /* Show toggle; collapse menu */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    height: var(--tap-target);
    min-width: var(--tap-target);
    padding: 0 10px;
    font-size: 20px;
    line-height: 1;
    color: var(--header-ink);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    cursor: pointer;
  }

  /* Stack interior: brand | toggle | (nav overlay) | slogan */
  #header { gap: 8px; }
  nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    /* overlay panel */
    background: var(--header-bg);
    transform: translateY(-8px);
    max-height: 0;
    overflow: hidden;
    transition: max-height 200ms ease, transform 200ms ease;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  nav.open {
    max-height: 70vh;             /* allow scroll */
    transform: translateY(0);
  }

  .nav {
    display: block;                /* vertical list */
  }
  .nav > li {
    height: auto;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav > li > a {
    height: var(--tap-target);
  }

  /* Submenus inline under parent; no hover needed on touch */
  .has-sub > .submenu {
    position: static;
    visibility: visible;
    opacity: 1;
    background: #2b3956;
    padding: 0;
  }
  .submenu a { padding-left: 20px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .has-sub > .submenu,
  nav { transition: none !important; }
}
