/* ==========================================================================
   NJDOH topic template: legacy components
   Load after njdoh-topic.css, ONLY on topic pages not yet moved to the new
   components. Delete this file once the last of those pages is migrated.
   Contains: alert banner, sidebar image card, amber alert, hotline bar,
   symptom cards, steps, checklist cards, protect tiles, system cards,
   myth vs fact, Expand all + accordion, collapsible mobile menu.
   ========================================================================== */

/* ── Alert banner ─────────────────────────────────────── */

.njdoh-topic-alert {
  background: var(--njdoh-surface-cyan);
  padding: 0.65rem 0;
  box-shadow: 0 0 0 100vmax var(--njdoh-surface-cyan), 0 1px 0 100vmax var(--njdoh-blue-light);
  clip-path: inset(0 -100vmax -1px);
}

.njdoh-topic-alert__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--njdoh-navy);
  line-height: 1.5;
}

.njdoh-topic-alert__inner p {
  margin: 0;
}

.njdoh-topic-alert__inner a {
  color: var(--njdoh-navy);
  font-weight: 600;
  text-decoration: underline;
}

.njdoh-topic-alert__inner img {
  flex-shrink: 0;
  filter: brightness(0) saturate(100%) invert(15%) sepia(50%) saturate(800%) hue-rotate(185deg);
}

/* ── Sidebar image card ───────────────────────────────── */

.njdoh-topic-sidebar__image-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--njdoh-border);
}

.njdoh-topic-sidebar__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.njdoh-topic-sidebar__image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 80%, transparent 100%);
  color: var(--njdoh-white);
}

.njdoh-topic-sidebar__image-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--njdoh-blue-light);
  margin: 0 0 4px;
}

.njdoh-topic-sidebar__image-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--njdoh-white);
  margin: 0;
  line-height: 1.3;
}

.njdoh-topic-sidebar__image-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--njdoh-white);
  margin: 0;
  line-height: 1.3;
}

.njdoh-topic-sidebar__image-text a {
  color: var(--njdoh-white);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--njdoh-blue-light);
}
.njdoh-topic-sidebar__image-text a:hover,
.njdoh-topic-sidebar__image-text a:focus-visible {
  color: var(--njdoh-blue-light);
}

/* ── Alert ────────────────────────────────────────────── */

.njdoh-alert {
  background: var(--njdoh-alert-surface);
  border-left: 5px solid var(--njdoh-warning);
  border-radius: 0 6px 6px 0;
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 1.5rem 0;
}

.njdoh-alert__icon {
  flex: 0 0 36px;
  height: 36px;
  background: var(--njdoh-alert-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.njdoh-alert__icon img {
  filter: brightness(0) invert(1);
}

.njdoh-alert__content {
  flex: 1;
}

.njdoh-alert__heading {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--njdoh-alert-accent);
  margin: 0 0 0.5rem;
}

.njdoh-alert__body {
  font-size: 0.9rem;
  color: var(--njdoh-alert-text);
  line-height: 1.6;
  margin: 0;
}

/* ── Hotline bar ──────────────────────────────────────── */

.njdoh-hotline {
  background: var(--njdoh-navy);
  box-shadow: 0 0 0 100vmax var(--njdoh-navy);
  clip-path: inset(0 -100vmax);
  margin-bottom: -3rem;
}

.njdoh-hotline__inner {
  max-width: var(--njdoh-max-width);
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.njdoh-hotline__inner p {
  font-size: clamp(0.9rem, 1vw + 0.25rem, 1.1rem);
  color: var(--njdoh-hotline-text);
  text-align: center;
  line-height: 1.6;
  margin: 0;
}

.njdoh-hotline__inner a {
  color: var(--njdoh-sky);
  font-weight: 600;
  text-decoration: none;
}

.njdoh-hotline__inner a:hover {
  text-decoration: underline;
}

.njdoh-hotline__inner strong {
  color: var(--njdoh-white);
}

/* ── Symptoms grid ────────────────────────────────────── */

.njdoh-symptoms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.njdoh-symptom-card {
  background: var(--njdoh-white);
  border: 1px solid var(--njdoh-border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s;
}

.njdoh-symptom-card--warning:hover {
  border-color: var(--njdoh-teal);
}

.njdoh-symptom-card--danger:hover {
  border-color: var(--njdoh-danger);
}

.njdoh-symptom-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.njdoh-symptom-card__icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.njdoh-symptom-card__icon-wrap--warning {
  background: var(--njdoh-surface-cyan);
}

.njdoh-symptom-card__icon-wrap--danger {
  background: var(--njdoh-surface-danger);
}

.njdoh-symptom-card__icon-wrap img {
  width: 24px;
  height: 24px;
}

.njdoh-symptom-card__heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.njdoh-symptom-card__heading--warning {
  color: var(--njdoh-blue);
}

.njdoh-symptom-card__heading--danger {
  color: var(--njdoh-danger);
}

/* ── Symptom list ─────────────────────────────────────── */

.njdoh-symptom-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.njdoh-symptom-list li {
  list-style: none !important;
}

.njdoh-symptom-list__item {
  font-size: 0.9rem;
  color: var(--njdoh-text);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding-left: 0 !important;
}

.njdoh-symptom-list__item::before {
  content: "";
  flex-shrink: 0;
  margin-top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}

.njdoh-symptom-list__item--warning::before {
  background-color: var(--njdoh-teal);
}

.njdoh-symptom-list__item--danger::before {
  background-color: var(--njdoh-danger);
}

/* ── Symptom action callout ───────────────────────────── */

.njdoh-symptom-card__action {
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin-top: auto;
}

.njdoh-symptom-card__action--warning {
  background: rgba(69,160,194,0.1);
  border: 1px solid rgba(69,160,194,0.25);
}

.njdoh-symptom-card__action--danger {
  background: rgba(114,0,2,0.06);
  border: 1px solid rgba(114,0,2,0.2);
}

.njdoh-symptom-card__action-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.njdoh-symptom-card__action--warning .njdoh-symptom-card__action-label {
  color: var(--njdoh-blue);
}

.njdoh-symptom-card__action--danger .njdoh-symptom-card__action-label {
  color: var(--njdoh-danger);
}

.njdoh-symptom-card__action-body {
  font-size: 0.875rem;
  color: var(--njdoh-text);
  line-height: 1.55;
  margin: 0;
}

/* How Legionella grows and spreads: 3 steps (mirrors the flyer) */
.njdoh-steps {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.njdoh-step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.njdoh-step__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.njdoh-step__number {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--njdoh-navy);
  color: var(--njdoh-white);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.njdoh-step__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--njdoh-navy);
  margin: 0;
  line-height: 1.2;
}
.njdoh-step__desc {
  font-size: 0.95rem;
  color: var(--njdoh-text);
  line-height: 1.6;
  margin: 0 0 1rem;
  flex: 1;
}
.njdoh-step__image {
  border-radius: 8px;
  overflow: hidden;
}
.njdoh-step__image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.njdoh-step__arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  color: var(--njdoh-navy);
  align-self: flex-start;
  margin-top: 0.4rem;
}

/* ── Prevention checklist cards ───────────────────────── */

.njdoh-checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.njdoh-checklist-card {
  background: var(--njdoh-white);
  border: 1px solid var(--njdoh-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.njdoh-checklist-card__image {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.njdoh-checklist-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.njdoh-checklist-card__number {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--njdoh-navy);
  color: var(--njdoh-white);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.njdoh-checklist-card.is-checked {
  border-color: var(--njdoh-success);
  box-shadow: 0 2px 12px rgba(86,147,12,0.12);
}

.njdoh-checklist-card.is-checked .njdoh-checklist-card__number {
  background: var(--njdoh-success);
}

.njdoh-checklist-card__body {
  padding: 1.25rem 1.25rem 0;
  flex: 1;
}

.njdoh-checklist-card__heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--njdoh-navy);
  margin-bottom: 0.5rem;
}

.njdoh-checklist-card__desc {
  font-size: 0.9rem;
  color: var(--njdoh-text);
  line-height: 1.55;
  margin: 0;
}

.njdoh-checklist-card__check {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--njdoh-surface-blue);
  margin-top: 1rem;
}

.njdoh-checklist-card__label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--njdoh-navy);
  cursor: pointer;
  margin: 0;
}

.njdoh-checklist-card__input {
  width: 18px;
  height: 18px;
  accent-color: var(--njdoh-success);
  cursor: pointer;
  flex-shrink: 0;
}

/* Protect your home's water: flyer-style icon tiles */
.njdoh-protect {
  margin-top: 1.25rem;
  background: var(--njdoh-surface-panel);
  border: 1px solid var(--njdoh-border-muted);
  border-radius: 8px;
  padding: 0 1rem;
}
.njdoh-protect__row {
  display: flex;
}
.njdoh-protect__row--secondary {
  justify-content: center;
  border-top: 1px solid var(--njdoh-divider);
}
.njdoh-protect__tile {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 1.75rem 1.25rem;
  border-left: 1px solid var(--njdoh-divider);
}
.njdoh-protect__tile:first-child {
  border-left: none;
}

.njdoh-protect__icon {
  display: block;
  width: 55px;
  height: 55px;
  margin: 0 auto 0.85rem;
  object-fit: contain;
}
.njdoh-protect__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--njdoh-navy);
  margin: 0 0 0.4rem;
}
.njdoh-protect__text {
  font-size: 0.9rem;
  color: var(--njdoh-text);
  line-height: 1.55;
  margin: 0;
}
.njdoh-protect__text a {
  color: var(--njdoh-link);
}

/* For building owners: 4 water systems */
.njdoh-systems-grid {
  margin-top: 1.25rem;
}
.njdoh-system-col {
  margin-bottom: 1.25rem;
}
.njdoh-system-card {
  background: var(--njdoh-white);
  border: 1px solid var(--njdoh-border);
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.njdoh-system-card__image {
  width: 100%;
  height: 250px;
  overflow: hidden;
}
.njdoh-system-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.njdoh-system-card__body {
  padding: 1.25rem 1.5rem;
}
.njdoh-system-card__heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--njdoh-navy);
  margin: 0 0 0.75rem;
}
.njdoh-system-card__number {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--njdoh-teal);
  color: var(--njdoh-white);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.njdoh-system-card__list {
  padding-left: 1.2rem;
  margin: 0;
}
.njdoh-system-card__list li {
  font-size: 0.9rem;
  color: var(--njdoh-text);
  line-height: 1.6;
  margin-bottom: 0.35rem;
}

/* ─── Myth vs Fact ──────────────────────────────────── */
.njdoh-mvf-grid {
  margin-top: 1.5rem;
}

.njdoh-mvf-col {
  margin-bottom: 1.25rem;
}

.njdoh-mvf-card {
  border: 1px solid var(--njdoh-border-soft);
  border-radius: 10px;
  padding: 1.25rem;
  background-color: var(--njdoh-white);
  height: 100%;
}

.njdoh-mvf-card__row {
  display: flex;
  align-items: flex-start;
}

.njdoh-mvf-card__row--myth {
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid #eee;
}

.njdoh-mvf-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
  margin-right: 0.5rem;
}

.njdoh-mvf-label {
  flex-shrink: 0;
  width: 48px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.njdoh-mvf-card__row--myth .njdoh-mvf-label {
  color: var(--njdoh-myth);
}

.njdoh-mvf-card__row--fact .njdoh-mvf-label {
  color: var(--njdoh-fact);
}

.njdoh-mvf-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  color: var(--njdoh-text);
}

#toggleAll {
  background-color: var(--njdoh-navy);
  color: var(--njdoh-white);
  border: 2px solid var(--njdoh-teal);
  padding: 6px 12px;
  border-radius: 5px;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
}
#toggleAll:hover {
  background-color: var(--njdoh-blue-hover);
  color: var(--njdoh-surface-alt);
  border-color: var(--njdoh-blue-hover);
}
#toggleAll.btn-outline-primary {
  background-color: var(--njdoh-surface-alt);
  color: var(--njdoh-navy);
  border-color: var(--njdoh-blue-hover);
}
#toggleAll.btn-outline-primary:hover {
  background-color: var(--njdoh-blue-hover);
  color: var(--njdoh-surface-alt);
  border-color: var(--njdoh-navy);
}
.accordion .toggle-icon { float: right; }
.close-icon { display: inline-block; }
.open-icon { display: none; }
.collapsed .open-icon { display: inline-block; }
.collapsed .close-icon { display: none; }
.accordion .card {
  border: 2px solid var(--njdoh-navy);
  margin-bottom: 7px;
  position: relative;
  overflow: hidden;
}
.accordion .card-header {
  cursor: pointer;
  border-bottom: 1px solid #d8d8d8;
  background-color: var(--njdoh-surface-alt);
  position: relative;
  z-index: 1;
  padding: 15px 20px;
}
.accordion .card-header:hover { background-color: #e9f1f7; }
.accordion .card-header.active {
  border: 3px solid var(--njdoh-blue-light);
  background-color: #f0f8ff;
  z-index: 2;
  margin: -4px;
}
.accordion .card-header.active + .collapse { border-top: 2px solid var(--njdoh-navy); }
.accordion .card:not(:last-child) { border-bottom: 2px solid var(--njdoh-navy); }
.accordion .card-header h5 { font-size: 1.1rem; font-weight: 700; color: var(--njdoh-navy); margin: 0; }

/* ── Collapsible "On this page" menu on phones (old template) ─── */

.njdoh-toc__heading--mobile { display: none; }

@media (min-width: 992px) {
  .njdoh-toc__toggle { display: none; }
  .njdoh-toc__list--collapsed { display: flex !important; }
}

@media (max-width: 991.98px) {
  /* Old pages have no jump row, so bring the sidebar menu back */
  .njdoh-topic-sidebar {
    display: flex;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .njdoh-toc { flex: 1 1 100%; }

  .njdoh-toc__heading--desktop { display: none; }

  .njdoh-toc__heading--mobile {
    display: block;
    margin: 0;
    font-size: 1rem !important;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--njdoh-navy);
  }

  .njdoh-toc__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
  }

  .njdoh-toc__toggle-icon { flex-shrink: 0; font-size: 1.25rem; font-weight: 400; line-height: 1; color: var(--njdoh-teal); }

  .njdoh-toc__list--collapsed { display: none; }
  .njdoh-toc__list--expanded { display: flex; margin-top: 0.75rem; }

  .njdoh-topic-sidebar__image-card { display: none; }

  .njdoh-steps { flex-direction: column; }
  .njdoh-step__arrow { align-self: center; margin: 0.25rem 0; transform: rotate(90deg); }
  .njdoh-step__desc { flex: 0 0 auto; margin-bottom: 0.75rem; }
  .njdoh-step__image img { height: 200px; }

  .njdoh-symptoms-grid,
  .njdoh-checklist-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767.98px) {
  .njdoh-symptoms-grid,
  .njdoh-checklist-grid { grid-template-columns: 1fr; }

  /* Decorative photos add screens of scrolling on phones */
  .njdoh-step__image,
  .njdoh-system-card__image { display: none; }

  .njdoh-protect__row,
  .njdoh-protect__row--secondary { flex-direction: column; }

  .njdoh-protect__tile,
  .njdoh-protect__row--secondary .njdoh-protect__tile {
    flex: 1 1 auto;
    border-left: none;
    border-top: 1px solid var(--njdoh-divider);
  }

  .njdoh-protect__row:first-child .njdoh-protect__tile:first-child { border-top: none; }
}
