/* The two-bar Satellite masthead is the shared site header. */
body #jtwnMasthead {
  --masthead-blue: #007bff;
  --masthead-nav: #0056b3;
  --masthead-logo-height: clamp(74px, 8.5vw, 110px);
  --masthead-nav-height: 32px;
  position: relative;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: calc(var(--masthead-logo-height) + 4px - var(--masthead-nav-height)) var(--masthead-nav-height);
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: linear-gradient(to top, var(--masthead-nav) 0 var(--masthead-nav-height), var(--masthead-blue) var(--masthead-nav-height) 100%);
  color: #fff;
  font: 16px/1.2 Arial, sans-serif;
}

#jtwnMasthead *, #jtwnMasthead *::before, #jtwnMasthead *::after { box-sizing: border-box; }
body #jtwnMasthead .banner { display: contents; }
body #jtwnMasthead .logo-container {
  display: block;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: start;
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  max-width: none;
  margin: 2px .6rem;
  padding: 0;
  transform: none;
  overflow: visible;
}
body #jtwnMasthead .logo-container img {
  display: block;
  position: static;
  height: var(--masthead-logo-height);
  width: auto;
  max-height: none;
  max-width: none;
  margin: 0;
  object-fit: contain;
}
body #jtwnMasthead .title-container {
  grid-column: 2;
  grid-row: 1;
  justify-self: stretch;
  position: static;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 3px 8px;
  transform: none;
  text-align: center;
}
body #jtwnMasthead .banner h1 {
  margin: 0;
  color: #fff;
  font: 700 1.45rem/1.02 Georgia, serif;
  letter-spacing: normal;
  overflow-wrap: break-word;
}
body #jtwnMasthead .banner #datetime {
  display: block;
  margin: .08rem 0 0;
  min-height: 1.2em;
  color: #fff;
  font: 400 .62rem/1.3 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: inherit;
}
body #jtwnMasthead .weather-search {
  display: block;
  grid-column: 3;
  grid-row: 1;
  width: auto;
  margin: 0 .6rem 0 0;
}
body #jtwnMasthead .weather-search form {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding: 0;
}
body #jtwnMasthead .weather-search input,
body #jtwnMasthead .weather-search button {
  appearance: auto;
  min-height: 0;
  max-width: 100%;
  margin: 0;
  padding: 1px 2px;
  border-radius: 0;
  font: 13px/normal Arial, sans-serif;
  color: #161616;
}
body #jtwnMasthead .weather-search input {
  min-width: 0;
  width: 158px;
  border: 1px solid #8b8b8b;
  background: #fff;
}
body #jtwnMasthead .weather-search input::placeholder { color: #555; opacity: 1; }
body #jtwnMasthead .weather-search button {
  padding-inline: 6px;
  border: 1px solid #8b8b8b;
  background: #f0f0f0;
  cursor: pointer;
}
body #jtwnMasthead .jtwn-masthead-toggle { display: none; }
body #jtwnMasthead #siteNav {
  position: relative;
  inset: auto;
  display: block;
  grid-column: 2 / 4;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--masthead-nav-height);
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: auto hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--masthead-nav);
  scrollbar-width: thin;
  scrollbar-color: #ffffff8c transparent;
}
#jtwnMasthead #siteNav::-webkit-scrollbar { height: 4px; }
#jtwnMasthead #siteNav::-webkit-scrollbar-thumb { background: #ffffff8c; border-radius: 4px; }
body #jtwnMasthead #siteNav ul {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 100%;
  height: var(--masthead-nav-height);
  gap: 0 !important;
  margin: 0;
  padding: 0;
  background: transparent;
  list-style: none;
}
body #jtwnMasthead #siteNav li { flex: none; width: auto; margin: 0; padding: 0; list-style: none; }
body #jtwnMasthead #siteNav a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--masthead-nav-height);
  min-height: 0;
  margin: 0;
  padding: 0 clamp(7px, 1vw, 15px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: 400 1rem/1.2 Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
body #jtwnMasthead #siteNav a:hover { background: #003d7a; }
body #jtwnMasthead #siteNav a[aria-current=page] { text-decoration: underline; text-underline-offset: 5px; }
body #jtwnMasthead :is(a, button, input):focus-visible { outline: 2px solid #ffdc7b; outline-offset: -2px; }

@media (max-width: 1023px), (pointer: coarse) and (hover: none) {
  body #jtwnMasthead {
    display: block;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--masthead-blue);
  }
  body #jtwnMasthead .banner {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    align-items: center;
    position: static;
    gap: 6px 8px;
    width: 100%;
    height: auto;
    min-height: 52px;
    margin: 0;
    padding: 3px max(10px, env(safe-area-inset-right, 0px)) 3px max(10px, env(safe-area-inset-left, 0px));
    overflow: visible;
  }
  body #jtwnMasthead .logo-container { grid-row: 1; width: 52px; margin: 0; }
  body #jtwnMasthead .logo-container img { width: 52px; height: 44px; }
  body #jtwnMasthead .title-container { padding: 0; text-align: left; }
  body #jtwnMasthead .banner h1 { font-size: clamp(1rem, 3.8vw, 1.25rem); line-height: 1.16; }
  body #jtwnMasthead .banner #datetime { margin-top: 4px; font-size: 11px; overflow-wrap: anywhere; }
  body #jtwnMasthead .weather-search { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; }
  body #jtwnMasthead[data-ready=true] .weather-search { display: none; }
  body #jtwnMasthead[data-ready=true] .weather-search.jtwn-search-open { display: block; padding: 2px 0 3px; }
  body #jtwnMasthead .weather-search form { gap: 8px; }
  body #jtwnMasthead .weather-search input {
    width: 100%;
    height: 44px;
    padding: 9px 12px;
    border: 1px solid #c8d8e6;
    border-radius: 9px;
    color: #132d46;
    font-size: 16px;
  }
  body #jtwnMasthead .weather-search button {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid #ffffff66;
    border-radius: 9px;
    background: #004c9d;
    color: #fff;
    font-size: 16px;
  }
  body #jtwnMasthead[data-ready=true] .jtwn-masthead-toggle {
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 4px;
    border: 1px solid #ffffff6b;
    border-radius: 9px;
    background: #00000029;
    color: #fff;
    font: 700 10px/1.2 Arial, sans-serif;
    cursor: pointer;
  }
  body #jtwnMasthead .jtwn-masthead-toggle[aria-expanded=true] { background: #00000059; }
  #jtwnMasthead #searchToggle { grid-column: 3; }
  #jtwnMasthead #menuToggle { grid-column: 4; }
  #jtwnMasthead #menuToggle::before { content: '\2630'; display: block; font-size: 18px; line-height: 1; }
  #jtwnMasthead .jtwn-search-icon {
    display: block;
    position: relative;
    width: 14px;
    height: 14px;
    margin: 0 3px 1px 0;
    border: 2px solid currentColor;
    border-radius: 50%;
  }
  #jtwnMasthead .jtwn-search-icon::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: rotate(45deg);
  }
  body #jtwnMasthead #siteNav { height: auto; }
  body #jtwnMasthead[data-ready=true] #siteNav { display: none; }
  body #jtwnMasthead[data-ready=true] #siteNav.jtwn-nav-open {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: block;
    max-height: 60dvh;
    overflow: auto;
    overscroll-behavior: contain;
    border-top: 1px solid #ffffff40;
    box-shadow: 0 8px 16px #16334d42;
  }
  body #jtwnMasthead #siteNav ul { height: auto; }
  body #jtwnMasthead #siteNav.jtwn-nav-open ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  body #jtwnMasthead #siteNav a {
    height: auto;
    min-height: 48px;
    padding: 8px;
    border-bottom: 1px solid #ffffff1f;
    font-size: 14px;
    line-height: 1.3;
    white-space: normal;
  }
  body #jtwnMasthead #siteNav a[aria-current=page] { background: #ffffff24; font-weight: 700; }
}
