/* NJDOH Health topics A to Z
   Colors fall back to hex values in case this template does not load secondary.css. */

/* The template's own page title is replaced by the H1 below */
.pageTitle { display: none; }

.njdoh-az [hidden] { display: none !important; }

/* Heading, intro, and search */
.njdoh-az__head { max-width: 46rem; padding-top: 0.5rem; }

.njdoh-az__title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 2.5vw + 1rem, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--njdoh-navy, #163753);
}

.njdoh-az__intro {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--njdoh-text, #3a3f45);
}

.njdoh-az__search { display: block; max-width: 34rem; margin: 0; }

.njdoh-az__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--njdoh-ink, #1a1c1e);
}

.njdoh-az__input {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  border: 2px solid #5f6f80;
  border-radius: 6px;
  background: #fff;
  font-size: 1.0625rem;
  color: var(--njdoh-ink, #1a1c1e);
}

.njdoh-az__input::placeholder { color: #6b7681; }

.njdoh-az__input:focus {
  outline: 3px solid var(--njdoh-blue, #266091);
  outline-offset: 2px;
  border-color: var(--njdoh-navy, #163753);
}

.njdoh-az__popular {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--njdoh-text, #3a3f45);
}

.njdoh-az__popular-label { margin-right: 0.35rem; font-weight: 700; }

.njdoh-az__popular a {
  margin-right: 0.9rem;
  color: var(--njdoh-link, #185fa5);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Letter bar: sticks to the top while scrolling, full-width background */
.njdoh-az__bar {
  position: sticky;
  top: var(--njdoh-sticky-offset, 0px);
  z-index: 20;
  margin-top: 2rem;
  padding: 0.6rem 0;
  background: #fff;
  /* White band and bottom line painted edge to edge with shadows only.
     Shadows never widen the page, so there is no horizontal scroll. */
  box-shadow: 0 0 0 100vmax #fff, 0 1px 0 100vmax var(--njdoh-divider, #dde3ea);
  clip-path: inset(0 -100vmax -1px);
}

.njdoh-az__keys {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.njdoh-az__keys::-webkit-scrollbar { display: none; }

.njdoh-az__key {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--njdoh-navy, #163753);
  text-decoration: none;
}

a.njdoh-az__key:hover { background: var(--njdoh-surface-muted, #f4f6f9); color: var(--njdoh-navy, #163753); text-decoration: underline; }

.njdoh-az__key.is-active,
.njdoh-az__key.is-active:hover { background: var(--njdoh-navy, #163753); color: #fff; text-decoration: none; }

.njdoh-az__key--empty,
.njdoh-az__key.is-disabled { color: #aab4bf; font-weight: 400; pointer-events: none; }

/* Pinned by script once scrolled past (works even when a site wrapper breaks CSS sticky) */
.njdoh-az__bar.is-fixed { position: fixed; margin-top: 0; }

/* During a search, leave room so the results can scroll up under the letter bar */
.njdoh-az.is-searching .njdoh-az__list { min-height: 100vh; }

/* Search result count */
.njdoh-az__status {
  margin: 1.25rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--njdoh-ink, #1a1c1e);
}

.njdoh-az__status:empty { display: none; }

/* Letter groups: letter in the left column, topics in columns on the right */
.njdoh-az__list { margin-top: 0.5rem; }

.njdoh-az__group {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--njdoh-divider, #dde3ea);
}

.njdoh-az__group:last-child { border-bottom: 0; }

.njdoh-az__group { position: relative; }

/* Anchor sits outside the grid so it does not take a column */
.njdoh-az__anchor { position: absolute; top: 0; left: 0; scroll-margin-top: 4.5rem; }

.njdoh-az__letter {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--njdoh-navy, #163753);
}

.njdoh-az__items {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 3 15rem;
  column-gap: 2.5rem;
}

.njdoh-az__item {
  padding: 0.3rem 0;
  break-inside: avoid;
  font-size: 1rem;
  line-height: 1.45;
}

.njdoh-az__link,
.njdoh-az__link:visited {
  color: var(--njdoh-link, #185fa5);
  text-decoration: none;
}

.njdoh-az__link:hover,
.njdoh-az__link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

.njdoh-az__source { font-size: 0.875rem; color: #5b6570; }

.njdoh-az__see {
  margin-left: 0.35rem;
  font-size: 0.875rem;
  font-style: italic;
  color: #5b6570;
}

@media (max-width: 767.98px) {
  .njdoh-az__intro { font-size: 1.0625rem; }

  .njdoh-az__bar { margin-top: 1.5rem; padding: 0.5rem 0; }

  /* One swipeable row of letters on phones */
  .njdoh-az__keys {
    justify-content: flex-start;
    padding-right: 2rem;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }

  .njdoh-az__group { grid-template-columns: 1fr; padding: 1.25rem 0; }
  .njdoh-az__letter { margin-bottom: 0.5rem; font-size: 1.75rem; }
  .njdoh-az__item { padding: 0.4rem 0; }
  .njdoh-az__anchor { scroll-margin-top: 3.75rem; }
}
