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

:root {
  --navy: #123A5A;
  --de-blue: #1C6E9E;
  --light-blue-bg: #EAF5FA;
  --cta-blue: #1C6E9E;
  --text: #1F2933;
  --muted: #52606D;
  --border: #D9E2EC;
  --white: #FFFFFF;

  --teal: #287D7A;
  --light-teal-bg: #E9F6F4;

  --sand: #D8C59A;
  --warning: #9A6700;
  --light-warning-bg: #FBF1DF;
  --error: #B42318;

  --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(--de-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(18, 58, 90, 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(18, 58, 90, 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);
  }
}

/* Nav dropdowns (Find My Water / Water Problems / Treatment Options / Schools & Facilities)
   Implemented with native <details>/<summary> so open/closed state is
   handled by the browser itself — no JS-driven class ever leaves a menu
   stuck open, on desktop or mobile. */
.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:hover,
.dropdown-toggle:focus-visible {
  color: var(--de-blue);
  text-decoration: underline;
}

.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);
}

.nav-dropdown {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 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) {
  .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(18, 58, 90, 0.12);
    padding: 0.5rem;
    z-index: 50;
  }
  .nav-dropdown li {
    margin: 0;
  }
  .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;
  }
}

/* Water-source selector (hero) */
.source-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.source-selector a {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.source-selector a:hover,
.source-selector a:focus-visible {
  border-color: var(--de-blue);
  color: var(--de-blue);
}

@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; }
}

/* Water Wizard */
.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(--de-blue);
  color: var(--de-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;
}

/* Hero visual weighting cards */
.priority-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--white);
}

.priority-card.primary {
  border-color: var(--de-blue);
  box-shadow: 0 4px 14px rgba(28, 110, 158, 0.14);
}

/* Compact freshness/status block */
.status-block {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
  background: #F6F8FA;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  margin: 0 0 1.25rem;
}

/* Trust line (short) */
.trust-line {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Hero */
.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(--de-blue);
  margin: 0 0 0.5rem;
}

/* Scope label */
.scope-label {
  display: inline-block;
  background: var(--sand);
  color: #4A3B14;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin: 0 0 1rem;
}

/* 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(--teal);
  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-teal {
  background: var(--teal);
  color: var(--white);
}

.btn-teal:hover,
.btn-teal:focus-visible {
  background: #1f5f5c;
  color: var(--white);
}

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

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--de-blue);
  color: var(--de-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.blue {
  background: var(--light-blue-bg);
  border-color: #cfe4f4;
}

.cta-box.teal {
  background: var(--light-teal-bg);
  border-color: #c9e6e3;
}

.cta-box.warning {
  background: var(--light-warning-bg);
  border-color: #ecdcb3;
}

.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);
  }
  .cta-grid.three {
    grid-template-columns: repeat(3, 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 {
  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);
}

/* Source banner */
.source-banner {
  background: var(--light-teal-bg);
  border: 1px solid #c9e6e3;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.source-banner p {
  margin: 0 0 0.35rem;
}

.source-banner p:last-child {
  margin-bottom: 0;
}

/* Summary / answer box */
.summary-box {
  background: var(--light-blue-bg);
  border: 1px solid #cfe4f4;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
}

.summary-box p:last-child {
  margin-bottom: 0;
}

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

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

.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(--de-blue);
  outline-offset: 1px;
  border-color: var(--de-blue);
}

.form-field .hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.required-mark {
  color: var(--de-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.teal {
  background: var(--light-teal-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);
}

/* Result table */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
}

.result-table th,
.result-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.result-table th {
  background: var(--light-blue-bg);
  color: var(--navy);
}

@media (max-width: 640px) {
  .result-table, .result-table thead, .result-table tbody, .result-table th, .result-table td, .result-table tr {
    display: block;
  }
  .result-table thead {
    display: none;
  }
  .result-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  .result-table td {
    border: none;
    padding: 0.35rem 0;
  }
  .result-table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    color: var(--navy);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
}
