/* ==========================================================================
   Oregon Water Utilities — shared stylesheet
   Brand palette:
     Navy   #002D72   header / nav / footer / headings
     Cyan   #00AEEF   accent underlines & links
     Green  #A0CF67   primary "Pay Your Bill" CTA
     Gray   #F7F7F7   alternating section background
     LtBlue #C1E9F4   subtle accents
     Red    #C62828   urgent site alert banner (see alert.js)
   ========================================================================== */

:root {
  --navy:      #002D72;
  --navy-dark: #001d4d;
  --cyan:      #00AEEF;   /* decorative accents / underlines only */
  --link:      #007AAA;   /* text links — WCAG AA on white (~4.8:1) */
  --green:     #A0CF67;
  --green-dark:#8bbd50;
  --gray:      #F7F7F7;
  --ltblue:    #C1E9F4;
  --alert-red: #C62828;   /* urgent alert banner — white on this ≈ 5.6:1, AA.
                             Do not lighten further: #E53935 drops to 4.2 and
                             fails AA for the banner's normal-size text. */
  --ink:       #313131;
  --muted:     #5b6470;
  --line:      #e4e7ec;
  --white:     #ffffff;
  --display:   "Archivo", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --maxw:      1180px;
  --radius:    10px;
  --shadow:    0 2px 10px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Public Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Site alert banner ----------------------------------------- */
/* Injected above the header by js/alert-banner.js; wording lives in the
   hot-editable alert.js at the site root. Absent unless a message is set. */
.site-alert {
  /* Four variables carry the whole look, so a level only has to restate the
     colours -- the rules below never hardcode a foreground. The base values
     ARE the loud red treatment on purpose: anything that fails to set a level
     still shouts, because a notice quietly played down is a notice missed. */
  --al-bg:   var(--alert-red);
  --al-fg:   #fff;
  --al-link: #fff;
  --al-rule: transparent;

  background: var(--al-bg);
  color: var(--al-fg);
  border-bottom: 2px solid var(--al-rule);
  font-size: .98rem;
  line-height: 1.55;
}
/* No .site-alert--alert rule needed: the base above is already that treatment.
   Routine notices instead read as a quiet line of navy on white, separated
   from the white header below by a light blue rule. A solid navy bar was tried
   and rejected -- with the white header and the --navy nav under it, the page
   turned into blue/white/blue striping. */
.site-alert--info {
  --al-bg:   var(--white);
  --al-fg:   var(--navy);
  --al-link: var(--link);      /* the AA-checked body link blue */
  --al-rule: var(--ltblue);
}
.site-alert .container {
  position: relative;          /* anchors the close button */
  padding-top: 12px;
  padding-bottom: 12px;
}
.site-alert .al-body {
  font-weight: 600;
  text-align: center;
  /* Symmetric gutters keep the text optically centred and clear of the
     absolutely-positioned close button. */
  padding: 0 26px;
}
.site-alert p { margin: 0 0 .5em; }
.site-alert p:last-child { margin-bottom: 0; }
.site-alert a {
  color: var(--al-link);
  font-weight: 700;
  text-decoration: underline;
}
/* On red both are white, so this is a no-op there; on the white info bar it
   gives the site's usual link-blue -> navy hover. */
.site-alert a:hover, .site-alert a:focus { color: var(--al-fg); }
.site-alert .al-more { white-space: nowrap; }
.site-alert .al-close {
  position: absolute;
  top: 8px;
  right: 24px;                 /* matches .container's side padding */
  background: none;
  border: 0;
  color: var(--al-fg);
  font-size: 1.5rem;
  line-height: 1.1;
  padding: 0 2px;
  cursor: pointer;
  opacity: .8;
}
.site-alert .al-close:hover { opacity: 1; }
.site-alert :focus-visible { outline: 2px solid var(--al-fg); outline-offset: 2px; }
@media print { .site-alert { display: none; } }

/* ---------- Header ---------------------------------------------------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  flex-wrap: wrap;
}
.logo img { height: 78px; width: auto; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  font-weight: 700;
  border-radius: 6px;
  padding: 12px 22px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  line-height: 1.2;
}
.btn-pay {
  background: var(--green);
  color: var(--navy);
}
.btn-pay:hover { background: var(--green-dark); color: var(--navy); text-decoration: none; }
.btn-outline {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: #fff; text-decoration: none; }

/* ---------- Primary navigation ---------------------------------------- */
.site-nav { background: var(--navy); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
}
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 0;
  cursor: pointer;
}
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.nav-menu > li > a {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: .98rem;
  padding: 16px 20px;
  letter-spacing: .2px;
}
.nav-menu > li > a:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}

/* Water Quality dropdown */
.nav-menu .has-submenu { position: relative; }
.nav-menu .has-submenu > a::after {
  content: "";
  display: inline-block;
  margin-left: 7px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  vertical-align: middle;
  transform: translateY(1px);
}
.nav-menu .submenu {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: var(--navy-dark);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
  display: none;
  z-index: 50;
}
.nav-menu .has-submenu:hover > .submenu,
.nav-menu .has-submenu:focus-within > .submenu { display: block; }
.nav-menu .submenu > li > a {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  padding: 11px 20px;
  white-space: nowrap;
}
.nav-menu .submenu > li > a:hover {
  background: rgba(255, 255, 255, .12);
  text-decoration: none;
}

/* ---------- Emergency bar --------------------------------------------- */
.emergency-bar {
  background: #eaf6fb;
  border-bottom: 1px solid #cfe8f4;
}
.emergency-bar .container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: .95rem;
  color: var(--navy);
}
.emergency-bar .em-tag {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
}
.emergency-bar a { font-weight: 700; }

/* ---------- Hero ------------------------------------------------------ */
.hero {
  position: relative;
  background: var(--navy) center/cover no-repeat;
  min-height: 380px;
  display: flex;
  align-items: center;
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,45,114,.15) 0%, rgba(0,45,114,.55) 100%);
}
.hero-caption {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: 40px 24px;
}
.hero-caption h1 {
  margin: 0 0 12px;
  font-size: 2.3rem;
  line-height: 1.15;
  max-width: 640px;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
}
.hero-caption p { margin: 0 0 18px; max-width: 560px; font-size: 1.05rem; }

/* ---------- Quick links ----------------------------------------------- */
.quicklinks {
  background: var(--white);
}
.quicklinks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 26px 0;
}
.quicklink {
  text-align: center;
  padding: 18px 12px;
  border-radius: var(--radius);
  color: var(--navy);
  transition: background .15s ease, transform .15s ease;
}
.quicklink:hover {
  background: var(--gray);
  text-decoration: none;
  transform: translateY(-2px);
}
.quicklink img { height: 54px; margin: 0 auto 12px; }
.quicklink span {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .84rem;
  letter-spacing: .4px;
  color: var(--navy);
}

/* ---------- Sections & typography ------------------------------------- */
.section { padding: 52px 0; }
.section-gray { background: var(--gray); }
.rule-green { border: 0; height: 4px; background: var(--green); margin: 0; }
.section-intro { padding-top: 24px; }

h2.section-title,
.page-title {
  color: var(--navy);
  font-size: 1.8rem;
  margin: 0 0 6px;
  position: relative;
}
.underline::after {
  content: "";
  display: block;
  width: 124px;
  height: 9px;
  background: var(--cyan);
  border-radius: 4px;
  margin-top: 7px;
}
.center { text-align: center; }
.center.underline::after { margin-left: auto; margin-right: auto; }

/* Section headings: strong Archivo weight + the cyan accent set sections
   apart (no divider rule); generous top spacing keeps them breathing apart. */
.content h2 {
  color: var(--navy);
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 1.9em 0 .5em;
}
.content > h2:first-of-type,
.content .lead + h2 { margin-top: 1em; }

.content h3 {
  color: var(--navy);
  font-size: 1.32rem;
  font-weight: 800;
  margin: 1.7em 0 .35em;
}
.content h4 {
  color: var(--navy);
  font-size: 1.13rem;
  font-weight: 800;
  margin: 1.4em 0 .3em;
}

/* Display headings — Archivo at normal width; heft comes from weight, not
   width (the expanded axis was tried and looked distorted).
   Grouped here so the whole heading system shares one font treatment. */
.hero-caption h1,
h2.section-title,
.page-title,
.content h2,
.content h3,
.content h4,
.news-card h3 {
  font-family: var(--display);
}
.hero-caption h1,
h2.section-title,
.page-title,
.content h2 { font-weight: 800; }
.content p, .content li { color: var(--ink); }
.content ul { padding-left: 1.3em; }
.content li { margin: .3em 0; }
.lead { font-size: 1.12rem; color: var(--muted); }

.breadcrumb {
  font-size: .86rem;
  color: var(--muted);
  margin: 0 0 22px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--navy); }

/* ---------- Cards / callouts ------------------------------------------ */
.callout {
  background: var(--gray);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 22px 0;
}
.pdf-list { list-style: none; padding: 0; margin: .5em 0; }
.pdf-list li { margin: .35em 0; padding-left: 26px; position: relative; }
.pdf-list li::before {
  content: "\1F4C4"; /* page icon */
  position: absolute; left: 0; top: 0;
  font-size: .95em;
}

/* Contact page cards */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 28px 0 10px;
}
.contact-card {
  background: var(--gray);
  border-top: 4px solid var(--cyan);
  border-radius: 10px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
}
.contact-card h2 { margin-top: 0; }
.contact-card p { color: var(--ink); }
.contact-card .btn { margin-top: auto; align-self: flex-start; }
.contact-btn { display: inline-flex; align-items: center; gap: 10px; }
.contact-btn .ico { width: 22px; height: 22px; flex: none; display: inline-block; }
.contact-btn .ico-hover { display: none; }
.contact-btn:hover .ico-normal,
.contact-btn:focus-visible .ico-normal { display: none; }
.contact-btn:hover .ico-hover,
.contact-btn:focus-visible .ico-hover { display: inline-block; }

/* Two-column value rows (mission page) */
.value-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.value-row:last-child { border-bottom: 0; }
.value-row img { width: 88px; height: 88px; }
.value-row h3 { margin-top: 0; }

/* ---------- News grid ------------------------------------------------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 34px;
}
.news-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.news-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--ltblue);
}
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-card .card-body { padding: 18px 20px 22px; }
.news-card .date {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--link);
  font-weight: 700;
}
.news-card h3 {
  color: var(--navy);
  font-size: 1.08rem;
  margin: 6px 0 0;
  line-height: 1.3;
}

/* ---------- Instructional step images (how-to pages) ------------------ */
.step-fig {
  margin: 14px 0 26px;
  max-width: 560px;
}
.step-fig img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.watch-link {
  display: inline-block;
  font-weight: 700;
  margin: 4px 0 8px;
}
.watch-link::before { content: "\25B6  "; color: var(--cyan); }

/* ---------- Article page ---------------------------------------------- */
.article { max-width: 820px; }
.article-meta { color: var(--muted); font-size: .9rem; margin: 0 0 20px; }
.article-hero {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 8px 0 28px;
}
.back-link { display: inline-block; margin-top: 34px; font-weight: 700; }

/* ---------- Error page -------------------------------------------------- */
.error-page {
  text-align: center;
  padding: 70px 24px 90px;
}
.error-page .error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
  margin: 0 0 10px;
}
.error-page h1 { color: var(--navy); margin: 0 0 14px; }
.error-page p { color: var(--muted); max-width: 480px; margin: 0 auto 28px; }

/* ---------- Footer ---------------------------------------------------- */
.site-footer {
  background: var(--navy);
  color: #cdd7ea;
  padding: 46px 0 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.footer-logo-link { display: inline-block; margin-bottom: 22px; }
.footer-logo { height: 78px; width: auto; display: block; }
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 32px;
}
.footer-links a { color: #fff; font-weight: 600; font-size: 1rem; }
.footer-links a:hover { color: var(--green); text-decoration: none; }
.footer-social { margin-top: 12px; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.footer-social a:hover { color: var(--green); }
.footer-social svg { width: 28px; height: 28px; display: block; }
.footer-bottom {
  margin-top: 40px;
  background: var(--navy-dark);
  color: #9fb0cf;
  text-align: center;
  font-size: .85rem;
  padding: 16px;
}

/* ---------- Responsive ------------------------------------------------ */
@media (max-width: 900px) {
  .quicklinks-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-caption h1 { font-size: 1.8rem; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  /* Expanded headings need trimming so wide words don't overflow on phones. */
  .hero-caption h1 { font-size: 1.55rem; }
  .page-title, h2.section-title { font-size: 1.45rem; }
  .content h2 { font-size: 1.3rem; }
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-bottom: 10px;
  }
  .nav-menu.open { display: flex; }
  .nav-menu > li > a { padding: 12px 4px; }
  .nav-menu .has-submenu > a::after { display: none; }
  .nav-menu .submenu {
    position: static;
    display: block;
    background: transparent;
    box-shadow: none;
    padding: 0 0 8px 18px;
  }
  .nav-menu .submenu > li > a { padding: 10px 4px; font-weight: 600; }
  .nav-inner { flex-direction: column; align-items: stretch; }
  .news-grid { grid-template-columns: 1fr; }
  .value-row { grid-template-columns: 64px 1fr; gap: 16px; }
  .value-row img { width: 60px; height: 60px; }
  .header-inner { justify-content: center; text-align: center; }
}
