/* NY Water Quality Guide — shared design system
   Mobile-first, no framework, minimal CSS per BUILD_SKILL speed rules. */

:root {
  --navy: #0B3558;
  --water-blue: #1E6FAE;
  --light-blue-bg: #EAF4FB;
  --cta-blue: #0A66C2;
  --text: #1F2933;
  --muted: #52606D;
  --border: #D9E2EC;
  --white: #FFFFFF;

  --trust-green: #2E7D32;
  --light-green-bg: #EAF7EA;
  --cta-green: #2F855A;

  --max-width: 1080px;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--cta-blue);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--water-blue);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* Layout helpers */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  box-shadow: 0 1px 8px rgba(11, 53, 88, 0.06);
}

.header-inner {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav > ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-block;
  padding: 0.5rem 0.25rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--cta-blue);
  text-decoration: underline;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 10px 20px rgba(11, 53, 88, 0.12);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .main-nav.is-open {
    display: block;
  }
  .main-nav > ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0.5rem 1.25rem;
    margin: 0;
  }
  .main-nav a {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }
}

/* Dropdown navigation used by Find My Water, Water Problems, and Treatment Options. */
.has-dropdown { position: relative; }
.nav-details { position: static; }
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.25rem;
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  font-family: var(--font);
  cursor: pointer;
  list-style: none;
}
.dropdown-toggle::-webkit-details-marker { display: none; }
.dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-top: 2px;
  flex-shrink: 0;
}
.nav-details[open] > .dropdown-toggle::after { transform: rotate(180deg); }
.dropdown-toggle:hover,
.dropdown-toggle:focus-visible { color: var(--cta-blue); text-decoration: underline; }
.nav-dropdown { list-style: none; margin: 0; padding: 0; }
@media (min-width: 769px) {
  .nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 20px rgba(11, 53, 88, 0.12);
    padding: 0.5rem;
    z-index: 50;
  }
  .nav-dropdown a { display: block; padding: 0.55rem 0.75rem; border-radius: 6px; white-space: nowrap; }
  .nav-dropdown a:hover,
  .nav-dropdown a:focus-visible { background: var(--light-blue-bg); text-decoration: none; }
}
@media (max-width: 768px) {
  .dropdown-toggle { display: flex; justify-content: space-between; width: 100%; padding: 0.85rem 0; border-bottom: 1px solid var(--border); text-align: left; }
  .nav-dropdown { padding: 0 0 0 1rem; }
  .nav-dropdown a { padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
}

/* Keep the complete desktop header on one row. */
@media (min-width: 769px) {
  .header-inner { flex-wrap: nowrap; }
  .main-nav { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
  .main-nav ul, .main-nav > ul { display: flex; flex-wrap: nowrap !important; white-space: nowrap; align-items: center; gap: 0.15rem 0.4rem; }
  .main-nav .nav-dropdown { display: block; }
  .main-nav > ul > li { flex: 0 0 auto; }
}

@media (min-width: 769px) {
  .header-inner { gap: 0.5rem; }
  .logo { flex: 0 0 auto; font-size: 1.05rem; }
  .main-nav { flex: 0 1 auto; min-width: 0; }
  .main-nav > ul { flex-wrap: nowrap !important; justify-content: flex-end; gap: 0.15rem 0.4rem; }
  .main-nav > ul > li { white-space: nowrap; }
  .main-nav a, .dropdown-toggle { font-size: 0.85rem; padding-left: 0.1rem; padding-right: 0.1rem; }
}

/* Hero */
.wizard {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  padding: 1.5rem;
}
.wizard-step { display: none; }
.wizard-step.is-active { display: block; }
.wizard-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}
@media (min-width: 640px) {
  .wizard-options { grid-template-columns: repeat(3, 1fr); }
}
.wizard-option {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.wizard-option:hover,
.wizard-option:focus-visible { border-color: var(--water-blue); color: var(--water-blue); }
.wizard-result { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.wizard-progress { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; margin: 0 0 0.5rem; }
.priority-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; background: var(--white); }
.priority-card.primary { border-color: var(--cta-blue); box-shadow: 0 4px 14px rgba(10, 102, 194, 0.12); }
.hero {
  background: var(--light-blue-bg);
  padding: 2.5rem 0 2.75rem;
}

.hero h1 {
  color: var(--navy);
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text);
  max-width: 62ch;
  margin: 0;
}

@media (min-width: 640px) {
  .hero h1 {
    font-size: 2.5rem;
  }
}

/* Main content spacing */
main {
  display: block;
}

.section {
  padding: 2.25rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

h2 {
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}

h3 {
  color: var(--navy);
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
}

@media (min-width: 640px) {
  h2 {
    font-size: 1.75rem;
  }
}

p {
  margin: 0 0 1rem;
}

ul, ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--water-blue);
  margin: 0 0 0.5rem;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--white);
}

.card h3 {
  margin-top: 0;
}

.card a.card-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
  text-decoration: none;
}

/* Checklist */
.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  padding-left: 1.75rem;
  position: relative;
}

.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--trust-green);
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--cta-blue);
  color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--navy);
  color: var(--white);
}

.btn-green {
  background: var(--cta-green);
  color: var(--white);
}

.btn-green:hover,
.btn-green:focus-visible {
  background: var(--trust-green);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--water-blue);
  color: var(--water-blue);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* CTA boxes */
.cta-box {
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.cta-box.home {
  background: var(--light-blue-bg);
  border-color: #cfe4f4;
}

.cta-box.facility {
  background: var(--light-green-bg);
  border-color: #cfe8cf;
}

.cta-box h3 {
  margin-top: 0;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .cta-grid.two {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Bottom contact section */
.bottom-contact {
  background: var(--navy);
  color: var(--white);
  padding: 2.5rem 0;
}

.bottom-contact h2 {
  color: var(--white);
}

.bottom-contact .cta-box.home,
.bottom-contact .cta-box.facility {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.bottom-contact .cta-box h3 {
  color: var(--white);
}

.bottom-contact .cta-box p {
  color: #DCE7F0;
}

.bottom-contact .muted {
  color: #B9C6D3;
}

.bottom-contact .btn-outline {
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--white);
}

.bottom-contact .btn-outline:hover,
.bottom-contact .btn-outline:focus-visible {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  font-size: 1.05rem;
}

.faq-item p {
  margin-top: 0.75rem;
}

/* Reviewed date */
.reviewed {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Disclaimer */
.disclaimer {
  background: #F6F8FA;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: #0A2D4B;
  color: #D9E2EC;
  padding: 2.5rem 0 1.5rem;
  font-size: 0.95rem;
}

.site-footer a {
  color: #BFE0FF;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-grid h3 {
  color: var(--white);
  font-size: 1rem;
  margin-top: 0;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin-bottom: 0.4rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 2rem;
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: #9FB3C4;
}

.footer-bottom p {
  margin: 0 0 0.5rem;
}

/* Forms */
.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field select,
.form-field textarea {
  width: 100%;
  font-size: 16px;
  font-family: var(--font);
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
}

.form-field textarea {
  min-height: 7rem;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 3px solid var(--water-blue);
  outline-offset: 1px;
  border-color: var(--water-blue);
}

.required-mark {
  color: var(--water-blue);
}

.form-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 1rem;
}

.download-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  background: var(--light-blue-bg);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.download-box .download-text h3 {
  margin: 0 0 0.25rem;
}

.download-box .download-text p {
  margin: 0;
  color: var(--muted);
}

.download-box.facility {
  background: var(--light-green-bg);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.75rem 0;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--border);
}

/* Header "Need Water Help" CTA button (added site-wide) */
.header-cta {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.55rem 0.9rem;
  border-radius: 7px;
  background: var(--cta-blue);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
}
.header-cta:hover,
.header-cta:focus-visible {
  background: var(--navy);
  color: #fff;
  text-decoration: none;
}
@media (min-width: 769px) {
  .main-nav { margin-left: auto; }
  .header-cta { margin-left: 0.85rem; }
}
@media (max-width: 768px) {
  .logo { margin-right: auto; }
  .header-cta {
    order: 2;
    font-size: 0.82rem;
    padding: 0.5rem 0.7rem;
  }
  .nav-toggle { order: 3; margin-left: 0.5rem; }
  .main-nav { order: 4; }
}

/* local report town lists */
.town-list{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:.4rem .5rem;margin:.5rem 0 0}
.town-list li{background:#eef3f8;border:1px solid #d7e2ec;border-radius:999px;padding:.2rem .7rem;font-size:.9rem}
.town-list.cols li{background:none;border:none;padding:.15rem 0;flex:0 0 240px}
.town-list.cols a{font-weight:600}
/* SDWIS systems table */
.data-table{width:100%;border-collapse:collapse;font-size:.93rem;margin:.5rem 0 1rem;min-width:640px}
.data-table th,.data-table td{padding:.55rem .6rem;border-bottom:1px solid #dbe3ee;text-align:left;vertical-align:top}
.data-table th{background:#eaf2f9;color:#0f4c81;white-space:nowrap;font-size:.82rem;text-transform:uppercase;letter-spacing:.02em}
.data-table tbody tr:nth-child(even){background:#f7fafc}
.data-table a{word-break:break-word}
