/* ==========================================================================
   MSR Wastewater Solutions – styles.css
   Pure CSS · mobile-first · Core Web Vitals friendly
   ========================================================================== */

/* --- Custom properties -------------------------------------------------- */
:root {
  --blue-deep: #003A8C;
  --blue: #0066CC;
  --blue-logo: #0A5296;
  --blue-light: #158BCB;
  --green-deep: #006B3F;
  --green: #008C45;
  --green-bright: #00A05A;
  --green-logo: #097E41;
  --green-soft: #489D3B;

  --text: #1a2433;
  --text-muted: #4a5568;
  --bg: #ffffff;
  --bg-soft: #f4f8fb;
  --bg-tint: #e8f2fa;
  --border: #d6e2ee;
  --white: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 58, 140, 0.08);
  --shadow-hover: 0 8px 28px rgba(0, 58, 140, 0.14);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1100px;
  --header-h: 4.25rem;
  --focus: 0 0 0 3px rgba(0, 102, 204, 0.35);
}

/* --- Reset / base ------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--blue-deep);
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  color: var(--blue-deep);
  margin-top: 0;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

p { margin: 0 0 1rem; }

ul { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }

/* --- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100%;
  z-index: 1000;
  background: var(--blue-deep);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
  box-shadow: var(--focus);
}

/* --- Layout helpers ----------------------------------------------------- */
.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.section {
  padding: 3rem 0;
}

.section--tint {
  background: var(--bg-soft);
}

.section--deep {
  background: linear-gradient(145deg, var(--blue-deep) 0%, var(--blue-logo) 55%, var(--green-deep) 100%);
  color: var(--white);
}

.section--deep h2,
.section--deep h3 {
  color: var(--white);
}

.section__intro {
  max-width: 40rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.section--deep .section__intro {
  color: rgba(255, 255, 255, 0.9);
}

/* --- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-link:focus-visible {
  border-radius: 6px;
}

.logo {
  height: 2.5rem;
  width: auto;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--blue-deep);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: none;
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1rem 1rem;
}

.site-nav a {
  display: block;
  padding: 0.75rem 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--blue-deep);
  background: var(--bg-tint);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--green);
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.35rem;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.btn--primary:hover {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: var(--white);
}

.btn--secondary {
  background: transparent;
  color: var(--blue-deep);
  border-color: var(--blue-deep);
}

.btn--secondary:hover {
  background: var(--blue-deep);
  color: var(--white);
}

.btn--light {
  background: var(--white);
  color: var(--blue-deep);
  border-color: var(--white);
}

.btn--light:hover {
  background: var(--bg-soft);
  color: var(--blue-deep);
}

.btn--ghost-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border-color: var(--white);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 3.5rem 0 3.75rem;
  background:
    radial-gradient(ellipse 80% 60% at 90% 10%, rgba(0, 160, 90, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 10% 90%, rgba(0, 102, 204, 0.1), transparent 50%),
    linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 100%);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue-light), var(--green), var(--green-soft));
}

.hero__logo {
  height: clamp(3rem, 10vw, 4.5rem);
  width: auto;
  margin-bottom: 1.5rem;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-deep);
  background: rgba(0, 140, 69, 0.1);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  margin-bottom: 1rem;
  max-width: 18ch;
}

.hero__tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 0;
}

/* --- Cards -------------------------------------------------------------- */
.cards {
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--bg-tint), rgba(0, 160, 90, 0.12));
  color: var(--blue-deep);
  flex-shrink: 0;
}

.card__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1rem;
}

.card__link {
  font-weight: 600;
  text-decoration: none;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.card__link:hover {
  color: var(--blue-deep);
}

.card__link::after {
  content: "→";
  transition: transform 0.15s ease;
}

.card__link:hover::after {
  transform: translateX(3px);
}

/* --- Feature / location ------------------------------------------------- */
.feature {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.feature__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  font-weight: 600;
  color: var(--blue-deep);
}

.feature__badge svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--green);
  flex-shrink: 0;
}

.pill-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-list li {
  margin: 0;
  background: var(--bg-tint);
  color: var(--blue-deep);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

/* --- CTA band ----------------------------------------------------------- */
.cta-band {
  text-align: center;
}

.cta-band p {
  max-width: 32rem;
  margin-inline: auto;
  margin-bottom: 0;
  opacity: 0.92;
}

.cta-band .btn-group {
  justify-content: center;
}

/* --- Page header (inner pages) ------------------------------------------ */
.page-header {
  padding: 2.5rem 0 2rem;
  background: linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  max-width: 40rem;
  margin-bottom: 0;
}

/* --- Service detail sections -------------------------------------------- */
.service-block {
  display: grid;
  gap: 1.5rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.service-block:last-child {
  border-bottom: none;
}

.service-block__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.service-block__num {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-deep), var(--green));
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.service-block h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
}

.service-block__body {
  color: var(--text-muted);
}

.service-block__body ul {
  color: var(--text);
}

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

.checklist li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 3.5px var(--white);
}

/* --- Blog --------------------------------------------------------------- */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.blog-card__date {
  font-weight: 600;
  color: var(--green-deep);
}

.blog-card__tag {
  background: var(--bg-tint);
  color: var(--blue-deep);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.blog-card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.blog-card h2 a {
  color: inherit;
  text-decoration: none;
}

.blog-card h2 a:hover {
  color: var(--blue);
}

.blog-card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* --- Blog post (single article) ----------------------------------------- */
.post {
  max-width: 40rem;
  margin-inline: auto;
}

.post .page-header {
  background: none;
  border-bottom: none;
  padding-bottom: 0;
}

.post .page-header p {
  margin-bottom: 0;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post__body {
  padding: 0 0 3rem;
}

.post__body h2 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

.post__body p {
  color: var(--text);
}

.post__body p.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.post__body ul {
  color: var(--text);
  margin-bottom: 1.25rem;
}

.post__body li {
  margin-bottom: 0.5rem;
}

.post__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  font-weight: 600;
}

.post__nav a {
  text-decoration: none;
}

.post__nav a:hover {
  text-decoration: underline;
}

/* --- Contact ------------------------------------------------------------ */
.contact-grid {
  display: grid;
  gap: 1.25rem;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.contact-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-card h2 svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--green);
  flex-shrink: 0;
}

.contact-card p,
.contact-card address {
  margin: 0;
  font-style: normal;
  color: var(--text-muted);
}

.contact-card a {
  font-weight: 600;
  text-decoration: none;
  color: var(--blue-deep);
  font-size: 1.15rem;
}

.contact-card a:hover {
  color: var(--blue);
}

.note {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-left: 3px solid var(--green);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 1.5rem;
}

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--blue-deep);
  color: rgba(255, 255, 255, 0.85);
  padding: 2.5rem 0 1.5rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

.site-footer__grid {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.site-footer .logo {
  height: 2.25rem;
  width: auto;
  /* Keep logo readable on dark footer */
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.site-footer h2 {
  color: var(--white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

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

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

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* --- Utilities ---------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Tablet+ ------------------------------------------------------------ */
@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards--3 > :last-child {
    grid-column: 1 / -1;
    max-width: 50%;
    justify-self: center;
    width: 100%;
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .site-nav ul {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
  }

  .site-nav a {
    padding: 0.5rem 0.85rem;
  }

  .site-nav a[aria-current="page"] {
    box-shadow: none;
    background: var(--bg-tint);
  }

  .logo {
    height: 2.75rem;
  }

  .cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .cards--3 > :last-child {
    grid-column: auto;
    max-width: none;
  }

  .feature {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
    align-items: center;
  }

  .service-block {
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: start;
  }
}

@media (min-width: 960px) {
  .section {
    padding: 4rem 0;
  }

  .hero {
    padding: 4.5rem 0 5rem;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .card:hover {
    transform: none;
  }
}
